UNPKG

@dojima-wallet/connection

Version:

Initialise and connection for layer 1&2 blockchain

60 lines (59 loc) 2.34 kB
import { Tx } from "../client"; import { BigNumberish } from "ethers"; import { GasOracleResponse, TokenBalanceParam, TransactionHistoryParam } from "./types"; /** * SafeGasPrice, ProposeGasPrice And FastGasPrice returned in string-Gwei * * @see https://etherscan.io/apis#gastracker * * @param {string} baseUrl The etherscan node url. * @param {string} apiKey The etherscan API key. (optional) * @returns {GasOracleResponse} LastBlock, SafeGasPrice, ProposeGasPrice, FastGasPrice */ export declare const getGasOracle: (baseUrl: string, apiKey?: string) => Promise<GasOracleResponse>; export declare const getGoerliGasOracle: (baseUrl: string, apiKey?: string) => Promise<string>; /** * Get token balance * * @see https://etherscan.io/apis#tokens * * @param {string} baseUrl The etherscan node url. * @param {string} address The address. * @param {string} assetAddress The token contract address. * @param {string} apiKey The etherscan API key. (optional) * @returns {BigNumberish} The token balance */ export declare const getTokenBalance: ({ baseUrl, address, assetAddress, apiKey, }: TokenBalanceParam & { baseUrl: string; apiKey?: string; }) => Promise<BigNumberish>; /** * Get ETH transaction history * * @see https://etherscan.io/apis#accounts * * @param {string} baseUrl The etherscan node url. * @param {string} address The address. * @param {TransactionHistoryParam} params The search options. * @param {string} apiKey The etherscan API key. (optional) * @returns {ETHTransactionInfo[]} The ETH transaction history */ export declare const getETHTransactionHistory: ({ baseUrl, address, page, offset, startblock, endblock, apiKey, }: TransactionHistoryParam & { baseUrl: string; apiKey?: string; }) => Promise<Tx[]>; /** * Get token transaction history * * @see https://etherscan.io/apis#accounts * * @param {string} baseUrl The etherscan node url. * @param {string} address The address. * @param {TransactionHistoryParam} params The search options. * @param {string} apiKey The etherscan API key. (optional) * @returns {Tx[]} The token transaction history */ export declare const getTokenTransactionHistory: ({ baseUrl, address, assetAddress, page, offset, startblock, endblock, apiKey, }: TransactionHistoryParam & { baseUrl: string; apiKey?: string; }) => Promise<Tx[]>;