Staking
claim
- Claim FRA Token Rewards This function enables users to claim rewards earned from staking FRA tokens.
Parameters:
<WalletKeypar>- Wallet keypair<string>- the amout of rewards which users wants to claim
Results:
Promise<TransactionBuilder>- TransactionBuilder which should be used inTransaction.submitTransaction.
Example:
const walletInfo = await Keypair.restoreFromPrivateKey(pkey, password);
// First, we create a transaction builder
const assetBuilder = await Asset.defineAsset(walletInfo, assetCode);
// Then, we submit a transaction
const handle = await Transaction.submitTransaction(assetBuilder);delegate
- Delegates FRA tokens This function allows users to delegate FRA tokens to a validator. This functionality is nearly identical to Transaction.sendToAddress except it adds one additional operation (i.e. add_operation_delegate) to the transaction builder.
Parameters:
<WalletKeypar>- Wallet keypair<string>- Target address for delegation<string>- delegation amout<string>- Asset Code<string>- Target validator Address<AssetBlindRules>- (optional) Confidential options for blind rule
Results:
Promise<TransactionBuilder>- TransactionBuilder which should be used inTransaction.submitTransaction.
Example:
getDelegateInfo
- Get the delegation information This method is used to get the delegation information
Parameters:
<string>- wallet address
Results:
Promise<DelegateInfoResponse>- An instance ofDelegateInfoDataResultcontaining the response and error..
Example:
getValidatorList
- Get validator list This method is used to get the list of validators.
Results:
Promise<validatorListResponse>- An instance ofvalidatorListResponsecontaining the response and error..
Example:
unStake
- Unstake FRA tokens This function allows users to unstake (aka unbond) FRA tokens.
Parameters:
<WalletKeypar>- Wallet keypair<string>- the amount users wants to unstake<string>- validator's address<boolean>- fully unstake option. Default isfalse
Results:
Promise<TransactionBuilder>- TransactionBuilder which should be used inTransaction.submitTransaction.
Example:
Last updated
Was this helpful?