@ardier16/q-js-sdk
v1.4.1
Published
Typescript Library to interact with Q System Contracts
Downloads
6
Readme
Q Javascript SDK
prepare
Install package as dependency
npm install --save @q-dev/q-js-sdk
using
Instantiation of ContractRegistry:
const contractRegistry = new ContractRegistryInstance(web3)
Retrieving SDK version:
import { Web3Adapter, Web3Factory, Web3 } from '@q-dev/q-js-sdk'
const web3 = Web3Factory.createFromMnemonic('your-rpc-Url', 'mnemonic')
const adapter = new Web3Adapter(web3)
const SDKVersion = adapter.SDK_VERSION
Obtaining of system-contracts instances:
const validators = await contractRegistry.validators()
Read access:
const longList = await validators.getLongList()
Write access:
await validators.commitStake({from: 'user-address', value: 'amount-for-commit'})