Skip to content
On this page

Delegate Cosmos

The delegate namespace contains method used for sending transactions on delegation. The unique method to the delegate namespace is:

  • delegate(token, address, amount): Delegate user tokens.

Delegate Code Example

ts
// Import SDK
import { Cosmos } from '@everstake/wallet-sdk';

// Token ID.
const token = process.env.TOKEN; // 3155f389-d943-4966-8e18-f159c2a6ef66

// User wallet address.
const address = 'examplecosmos1hgmhc4hajlh8u47wmmls6ze4yrfekhs';

// The amount that the user delegates.
const amountDelegate = 10; // min value 0.01 (ATOM)

// Delegate - return transaction
const delegate = await Cosmos.delegate(token, address, amountDelegate);
console.log(delegate); // { result: { address, msg, fee, memo } }