Skip to content
docs

NativeStakingProtocolMonad

Defined in: protocol-staking-native-monad/src/protocol.ts:215

Native MON staking on Monad: delegations straight to validators through the staking precompile (0x…1000). No pool, no token: the position is the wallet’s DelInfo per validator.

  • stake is delegate(validatorId) with the amount as value. It becomes active at the next epoch (n+1), or n+2 when sent after the boundary block (getEpoch().activatesAtEpoch).
  • requestWithdrawal is undelegate(validatorId, amount, withdrawId) with the lowest free slot (0..255). Only active stake can be undelegated. The MON can be withdrawn one epoch after it deactivates (withdrawableAtEpoch).
  • claimWithdrawals sends withdraw(validatorId, withdrawId) for each ready request (the precompile takes one per transaction). Rewards are separate: claimRewards / compound.

Fail-closed before anything is signed: the validator must be listed (or 'any'), exist, be in the consensus set in good standing and charge at most maxCommission; amounts respect the 1 gwei minimum, the active stake and Monad’s 10 MON reserve balance; withdrawal slots must be free; the account and the read RPC must both be on Monad. Every write is simulated with eth_call first and a revert comes back in plain words.

new NativeStakingProtocolMonad(account, config): NativeStakingProtocolMonad

Defined in: protocol-staking-native-monad/src/protocol.ts:235

IWalletAccountReadOnly | IWalletAccount

NativeStakingMonadConfig

NativeStakingProtocolMonad

StakingProtocol.constructor

protected readonly _account: IWalletAccountReadOnly | IWalletAccount

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

StakingProtocol._account


protected readonly _config: NativeStakingMonadConfig

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

StakingProtocol._config


readonly defaultValidator: bigint | undefined

Defined in: protocol-staking-native-monad/src/protocol.ts:217


readonly maxCommission: number

Defined in: protocol-staking-native-monad/src/protocol.ts:218


readonly maxWithdrawId: number

Defined in: protocol-staking-native-monad/src/protocol.ts:221


readonly reserveBalance: bigint

Defined in: protocol-staking-native-monad/src/protocol.ts:220


readonly stakingAddress: `0x${string}`

Defined in: protocol-staking-native-monad/src/protocol.ts:219


readonly validators: NormalizedValidators

Defined in: protocol-staking-native-monad/src/protocol.ts:216


readonly withdrawScan: "multicall" | "gap" | "full"

Defined in: protocol-staking-native-monad/src/protocol.ts:225

claimRewards(options?): Promise<MonadRewardsResult>

Defined in: protocol-staking-native-monad/src/protocol.ts:858

Sends the rewards earned with a validator to the wallet, right away.

MonadRewardsOptions = {}

Promise<MonadRewardsResult>


claimWithdrawals(options?): Promise<MonadClaimResult>

Defined in: protocol-staking-native-monad/src/protocol.ts:798

Withdraws ready requests (all, or ids): one withdraw transaction each, sent in order. If one fails midway, the error carries sent (the hashes that went out).

MonadClaimOptions = {}

Promise<MonadClaimResult>

StakingProtocol.claimWithdrawals


compound(options?): Promise<MonadRewardsResult>

Defined in: protocol-staking-native-monad/src/protocol.ts:843

Re-delegates the rewards earned with a validator (active from activatesAtEpoch).

MonadRewardsOptions = {}

Promise<MonadRewardsResult>


describeActivity(tx, ctx): ActivityItem | null

Defined in: protocol-staking-native-monad/src/protocol.ts:866

Labels staking-precompile transactions (stake, unstake, withdraw, compound, claim rewards) offline; see activity.ts.

ChainTx

DescribeActivityContext

ActivityItem | null

StakingProtocol.describeActivity


getApr(options?): Promise<number>

Defined in: protocol-staking-native-monad/src/protocol.ts:496

APR in percent for a validator (validator, else the default): enrich’s figure when it gives one, else 18 MON × blocks per year ÷ consensus stake × (1 − commission). Without a validator in 'any' mode: the network figure before commission.

number | bigint

Promise<number>

StakingProtocol.getApr


getEpoch(): Promise<MonadEpoch>

Defined in: protocol-staking-native-monad/src/protocol.ts:350

The current epoch, whether the boundary block has passed, and the epoch a change made now takes effect in.

Promise<MonadEpoch>


getMaxStakeable(): Promise<bigint>

Defined in: protocol-staking-native-monad/src/protocol.ts:567

The most stake can take now: balance − reserve balance (the gas is paid out of the reserve, as Monad allows); 0 below 1 gwei.

Promise<bigint>


getNetworkStats(): Promise<MonadNetworkStats>

Defined in: protocol-staking-native-monad/src/protocol.ts:423

Network figures for the APR estimate: the consensus set’s total stake (one getValidator per validator, cached) and the block time measured over the last 50 000 blocks. Cached 10 minutes.

Promise<MonadNetworkStats>


getStakedBalance(): Promise<StakedBalance & object>

Defined in: protocol-staking-native-monad/src/protocol.ts:555

The position: balance is active stake, total active plus activating (rewards are not in it until compounded; they are in unclaimedRewards). No wrapped form (rate 0).

Promise<StakedBalance & object>

StakingProtocol.getStakedBalance


getValidator(id): Promise<ValidatorInfo>

Defined in: protocol-staking-native-monad/src/protocol.ts:446

One validator, read fresh: stake, commission, standing, APR, and whether the module may delegate to it.

number | bigint

Promise<ValidatorInfo>


getWithdrawalRequests(options?): Promise<MonadWithdrawalRequestsView>

Defined in: protocol-staking-native-monad/src/protocol.ts:639

Pending withdrawals. id is validatorId << 8 | withdrawId; claimable once the epoch is past the stake’s deactivation (withdrawableAtEpoch); timestamp is 0 (the precompile does not keep it).

Validators looked at: the wallet’s delegations, the configured list, validators this instance undelegated from, and validators. A validator the wallet fully exited drops out of getDelegations, so in 'any' mode pass it (from the activity feed or the id that requestWithdrawal returned) or its withdrawal is not found. validator reads just one.

MonadWithdrawalScanOptions = {}

Promise<MonadWithdrawalRequestsView>

StakingProtocol.getWithdrawalRequests


listPositions(options?): Promise<DelegatorPosition[]>

Defined in: protocol-staking-native-monad/src/protocol.ts:542

The wallet’s positions — every validator it has stake with, plus the configured ones, the ones it unstaked from and options.validators — with pending stake and unclaimed rewards; a validator with nothing there is left out. validator.apr is filled only once getNetworkStats() has run (it costs ~200 reads).

readonly (number | bigint)[]

Promise<DelegatorPosition[]>


listValidators(options?): Promise<ValidatorInfo[]>

Defined in: protocol-staking-native-monad/src/protocol.ts:461

The validators to offer: the configured list in its order, or in 'any' mode the consensus set by stake (limit to cut it). Each says whether it can take stake now and why not.

number

Promise<ValidatorInfo[]>


nextWithdrawId(validatorId): Promise<number | null>

Defined in: protocol-staking-native-monad/src/protocol.ts:580

The lowest free withdrawal slot for this validator (null when all are in use).

number | bigint

Promise<number | null>


quoteClaimRewards(options?): Promise<MonadRewardsQuote>

Defined in: protocol-staking-native-monad/src/protocol.ts:851

Network fee of claimRewards; nothing is signed.

MonadRewardsOptions = {}

Promise<MonadRewardsQuote>


quoteClaimWithdrawals(options?): Promise<MonadClaimQuote>

Defined in: protocol-staking-native-monad/src/protocol.ts:784

Total fee and amount of a claim (one withdraw per request); nothing is signed. Each transaction is simulated.

MonadClaimOptions = {}

Promise<MonadClaimQuote>

StakingProtocol.quoteClaimWithdrawals


quoteCompound(options?): Promise<MonadRewardsQuote>

Defined in: protocol-staking-native-monad/src/protocol.ts:836

Network fee of compound; nothing is signed.

MonadRewardsOptions = {}

Promise<MonadRewardsQuote>


quoteRequestWithdrawal(options): Promise<MonadUnstakeQuote>

Defined in: protocol-staking-native-monad/src/protocol.ts:736

Network fee and slot of an unstake; nothing is signed. The transaction is simulated.

MonadUnstakeOptions

Promise<MonadUnstakeQuote>

StakingProtocol.quoteRequestWithdrawal


quoteStake(options): Promise<MonadStakeQuote>

Defined in: protocol-staking-native-monad/src/protocol.ts:684

Network fee and details of a stake; nothing is signed. The transaction is simulated.

MonadStakeOptions

Promise<MonadStakeQuote>

StakingProtocol.quoteStake


requestWithdrawal(options): Promise<MonadUnstakeResult>

Defined in: protocol-staking-native-monad/src/protocol.ts:747

Undelegates amount wei of active stake into a withdrawal slot; claim it with claimWithdrawals once it opens. Keep the returned id: after a full exit the validator no longer shows in getDelegations, and claimWithdrawals({ ids: [id] }) always works.

MonadUnstakeOptions

Promise<MonadUnstakeResult>

StakingProtocol.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

StakingProtocol.requireSigningAccount


stake(options): Promise<MonadStakeResult>

Defined in: protocol-staking-native-monad/src/protocol.ts:691

Delegates amount wei of MON to a validator (delegate, the amount as value).

MonadStakeOptions

Promise<MonadStakeResult>

StakingProtocol.stake