@knine-sdk/constants
TypeScript icon, indicating that this package has built-in type declarations

1.21.1 • Public • Published

Constants

Constants for K9 Finance projects.

Install

yarn add @knine-sdk/constants

Chains

Source

Chains enum

import { CHAINS } from '@knine-sdk/constants';

console.log(CHAINS.Mainnet, CHAINS.Sepolia); // 1, 17000

Array of chains ids

import { CHAINS_IDS } from '@knine-sdk/constants';

console.log(CHAINS_IDS); // [1, 3, 4, 5, 42]

getChainColor

Color getter by chain id

import { CHAINS, getChainColor } from '@knine-sdk/constants';

const goerliChainColor = getChainColor(CHAINS.Goerli);
console.log(goerliChainColor); // #3099f2

Tokens

Source

Tokens enum

import { TOKENS } from '@knine-sdk/constants';

console.log(TOKENS.BONE); // STETH
console.log(TOKENS.KNBONE); // LDO

getTokenAddress

Getter for Knine token addresses. Returns a contract address or throws an error if the contract is not deployed in the chain.

import { CHAINS, TOKENS, getTokenAddress } from '@knine-sdk/constants';

const stethAddress = getTokenAddress(CHAINS.Mainnet, TOKENS.STETH);
console.log(stethAddress); // 0xae7ab96520de3a18e5e111b5eaab095312d7fe84

Aggregator

Source

EACAggregatorProxy https://etherscan.io/address/0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419
It’s used to get the ETH price

getAggregatorAddress

import { CHAINS, getAggregatorAddress } from '@knine-sdk/constants';

const aggregatorAddress = getAggregatorAddress(CHAINS.Mainnet);
console.log(aggregatorAddress); // 0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419

WithdrawalQueue

WithdrawalQueue contract for KNINE protocol

getWithdrawalQueueAddress

import { CHAINS, getWithdrawalQueueAddress } from '@knine-sdk/constants';

const withdrawalQueueAddress = getWithdrawalQueueAddress(CHAINS.Mainnet);
console.log(withdrawalQueueAddress); // 0x889edC2eDab5f40e902b864aD4d7AdE8E412F9B1

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.21.16latest

Version History

VersionDownloads (Last 7 Days)Published
1.21.16
1.21.00
1.20.00
1.19.00
1.18.00
1.17.00
1.16.00
1.15.00
1.14.00
1.13.10
1.13.00
1.12.10
1.12.00
1.11.00
1.10.00
1.9.00
1.8.00
1.7.00
1.6.00
1.5.00
1.4.00
1.3.00
1.2.20
1.2.10
1.2.00
1.1.10
1.1.04
1.0.20
1.0.10
1.0.00

Package Sidebar

Install

npm i @knine-sdk/constants

Weekly Downloads

10

Version

1.21.1

License

MIT

Unpacked Size

56.5 kB

Total Files

67

Last publish

Collaborators

  • ekalinins
  • kiryaft90
  • rocknblock