Kiln docs
Search…
⌃K

Polkadot (DOT): Stake DOT with Kiln Connect

Stake DOT programmatically with Kiln Connect SDK.

Staking

Craft dot bonding transaction.
// optional, only for specific setups
const options = {
controllerAccount: '';
rewardDestination: 'Staked';
};
/* async craftBondTx(accountId: string, stashAccount: string, amountDot: number, options?: DotStakeOptions): Promise<DotTransaction> */
const tx = await k.dot.craftBondTx(account.id, WALLET_PUBKEY, 42.2, options);

Extra bond

Craft dot bonding extra token transaction (to be used if you already bonded tokens).
/* async craftBondExtraTx(stashAccount: string, amountDot: number): Promise<DotTransaction> */
const tx = await k.dot.craftBondExtraTx(stashAccount, 2.4);

Rebond

Craft dot rebond transaction (to be used to rebond unbonding token).
/* async craftRebondTx(controllerAccount: string, amountDot: number): Promise<DotTransaction> */
const tx = await k.dot.craftRebondTx(controllerAccount, 2.4);

Nominate

Craft dot nominate transaction.
/* async craftNominateTx(controllerAccount: string, validatorAddresses?: string[]): Promise<DotTransaction> */
const tx = await k.dot.craftNominateTx(controllerAccount, validators);

Unstake

To unstake a position on Polkadot, you need to:
  1. 1.
    Unbond the position, which usually takes 28 days.
  2. 2.
    Withdraw the Unbonded position.

Unbond

Craft dot unbonding transaction, there is an unbonding period before your tokens can be withdrawn.
/* async craftUnbondTx(controllerAccount: string, amountDot: number): Promise<DotTransaction> */
const tx = await k.dot.craftUnbondTx(controllerAccount, amountDot);

Withdraw Unbonded

Craft dot withdraw unbonded token transaction.
/* async craftWithdrawUnbondedTx(controllerAccount: string): Promise<DotTransaction> */
const tx = await k.dot.craftWithdrawUnbondedTx(controllerAccount);

Chill

Craft dot chill transaction to chill the controller account associated to the given stash account, meaning that given account will not nominate any validator anymore, so you will stop earning rewards at the beginning of the next era.
/* async craftChillTx(controllerAccount: string): Promise<DotTransaction> */
const tx = await k.dot.craftChillTx(controllerAccount);

Set Controller

Craft dot set controller transaction that updates the controller for the given stash account.
/* async craftSetControllerTx(stashAccount: string, controllerAccount: string): Promise<DotTransaction> */
const tx = await k.dot.craftSetControllerTx(stashAccount, controllerAccount);

Set Payee

Craft dot set reward destination transaction that updates the destination rewards address for the given stash account.
/* async craftSetPayeeTx(controllerAccount: string, rewardsDestination: RewardDestination): Promise<DotTransaction> */
const tx = await k.dot.craftSetPayeeTx(controllerAccount, rewardsDestination);

Sign

Sign Polkadot transactions by specifying the integration name and the crafted transaction.
/* async sign(integration: string, transaction: DotTransaction): Promise<SubmittableExtrinsic> */
const signed = await k.dot.sign('vault-1', tx);

Broadcast

Broadcast and get the status of a broadcasted transaction. If you specified a custom RPC url for Polkadot in the SDK configuration, it will be used instead of the default one.
/* async broadcast(transaction: SubmittableExtrinsic): Promise<SubmittedDotTransaction> */
const hash = await k.dot.broadcast(signed);
/* async getTxStatus(transaction: SubmittedDotTransaction): Promise<DotTransactionStatus> */
const status = await k.dot.getTxStatus(signed);