atn-node-js is for building browser AIapps & NodeJS services that interact with ATN Network.
This JS Client contains the following methods
-
createChannel
-
getChannelInfo
-
getChannelDetail
-
topUpChannel
-
closeChannel
-
callDBotAI
-
callAPI
-
requestCloseSignature
-
initConfig
-
initAccount
-
signBalanceProof
-
getDBotName
-
getDBotDomain
-
getPrice
-
waitTx
-
privateKeyToAccount
-
unlockAccountsIfNeeded
-
asyncSleep
-
getBalanceProofData
-
handlerDBotDomain
Getting started
node version required: v8.11.3 or above
Clone this repository and install its dependencies:
$ npm i atn-node-js --save
NPM script
"test": "mocha --timeout 5000", "generate-docs-version": "rm -rf docs && jsdoc --configure .jsdoc.json --verbose", "jsdoc-minami-docs": "rm -rf docs && jsdoc src/atn.js -d docs generate-doc/minami", "":
npm run test
: Run test suitenpm run generate-docs-version
: generate theatn-node-js
API documents by jsdocnpm run deploy-docs
: Run linting and generate coverage
Usage
Step 1:
Create calling channel between account and DBot
atn.createChannel()
Step 2:
Getting calling channel information from DBotServer
atn.getChannelDetail()
Step 3:
Use the calling channel to call DBot Server AI services
atn.callDBotAI()
Step 4:
Increase the calling times , you can topup the balance to the channel
atn.topUpChannel()
Step 5:
Get your balance back from channel
atn.closeChannel()