Nail Polishing Minions

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

    1.6.0 • Public • Published

    Constants

    Constants for Lido Finance projects. Part of Lido JS SDK

    Install

    yarn add @lido-sdk/constants

    Chains

    Source

    Chains enum

    import { CHAINS } from '@lido-sdk/constants';
    
    console.log(CHAINS.Mainnet, CHAINS.Goerli); // 1, 5

    Array of chains ids

    import { CHAINS_IDS } from '@lido-sdk/constants';
    
    console.log(CHAINS_IDS); // [1, 3, 4, 5, 42]

    getChainColor

    Color getter by chain id

    import { CHAINS, getChainColor } from '@lido-sdk/constants';
    
    const goerliChainColor = getChainColor(CHAINS.Goerli);
    console.log(goerliChainColor); // #3099f2

    Tokens

    Source

    Lido tokens enum

    import { TOKENS } from '@lido-sdk/constants';
    
    console.log(TOKENS.WSTETH); // WSTETH
    console.log(TOKENS.STETH); // STETH
    console.log(TOKENS.LDO); // LDO

    getTokenAddress

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

    import { CHAINS, TOKENS, getTokenAddress } from '@lido-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 '@lido-sdk/constants';
    
    const aggregatorAddress = getAggregatorAddress(CHAINS.Mainnet);
    console.log(aggregatorAddress); // 0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419

    Install

    npm i @lido-sdk/constants

    DownloadsWeekly Downloads

    107

    Version

    1.6.0

    License

    MIT

    Unpacked Size

    14.2 kB

    Total Files

    19

    Last publish

    Collaborators

    • zmoki
    • skozin
    • kolyasapphire
    • azat-s
    • george-avs