githubEdit

Staking

- Claim FRA Token Rewards This function enables users to claim rewards earned from staking FRA tokens.

Parameters:arrow-up-right

  • <WalletKeypar> - Wallet keypair

  • <string> - the amout of rewards which users wants to claim

Results:arrow-up-right

  • Promise<TransactionBuilder> - TransactionBuilder which should be used in Transaction.submitTransaction.

Example:arrow-up-right

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);

- 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:arrow-up-right

  • <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:arrow-up-right

  • Promise<TransactionBuilder> - TransactionBuilder which should be used in Transaction.submitTransaction.

Example:arrow-up-right

getDelegateInfoarrow-up-right

- Get the delegation information This method is used to get the delegation information

Parameters:arrow-up-right

  • <string> - wallet address

Results:arrow-up-right

  • Promise<DelegateInfoResponse> - An instance of DelegateInfoDataResult containing the response and error..

Example:arrow-up-right

getValidatorListarrow-up-right

- Get validator list This method is used to get the list of validators.

Results:arrow-up-right

  • Promise<validatorListResponse> - An instance of validatorListResponse containing the response and error..

Example:arrow-up-right

- Unstake FRA tokens This function allows users to unstake (aka unbond) FRA tokens.

Parameters:arrow-up-right

  • <WalletKeypar> - Wallet keypair

  • <string> - the amount users wants to unstake

  • <string> - validator's address

  • <boolean> - fully unstake option. Default is false

Results:arrow-up-right

  • Promise<TransactionBuilder> - TransactionBuilder which should be used in Transaction.submitTransaction.

Example:arrow-up-right

Last updated

Was this helpful?