UNPKG

@coinbase/onchaintestkit

Version:

End-to-end testing toolkit for blockchain applications, powered by Playwright

34 lines (33 loc) 1.09 kB
import type { CoinbaseWallet } from "./Coinbase"; import type { MetaMask } from "./MetaMask"; import type { PhantomWallet } from "./Phantom"; export type NetworkConfig = { name: string; chainId: number; rpcUrl: string; symbol: string; blockExplorerUrl?: string; }; export type BaseWalletConfig = { network?: NetworkConfig; walletSetup: (wallet: MetaMask | CoinbaseWallet | PhantomWallet) => Promise<void>; }; export type MetaMaskConfig = { password: string; walletSetup: (wallet: MetaMask, context: { localNodePort: number; }) => Promise<void>; } & BaseWalletConfig; export type CoinbaseConfig = { password: string; walletSetup: (wallet: CoinbaseWallet, context: { localNodePort: number; }) => Promise<void>; } & BaseWalletConfig; export type PhantomConfig = { password: string; walletSetup: (wallet: PhantomWallet, context: { localNodePort: number; }) => Promise<void>; } & BaseWalletConfig; export type WalletSetupFn<T extends MetaMask | CoinbaseWallet | PhantomWallet> = (wallet: T) => Promise<void>;