Skip to content
docs

StakingProtocol

Defined in: protocols/staking.ts:101

Base class for staking modules: holds the account and config, and throws NotImplementedError for every method a module leaves out.

TConfig extends object = Record<string, never>

new StakingProtocol<TConfig>(account, config?): StakingProtocol<TConfig>

Defined in: protocols/staking.ts:105

IWalletAccountReadOnly | IWalletAccount

TConfig = ...

StakingProtocol<TConfig>

ProtocolBase.constructor

protected readonly _account: IWalletAccountReadOnly | IWalletAccount

Defined in: protocols/base.ts:8

ProtocolBase._account


protected readonly _config: TConfig

Defined in: protocols/base.ts:9

ProtocolBase._config

claimWithdrawals(_o?): Promise<ClaimWithdrawalsResult>

Defined in: protocols/staking.ts:113

Claim finalized requests; the native coin returns to the account.

ClaimWithdrawalsOptions

Promise<ClaimWithdrawalsResult>

IStakingProtocol.claimWithdrawals


describeActivity(_tx, _ctx): ActivityItem | null

Defined in: protocols/base.ts:24

Recognize one of this protocol’s own transactions in an address’s history and describe it for the wallet’s activity feed (“Supplied 100 USDC · Aave v3”). Return null when the transaction is not this protocol’s: the kit then asks the next module and finally falls back to send / receive / approve / contract call. Must be pure and synchronous: no network, no account state. The conformance suite feeds every module its recorded fixtures through this method.

ChainTx

DescribeActivityContext

ActivityItem | null

ProtocolBase.describeActivity


getApr(): Promise<number>

Defined in: protocols/staking.ts:116

APR in percent: 2.5 = 2.5 % (every staking module and app reads it this way).

Promise<number>

IStakingProtocol.getApr


getStakedBalance(): Promise<StakedBalance>

Defined in: protocols/staking.ts:115

The account’s staked position.

Promise<StakedBalance>

IStakingProtocol.getStakedBalance


getWithdrawalRequests(): Promise<WithdrawalRequestsView>

Defined in: protocols/staking.ts:112

The account’s open requests, and which are claimable.

Promise<WithdrawalRequestsView>

IStakingProtocol.getWithdrawalRequests


quoteClaimWithdrawals(_o?): Promise<Omit<ClaimWithdrawalsResult, "hash">>

Defined in: protocols/staking.ts:114

Network fee of IStakingProtocol.claimWithdrawals.

ClaimWithdrawalsOptions

Promise<Omit<ClaimWithdrawalsResult, "hash">>

IStakingProtocol.quoteClaimWithdrawals


quoteRequestWithdrawal(_o): Promise<Omit<WithdrawalRequestResult, "hash" | "approveHash">>

Defined in: protocols/staking.ts:111

Network fee of IStakingProtocol.requestWithdrawal.

WithdrawalRequestOptions

Promise<Omit<WithdrawalRequestResult, "hash" | "approveHash">>

IStakingProtocol.quoteRequestWithdrawal


quoteStake(_o): Promise<Omit<StakeResult, "hash">>

Defined in: protocols/staking.ts:109

Network fee of IStakingProtocol.stake; nothing is signed.

StakeOptions

Promise<Omit<StakeResult, "hash">>

IStakingProtocol.quoteStake


requestWithdrawal(_o): Promise<WithdrawalRequestResult>

Defined in: protocols/staking.ts:110

Put staked tokens in the withdrawal queue. Sends an approval first when the protocol needs one.

WithdrawalRequestOptions

Promise<WithdrawalRequestResult>

IStakingProtocol.requestWithdrawal


protected requireSigningAccount(methodName): IWalletAccount

Defined in: protocols/base.ts:29

The account, narrowed to a signing one, or a ReadOnlyAccountError naming the caller.

string

IWalletAccount

ProtocolBase.requireSigningAccount


stake(_o): Promise<StakeResult>

Defined in: protocols/staking.ts:108

Stake native coin and receive the protocol’s staked token.

StakeOptions

Promise<StakeResult>

IStakingProtocol.stake