@q-dev/qdex-js-sdk
v0.0.1
Published
Typescript Library to interact with Q DEX Contracts
Downloads
2
Readme
Q Javascript SDK
prepare
Install package as dependency
npm install --save @q-dev/qdex-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'})