debeem-wallet

Constructors

Methods

  • query the balance of native currency on chain

    Parameters

    • address: string

      wallet address

    Returns Promise<bigint>

    balance in wei, 18 decimal places

  • Get the price of the specified pair in real-time

    //
    // query the price of BTC/USD in real-time
    //
    const priceObj : ChainLinkPriceResult | null = await new WalletAccount().queryPairPrice( `BTC/USD` );

    // should return:
    {
    chainLink: {
    roundId: 110680464442257326336n,
    answer: 7087192046296n,
    startedAt: 1717653347n,
    updatedAt: 1717653347n,
    answeredInRound: 110680464442257326336n,
    address: '0xF4030086522a5bEEa4988F8cA5B36dbC97BeE88c',
    decimals: 8
    },
    price: 7087192046296n,
    floatPrice: 70871.92
    }

    Parameters

    • pair: string

      {string} - e.g.: BTC/USD, see: EthereumPriceFeedAddresses.ts

    Returns Promise<null | ChainLinkPriceResult>

  • Get the current price of any cryptocurrencies in any other supported currencies that you need.

    Parameters

    • ids: string

      {string} id of coins, comma-separated if querying more than 1 coin. see: src/resources/coinGeckoCoinList.json

    • vsCurrencies: string

      {string} vs_currency of coins, comma-separated if querying more than 1 vs_currency. see: src/resources/coinGeckoSupportedVsCurrencies.json

    Returns Promise<any>

  • Get current price of tokens (using contract addresses) for a given platform in any other currency that you need.

    Parameters

    • platformId: string

      {string} The id of the platform issuing tokens. see: src/resources/coinGeckoAssetPlatforms.json

    • contractAddresses: string

      {string} The contract address of tokens, comma separated see: src/resources/ethereumTokens.json.ts

    • vsCurrencies: string

      {string} vs_currency of coins, comma-separated if querying more than 1 vs_currency see: src/resources/coinGeckoSupportedVsCurrencies.json

    Returns Promise<any>