UNPKG

@xchainjs/xchain-evm

Version:
33 lines (32 loc) 1.14 kB
import { Provider } from 'ethers'; import { ISigner, SignApproveParams, SignTransferParams } from '../types'; /** * Signer parameters */ export type SignerParams = { provider: Provider; derivationPath: string; }; /** * Abstraction of EVM Account */ export declare abstract class Signer implements ISigner { protected provider: Provider; protected derivationPath: string; constructor({ provider, derivationPath }: SignerParams); /** * Get the full derivation path based on the wallet index. * @param {number} walletIndex The HD wallet index * @returns {string} The full derivation path */ getFullDerivationPath(walletIndex: number): string; /** * Get the provider the signer is using to be connected with the blockchain. * @returns {Provider} The provider the signer is using */ protected getProvider(): Provider; abstract purge(): void; abstract signTransfer(params: SignTransferParams): Promise<string>; abstract signApprove(params: SignApproveParams): Promise<string>; abstract getAddressAsync(walletIndex?: number | undefined): Promise<string>; }