Kiln docs

Polkadot (DOT): Stake DOT with Kiln Connect

Stake DOT programmatically with Kiln Connect SDK.


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


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


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


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.


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

Withdraw Unbonded

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


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;

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


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


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;
/* async getTxStatus(transaction: SubmittedDotTransaction): Promise<DotTransactionStatus> */
const status = await;