Thanks to visit codestin.com
Credit goes to github.com

Skip to content

nymd/pocket-js

 
 

Repository files navigation

Pocket-JS

Official Javascript client to use with the Pocket Network

Overview

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Requirements

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.

Installation

npm install --save @pokt-network/pocket-js

Documentation

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)

Running the tests

npm run test:unit
npm run test:integration

Contributing

Please read CONTRIBUTING.md for details on contributions and the process of submitting pull requests.

Support & Contact

License

This project is licensed under the MIT License; see the LICENSE.md file for details.

About

The Official Javascript Client of the Pocket Network

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 99.9%
  • JavaScript 0.1%