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

    1.4.2 • Public • Published

    Facade

    Contract queries and query builder for Lido Terra Finance projects. Part of Lido JS SDK

    Install

    yarn add @lido-terra-sdk/facade

    Address provider

    import { CHAIN, NETWORK, NETWORK_URL } from '@lido-terra-sdk/constants';
    import { LCDClient } from '@terra-money/terra.js';
    import { LidoTerraAddressProvider } from '@lido-terra-sdk/facade';
    const lcd = new LCDClient({
      URL: NETWORK_URL[NETWORK.TESTNET],
      chainID: CHAIN[NETWORK.TESTNET].BOMBAY12,
    });
    
    const addressProvider = new LidoTerraAddressProvider(NETWORK.TESTNET, lcd);
    const { hub, airdropRegistryContract } = await addressProvider.getAddresses();

    Contract queries

    Source

    Hub

    import { CHAIN, NETWORK, NETWORK_URL } from '@lido-terra-sdk/constants';
    import { LCDClient } from '@terra-money/terra.js';
    import { LidoTerraAddressProvider } from '@lido-terra-sdk/facade';
    
    const lcd = new LCDClient({
      URL: NETWORK_URL[NETWORK.TESTNET],
      chainID: CHAIN[NETWORK.TESTNET].BOMBAY12,
    });
    const addressProvider = new LidoTerraAddressProvider(NETWORK.TESTNET, lcd);
    const contract = new LidoTerraHub(NETWORK.TESTNET, lcd, addressProvider);
    const config = await contract.getConfig();

    bLuna token

    import { CHAIN, NETWORK, NETWORK_URL } from '@lido-terra-sdk/constants';
    import { LCDClient } from '@terra-money/terra.js';
    import {
      LidoTerraAddressProvider,
      LidoTerraBLunaToken,
    } from '@lido-terra-sdk/facade';
    
    const lcd = new LCDClient({
      URL: NETWORK_URL[NETWORK.TESTNET],
      chainID: CHAIN[NETWORK.TESTNET].BOMBAY12,
    });
    const addressProvider = new LidoTerraAddressProvider(NETWORK.TESTNET, lcd);
    const contract = new LidoTerraBLunaToken(NETWORK.TESTNET, lcd, addressProvider);
    const config = await contract.getConfig();

    stLuna token

    import { CHAIN, NETWORK, NETWORK_URL } from '@lido-terra-sdk/constants';
    import { LCDClient } from '@terra-money/terra.js';
    import {
      LidoTerraAddressProvider,
      LidoTerraStLunaToken,
    } from '@lido-terra-sdk/facade';
    
    const lcd = new LCDClient({
      URL: NETWORK_URL[NETWORK.TESTNET],
      chainID: CHAIN[NETWORK.TESTNET].BOMBAY12,
    });
    const addressProvider = new LidoTerraAddressProvider(NETWORK.TESTNET, lcd);
    const contract = new LidoTerraStLunaToken(
      NETWORK.TESTNET,
      lcd,
      addressProvider,
    );
    const config = await contract.getConfig();

    Validators registry

    import { CHAIN, NETWORK, NETWORK_URL } from '@lido-terra-sdk/constants';
    import { LCDClient } from '@terra-money/terra.js';
    import {
      LidoTerraAddressProvider,
      LidoTerraValidatorsRegistry,
    } from '@lido-terra-sdk/facade';
    
    const lcd = new LCDClient({
      URL: NETWORK_URL[NETWORK.TESTNET],
      chainID: CHAIN[NETWORK.TESTNET].BOMBAY12,
    });
    const addressProvider = new LidoTerraAddressProvider(NETWORK.TESTNET, lcd);
    const contract = new LidoTerraValidatorsRegistry(
      NETWORK.TESTNET,
      lcd,
      addressProvider,
    );
    const config = await contract.getConfig();

    Rewards contract

    import { CHAIN, NETWORK, NETWORK_URL } from '@lido-terra-sdk/constants';
    import { LCDClient } from '@terra-money/terra.js';
    import {
      LidoTerraAddressProvider,
      LidoTerraRewards,
    } from '@lido-terra-sdk/facade';
    
    const lcd = new LCDClient({
      URL: NETWORK_URL[NETWORK.TESTNET],
      chainID: CHAIN[NETWORK.TESTNET].BOMBAY12,
    });
    const addressProvider = new LidoTerraAddressProvider(NETWORK.TESTNET, lcd);
    const contract = new LidoTerraRewards(NETWORK.TESTNET, lcd, addressProvider);
    const config = await contract.getConfig();

    Airdrop registry

    import { CHAIN, NETWORK, NETWORK_URL } from '@lido-terra-sdk/constants';
    import { LCDClient } from '@terra-money/terra.js';
    import {
      LidoTerraAirdropRegistry,
      LidoTerraRewards,
    } from '@lido-terra-sdk/facade';
    
    const lcd = new LCDClient({
      URL: NETWORK_URL[NETWORK.TESTNET],
      chainID: CHAIN[NETWORK.TESTNET].BOMBAY12,
    });
    const addressProvider = new LidoTerraAirdropRegistry(NETWORK.TESTNET, lcd);
    const contract = new LidoTerraRewards(NETWORK.TESTNET, lcd, addressProvider);
    const config = await contract.getConfig();

    Keywords

    none

    Install

    npm i @lido-terra-sdk/facade

    DownloadsWeekly Downloads

    1

    Version

    1.4.2

    License

    MIT

    Unpacked Size

    188 kB

    Total Files

    78

    Last publish

    Collaborators

    • azat-s
    • george-avs
    • ratik