NativeStakingProtocolSolana
Defined in: protocol-staking-native-solana/src/protocol.ts:287
Native staking on Solana: SOL delegated straight to validators the app chooses, through the Stake program. No pool, no token, no third-party program: each position is a stake account owned by the wallet (staker and withdrawer are always the wallet’s address).
stakecreates a stake account at a seed-derived address (create_with_seed(wallet, "stake:<i>"), so only the wallet signs and the position can be rebuilt from the wallet alone), initializes it and delegates it, in one transaction. It becomes active at the next epoch boundary (~2 days).requestWithdrawaldeactivates whole accounts and, for a partial amount, splits it into a new account first. The SOL can be withdrawn once the cool-down ends (next epoch boundary).claimWithdrawalswithdraws every lamport of fully inactive accounts back to the wallet.delegatere-delegates an inactive account, or undoes a deactivation made in the same epoch;mergejoins two compatible accounts.
Fail-closed before anything is signed: the validator must be in the configured list (or the app
chose 'any'), voting, and within maxCommission; amounts respect the minimum delegation and the
rent; the wallet keeps feeReserve for later fees. Statuses (activating / active / deactivating /
inactive) are computed from the StakeHistory sysvar exactly as the program does.
Extends
Section titled “Extends”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new NativeStakingProtocolSolana(
account,config):NativeStakingProtocolSolana
Defined in: protocol-staking-native-solana/src/protocol.ts:301
Parameters
Section titled “Parameters”account
Section titled “account”IWalletAccountReadOnly | IWalletAccount
config
Section titled “config”Returns
Section titled “Returns”NativeStakingProtocolSolana
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:NativeStakingConfig
Defined in: core/dist/index-QWdcwE6y.d.ts:310
Inherited from
Section titled “Inherited from”defaultValidator
Section titled “defaultValidator”
readonlydefaultValidator:string|undefined
Defined in: protocol-staking-native-solana/src/protocol.ts:290
feeReserve
Section titled “feeReserve”
readonlyfeeReserve:bigint
Defined in: protocol-staking-native-solana/src/protocol.ts:294
maxAccounts
Section titled “maxAccounts”
readonlymaxAccounts:number
Defined in: protocol-staking-native-solana/src/protocol.ts:293
maxCommission
Section titled “maxCommission”
readonlymaxCommission:number
Defined in: protocol-staking-native-solana/src/protocol.ts:291
seedPrefix
Section titled “seedPrefix”
readonlyseedPrefix:string
Defined in: protocol-staking-native-solana/src/protocol.ts:292
validators
Section titled “validators”
readonlyvalidators:"any"| readonlyValidatorConfig[]
Defined in: protocol-staking-native-solana/src/protocol.ts:289
The configured validators, or 'any'.
Methods
Section titled “Methods”claimWithdrawals()
Section titled “claimWithdrawals()”claimWithdrawals(
options?):Promise<NativeClaimResult>
Defined in: protocol-staking-native-solana/src/protocol.ts:884
Withdraws every lamport of fully inactive stake accounts to the wallet (the accounts close).
Parameters
Section titled “Parameters”options?
Section titled “options?”NativeClaimOptions = {}
Returns
Section titled “Returns”Promise<NativeClaimResult>
Overrides
Section titled “Overrides”StakingProtocol.claimWithdrawals
delegate()
Section titled “delegate()”delegate(
options):Promise<DelegateResult>
Defined in: protocol-staking-native-solana/src/protocol.ts:926
Delegates an inactive stake account (to validator, or the default), or — for an account
deactivated in the current epoch — puts it back on its validator, undoing the unstake.
Parameters
Section titled “Parameters”options
Section titled “options”Returns
Section titled “Returns”Promise<DelegateResult>
describeActivity()
Section titled “describeActivity()”describeActivity(
tx,ctx):ActivityItem|null
Defined in: protocol-staking-native-solana/src/protocol.ts:978
Labels Stake-program transactions (stake, unstake, claim, delegate, merge) 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-solana/src/protocol.ts:655
APR in percent for a validator (validator, else the default or the first eligible one): the
enrich figure when it gives one, else validator inflation × supply ÷ staked SOL × (1 − commission).
With 'any' and no validator: the cluster-wide figure before commission.
Parameters
Section titled “Parameters”options?
Section titled “options?”validator?
Section titled “validator?”string
Returns
Section titled “Returns”Promise<number>
Overrides
Section titled “Overrides”getEpochInfo()
Section titled “getEpochInfo()”getEpochInfo():
Promise<EpochClock>
Defined in: protocol-staking-native-solana/src/protocol.ts:345
The epoch clock, with a projected end of the current epoch.
Returns
Section titled “Returns”Promise<EpochClock>
getMaxStakeable()
Section titled “getMaxStakeable()”getMaxStakeable():
Promise<bigint>
Defined in: protocol-staking-native-solana/src/protocol.ts:533
The most stake can take now: balance − account rent − fee reserve (0 when below the minimum delegation).
Returns
Section titled “Returns”Promise<bigint>
getRewards()
Section titled “getRewards()”getRewards(
options?):Promise<NativeRewards>
Defined in: protocol-staking-native-solana/src/protocol.ts:667
Inflation rewards the wallet’s delegated stake accounts earned in the last epochs completed
epochs (default 5). An epoch the node no longer serves is reported with its error, not dropped.
Parameters
Section titled “Parameters”options?
Section titled “options?”epochs?
Section titled “epochs?”number
Returns
Section titled “Returns”Promise<NativeRewards>
getStakeAccountAddress()
Section titled “getStakeAccountAddress()”getStakeAccountAddress(
index):Promise<string>
Defined in: protocol-staking-native-solana/src/protocol.ts:392
Address of the wallet’s stake account in seed slot index.
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”Promise<string>
getStakeAccounts()
Section titled “getStakeAccounts()”getStakeAccounts():
Promise<StakeAccountInfo[]>
Defined in: protocol-staking-native-solana/src/protocol.ts:506
The wallet’s stake accounts: its seed slots, plus (with discover) accounts other wallets made for
it. Each with its status, amounts, when it settles and what the wallet may do with it.
Returns
Section titled “Returns”Promise<StakeAccountInfo[]>
getStakedBalance()
Section titled “getStakedBalance()”getStakedBalance():
Promise<StakedBalance&object>
Defined in: protocol-staking-native-solana/src/protocol.ts:517
The position: balance is the stake delegated and not being withdrawn (principal plus compounded
rewards), total every lamport in the wallet’s stake accounts. There is no wrapped form (rate 0).
Only accounts the wallet can withdraw count; managedOnly sums those it is just the stake authority of.
Returns
Section titled “Returns”Promise<StakedBalance & object>
Overrides
Section titled “Overrides”StakingProtocol.getStakedBalance
getStakeParams()
Section titled “getStakeParams()”getStakeParams():
Promise<{minimumDelegation:bigint;rentExempt:bigint; }>
Defined in: protocol-staking-native-solana/src/protocol.ts:353
Rent of a stake account and the minimum delegation, lamports (cached for 10 minutes).
Returns
Section titled “Returns”Promise<{ minimumDelegation: bigint; rentExempt: bigint; }>
getValidator()
Section titled “getValidator()”getValidator(
voteAccount):Promise<ValidatorInfo>
Defined in: protocol-staking-native-solana/src/protocol.ts:610
One validator, live: commission, stake, delinquency, APR, and whether the module may delegate to it.
Parameters
Section titled “Parameters”voteAccount
Section titled “voteAccount”string
Returns
Section titled “Returns”Promise<ValidatorInfo>
getWithdrawalRequests()
Section titled “getWithdrawalRequests()”getWithdrawalRequests():
Promise<NativeWithdrawalRequestsView>
Defined in: protocol-staking-native-solana/src/protocol.ts:831
Stake accounts that are cooling down or ready to claim. id is accountId; amount the
account’s lamports (all of it returns on claim, rent included); timestamp is 0 (the chain does
not record when a deactivation was sent).
Returns
Section titled “Returns”Promise<NativeWithdrawalRequestsView>
Overrides
Section titled “Overrides”StakingProtocol.getWithdrawalRequests
listValidators()
Section titled “listValidators()”listValidators(
options?):Promise<ValidatorInfo[]>
Defined in: protocol-staking-native-solana/src/protocol.ts:620
The validators to offer: the configured list in its order, or in 'any' mode the cluster’s voting
validators 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[]>
merge()
Section titled “merge()”merge(
options):Promise<MergeResult>
Defined in: protocol-staking-native-solana/src/protocol.ts:971
Merges source into destination (the source closes). Frees a seed slot and keeps the position tidy.
Parameters
Section titled “Parameters”options
Section titled “options”Returns
Section titled “Returns”Promise<MergeResult>
quoteClaimWithdrawals()
Section titled “quoteClaimWithdrawals()”quoteClaimWithdrawals(
options?):Promise<NativeClaimQuote>
Defined in: protocol-staking-native-solana/src/protocol.ts:878
Network fee and amount of a claim; nothing is signed.
Parameters
Section titled “Parameters”options?
Section titled “options?”NativeClaimOptions = {}
Returns
Section titled “Returns”Promise<NativeClaimQuote>
Overrides
Section titled “Overrides”StakingProtocol.quoteClaimWithdrawals
quoteDelegate()
Section titled “quoteDelegate()”quoteDelegate(
options):Promise<DelegateQuote>
Defined in: protocol-staking-native-solana/src/protocol.ts:917
Network fee of delegate; nothing is signed.
Parameters
Section titled “Parameters”options
Section titled “options”Returns
Section titled “Returns”Promise<DelegateQuote>
quoteMerge()
Section titled “quoteMerge()”quoteMerge(
options):Promise<MergeQuote>
Defined in: protocol-staking-native-solana/src/protocol.ts:965
Network fee of merge; nothing is signed.
Parameters
Section titled “Parameters”options
Section titled “options”Returns
Section titled “Returns”Promise<MergeQuote>
quoteRequestWithdrawal()
Section titled “quoteRequestWithdrawal()”quoteRequestWithdrawal(
options):Promise<NativeUnstakeQuote>
Defined in: protocol-staking-native-solana/src/protocol.ts:811
Network fee and plan of an unstake; nothing is signed.
Parameters
Section titled “Parameters”options
Section titled “options”Returns
Section titled “Returns”Promise<NativeUnstakeQuote>
Overrides
Section titled “Overrides”StakingProtocol.quoteRequestWithdrawal
quoteStake()
Section titled “quoteStake()”quoteStake(
options):Promise<NativeStakeQuote>
Defined in: protocol-staking-native-solana/src/protocol.ts:743
Network fee and details of a stake; nothing is signed.
Parameters
Section titled “Parameters”options
Section titled “options”Returns
Section titled “Returns”Promise<NativeStakeQuote>
Overrides
Section titled “Overrides”requestWithdrawal()
Section titled “requestWithdrawal()”requestWithdrawal(
options):Promise<NativeUnstakeResult>
Defined in: protocol-staking-native-solana/src/protocol.ts:820
Unstakes amount lamports of delegated stake: deactivates whole accounts (an exact match first,
then the largest that fit) and splits the remainder off one account. Claim after the cool-down.
Parameters
Section titled “Parameters”options
Section titled “options”Returns
Section titled “Returns”Promise<NativeUnstakeResult>
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<NativeStakeResult>
Defined in: protocol-staking-native-solana/src/protocol.ts:749
Stakes amount lamports with a validator: a new stake account, initialized and delegated in one transaction.
Parameters
Section titled “Parameters”options
Section titled “options”Returns
Section titled “Returns”Promise<NativeStakeResult>