diff --git a/apps/examples/README.md b/apps/examples/README.md index 00bddb56d..6200834f0 100644 --- a/apps/examples/README.md +++ b/apps/examples/README.md @@ -1,133 +1,133 @@ # App dev reference guide This folder contains a series of example code to serve as a reference guide for app developers looking to build on eCash. These examples utilize the [Chronik](https://www.npmjs.com/package/chronik-client) indexer and [NodeJS](https://github.com/nvm-sh/nvm) to interact with the eCash blockchain and highlights some of the technical nuances specific to app development on eCash. ## Requirements Please ensure your node version is > 16.x.x and the chronik and mocha dependencies are installed: - `nvm install 16` - `npm i` ## Chronik indexer If you'd like to optionally setup your own Chronik instance, please refer to the [Chronik NNG README](https://github.com/raipay/chronik/). ## Simple Examples
Retrieving transaction details from txid [getDetailsFromTxid()](scripts/getDetailsFromTxid.js) **_Usage_**: `npm run getDetailsFromTxid ` **_Example_**: `npm run getDetailsFromTxid bd6ed16b16c00808ee242e570a2672f596434c09da5290ff77cadf52387bd2f3`
Retrieving transaction history from address [getTxHistoryFromAddress()](scripts/getTxHistoryFromAddress.js) **_Usage_**: `npm run getTxHistoryFromAddress
` **_Example_**: `npm run getTxHistoryFromAddress ecash:qq9h6d0a5q65fgywv4ry64x04ep906mdku8f0gxfgx 0 10`
Retrieving UTXOs from address [getUtxosFromAddress()](scripts/getUtxosFromAddress.js) **_Usage_**: `npm run getUtxosFromAddress
` **_Example_**: `npm run getUtxosFromAddress ecash:qq9h6d0a5q65fgywv4ry64x04ep906mdku8f0gxfgx`
Creating a new wallet [createWallet()](scripts/createWallet.js) **_Usage_**: `npm run createWallet`
Retrieving details of an SLP token [getTokenDetails()](scripts/getTokenDetails.js) **_Usage_**: `npm run getTokenDetails ` **_Example_**: `npm run getTokenDetails 861dede36f7f73f0af4e979fc3a3f77f37d53fe27be4444601150c21619635f4`
(WIP) Sending a one to one XEC transaction TBC
(WIP) Sending a one to one SLP token transaction TBC
(WIP) Creating an SLP token TBC
(WIP) Burning an SLP token TBC
## Advanced Examples
Using websockets to listen for confirmation of a transaction [listenForConfirmation()](scripts/listenForConfirmation.js) **_Usage_**: `npm run listenForConfirmation
` **_Example_**: `npm run listenForConfirmation ecash:qq9h6d0a5q65fgywv4ry64x04ep906mdku8f0gxfgx 3bae2f96cf076437ba1755c8e12f864bf6c060071ed12173a5e505c2d4b9a3c9`
(WIP) Using websockets to listen for new blocks found TBC
- (WIP) Create a cashscript smart contract where only the designated signature can withdraw the XEC + (WIP) Create a one to many XEC transaction TBC
- (WIP) Create a cashscript smart contract that allows a recipient to withdraw a specific amount every month + (WIP) Create an OP_RETURN messaging transaction TBC
- (WIP) Create a cashscript smart contact that locks XECs for a nominated amount of blocks + (WIP) Create an encrypted OP_RETURN messaging transaction TBC
(WIP) Implementing CashtabPay from cashtab-components for an online store TBC
## Questions? If you have any questions regarding these examples please feel free to reach out to the development team via the [eCash Development Telegram](https://t.me/eCashDevelopment).