@dojima-wallet/connection
Version:
Initialise and connection for layer 1&2 blockchain
57 lines (56 loc) • 1.63 kB
TypeScript
import { FeeOption, Fees, Network } from "../../client";
import { Address, BaseAmount } from "@dojima-wallet/utils";
import { BigNumber, Signer, ethers } from "ethers";
export declare enum EthNetwork {
Test = "goerli",
Main = "homestead"
}
export type ClientUrl = Record<Network, string>;
export type ExplorerUrl = Record<Network, string>;
export type TxOverrides = {
nonce?: ethers.BigNumberish;
gasLimit: ethers.BigNumberish;
gasPrice?: ethers.BigNumberish;
data?: ethers.BytesLike;
value?: ethers.BigNumberish;
};
export type InfuraCreds = {
projectId: string;
projectSecret?: string;
};
export type GasPrices = Record<FeeOption, BaseAmount>;
export type FeesWithGasPricesAndLimits = {
fees: Fees;
gasPrices: GasPrices;
gasLimit: BigNumber;
};
export type ApproveParams = {
walletIndex?: number;
signer?: Signer;
contractAddress: Address;
spenderAddress: Address;
feeOption?: FeeOption;
amount?: BaseAmount;
gasLimitFallback?: ethers.BigNumberish;
};
export type EstimateApproveParams = {
contractAddress: Address;
spenderAddress: Address;
fromAddress: Address;
amount?: BaseAmount;
};
export type IsApprovedParams = {
walletIndex?: number;
contractAddress: Address;
spenderAddress: Address;
amount?: BaseAmount;
};
export type CallParams = {
signer?: Signer;
walletIndex?: number;
contractAddress: Address;
abi: ethers.ContractInterface;
funcName: string;
funcParams?: unknown[];
};
export type EstimateCallParams = Pick<CallParams, "contractAddress" | "abi" | "funcName" | "funcParams">;