atn-node-js

0.1.38 • Public • Published

atn-node-js is for building browser AIapps & NodeJS services that interact with ATN Network.

atn-node-js architecture

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 suite
  • npm run generate-docs-version: generate the atn-node-js API documents by jsdoc
  • npm 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()

reference

Readme

Keywords

Package Sidebar

Install

npm i atn-node-js

Weekly Downloads

2

Version

0.1.38

License

MIT

Unpacked Size

3.16 MB

Total Files

122

Last publish

Collaborators

  • atnio