Skip to content
docs

NativeStakingNearConfig

Defined in: protocol-staking-native-near/src/types.ts:46

Configuration of NativeStakingProtocolNear. Only pools is required.

optional allowInactive?: boolean

Defined in: protocol-staking-native-near/src/types.ts:54

Allow pools outside the current or next validator set (default false: their stake earns nothing).


optional codeHashes?: readonly string[]

Defined in: protocol-staking-native-near/src/types.ts:72

More staking-pool code hashes to accept, on top of KNOWN_POOL_CODE_HASHES (the app vouches for them).


optional concurrency?: number

Defined in: protocol-staking-native-near/src/types.ts:85

Reads in flight at once (default 4).


optional defaultPool?: string

Defined in: protocol-staking-native-near/src/types.ts:50

Used when a call names no pool. A single-entry list is its own default.


optional discover?: false | PoolDiscovery | "fastnear"

Defined in: protocol-staking-native-near/src/types.ts:81

How positions outside the configured pools are found: 'fastnear' (default) asks api.fastnear.com (test.api.fastnear.com on testnet) which pools the account delegated to; a function is the app’s own lookup; false reads only listed pools and the pools passed to a call. Discovered ids that are not factory pools are dropped without a read.


optional enrich?: PoolEnricher

Defined in: protocol-staking-native-near/src/types.ts:74

Adds data to pools (APR, names, logos).


optional gas?: object

Defined in: protocol-staking-native-near/src/types.ts:70

Prepaid gas overrides (defaults: 50 Tgas each). All of it is bought upfront at min_gas_purchase_price: keep it small.

optional stake?: bigint

optional unstake?: bigint

optional withdraw?: bigint


optional history?: HistorySource

Defined in: protocol-staking-native-near/src/types.ts:83

History of the account (e.g. wallet-near’s createNearHistory): dates the last unstake for exact unlock epochs.


optional maxFee?: number

Defined in: protocol-staking-native-near/src/types.ts:52

Refuse pools whose reward fee is above this, percent (default 10). Read fresh at every write.


optional minUptime?: number

Defined in: protocol-staking-native-near/src/types.ts:56

Refuse pools whose uptime in the current epoch is below this, percent (default 0: off).


optional network?: NearNetwork

Defined in: protocol-staking-native-near/src/types.ts:58

Default: from the account’s chain (near:testnet → testnet, else mainnet).


pools: PoolsOption

Defined in: protocol-staking-native-near/src/types.ts:48

Pool ids to stake into, or 'any'. Required.


optional provider?: NearProvider | NearProvider[]

Defined in: protocol-staking-native-near/src/types.ts:60

RPC url(s) or transport(s); a list fails over. Default: the wallet-near account’s own provider.


optional reserve?: number | bigint

Defined in: protocol-staking-native-near/src/types.ts:68

yoctoNEAR stake leaves on the account (default 0.02 NEAR). Never less than the upfront gas of the largest exit, [withdraw_all, unstake], at the current prices (see NearStakeQuote.reserve), so a stake can always be left.


optional timeoutMs?: number

Defined in: protocol-staking-native-near/src/types.ts:62

Per-request timeout for url providers, ms (default 15 000).