LiquidStakingProtocolNear
Defined in: protocol-staking-liquid-near/src/protocol.ts:100
Liquid NEAR staking through the LiNEAR contract family (LiNEAR, Rhea rNEAR): deposit_and_stake
mints the token, unstake starts the delayed exit (4+ epochs, exact epoch from the contract),
withdraw_all pays out once unlocked and the contract holds the NEAR. See the package README.
Never builds ft_transfer_call or ft_transfer into the contract (it has no ft_on_transfer:
tokens sent that way are lost), and nothing but function calls to the pinned contract. Writes
refuse a paused contract (or a paused feature their calls need) or one whose code hash is not
pinned. Every quote returns the exact transactions; a write given expected refuses when its
fresh plan differs.
Extends
Section titled “Extends”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new LiquidStakingProtocolNear(
account,config):LiquidStakingProtocolNear
Defined in: protocol-staking-liquid-near/src/protocol.ts:112
Parameters
Section titled “Parameters”account
Section titled “account”IWalletAccountReadOnly | IWalletAccount
config
Section titled “config”Returns
Section titled “Returns”LiquidStakingProtocolNear
Overrides
Section titled “Overrides”Properties
Section titled “Properties”_account
Section titled “_account”
protectedreadonly_account:IWalletAccountReadOnly|IWalletAccount
Defined in: core/dist/index-i6xtgDlq.d.ts:317
Inherited from
Section titled “Inherited from”_config
Section titled “_config”
protectedreadonly_config:LiquidStakingNearConfig
Defined in: core/dist/index-i6xtgDlq.d.ts:318
Inherited from
Section titled “Inherited from”aprWindowEpochs
Section titled “aprWindowEpochs”
readonlyaprWindowEpochs:number
Defined in: protocol-staking-liquid-near/src/protocol.ts:103
readonlygas:object
Defined in: protocol-staking-liquid-near/src/protocol.ts:102
stake:
bigint
unstake
Section titled “unstake”unstake:
bigint
withdraw
Section titled “withdraw”withdraw:
bigint
reserve
Section titled “reserve”
readonlyreserve:bigint
Defined in: protocol-staking-liquid-near/src/protocol.ts:101
protectedreadonlyrpc:NearRpc|undefined
Defined in: protocol-staking-liquid-near/src/protocol.ts:105
Accessors
Section titled “Accessors”network
Section titled “network”Get Signature
Section titled “Get Signature”get network():
NearNetwork
Defined in: protocol-staking-liquid-near/src/protocol.ts:137
The configured network, else the account’s (near:testnet → testnet, anything else → mainnet).
Returns
Section titled “Returns”Get Signature
Section titled “Get Signature”get pool():
ResolvedLiquidPool
Defined in: protocol-staking-liquid-near/src/protocol.ts:142
Contract, symbol and pinned code hashes on the current network (throws ‘unsupported-network’).
Returns
Section titled “Returns”Methods
Section titled “Methods”claimWithdrawals()
Section titled “claimWithdrawals()”claimWithdrawals(
options?):Promise<LiquidClaimResult>
Defined in: protocol-staking-liquid-near/src/protocol.ts:656
Withdraws the unstaked NEAR (withdraw_all) once unlocked and payable.
Parameters
Section titled “Parameters”options?
Section titled “options?”LiquidClaimOptions = {}
Returns
Section titled “Returns”Promise<LiquidClaimResult>
Overrides
Section titled “Overrides”StakingProtocol.claimWithdrawals
describeActivity()
Section titled “describeActivity()”describeActivity(
tx,ctx):ActivityItem|null
Defined in: protocol-staking-liquid-near/src/protocol.ts:663
Labels LiNEAR-family staking transactions offline; see activity.ts.
Parameters
Section titled “Parameters”ChainTx
DescribeActivityContext
Returns
Section titled “Returns”ActivityItem | null
Overrides
Section titled “Overrides”StakingProtocol.describeActivity
getAccountDetails()
Section titled “getAccountDetails()”getAccountDetails():
Promise<LiquidAccountDetails>
Defined in: protocol-staking-liquid-near/src/protocol.ts:352
The account in the contract: tokens, their NEAR value, unstaked NEAR, exact unlock epoch, registration.
Returns
Section titled “Returns”Promise<LiquidAccountDetails>
getApr()
Section titled “getApr()”getApr():
Promise<number>
Defined in: protocol-staking-liquid-near/src/protocol.ts:376
APR in percent: the apr hook, else the token price’s growth over aprWindowEpochs (default 24,
~7 days), annualized by the two blocks’ timestamps. The past price comes from the archival RPC;
when that fails, from a 2-epoch window on the regular RPC. Cached for 10 minutes.
Returns
Section titled “Returns”Promise<number>
Overrides
Section titled “Overrides”getEpoch()
Section titled “getEpoch()”getEpoch():
Promise<NearEpoch>
Defined in: protocol-staking-liquid-near/src/protocol.ts:293
The epoch clock: height, start, measured duration (~6.9 h on mainnet), estimated end.
Returns
Section titled “Returns”Promise<NearEpoch>
getMaxStakeable()
Section titled “getMaxStakeable()”getMaxStakeable():
Promise<bigint>
Defined in: protocol-staking-liquid-near/src/protocol.ts:360
What stake can send now: available − reserve − the stake’s upfront gas (never below 0).
Returns
Section titled “Returns”Promise<bigint>
getPoolInfo()
Section titled “getPoolInfo()”getPoolInfo():
Promise<LiquidPoolInfo>
Defined in: protocol-staking-liquid-near/src/protocol.ts:298
Contract state: price, totals, pause flag, live code hash, liquidity, fee. Read fresh every time.
Returns
Section titled “Returns”Promise<LiquidPoolInfo>
getStakedBalance()
Section titled “getStakedBalance()”getStakedBalance():
Promise<LiquidStakedBalance>
Defined in: protocol-staking-liquid-near/src/protocol.ts:437
The position, Tonstakers-style: balance = tokens held, rate = price (yoctoNEAR per token,
10^24 = 1:1), total = their NEAR value; unstaked and withdrawable (unlocked and payable
from the contract’s liquid balance now) beside.
Returns
Section titled “Returns”Promise<LiquidStakedBalance>
Overrides
Section titled “Overrides”StakingProtocol.getStakedBalance
getWithdrawalRequests()
Section titled “getWithdrawalRequests()”getWithdrawalRequests():
Promise<LiquidWithdrawalRequestsView>
Defined in: protocol-staking-liquid-near/src/protocol.ts:452
The account’s unstaked NEAR as one request (a contract keeps one unstaked balance per account):
id poolRequestId(contract), unlockEpoch exact from the contract. claimable needs the epoch
reached, the contract’s liquid balance to cover it (awaitingLiquidity otherwise) and withdrawals
not paused (paused). timestamp is 0: the contract does not keep the unstake time.
Returns
Section titled “Returns”Promise<LiquidWithdrawalRequestsView>
Overrides
Section titled “Overrides”StakingProtocol.getWithdrawalRequests
quoteClaimWithdrawals()
Section titled “quoteClaimWithdrawals()”quoteClaimWithdrawals(
options?):Promise<LiquidClaimQuote>
Defined in: protocol-staking-liquid-near/src/protocol.ts:651
The claim’s transaction (withdraw_all) and fee; nothing is signed.
Parameters
Section titled “Parameters”options?
Section titled “options?”LiquidClaimOptions = {}
Returns
Section titled “Returns”Promise<LiquidClaimQuote>
Overrides
Section titled “Overrides”StakingProtocol.quoteClaimWithdrawals
quoteRequestWithdrawal()
Section titled “quoteRequestWithdrawal()”quoteRequestWithdrawal(
options):Promise<LiquidUnstakeQuote>
Defined in: protocol-staking-liquid-near/src/protocol.ts:608
The unstake’s transaction, fee and unlock estimate; nothing is signed. amount is in token base units.
Parameters
Section titled “Parameters”options
Section titled “options”Returns
Section titled “Returns”Promise<LiquidUnstakeQuote>
Overrides
Section titled “Overrides”StakingProtocol.quoteRequestWithdrawal
quoteStake()
Section titled “quoteStake()”quoteStake(
options):Promise<LiquidStakeQuote>
Defined in: protocol-staking-liquid-near/src/protocol.ts:536
The stake’s transaction, fee, tokens expected and APR; nothing is signed.
Parameters
Section titled “Parameters”options
Section titled “options”Returns
Section titled “Returns”Promise<LiquidStakeQuote>
Overrides
Section titled “Overrides”requestWithdrawal()
Section titled “requestWithdrawal()”requestWithdrawal(
options):Promise<LiquidUnstakeResult>
Defined in: protocol-staking-liquid-near/src/protocol.ts:618
Unstakes amount token base units (unstake with their NEAR value), or 'all' (unstake_all).
An unlocked balance is withdrawn in the same transaction first. Once it is final,
getAccountDetails().unlockEpoch is the exact epoch the NEAR unlocks at; reads use final blocks,
so right after the send they still show the previous one (show the result’s unlock meanwhile).
Parameters
Section titled “Parameters”options
Section titled “options”Returns
Section titled “Returns”Promise<LiquidUnstakeResult>
Overrides
Section titled “Overrides”StakingProtocol.requestWithdrawal
requireSigningAccount()
Section titled “requireSigningAccount()”
protectedrequireSigningAccount(methodName):IWalletAccount
Defined in: core/dist/index-i6xtgDlq.d.ts:330
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<LiquidStakeResult>
Defined in: protocol-staking-liquid-near/src/protocol.ts:544
Stakes exactly amount yoctoNEAR (deposit_and_stake) for the token. There is no “stake
everything”: pass the amount (at most getMaxStakeable()).
Parameters
Section titled “Parameters”options
Section titled “options”Returns
Section titled “Returns”Promise<LiquidStakeResult>