UNPKG

@bozhkovatanas/wallet-mock

Version:

Mock Web3 Browser wallets, like Metamask, in Playwright tests.

26 lines (25 loc) 1.04 kB
import { Transport, LocalAccount } from "viem"; export type Wallet = ReturnType<typeof createWallet>; export declare function createWallet(account: LocalAccount, transports: Map<number, Transport>): { request: ({ method, params, }: { method: string; params?: Array<unknown>; }) => Promise<string | boolean | void | `0x${string}`[] | import("viem").NetworkSync | import("viem").WalletGetCallsStatusReturnType<`0x${string}`, `0x${string}`> | { [x: `0x${string}`]: import("viem").WalletCapabilities; } | import("viem").WalletPermission[] | { expiry: number; factory?: `0x${string}` | undefined; factoryData?: string | undefined; grantedPermissions: readonly { type: string; data: any; }[]; permissionsContext: string; signerData?: { userOpBuilder?: `0x${string}` | undefined; submitToAddress?: `0x${string}` | undefined; } | undefined; } | { parentCapability: string; }[] | null>; };