CodeChain SDK Stakeholder Helper
A JavaScript implementation for CodeChain stake token related custom actions and custom transactions
Features
It adds the following features to CodeChain SDK for JavaScript:
- Get the list of stakeholders
- Get the stake token balance of a stakeholder
- Transfer stake tokens
How to
You first need to install the package.
# npm npm install codechain-sdk-stakeholder-helper # yarn yarn add codechain-sdk-stakeholder-helper
Get the list of stakeholders
const SDK = ;const getCCSHolders = ; const sdk = server: "http://localhost:8080" networkId: "tc"; ;
Get the stake token balance of a stakeholder
const sdk = ...const getCCSBalance = ;
Transfer stake tokens
const sdk = ...const createTransferCCSTransaction = ; // Transfer 100 tokens to tccq94guhkrfndnehnca06dlkxcfuq0gdlamvw9ga4fconst tx = ;const signedTx = tx;sdkrpcchain ;