Options
All
  • Public
  • Public/Protected
  • All
Menu

@ankr.com/staking-sdk

Index

Namespaces

Enumerations

Classes

Interfaces

Type Aliases

Properties

Variables

Functions

Type Aliases

BigNumberish: string | number | BigNumber
IFetchTxReceiptData: TransactionReceipt | null

Transaction receipt

TBnbSyntToken: typeof AVAILABLE_BNB_SYNT_TOKENS[number]

Available tokens for BinanceSDK

TEthToken: typeof OSynthEthTokens[keyof typeof OSynthEthTokens]

Available tokens for EthereumSDK

TFtmSyntToken: "aFTMb" | "ankrFTM"

Available tokens for FantomSDK

TMaticSyntToken: "ankrMATIC" | "aMATICb"

Available tokens for MaticSDK

TUnstakingStatsType: "bond" | "cert" | "all"

Unstaking type from API

Properties

AAVAXB_ABI: ({ anonymous: boolean; inputs: { indexed: boolean; internalType: string; name: string; type: string }[]; name: string; outputs: undefined; stateMutability: undefined; type: string } | { anonymous: undefined; inputs: { internalType: string; name: string; type: string }[]; name: string; outputs: { internalType: string; name: string; type: string }[]; stateMutability: string; type: string })[]
ABI_ABNBB: ({ anonymous: boolean; inputs: { indexed: boolean; internalType: string; name: string; type: string }[]; name: string; outputs: undefined; stateMutability: undefined; type: string } | { anonymous: undefined; inputs: { internalType: string; name: string; type: string }[]; name: string; outputs: { internalType: string; name: string; type: string }[]; stateMutability: string; type: string })[]
ABI_ANKR_BNB: ({ anonymous: boolean; inputs: { indexed: boolean; internalType: string; name: string; type: string }[]; name: string; outputs: undefined; stateMutability: undefined; type: string } | { anonymous: undefined; inputs: { internalType: string; name: string; type: string }[]; name: string; outputs: { internalType: string; name: string; type: string }[]; stateMutability: string; type: string })[]
ABI_BINANCE_PARTERS: ({ anonymous: boolean; inputs: { indexed: boolean; internalType: string; name: string; type: string }[]; name: string; outputs: undefined; stateMutability: undefined; type: string } | { anonymous: undefined; inputs: { internalType: string; name: string; type: string }[]; name: string; outputs: { internalType: string; name: string; type: string }[]; stateMutability: string; type: string } | { anonymous: undefined; inputs: undefined; name: undefined; outputs: undefined; stateMutability: string; type: string })[]
ABI_BINANCE_POOL: ({ anonymous: undefined; inputs: never[]; name: undefined; outputs: undefined; stateMutability: string; type: string } | { anonymous: undefined; inputs: { internalType: string; name: string; type: string }[]; name: string; outputs: undefined; stateMutability: undefined; type: string } | { anonymous: boolean; inputs: { indexed: boolean; internalType: string; name: string; type: string }[]; name: string; outputs: undefined; stateMutability: undefined; type: string } | { anonymous: undefined; inputs: { internalType: string; name: string; type: string }[]; name: string; outputs: { internalType: string; name: string; type: string }[]; stateMutability: string; type: string } | { anonymous: undefined; inputs: undefined; name: undefined; outputs: undefined; stateMutability: string; type: string })[]
ABI_BINANCE_POOL_OLD: ({ anonymous: boolean; inputs: { indexed: boolean; internalType: string; name: string; type: string }[]; name: string; outputs: undefined; stateMutability: undefined; type: string } | { anonymous: undefined; inputs: { internalType: string; name: string; type: string }[]; name: string; outputs: { internalType: string; name: string; type: string }[]; stateMutability: string; type: string } | { anonymous: undefined; inputs: undefined; name: undefined; outputs: undefined; stateMutability: string; type: string })[]
ABI_ERC20: ({ anonymous: undefined; constant: boolean; inputs: { name: string; type: string }[]; name: string; outputs: { name: string; type: string }[]; payable: boolean; stateMutability: string; type: string } | { anonymous: undefined; constant: undefined; inputs: undefined; name: undefined; outputs: undefined; payable: boolean; stateMutability: string; type: string } | { anonymous: boolean; constant: undefined; inputs: { indexed: boolean; name: string; type: string }[]; name: string; outputs: undefined; payable: undefined; stateMutability: undefined; type: string })[]
AETHB_ABI: ({ anonymous: boolean; inputs: { indexed: boolean; internalType: string; name: string; type: string }[]; name: string; outputs: undefined; stateMutability: undefined; type: string } | { anonymous: undefined; inputs: { internalType: string; name: string; type: string }[]; name: string; outputs: { internalType: string; name: string; type: string }[]; stateMutability: string; type: string })[]
AETH_BSC_ABI: ({ anonymous: boolean; inputs: { indexed: boolean; internalType: string; name: string; type: string }[]; name: string; outputs: undefined; stateMutability: undefined; type: string } | { anonymous: undefined; inputs: { internalType: string; name: string; type: string }[]; name: string; outputs: { internalType: string; name: string; type: string }[]; stateMutability: string; type: string })[]
AFTMB_ABI: ({ anonymous: boolean; inputs: { indexed: boolean; internalType: string; name: string; type: string }[]; name: string; outputs: undefined; stateMutability: undefined; type: string } | { anonymous: undefined; inputs: { internalType: string; name: string; type: string }[]; name: string; outputs: { internalType: string; name: string; type: string }[]; stateMutability: string; type: string })[]
AMATICB_ABI: ({ anonymous: boolean; inputs: { indexed: boolean; internalType: string; name: string; type: string }[]; name: string; outputs: undefined; stateMutability: undefined; type: string } | { anonymous: undefined; inputs: { internalType: string; name: string; type: string }[]; name: string; outputs: { internalType: string; name: string; type: string }[]; stateMutability: string; type: string })[]
ANKRAVAX_ABI: ({ anonymous: boolean; inputs: { indexed: boolean; internalType: string; name: string; type: string }[]; name: string; outputs: undefined; stateMutability: undefined; type: string } | { anonymous: undefined; inputs: { internalType: string; name: string; type: string }[]; name: string; outputs: { internalType: string; name: string; type: string }[]; stateMutability: string; type: string })[]
ANKRETH_ABI: ({ anonymous: boolean; inputs: { indexed: boolean; internalType: string; name: string; type: string }[]; name: string; outputs: undefined; stateMutability: undefined; type: string } | { anonymous: undefined; inputs: { internalType: string; name: string; type: string }[]; name: string; outputs: { internalType: string; name: string; type: string }[]; stateMutability: string; type: string })[]
ANKRETH_BSC_ABI: ({ anonymous: boolean; inputs: { indexed: boolean; internalType: string; name: string; type: string }[]; name: string; outputs: undefined; stateMutability: undefined; type: string } | { anonymous: undefined; inputs: { internalType: string; name: string; type: string }[]; name: string; outputs: { internalType: string; name: string; type: string }[]; stateMutability: string; type: string })[]
ANKRFTM_ABI: ({ anonymous: boolean; inputs: { indexed: boolean; internalType: string; name: string; type: string }[]; name: string; outputs: undefined; stateMutability: undefined; type: string } | { anonymous: undefined; inputs: { internalType: string; name: string; type: string }[]; name: string; outputs: { internalType: string; name: string; type: string }[]; stateMutability: string; type: string })[]
ANKRMATIC_ABI: ({ anonymous: boolean; inputs: { indexed: boolean; internalType: string; name: string; type: string }[]; name: string; outputs: undefined; stateMutability: undefined; type: string } | { anonymous: undefined; inputs: { internalType: string; name: string; type: string }[]; name: string; outputs: { internalType: string; name: string; type: string }[]; stateMutability: string; type: string })[]
ANKR_ABI: ({ anonymous: boolean; constant: undefined; inputs: { indexed: boolean; internalType: string; name: string; type: string }[]; name: string; outputs: undefined; stateMutability: undefined; type: string } | { anonymous: undefined; constant: boolean; inputs: { internalType: string; name: string; type: string }[]; name: string; outputs: { internalType: string; name: string; type: string }[]; stateMutability: string; type: string } | { anonymous: undefined; constant: undefined; inputs: { internalType: string; name: string; type: string }[]; name: string; outputs: { internalType: string; name: string; type: string }[]; stateMutability: string; type: string })[]
AVALANCHE_POOL_ABI: ({ anonymous: boolean; inputs: { indexed: boolean; internalType: string; name: string; type: string }[]; name: string; outputs: undefined; stateMutability: undefined; type: string } | { anonymous: undefined; inputs: { internalType: string; name: string; type: string }[]; name: string; outputs: { internalType: string; name: string; type: string }[]; stateMutability: string; type: string })[]
ETHEREUM_POOL_ABI: ({ anonymous: boolean; inputs: { indexed: boolean; internalType: string; name: string; type: string }[]; name: string; outputs: undefined; stateMutability: undefined; type: string } | { anonymous: undefined; inputs: { internalType: string; name: string; type: string }[]; name: string; outputs: { internalType: string; name: string; type: string }[]; stateMutability: string; type: string } | { anonymous: undefined; inputs: undefined; name: undefined; outputs: undefined; stateMutability: string; type: string })[]
ETHEREUM_POOL_CONFIG_ABI: ({ anonymous: boolean; inputs: { indexed: boolean; internalType: string; name: string; type: string }[]; name: string; outputs: undefined; stateMutability: undefined; type: string } | { anonymous: undefined; inputs: { internalType: string; name: string; type: string }[]; name: string; outputs: { internalType: string; name: string; type: string }[]; stateMutability: string; type: string })[]
ETHEREUM_SWAP_POOL_ABI: ({ anonymous: boolean; inputs: { indexed: boolean; internalType: string; name: string; type: string }[]; name: string; outputs: undefined; stateMutability: undefined; type: string } | { anonymous: undefined; inputs: { internalType: string; name: string; type: string }[]; name: string; outputs: { internalType: string; name: string; type: string }[]; stateMutability: string; type: string } | { anonymous: undefined; inputs: { internalType: string; name: string; type: string }[]; name: string; outputs: { components: { internalType: string; name: string; type: string }[]; internalType: string; name: string; type: string }[]; stateMutability: string; type: string } | { anonymous: undefined; inputs: undefined; name: undefined; outputs: undefined; stateMutability: string; type: string })[]
FANTOM_POOL_ABI: ({ anonymous: boolean; inputs: { indexed: boolean; internalType: string; name: string; type: string }[]; name: string; outputs: undefined; stateMutability: undefined; type: string } | { anonymous: undefined; inputs: { internalType: string; name: string; type: string }[]; name: string; outputs: { internalType: string; name: string; type: string }[]; stateMutability: string; type: string } | { anonymous: undefined; inputs: undefined; name: undefined; outputs: undefined; stateMutability: string; type: string })[]
POLYGON_POOL_ABI: ({ anonymous: boolean; inputs: { indexed: boolean; internalType: string; name: string; type: string }[]; name: string; outputs: undefined; stateMutability: undefined; type: string } | { anonymous: undefined; inputs: { internalType: string; name: string; type: string }[]; name: string; outputs: { internalType: string; name: string; type: string }[]; stateMutability: string; type: string })[]

Variables

ALLOWANCE_RATE: 5 = 5

Multiplication factor for fee when approving funds

AVAILABLE_BNB_SYNT_TOKENS: readonly ["aBNBb", "ankrBNB", "aETH", "ankrETH"] = ...

List of supported tokens for BinanceSDK

AVAX_DECIMALS: 18 = 18

AVAX token decimals

AVAX_ESTIMATE_GAS_MULTIPLIER: 1.6 = 1.6

Even with this multiplier, the gas estimate is two times less than if we did not manage this value.

note

Magic number, 60%

AVAX_HISTORY_2_WEEKS_OFFSET: number = ...

Events block range for stake/unstake history

note

404_000 blocks = ~14 days

AVAX_MAX_BLOCK_RANGE: 3000 = 3_000

Max block range per request

AVAX_POOL_START_BLOCK_MAINNET: 1696977 = 1696977

Avalanche pool start block. Block number when the pool was deployed on mainnet.

AVAX_POOL_START_BLOCK_TESTNET: 178962 = 178962

Avalanche pool start block. Block number when the pool was deployed on testnet.

AVAX_SCALE_FACTOR: 1000000000000000000 = 1e18

Scale factor fo AVAX token

BINANCE_HISTORY_2_WEEKS_BLOCK_OFFSET: number = ...

Block offset to get 14 days history events

BINANCE_PARTNERS_CONTRACT_START_BLOCK_MAINNET: 20956307 = 20_956_307

Start block to check events for BinancePartners on mainnet

BINANCE_PARTNERS_CONTRACT_START_BLOCK_TESTNET: 22056801 = 22_056_801

Start block to check events for BinancePartners on testnet

BINANCE_POOL_CONTRACT_START_BLOCK_MAINNET: 28123526 = 28_123_526

Start block to check events for BinancePool on mainnet.

BINANCE_POOL_CONTRACT_START_BLOCK_TESTNET: 28704783 = 28_704_783

Start block to check events for BinancePool on testnet.

BINANCE_POOL_OLD_CONTRACT_START_BLOCK_MAINNET: 15336167 = 15_336_167

Start block to check events for BinancePool on mainnet. (old contract)

BINANCE_POOL_OLD_CONTRACT_START_BLOCK_TESTNET: 16716904 = 16_716_904

Start block to check events for BinancePool on testnet. (old contract)

BINANCE_WRITE_PROVIDER_ID: ethCompatible = AvailableWriteProviders.ethCompatible

Internal write provider id

BNB_ESTIMATE_GAS_MULTIPLIER: 1.4 = 1.4

Magic number to prevent metamask fee calculation issue

BNB_GAS_FEE_SAFE_LIMIT: 0.008 = 0.008

Magic number for preventing gas fee calculation issue in the MetaMask with a maximum amount

BNB_MAX_BLOCK_RANGE_MAINNET: 2500 = 2_500

Events block range for stake/unstake history on mainnet

note

~2.5h = 2_500 blocks

BNB_MAX_BLOCK_RANGE_TESTNET: 3000 = 3_000

Events block range for stake/unstake history on testnet

note

~3h = 3_000 blocks

BNB_STAKING_MAX_DECIMALS_LEN: 8 = 8

Maximum decimals length for the BNB Staking

CERT_STAKING_LOG_HASH: "0x0f0bc5b519ddefdd8e5f9e6423433aa2b869738de2ae34d58ebc796fc749fa0d" = '0x0f0bc5b519ddefdd8e5f9e6423433aa2b869738de2ae34d58ebc796fc749fa0d'

Staking topic hash. Used for fetching transaction amount from receipt.

DEFAULT_NETWORK_MODE: Develop = ENetworkMode.Develop
ETH_BLOCK_2_WEEKS_OFFSET_MAINNET: 100800 = 100_800

Block offset to get 14 days history events on mainnet

ETH_BLOCK_2_WEEKS_OFFSET_TESTNET: 80640 = 80_640

Block offset to get 14 days history events on testnet

ETH_DECIMALS: 18 = 18
ETH_GAS_LIMIT_MULTIPLIER: 1.5 = 1.5

Magic number to prevent metamask fee calculation issue

ETH_HISTORY_RANGE_STEP: 3000 = 3_000

Block step range for events

ETH_POOL_START_BLOCK_MAINNET: 11225126 = 11_225_126

Start block to check events for Ethereum pool on mainnet

ETH_POOL_START_BLOCK_TESTNET: 1173780 = 1_173_780

Start block to check events for Ethereum pool on testnet

ETH_SCALE_FACTOR: number = ...
ETH_STAKE_GAS_FEE_MULTIPLIER: 2.15 = 2.15

Magic number for preventing gas fee calculation issue in the MetaMask with a maximum amount

FANTOM_BLOCK_WEEK_OFFSET_MAINNET: 604800 = 604_800

Block offset to get history events for 7 days on mainnet

FANTOM_BLOCK_WEEK_OFFSET_TESTNET: 120960 = 120_960

Block offset to get history events for 7 days on testnet

FANTOM_ESTIMATE_GAS_MULTIPLIER: 1.6 = 1.6

Gas limit increase by 60%

FANTOM_GAS_FEE_MULTIPLIER: 3.5 = 3.5

Magic number to avoid problems with max amount and fee calculation in the wallet

FANTOM_MAX_BLOCK_RANGE_MAINNET: 2000 = 2_000

Max block range per request on mainnet

FANTOM_MAX_BLOCK_RANGE_TESTNET: 3000 = 3_000

Max block range per request on testnet

FANTOM_POOL_START_BLOCK_MAINNET: 31218797 = 31_218_797

Start block to check events for Ethereum pool on mainnet

FANTOM_POOL_START_BLOCK_TESTNET: 7729481 = 7_729_481

Start block to check events for Ethereum pool on testnet

GAS_FEE_MULTIPLIER: 3 = 3

Magic number to avoid problems with max amount and fee calculation in the wallet

MATIC_DECIMALS: 18 = 18

Decimals length for MATIC

MATIC_ETH_BLOCK_2_WEEKS_OFFSET_MAINNET: 100800 = 100_800

Block offset to get 14 days history events on mainnet

MATIC_ETH_BLOCK_2_WEEKS_OFFSET_TESTNET: 80640 = 80_640

Block offset to get 14 days history events on testnet

MATIC_ON_POLYGON_ESTIMATE_GAS_MULTIPLIER: 1.6 = 1.6

Magic number for preventing fee calculation issue in MetaMask

MATIC_ON_POLYGON_GAS_FEE_MULTIPLIER: 2 = 2

Magic number to avoid issues with max amount and fee calculation in the wallet

MATIC_SCALE_FACTOR: number = ...

Internal scale factor for MATIC on Polygon network

MAX_BLOCK_RANGE_MAINNET: 2000 = 2_000

Events block range for stake/unstake history on mainnet

MAX_BLOCK_RANGE_TESTNET: 3000 = 3_000

Events block range for stake/unstake history on testnet

MAX_UINT256: BigNumber = ...
MAX_UINT256_SCALE: 1 = 1
METHOD_NAME_BY_SYMBOL: Record<TEthToken, { claim: string; claimable: string; stake: string; unstake: string }> = ...

Methods by token symbol

MIN_UNSTAKE_AMOUNT_IN_CONFIG: "UNSTAKE_MIN_AMOUNT" = 'UNSTAKE_MIN_AMOUNT'

Parameter name in the pool config contract to get minimum unstake amount.

ONE_ETH: BigNumber = ...
OSynthEthTokens: { aETHb: "aETHb"; ankrETH: "ankrETH" } = ...

Available tokens for EthereumSDK

Type declaration

  • aETHb: "aETHb"
  • ankrETH: "ankrETH"
PAD_RIGHT_CHARACTER_AMOUNT: 64 = 64

Is used to pad right the parameter name to 64 characters.

POLYGON_PROVIDER_ID: ethCompatible = AvailableWriteProviders.ethCompatible

Internal write provider id

POOL_CONTRACT_START_BLOCK_MAINNET: 13396826 = 13_396_826

Start block to check events for PolygonPool on mainnet

POOL_CONTRACT_START_BLOCK_TESTNET: 6735811 = 6_735_811

Start block to check events for PolygonPool on testnet

TOPIC_WITH_TOKEN_TYPE_INFO: "0x19e86fee7352f6a0c9bf1635ff7e554c083f9af69dff8d69c054f2ac5dba1a9c" = '0x19e86fee7352f6a0c9bf1635ff7e554c083f9af69dff8d69c054f2ac5dba1a9c'

Staking topic hash. Used for fetching transaction amount from receipt.

UNSTAKE_PAUSED_PARAM_NAME: "unstake" = 'unstake'

Parameter name that is used to obtain the paused status of unstaking.

ZERO: BigNumber = ...
ZERO_ADDRESS: "0x0000000000000000000000000000000000000000" = '0x0000000000000000000000000000000000000000'
ZERO_EVENT_HASH: "0x0000000000000000000000000000000000000000000000000000000000000000" = '0x0000000000000000000000000000000000000000000000000000000000000000'

Functions

  • getFilteredContractEvents(events: EventData[]): IFilteredEvents
  • getIsHttpProvider(provider: unknown): provider is HttpProvider
  • sleep(ms: number): Promise<void>

Generated using TypeDoc