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.
stakeisdelegate(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).requestWithdrawalisundelegate(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).claimWithdrawalssendswithdraw(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.
Extends
Section titled “Extends”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new NativeStakingProtocolMonad(
account,config):NativeStakingProtocolMonad
Defined in: protocol-staking-native-monad/src/protocol.ts:235
Parameters
Section titled “Parameters”account
Section titled “account”IWalletAccountReadOnly | IWalletAccount
config
Section titled “config”Returns
Section titled “Returns”NativeStakingProtocolMonad
Overrides
Section titled “Overrides”Properties
Section titled “Properties”_account
Section titled “_account”
protectedreadonly_account:IWalletAccountReadOnly|IWalletAccount
Defined in: core/dist/index-QWdcwE6y.d.ts:309
Inherited from
Section titled “Inherited from”_config
Section titled “_config”
protectedreadonly_config:NativeStakingMonadConfig
Defined in: core/dist/index-QWdcwE6y.d.ts:310
Inherited from
Section titled “Inherited from”defaultValidator
Section titled “defaultValidator”
readonlydefaultValidator:bigint|undefined
Defined in: protocol-staking-native-monad/src/protocol.ts:217
maxCommission
Section titled “maxCommission”
readonlymaxCommission:number
Defined in: protocol-staking-native-monad/src/protocol.ts:218
maxWithdrawId
Section titled “maxWithdrawId”
readonlymaxWithdrawId:number
Defined in: protocol-staking-native-monad/src/protocol.ts:221
reserveBalance
Section titled “reserveBalance”
readonlyreserveBalance:bigint
Defined in: protocol-staking-native-monad/src/protocol.ts:220
stakingAddress
Section titled “stakingAddress”
readonlystakingAddress:`0x${string}`
Defined in: protocol-staking-native-monad/src/protocol.ts:219
validators
Section titled “validators”
readonlyvalidators:NormalizedValidators
Defined in: protocol-staking-native-monad/src/protocol.ts:216
withdrawScan
Section titled “withdrawScan”
readonlywithdrawScan:"multicall"|"gap"|"full"
Defined in: protocol-staking-native-monad/src/protocol.ts:225
Methods
Section titled “Methods”claimRewards()
Section titled “claimRewards()”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.
Parameters
Section titled “Parameters”options?
Section titled “options?”MonadRewardsOptions = {}
Returns
Section titled “Returns”Promise<MonadRewardsResult>
claimWithdrawals()
Section titled “claimWithdrawals()”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).
Parameters
Section titled “Parameters”options?
Section titled “options?”MonadClaimOptions = {}
Returns
Section titled “Returns”Promise<MonadClaimResult>
Overrides
Section titled “Overrides”StakingProtocol.claimWithdrawals
compound()
Section titled “compound()”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).
Parameters
Section titled “Parameters”options?
Section titled “options?”MonadRewardsOptions = {}
Returns
Section titled “Returns”Promise<MonadRewardsResult>
describeActivity()
Section titled “describeActivity()”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.
Parameters
Section titled “Parameters”ChainTx
DescribeActivityContext
Returns
Section titled “Returns”ActivityItem | null
Overrides
Section titled “Overrides”StakingProtocol.describeActivity
getApr()
Section titled “getApr()”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.
Parameters
Section titled “Parameters”options?
Section titled “options?”validator?
Section titled “validator?”number | bigint
Returns
Section titled “Returns”Promise<number>
Overrides
Section titled “Overrides”getEpoch()
Section titled “getEpoch()”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.
Returns
Section titled “Returns”Promise<MonadEpoch>
getMaxStakeable()
Section titled “getMaxStakeable()”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.
Returns
Section titled “Returns”Promise<bigint>
getNetworkStats()
Section titled “getNetworkStats()”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.
Returns
Section titled “Returns”Promise<MonadNetworkStats>
getStakedBalance()
Section titled “getStakedBalance()”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).
Returns
Section titled “Returns”Promise<StakedBalance & object>
Overrides
Section titled “Overrides”StakingProtocol.getStakedBalance
getValidator()
Section titled “getValidator()”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.
Parameters
Section titled “Parameters”number | bigint
Returns
Section titled “Returns”Promise<ValidatorInfo>
getWithdrawalRequests()
Section titled “getWithdrawalRequests()”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.
Parameters
Section titled “Parameters”options?
Section titled “options?”MonadWithdrawalScanOptions = {}
Returns
Section titled “Returns”Promise<MonadWithdrawalRequestsView>
Overrides
Section titled “Overrides”StakingProtocol.getWithdrawalRequests
listPositions()
Section titled “listPositions()”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).
Parameters
Section titled “Parameters”options?
Section titled “options?”validators?
Section titled “validators?”readonly (number | bigint)[]
Returns
Section titled “Returns”Promise<DelegatorPosition[]>
listValidators()
Section titled “listValidators()”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.
Parameters
Section titled “Parameters”options?
Section titled “options?”limit?
Section titled “limit?”number
Returns
Section titled “Returns”Promise<ValidatorInfo[]>
nextWithdrawId()
Section titled “nextWithdrawId()”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).
Parameters
Section titled “Parameters”validatorId
Section titled “validatorId”number | bigint
Returns
Section titled “Returns”Promise<number | null>
quoteClaimRewards()
Section titled “quoteClaimRewards()”quoteClaimRewards(
options?):Promise<MonadRewardsQuote>
Defined in: protocol-staking-native-monad/src/protocol.ts:851
Network fee of claimRewards; nothing is signed.
Parameters
Section titled “Parameters”options?
Section titled “options?”MonadRewardsOptions = {}
Returns
Section titled “Returns”Promise<MonadRewardsQuote>
quoteClaimWithdrawals()
Section titled “quoteClaimWithdrawals()”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.
Parameters
Section titled “Parameters”options?
Section titled “options?”MonadClaimOptions = {}
Returns
Section titled “Returns”Promise<MonadClaimQuote>
Overrides
Section titled “Overrides”StakingProtocol.quoteClaimWithdrawals
quoteCompound()
Section titled “quoteCompound()”quoteCompound(
options?):Promise<MonadRewardsQuote>
Defined in: protocol-staking-native-monad/src/protocol.ts:836
Network fee of compound; nothing is signed.
Parameters
Section titled “Parameters”options?
Section titled “options?”MonadRewardsOptions = {}
Returns
Section titled “Returns”Promise<MonadRewardsQuote>
quoteRequestWithdrawal()
Section titled “quoteRequestWithdrawal()”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.
Parameters
Section titled “Parameters”options
Section titled “options”Returns
Section titled “Returns”Promise<MonadUnstakeQuote>
Overrides
Section titled “Overrides”StakingProtocol.quoteRequestWithdrawal
quoteStake()
Section titled “quoteStake()”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.
Parameters
Section titled “Parameters”options
Section titled “options”Returns
Section titled “Returns”Promise<MonadStakeQuote>
Overrides
Section titled “Overrides”requestWithdrawal()
Section titled “requestWithdrawal()”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.
Parameters
Section titled “Parameters”options
Section titled “options”Returns
Section titled “Returns”Promise<MonadUnstakeResult>
Overrides
Section titled “Overrides”StakingProtocol.requestWithdrawal
requireSigningAccount()
Section titled “requireSigningAccount()”
protectedrequireSigningAccount(methodName):IWalletAccount
Defined in: core/dist/index-QWdcwE6y.d.ts:322
The account, narrowed to a signing one, or a ReadOnlyAccountError naming the caller.
Parameters
Section titled “Parameters”methodName
Section titled “methodName”string
Returns
Section titled “Returns”IWalletAccount
Inherited from
Section titled “Inherited from”StakingProtocol.requireSigningAccount
stake()
Section titled “stake()”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).
Parameters
Section titled “Parameters”options
Section titled “options”Returns
Section titled “Returns”Promise<MonadStakeResult>