Staking
Use this module when users lock a product token from the catalog to earn rewards, unlock some or all of it, or claim pending rewards. Typical UI: stake form, “my stake” card, claim button.
This is product-token staking — not native chain / consensus delegation (e.g. Cosmos validators). That is a different capability when offered.
Amounts are display decimals. Writes use a Wallet adapter.
Rules
- Stake / unstake / claim are separate writes. You compose “stake then claim on a schedule” in your app.
- Pass
owneronly when you need a specific address; omit it when awalletis configured — Whose wallet (owner). - You may need
balances.approvebeforestakeif allowance is too low. - After a successful write, refresh stake or
positionsreads. Pollsettlement.trackuntilconfirmedorfailedif the handle is still running. - For a mixed portfolio table, prefer
positions.listPositionswithkinds: ['stake']. - Stake / unstake / claim can incur gas and the service fee when they run. The SDK does not return a
costslist before those calls — Fees and costs.
Reads
staking.listStakePositions
List stake rows for an owner (optionally one instrument).
const rows = await sdk.staking.listStakePositions({
instrumentId: 'evm:421018:instrument:42',
ledgers: ['infinite-mainnet'],
})Parameters — ListStakePositionsQuery
| Field | Type | Description |
|---|---|---|
owner | string | Optional. Whose stakes to list. Omit to use the connected wallet — Whose wallet (owner). |
ledgers | LedgerScope[] | Optional. Limit to these ledgers (ID or alias). |
instrumentId | InstrumentId | Optional. Only this stake asset. Omit to list all product stakes for the owner. |
Returns — StakePosition[]
| Field | Type | Description |
|---|---|---|
id | PositionId | Opaque stake position id. |
instrumentId | InstrumentId | Token that is staked. |
ledger | LedgerId | Canonical ledger. |
owner | string | Staker address. |
amount | string | Staked amount as a display decimal. |
claimableReward | object | Optional. Pending reward: instrumentId + display amount. |
Example response:
[
{
"id": "pos_stake_01…",
"instrumentId": "evm:421018:instrument:42",
"ledger": "evm:421018",
"owner": "0xabc…",
"amount": "250",
"claimableReward": {
"instrumentId": "evm:421018:instrument:42",
"amount": "1.25"
}
}
]staking.getStakePosition
One stake row for an instrument + owner (detail or refresh after stake/unstake/claim).
const position = await sdk.staking.getStakePosition({
instrumentId: 'evm:421018:instrument:42',
})Parameters — GetStakePositionParams
| Field | Type | Description |
|---|---|---|
instrumentId | InstrumentId | Product token whose stake you want. |
owner | string | Optional. Omit to use the connected wallet — Whose wallet (owner). |
ledgers | LedgerScope[] | Optional ledger filter when the instrument could resolve on more than one. |
Returns — StakePosition
Same fields as each element in listStakePositions.
Example response:
{
"id": "pos_stake_01…",
"instrumentId": "evm:421018:instrument:42",
"ledger": "evm:421018",
"owner": "0xabc…",
"amount": "250",
"claimableReward": {
"instrumentId": "evm:421018:instrument:42",
"amount": "1.25"
}
}Writes
staking.stake
Lock amount of a product token. Signing uses purpose: 'stake'.
const handle = await sdk.staking.stake({
instrumentId: 'evm:421018:instrument:42',
amount: '100',
})Parameters — StakeRequest
| Field | Type | Description |
|---|---|---|
instrumentId | InstrumentId | Product token to stake. |
amount | string | How much to stake, as a display decimal (what the user typed). |
deadline | number | Optional. Unix time in milliseconds after which the stake should not proceed. |
ledgers | LedgerScope[] | Optional. Limit to these ledgers. |
Returns — ExecutionHandle
Poll settlement.track until confirmed or failed if still running. Then refresh stake / positions reads.
Example response:
{
"id": "exec_01HZZ…",
"status": "confirmed",
"ledger": "evm:421018",
"txRef": "0xdef…"
}staking.unstake
Unlock amount of a previously staked product token. Signing uses purpose: 'unstake'.
const handle = await sdk.staking.unstake({
instrumentId: 'evm:421018:instrument:42',
amount: '50',
})Parameters — UnstakeRequest
| Field | Type | Description |
|---|---|---|
instrumentId | InstrumentId | Product token to unstake. |
amount | string | How much to unlock, as a display decimal. |
deadline | number | Optional. Unix time in milliseconds. |
ledgers | LedgerScope[] | Optional. |
Returns — ExecutionHandle
Same shape as staking.stake.
Example response:
{
"id": "exec_01HZZ…",
"status": "confirmed",
"ledger": "evm:421018",
"txRef": "0xabc…"
}staking.claim
Claim pending staking rewards for that instrument. Signing uses purpose: 'stake_claim'.
const handle = await sdk.staking.claim({
instrumentId: 'evm:421018:instrument:42',
})Parameters — StakeClaimRequest
| Field | Type | Description |
|---|---|---|
instrumentId | InstrumentId | Stake asset whose rewards you are claiming. |
deadline | number | Optional. Unix time in milliseconds. |
ledgers | LedgerScope[] | Optional. |
Returns — ExecutionHandle
Same shape as staking.stake.
Example response:
{
"id": "exec_01HZZ…",
"status": "confirmed",
"ledger": "evm:421018",
"txRef": "0xclaim…"
}Errors
READ_ONLY_MODE, CAPABILITY_NOT_AVAILABLE, WALLET_REQUIRED, USER_REJECTED, LEDGER_NOT_SUPPORTED.
→ Positions · Farming · Balances · Write operations