UNPKG

@metamask/snaps-simulation

Version:

A simulation framework for MetaMask Snaps, enabling headless testing of Snaps in a controlled environment

135 lines 7.23 kB
import type { Infer } from "@metamask/superstruct"; declare const SimulationAccountStruct: import("@metamask/superstruct").Struct<{ address: string; id: string; scopes: `${string}:${string}`[]; selected?: boolean | undefined; owned?: boolean | undefined; assets?: `${string}:${string}/${string}:${string}`[] | undefined; }, { address: import("@metamask/superstruct").Struct<string, null>; id: import("@metamask/superstruct").Struct<string, null>; scopes: import("@metamask/superstruct").Struct<`${string}:${string}`[], import("@metamask/superstruct").Struct<`${string}:${string}`, null>>; selected: import("@metamask/superstruct").Struct<boolean | undefined, null>; owned: import("@metamask/superstruct").Struct<boolean | undefined, null>; assets: import("@metamask/superstruct").Struct<`${string}:${string}/${string}:${string}`[] | undefined, import("@metamask/superstruct").Struct<`${string}:${string}/${string}:${string}`, null>>; }>; export type SimulationAccount = Infer<typeof SimulationAccountStruct>; declare const SimulationAssetStruct: import("@metamask/superstruct").Struct<{ symbol: string; name: string; }, { name: import("@metamask/superstruct").Struct<string, null>; symbol: import("@metamask/superstruct").Struct<string, null>; }>; export type SimulationAsset = Infer<typeof SimulationAssetStruct>; declare const SimulationOptionsStruct: import("@metamask/superstruct").Struct<{ assets?: Record<`${string}:${string}/${string}:${string}`, { symbol: string; name: string; }> | undefined; currency?: string | undefined; secretRecoveryPhrase?: string | undefined; locale?: string | undefined; state?: Record<string, import("@metamask/utils").Json> | null | undefined; unencryptedState?: Record<string, import("@metamask/utils").Json> | null | undefined; accounts?: { address: string; id: string; scopes: `${string}:${string}`[]; selected?: boolean | undefined; owned?: boolean | undefined; assets?: `${string}:${string}/${string}:${string}`[] | undefined; }[] | undefined; hideBalances?: boolean | undefined; useSecurityAlerts?: boolean | undefined; simulateOnChainActions?: boolean | undefined; useTokenDetection?: boolean | undefined; batchCheckBalances?: boolean | undefined; displayNftMedia?: boolean | undefined; useNftDetection?: boolean | undefined; useExternalPricingData?: boolean | undefined; showTestnets?: boolean | undefined; }, { currency: import("@metamask/superstruct").Struct<string | undefined, null>; secretRecoveryPhrase: import("@metamask/superstruct").Struct<string | undefined, null>; locale: import("@metamask/superstruct").Struct<string | undefined, null>; state: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json> | null | undefined, null>; unencryptedState: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json> | null | undefined, null>; accounts: import("@metamask/superstruct").Struct<{ address: string; id: string; scopes: `${string}:${string}`[]; selected?: boolean | undefined; owned?: boolean | undefined; assets?: `${string}:${string}/${string}:${string}`[] | undefined; }[] | undefined, import("@metamask/superstruct").Struct<{ address: string; id: string; scopes: `${string}:${string}`[]; selected?: boolean | undefined; owned?: boolean | undefined; assets?: `${string}:${string}/${string}:${string}`[] | undefined; }, { address: import("@metamask/superstruct").Struct<string, null>; id: import("@metamask/superstruct").Struct<string, null>; scopes: import("@metamask/superstruct").Struct<`${string}:${string}`[], import("@metamask/superstruct").Struct<`${string}:${string}`, null>>; selected: import("@metamask/superstruct").Struct<boolean | undefined, null>; owned: import("@metamask/superstruct").Struct<boolean | undefined, null>; assets: import("@metamask/superstruct").Struct<`${string}:${string}/${string}:${string}`[] | undefined, import("@metamask/superstruct").Struct<`${string}:${string}/${string}:${string}`, null>>; }>>; assets: import("@metamask/superstruct").Struct<Record<`${string}:${string}/${string}:${string}`, { symbol: string; name: string; }> | undefined, null>; hideBalances: import("@metamask/superstruct").Struct<boolean | undefined, null>; useSecurityAlerts: import("@metamask/superstruct").Struct<boolean | undefined, null>; simulateOnChainActions: import("@metamask/superstruct").Struct<boolean | undefined, null>; useTokenDetection: import("@metamask/superstruct").Struct<boolean | undefined, null>; batchCheckBalances: import("@metamask/superstruct").Struct<boolean | undefined, null>; displayNftMedia: import("@metamask/superstruct").Struct<boolean | undefined, null>; useNftDetection: import("@metamask/superstruct").Struct<boolean | undefined, null>; useExternalPricingData: import("@metamask/superstruct").Struct<boolean | undefined, null>; showTestnets: import("@metamask/superstruct").Struct<boolean | undefined, null>; }>; /** * Options for the simulation. * * @property currency - The currency to use. Defaults to `usd`. * @property secretRecoveryPhrase - The secret recovery phrase to use. This is * used to derive addresses and private keys. Defaults to a test recovery * phrase. * @property locale - The locale to use. Defaults to `en`. * @property state - The initial state of the Snap, if any. Defaults to `null`. * @property unencryptedState - The initial unencrypted state of the Snap, if * any. Defaults to `null`. * @property accounts - The accounts to use in the simulation, if any. Defaults * to an empty array. * @property assets - The assets to use in the simulation, if any. Defaults to * an empty object. * @property useSecurityAlerts - Whether to run transactions and signatures through security providers. * @property simulateOnChainActions - Whether to simulate transactions and signatures. * @property useTokenDetection - Whether to auto-detect tokens. * @property batchCheckBalances - Whether to fetch balances in an aggregated manner. * @property displayNftMedia - Whether to display NFT media. * @property useNftDetection - Whether to auto-detect NFTs. * @property useExternalPricingData - Whether to get token price data from an external source. * @property showTestnets - Whether to show testnets. */ export type SimulationUserOptions = Infer<typeof SimulationOptionsStruct>; /** * Options for the simulation, with defaults filled in. * * See {@link SimulationUserOptions} for documentation. */ export type SimulationOptions = Required<SimulationUserOptions>; /** * Get the options for the simulation. * * @param options - The user options. Any options not specified will be filled * in with default values. * @returns The simulation options. */ export declare function getOptions(options: SimulationUserOptions): SimulationOptions; export {}; //# sourceMappingURL=options.d.mts.map