Staking is available under private access. Contact us if you need access

Prerequisites

  • Ensure you have a wallet created.
  • API Key: Ensure you have an API key with the scopes: wallets:transactions.create.

Listing yields

List available yield opportunities for a wallet.

import { useWallet } from '@crossmint/client-sdk-react-ui';

const { wallet } = useWallet();

const yields = await wallet.experimental_yields(tokens);

Parameters

tokens
string[]

The tokens to generate yield for.

Returns

yields
Yield[]

The yields.

Staking

Stake to earn yield.

import { useWallet } from '@crossmint/client-sdk-react-ui';

const { wallet } = useWallet();

const { hash, explorerLink } = await wallet.experimental_stake(tokenLocator, amount);

Parameters

tokenLocator
string

The token locator to stake.

amount
string

The amount to stake.

Returns

hash
string

The hash of the transaction.

The explorer link of the transaction.

Unstaking

Unstake from the yield.

import { useWallet } from '@crossmint/client-sdk-react-ui';

const { wallet } = useWallet();

const { hash, explorerLink } = await wallet.experimental_unstake(tokenLocator, amount);

Parameters

tokenLocator
string

The token locator to unstake.

amount
string

The amount to unstake.

Returns

hash
string

The hash of the transaction.

The explorer link of the transaction.