Skip to content
docs

StakingProtocol

Defined in: core/dist/index-QWdcwE6y.d.ts:783

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

  • ProtocolBase<TConfig>

TConfig extends object = Record<string, never>

  • IStakingProtocol

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

Defined in: core/dist/index-QWdcwE6y.d.ts:784

IWalletAccountReadOnly | IWalletAccount

TConfig

StakingProtocol<TConfig>

ProtocolBase<TConfig>.constructor

protected readonly _account: IWalletAccountReadOnly | IWalletAccount

Defined in: core/dist/index-QWdcwE6y.d.ts:309

ProtocolBase._account


protected readonly _config: TConfig

Defined in: core/dist/index-QWdcwE6y.d.ts:310

ProtocolBase._config

claimWithdrawals(_o?): Promise<ClaimWithdrawalsResult>

Defined in: core/dist/index-QWdcwE6y.d.ts:790

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

ClaimWithdrawalsOptions

Promise<ClaimWithdrawalsResult>

IStakingProtocol.claimWithdrawals


describeActivity(_tx, _ctx): ActivityItem | null

Defined in: core/dist/index-QWdcwE6y.d.ts:320

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: core/dist/index-QWdcwE6y.d.ts:793

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: core/dist/index-QWdcwE6y.d.ts:792

The account’s staked position.

Promise<StakedBalance>

IStakingProtocol.getStakedBalance


getWithdrawalRequests(): Promise<WithdrawalRequestsView>

Defined in: core/dist/index-QWdcwE6y.d.ts:789

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

Promise<WithdrawalRequestsView>

IStakingProtocol.getWithdrawalRequests


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

Defined in: core/dist/index-QWdcwE6y.d.ts:791

Network fee of IStakingProtocol.claimWithdrawals.

ClaimWithdrawalsOptions

Promise<Omit<ClaimWithdrawalsResult, "hash">>

IStakingProtocol.quoteClaimWithdrawals


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

Defined in: core/dist/index-QWdcwE6y.d.ts:788

Network fee of IStakingProtocol.requestWithdrawal.

WithdrawalRequestOptions

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

IStakingProtocol.quoteRequestWithdrawal


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

Defined in: core/dist/index-QWdcwE6y.d.ts:786

Network fee of IStakingProtocol.stake; nothing is signed.

StakeOptions

Promise<Omit<StakeResult, "hash">>

IStakingProtocol.quoteStake


requestWithdrawal(_o): Promise<WithdrawalRequestResult>

Defined in: core/dist/index-QWdcwE6y.d.ts:787

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: core/dist/index-QWdcwE6y.d.ts:322

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

string

IWalletAccount

ProtocolBase.requireSigningAccount


stake(_o): Promise<StakeResult>

Defined in: core/dist/index-QWdcwE6y.d.ts:785

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

StakeOptions

Promise<StakeResult>

IStakingProtocol.stake