@dojima-wallet/connection
Version:
Initialise and connection for layer 1&2 blockchain
28 lines (27 loc) • 1.43 kB
TypeScript
import { ChainClientParams, Network } from "../client";
import * as ethers from "ethers";
import Web3 from "web3";
import { EvmChainConfigParams, EvmChainParams, EvmTransferParams, EvmTxData } from "./types";
import { SwapAssetList } from "@dojima-wallet/utils";
declare class EvmChainClient {
protected network: Network;
protected web3: Web3;
protected rpcUrl: string;
protected config: EvmChainConfigParams;
protected provider: ethers.ethers.providers.JsonRpcProvider;
protected account: ethers.ethers.Wallet;
private phrase;
private privateKey;
constructor({ phrase, privateKey, network, config, }: ChainClientParams & EvmChainParams);
getAddress(): string;
getBalance(address: string): Promise<number>;
estimateGasLimit(tx: ethers.providers.TransactionRequest): Promise<ethers.BigNumber>;
getCurrentGasPrice(): Promise<ethers.BigNumber>;
calculateGasFee(recipient: string, amount: number, memo?: string): Promise<string>;
transfer(params: EvmTransferParams): Promise<string>;
dummyTx(recipient: string, amount: number): Promise<string>;
getTransactionData(hash: string): Promise<EvmTxData>;
addLiquidityPool(amount: number, asset: string, inboundAddress: string, hermesAddress?: string): Promise<string>;
swap(amount: number, token: SwapAssetList | string, inboundAddress: string, recipient: string): Promise<string>;
}
export { EvmChainClient };