Official Javascript client to use with the Pocket Network
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
You should have at least have a basic knowledge of blockchain technology and know your way around JavaScript. You will also need to install the NPM tool.
npm install --save @pokt-network/pocket-js
If you would like to know how to integrate Pocket-JS into your DApp, visit our developer portal that has a lot of useful tutorials and material about the Pocket Network.
const module = require('@pokt-network/pocket-js')
const Pocket = module.Pocket
const Configuration = module.Configuration
const HttpRpcProvider = module.HttpRpcProvider
const Node = module.Node
const dispatchURL = new URL("http://node9.testnet.pokt.network:8081")
const rpcProvider = new HttpRpcProvider(dispatchURL)
const configuration = new Configuration(5, 1000, undefined, 40000)
const pocketInstance = new Pocket([dispatchURL], rpcProvider, configuration)
const balance = await pocketInstance.rpc.query.getBalance(accountAddress)
console.log("Account Balance: " + balance)npm run test:unit
npm run test:integration
Please read CONTRIBUTING.md for details on contributions and the process of submitting pull requests.
This project is licensed under the MIT License; see the LICENSE.md file for details.