@metamask/keyring-api 10.1.0 → 11.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -1
- package/dist/{JsonRpcRequest.js → JsonRpcRequest.cjs} +2 -2
- package/dist/JsonRpcRequest.cjs.map +1 -0
- package/dist/{JsonRpcRequest.d.ts → JsonRpcRequest.d.cts} +3 -2
- package/dist/JsonRpcRequest.d.cts.map +1 -0
- package/dist/JsonRpcRequest.d.mts +17 -0
- package/dist/JsonRpcRequest.d.mts.map +1 -0
- package/dist/JsonRpcRequest.mjs +10 -0
- package/dist/JsonRpcRequest.mjs.map +1 -0
- package/dist/{KeyringClient.js → KeyringClient.cjs} +4 -4
- package/dist/KeyringClient.cjs.map +1 -0
- package/dist/{KeyringClient.d.ts → KeyringClient.d.cts} +4 -3
- package/dist/KeyringClient.d.cts.map +1 -0
- package/dist/KeyringClient.d.mts +29 -0
- package/dist/KeyringClient.d.mts.map +1 -0
- package/dist/KeyringClient.mjs +120 -0
- package/dist/KeyringClient.mjs.map +1 -0
- package/dist/{KeyringSnapRpcClient.js → KeyringSnapRpcClient.cjs} +2 -2
- package/dist/KeyringSnapRpcClient.cjs.map +1 -0
- package/dist/{KeyringSnapRpcClient.d.ts → KeyringSnapRpcClient.d.cts} +6 -5
- package/dist/KeyringSnapRpcClient.d.cts.map +1 -0
- package/dist/KeyringSnapRpcClient.d.mts +40 -0
- package/dist/KeyringSnapRpcClient.d.mts.map +1 -0
- package/dist/KeyringSnapRpcClient.mjs +63 -0
- package/dist/KeyringSnapRpcClient.mjs.map +1 -0
- package/dist/api/{account.js → account.cjs} +3 -3
- package/dist/api/account.cjs.map +1 -0
- package/dist/api/{account.d.ts → account.d.cts} +2 -1
- package/dist/api/account.d.cts.map +1 -0
- package/dist/api/account.d.mts +70 -0
- package/dist/api/account.d.mts.map +1 -0
- package/dist/api/account.mjs +61 -0
- package/dist/api/account.mjs.map +1 -0
- package/dist/api/{balance.js → balance.cjs} +3 -3
- package/dist/api/balance.cjs.map +1 -0
- package/dist/api/{balance.d.ts → balance.d.cts} +2 -1
- package/dist/api/balance.d.cts.map +1 -0
- package/dist/api/balance.d.mts +10 -0
- package/dist/api/balance.d.mts.map +1 -0
- package/dist/api/balance.mjs +8 -0
- package/dist/api/balance.mjs.map +1 -0
- package/dist/api/{caip.js → caip.cjs} +5 -5
- package/dist/api/caip.cjs.map +1 -0
- package/dist/api/{caip.d.ts → caip.d.cts} +2 -1
- package/dist/api/caip.d.cts.map +1 -0
- package/dist/api/caip.d.mts +38 -0
- package/dist/api/caip.d.mts.map +1 -0
- package/dist/api/caip.mjs +43 -0
- package/dist/api/caip.mjs.map +1 -0
- package/dist/api/{export.js → export.cjs} +1 -1
- package/dist/api/export.cjs.map +1 -0
- package/dist/api/{export.d.ts → export.d.cts} +2 -1
- package/dist/api/export.d.cts.map +1 -0
- package/dist/api/export.d.mts +9 -0
- package/dist/api/export.d.mts.map +1 -0
- package/dist/api/export.mjs +4 -0
- package/dist/api/export.mjs.map +1 -0
- package/dist/api/{index.js → index.cjs} +7 -7
- package/dist/api/index.cjs.map +1 -0
- package/dist/api/index.d.cts +8 -0
- package/dist/api/index.d.cts.map +1 -0
- package/dist/api/index.d.mts +8 -0
- package/dist/api/index.d.mts.map +1 -0
- package/dist/api/index.mjs +7 -0
- package/dist/api/index.mjs.map +1 -0
- package/dist/api/{keyring.js → keyring.cjs} +1 -1
- package/dist/api/keyring.cjs.map +1 -0
- package/dist/api/{keyring.d.ts → keyring.d.cts} +8 -7
- package/dist/api/keyring.d.cts.map +1 -0
- package/dist/api/keyring.d.mts +160 -0
- package/dist/api/keyring.d.mts.map +1 -0
- package/dist/api/keyring.mjs +2 -0
- package/dist/api/keyring.mjs.map +1 -0
- package/dist/api/{request.js → request.cjs} +3 -3
- package/dist/api/request.cjs.map +1 -0
- package/dist/api/{request.d.ts → request.d.cts} +3 -2
- package/dist/api/request.d.cts.map +1 -0
- package/dist/api/request.d.mts +40 -0
- package/dist/api/request.d.mts.map +1 -0
- package/dist/api/request.mjs +26 -0
- package/dist/api/request.mjs.map +1 -0
- package/dist/api/{response.js → response.cjs} +2 -2
- package/dist/api/response.cjs.map +1 -0
- package/dist/api/{response.d.ts → response.d.cts} +2 -1
- package/dist/api/response.d.cts.map +1 -0
- package/dist/api/response.d.mts +25 -0
- package/dist/api/response.d.mts.map +1 -0
- package/dist/api/response.mjs +41 -0
- package/dist/api/response.mjs.map +1 -0
- package/dist/{eth/erc4337/index.js → btc/index.cjs} +2 -2
- package/dist/btc/index.cjs.map +1 -0
- package/dist/btc/index.d.cts +2 -0
- package/dist/btc/index.d.cts.map +1 -0
- package/dist/btc/index.d.mts +2 -0
- package/dist/btc/index.d.mts.map +1 -0
- package/dist/btc/index.mjs +2 -0
- package/dist/btc/index.mjs.map +1 -0
- package/dist/btc/{types.js → types.cjs} +3 -3
- package/dist/btc/types.cjs.map +1 -0
- package/dist/btc/{types.d.ts → types.d.cts} +2 -1
- package/dist/btc/types.d.cts.map +1 -0
- package/dist/btc/types.d.mts +34 -0
- package/dist/btc/types.d.mts.map +1 -0
- package/dist/btc/types.mjs +37 -0
- package/dist/btc/types.mjs.map +1 -0
- package/dist/{contexts.js → contexts.cjs} +1 -1
- package/dist/contexts.cjs.map +1 -0
- package/dist/{contexts.d.ts → contexts.d.cts} +1 -0
- package/dist/contexts.d.cts.map +1 -0
- package/dist/contexts.d.mts +8 -0
- package/dist/contexts.d.mts.map +1 -0
- package/dist/contexts.mjs +2 -0
- package/dist/contexts.mjs.map +1 -0
- package/dist/{sol/index.js → eth/erc4337/index.cjs} +2 -2
- package/dist/eth/erc4337/index.cjs.map +1 -0
- package/dist/eth/erc4337/index.d.cts +2 -0
- package/dist/eth/erc4337/index.d.cts.map +1 -0
- package/dist/eth/erc4337/index.d.mts +2 -0
- package/dist/eth/erc4337/index.d.mts.map +1 -0
- package/dist/eth/erc4337/index.mjs +2 -0
- package/dist/eth/erc4337/index.mjs.map +1 -0
- package/dist/eth/erc4337/{types.js → types.cjs} +4 -4
- package/dist/eth/erc4337/types.cjs.map +1 -0
- package/dist/eth/erc4337/{types.d.ts → types.d.cts} +6 -5
- package/dist/eth/erc4337/types.d.cts.map +1 -0
- package/dist/eth/erc4337/types.d.mts +98 -0
- package/dist/eth/erc4337/types.d.mts.map +1 -0
- package/dist/eth/erc4337/types.mjs +59 -0
- package/dist/eth/erc4337/types.mjs.map +1 -0
- package/dist/eth/{index.js → index.cjs} +4 -4
- package/dist/eth/index.cjs.map +1 -0
- package/dist/eth/index.d.cts +4 -0
- package/dist/eth/index.d.cts.map +1 -0
- package/dist/eth/index.d.mts +4 -0
- package/dist/eth/index.d.mts.map +1 -0
- package/dist/eth/index.mjs +4 -0
- package/dist/eth/index.mjs.map +1 -0
- package/dist/eth/{types.js → types.cjs} +3 -3
- package/dist/eth/types.cjs.map +1 -0
- package/dist/eth/{types.d.ts → types.d.cts} +2 -1
- package/dist/eth/types.d.cts.map +1 -0
- package/dist/eth/types.d.mts +81 -0
- package/dist/eth/types.d.mts.map +1 -0
- package/dist/eth/types.mjs +70 -0
- package/dist/eth/types.mjs.map +1 -0
- package/dist/eth/{utils.js → utils.cjs} +3 -4
- package/dist/eth/{utils.js.map → utils.cjs.map} +1 -1
- package/dist/eth/{utils.d.ts → utils.d.cts} +2 -1
- package/dist/eth/utils.d.cts.map +1 -0
- package/dist/eth/utils.d.mts +9 -0
- package/dist/eth/utils.d.mts.map +1 -0
- package/dist/eth/utils.mjs +11 -0
- package/dist/eth/utils.mjs.map +1 -0
- package/dist/{events.js → events.cjs} +1 -1
- package/dist/events.cjs.map +1 -0
- package/dist/{events.d.ts → events.d.cts} +1 -0
- package/dist/events.d.cts.map +1 -0
- package/dist/events.d.mts +11 -0
- package/dist/events.d.mts.map +1 -0
- package/dist/events.mjs +14 -0
- package/dist/events.mjs.map +1 -0
- package/dist/index.cjs +29 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +14 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +14 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +13 -0
- package/dist/index.mjs.map +1 -0
- package/dist/internal/{api.js → api.cjs} +5 -5
- package/dist/internal/api.cjs.map +1 -0
- package/dist/internal/{api.d.ts → api.d.cts} +5 -4
- package/dist/internal/api.d.cts.map +1 -0
- package/dist/internal/api.d.mts +420 -0
- package/dist/internal/api.d.mts.map +1 -0
- package/dist/internal/api.mjs +136 -0
- package/dist/internal/api.mjs.map +1 -0
- package/dist/internal/eth/{EthKeyring.js → EthKeyring.cjs} +1 -1
- package/dist/internal/eth/EthKeyring.cjs.map +1 -0
- package/dist/internal/eth/{EthKeyring.d.ts → EthKeyring.d.cts} +4 -3
- package/dist/internal/eth/EthKeyring.d.cts.map +1 -0
- package/dist/internal/eth/EthKeyring.d.mts +34 -0
- package/dist/internal/eth/EthKeyring.d.mts.map +1 -0
- package/dist/internal/eth/EthKeyring.mjs +2 -0
- package/dist/internal/eth/EthKeyring.mjs.map +1 -0
- package/dist/internal/eth/{index.js → index.cjs} +1 -1
- package/dist/internal/eth/index.cjs.map +1 -0
- package/dist/internal/eth/index.d.cts +2 -0
- package/dist/internal/eth/index.d.cts.map +1 -0
- package/dist/internal/eth/index.d.mts +2 -0
- package/dist/internal/eth/index.d.mts.map +1 -0
- package/dist/internal/eth/index.mjs +2 -0
- package/dist/internal/eth/index.mjs.map +1 -0
- package/dist/internal/{events.js → events.cjs} +5 -5
- package/dist/internal/events.cjs.map +1 -0
- package/dist/internal/{events.d.ts → events.d.cts} +3 -2
- package/dist/internal/events.d.cts.map +1 -0
- package/dist/internal/events.d.mts +162 -0
- package/dist/internal/events.d.mts.map +1 -0
- package/dist/internal/events.mjs +69 -0
- package/dist/internal/events.mjs.map +1 -0
- package/dist/internal/{index.js → index.cjs} +5 -5
- package/dist/internal/index.cjs.map +1 -0
- package/dist/internal/index.d.cts +6 -0
- package/dist/internal/index.d.cts.map +1 -0
- package/dist/internal/index.d.mts +6 -0
- package/dist/internal/index.d.mts.map +1 -0
- package/dist/internal/index.mjs +5 -0
- package/dist/internal/index.mjs.map +1 -0
- package/dist/internal/{rpc.js → rpc.cjs} +3 -3
- package/dist/internal/rpc.cjs.map +1 -0
- package/dist/internal/{rpc.d.ts → rpc.d.cts} +1 -0
- package/dist/internal/rpc.d.cts.map +1 -0
- package/dist/internal/rpc.d.mts +26 -0
- package/dist/internal/rpc.d.mts.map +1 -0
- package/dist/internal/rpc.mjs +29 -0
- package/dist/internal/{rpc.js.map → rpc.mjs.map} +1 -1
- package/dist/internal/{types.js → types.cjs} +6 -6
- package/dist/internal/types.cjs.map +1 -0
- package/dist/internal/{types.d.ts → types.d.cts} +21 -20
- package/dist/internal/types.d.cts.map +1 -0
- package/dist/internal/types.d.mts +392 -0
- package/dist/internal/types.d.mts.map +1 -0
- package/dist/internal/types.mjs +49 -0
- package/dist/internal/types.mjs.map +1 -0
- package/dist/{rpc-handler.js → rpc-handler.cjs} +6 -6
- package/dist/rpc-handler.cjs.map +1 -0
- package/dist/{rpc-handler.d.ts → rpc-handler.d.cts} +4 -3
- package/dist/rpc-handler.d.cts.map +1 -0
- package/dist/rpc-handler.d.mts +30 -0
- package/dist/rpc-handler.d.mts.map +1 -0
- package/dist/rpc-handler.mjs +131 -0
- package/dist/rpc-handler.mjs.map +1 -0
- package/dist/{snap-utils.js → snap-utils.cjs} +2 -3
- package/dist/snap-utils.cjs.map +1 -0
- package/dist/{snap-utils.d.ts → snap-utils.d.cts} +4 -3
- package/dist/snap-utils.d.cts.map +1 -0
- package/dist/snap-utils.d.mts +12 -0
- package/dist/snap-utils.d.mts.map +1 -0
- package/dist/snap-utils.mjs +17 -0
- package/dist/snap-utils.mjs.map +1 -0
- package/dist/{btc/index.js → sol/index.cjs} +2 -2
- package/dist/sol/index.cjs.map +1 -0
- package/dist/sol/index.d.cts +2 -0
- package/dist/sol/index.d.cts.map +1 -0
- package/dist/sol/index.d.mts +2 -0
- package/dist/sol/index.d.mts.map +1 -0
- package/dist/sol/index.mjs +2 -0
- package/dist/sol/index.mjs.map +1 -0
- package/dist/sol/{types.js → types.cjs} +3 -3
- package/dist/sol/types.cjs.map +1 -0
- package/dist/sol/{types.d.ts → types.d.cts} +2 -1
- package/dist/sol/types.d.cts.map +1 -0
- package/dist/sol/types.d.mts +39 -0
- package/dist/sol/types.d.mts.map +1 -0
- package/dist/sol/types.mjs +33 -0
- package/dist/sol/types.mjs.map +1 -0
- package/dist/{superstruct.js → superstruct.cjs} +5 -6
- package/dist/superstruct.cjs.map +1 -0
- package/dist/{superstruct.d.ts → superstruct.d.cts} +3 -2
- package/dist/superstruct.d.cts.map +1 -0
- package/dist/superstruct.d.mts +84 -0
- package/dist/superstruct.d.mts.map +1 -0
- package/dist/superstruct.mjs +74 -0
- package/dist/superstruct.mjs.map +1 -0
- package/dist/utils/{index.js → index.cjs} +3 -3
- package/dist/utils/index.cjs.map +1 -0
- package/dist/utils/index.d.cts +3 -0
- package/dist/utils/index.d.cts.map +1 -0
- package/dist/utils/index.d.mts +3 -0
- package/dist/utils/index.d.mts.map +1 -0
- package/dist/utils/index.mjs +3 -0
- package/dist/utils/index.mjs.map +1 -0
- package/dist/utils/{types.js → types.cjs} +2 -2
- package/dist/utils/types.cjs.map +1 -0
- package/dist/utils/{types.d.ts → types.d.cts} +2 -1
- package/dist/utils/types.d.cts.map +1 -0
- package/dist/utils/types.d.mts +18 -0
- package/dist/utils/types.d.mts.map +1 -0
- package/dist/utils/types.mjs +26 -0
- package/dist/utils/types.mjs.map +1 -0
- package/dist/utils/{typing.js → typing.cjs} +2 -3
- package/dist/utils/{typing.js.map → typing.cjs.map} +1 -1
- package/dist/utils/{typing.d.ts → typing.d.cts} +1 -0
- package/dist/utils/typing.d.cts.map +1 -0
- package/dist/utils/typing.d.mts +33 -0
- package/dist/utils/typing.d.mts.map +1 -0
- package/dist/utils/typing.mjs +17 -0
- package/dist/utils/typing.mjs.map +1 -0
- package/package.json +19 -8
- package/dist/JsonRpcRequest.js.map +0 -1
- package/dist/KeyringClient.js.map +0 -1
- package/dist/KeyringSnapRpcClient.js.map +0 -1
- package/dist/api/account.js.map +0 -1
- package/dist/api/balance.js.map +0 -1
- package/dist/api/caip.js.map +0 -1
- package/dist/api/export.js.map +0 -1
- package/dist/api/index.d.ts +0 -7
- package/dist/api/index.js.map +0 -1
- package/dist/api/keyring.js.map +0 -1
- package/dist/api/request.js.map +0 -1
- package/dist/api/response.js.map +0 -1
- package/dist/btc/index.d.ts +0 -1
- package/dist/btc/index.js.map +0 -1
- package/dist/btc/types.js.map +0 -1
- package/dist/contexts.js.map +0 -1
- package/dist/eth/erc4337/index.d.ts +0 -1
- package/dist/eth/erc4337/index.js.map +0 -1
- package/dist/eth/erc4337/types.js.map +0 -1
- package/dist/eth/index.d.ts +0 -3
- package/dist/eth/index.js.map +0 -1
- package/dist/eth/types.js.map +0 -1
- package/dist/events.js.map +0 -1
- package/dist/index.d.ts +0 -12
- package/dist/index.js +0 -28
- package/dist/index.js.map +0 -1
- package/dist/internal/api.js.map +0 -1
- package/dist/internal/eth/EthKeyring.js.map +0 -1
- package/dist/internal/eth/index.d.ts +0 -1
- package/dist/internal/eth/index.js.map +0 -1
- package/dist/internal/events.js.map +0 -1
- package/dist/internal/index.d.ts +0 -5
- package/dist/internal/index.js.map +0 -1
- package/dist/internal/types.js.map +0 -1
- package/dist/rpc-handler.js.map +0 -1
- package/dist/snap-utils.js.map +0 -1
- package/dist/sol/index.d.ts +0 -1
- package/dist/sol/index.js.map +0 -1
- package/dist/sol/types.js.map +0 -1
- package/dist/superstruct.js.map +0 -1
- package/dist/utils/index.d.ts +0 -2
- package/dist/utils/index.js.map +0 -1
- package/dist/utils/types.js.map +0 -1
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"keyring.mjs","sourceRoot":"","sources":["../../src/api/keyring.ts"],"names":[],"mappings":"","sourcesContent":["import type { Json } from '@metamask/utils';\n\nimport type { KeyringAccount } from './account';\nimport type { Balance } from './balance';\nimport type { CaipAssetType } from './caip';\nimport type { KeyringAccountData } from './export';\nimport type { KeyringRequest } from './request';\nimport type { KeyringResponse } from './response';\n\n/**\n * Keyring interface.\n *\n * Represents the functionality and operations related to managing accounts and\n * handling requests.\n */\nexport type Keyring = {\n /**\n * List accounts.\n *\n * Retrieves an array of KeyringAccount objects representing the available\n * accounts.\n *\n * @returns A promise that resolves to an array of KeyringAccount objects.\n */\n listAccounts(): Promise<KeyringAccount[]>;\n\n /**\n * Get an account.\n *\n * Retrieves the KeyringAccount object for the given account ID.\n *\n * @param id - The ID of the account to retrieve.\n * @returns A promise that resolves to the KeyringAccount object if found, or\n * undefined otherwise.\n */\n getAccount(id: string): Promise<KeyringAccount | undefined>;\n\n /**\n * Create an account.\n *\n * Creates a new account with optional, keyring-defined, account options.\n *\n * @param options - Keyring-defined options for the account (optional).\n * @returns A promise that resolves to the newly created KeyringAccount\n * object without any private information.\n */\n createAccount(options?: Record<string, Json>): Promise<KeyringAccount>;\n\n /**\n * Retrieve the balances of a given account.\n *\n * This method fetches the balances of specified assets for a given account\n * ID. It returns a promise that resolves to an object where the keys are\n * asset types and the values are balance objects containing the amount and\n * unit.\n *\n * @example\n * ```ts\n * await keyring.getAccountBalances(\n * '43550276-c7d6-4fac-87c7-00390ad0ce90',\n * ['bip122:000000000019d6689c085ae165831e93/slip44:0']\n * );\n * // Returns something similar to:\n * // {\n * // 'bip122:000000000019d6689c085ae165831e93/slip44:0': {\n * // amount: '0.0001',\n * // unit: 'BTC',\n * // }\n * // }\n * ```\n * @param id - ID of the account to retrieve the balances for.\n * @param assets - Array of asset types (CAIP-19) to retrieve balances for.\n * @returns A promise that resolves to an object mapping asset types to their\n * respective balances.\n */\n getAccountBalances?(\n id: string,\n assets: CaipAssetType[],\n ): Promise<Record<CaipAssetType, Balance>>;\n\n /**\n * Filter supported chains for a given account.\n *\n * @param id - ID of the account to be checked.\n * @param chains - List of chains (CAIP-2) to be checked.\n * @returns A Promise that resolves to a filtered list of CAIP-2 IDs\n * representing the supported chains.\n */\n filterAccountChains(id: string, chains: string[]): Promise<string[]>;\n\n /**\n * Update an account.\n *\n * Updates the account with the given account object. Does nothing if the\n * account does not exist.\n *\n * @param account - The updated account object.\n * @returns A promise that resolves when the account is successfully updated.\n */\n updateAccount(account: KeyringAccount): Promise<void>;\n\n /**\n * Delete an account from the keyring.\n *\n * Deletes the account with the given ID from the keyring.\n *\n * @param id - The ID of the account to delete.\n * @returns A promise that resolves when the account is successfully deleted.\n */\n deleteAccount(id: string): Promise<void>;\n\n /**\n * Exports an account's private key.\n *\n * If the keyring cannot export a private key, this function should throw an\n * error.\n *\n * @param id - The ID of the account to export.\n * @returns A promise that resolves to the exported account.\n */\n exportAccount?(id: string): Promise<KeyringAccountData>;\n\n /**\n * List all submitted requests.\n *\n * Retrieves an array of KeyringRequest objects representing the submitted\n * requests.\n *\n * @returns A promise that resolves to an array of KeyringRequest objects.\n */\n listRequests?(): Promise<KeyringRequest[]>;\n\n /**\n * Get a request.\n *\n * Retrieves the KeyringRequest object for the given request ID.\n *\n * @param id - The ID of the request to retrieve.\n * @returns A promise that resolves to the KeyringRequest object if found, or\n * undefined otherwise.\n */\n getRequest?(id: string): Promise<KeyringRequest | undefined>;\n\n /**\n * Submit a request.\n *\n * Submits the given KeyringRequest object.\n *\n * @param request - The KeyringRequest object to submit.\n * @returns A promise that resolves to the request response.\n */\n submitRequest(request: KeyringRequest): Promise<KeyringResponse>;\n\n /**\n * Approve a request.\n *\n * Approves the request with the given ID and sets the response if provided.\n *\n * @param id - The ID of the request to approve.\n * @param data - The response to the request (optional).\n * @returns A promise that resolves when the request is successfully\n * approved.\n */\n approveRequest?(id: string, data?: Record<string, Json>): Promise<void>;\n\n /**\n * Reject a request.\n *\n * Rejects the request with the given ID.\n *\n * @param id - The ID of the request to reject.\n * @returns A promise that resolves when the request is successfully\n * rejected.\n */\n rejectRequest?(id: string): Promise<void>;\n};\n"]}
|
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.KeyringRequestStruct = void 0;
|
4
4
|
const superstruct_1 = require("@metamask/superstruct");
|
5
5
|
const utils_1 = require("@metamask/utils");
|
6
|
-
const superstruct_2 = require("../superstruct");
|
7
|
-
const utils_2 = require("../utils");
|
6
|
+
const superstruct_2 = require("../superstruct.cjs");
|
7
|
+
const utils_2 = require("../utils/index.cjs");
|
8
8
|
exports.KeyringRequestStruct = (0, superstruct_2.object)({
|
9
9
|
/**
|
10
10
|
* Keyring request ID (UUIDv4).
|
@@ -26,4 +26,4 @@ exports.KeyringRequestStruct = (0, superstruct_2.object)({
|
|
26
26
|
params: (0, superstruct_2.exactOptional)((0, superstruct_1.union)([(0, superstruct_1.array)(utils_1.JsonStruct), (0, superstruct_1.record)((0, superstruct_1.string)(), utils_1.JsonStruct)])),
|
27
27
|
}),
|
28
28
|
});
|
29
|
-
//# sourceMappingURL=request.
|
29
|
+
//# sourceMappingURL=request.cjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"request.cjs","sourceRoot":"","sources":["../../src/api/request.ts"],"names":[],"mappings":";;;AACA,uDAAqE;AACrE,2CAA6C;AAE7C,oDAAuD;AACvD,8CAAsC;AAEzB,QAAA,oBAAoB,GAAG,IAAA,oBAAM,EAAC;IACzC;;OAEG;IACH,EAAE,EAAE,kBAAU;IAEd;;OAEG;IACH,KAAK,EAAE,IAAA,oBAAM,GAAE;IAEf;;OAEG;IACH,OAAO,EAAE,kBAAU;IAEnB;;OAEG;IACH,OAAO,EAAE,IAAA,oBAAM,EAAC;QACd,MAAM,EAAE,IAAA,oBAAM,GAAE;QAChB,MAAM,EAAE,IAAA,2BAAa,EACnB,IAAA,mBAAK,EAAC,CAAC,IAAA,mBAAK,EAAC,kBAAU,CAAC,EAAE,IAAA,oBAAM,EAAC,IAAA,oBAAM,GAAE,EAAE,kBAAU,CAAC,CAAC,CAAC,CACzD;KACF,CAAC;CACH,CAAC,CAAC","sourcesContent":["import type { Infer } from '@metamask/superstruct';\nimport { array, record, string, union } from '@metamask/superstruct';\nimport { JsonStruct } from '@metamask/utils';\n\nimport { exactOptional, object } from '../superstruct';\nimport { UuidStruct } from '../utils';\n\nexport const KeyringRequestStruct = object({\n /**\n * Keyring request ID (UUIDv4).\n */\n id: UuidStruct,\n\n /**\n * Request's scope (CAIP-2 chain ID).\n */\n scope: string(),\n\n /**\n * Account ID (UUIDv4).\n */\n account: UuidStruct,\n\n /**\n * Inner request sent by the client application.\n */\n request: object({\n method: string(),\n params: exactOptional(\n union([array(JsonStruct), record(string(), JsonStruct)]),\n ),\n }),\n});\n\n/**\n * Keyring request.\n *\n * Represents a request made to the keyring for account-related operations.\n */\nexport type KeyringRequest = Infer<typeof KeyringRequestStruct>;\n"]}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import type { Infer } from
|
1
|
+
import type { Infer } from "@metamask/superstruct";
|
2
2
|
export declare const KeyringRequestStruct: import("@metamask/superstruct").Struct<{
|
3
3
|
id: string;
|
4
4
|
scope: string;
|
@@ -28,7 +28,7 @@ export declare const KeyringRequestStruct: import("@metamask/superstruct").Struc
|
|
28
28
|
params?: import("@metamask/utils").Json[] | Record<string, import("@metamask/utils").Json>;
|
29
29
|
}, {
|
30
30
|
method: import("@metamask/superstruct").Struct<string, null>;
|
31
|
-
params: import("@metamask/superstruct").Struct<import("../superstruct").ExactOptionalTag | import("@metamask/utils").Json[] | Record<string, import("@metamask/utils").Json>, null>;
|
31
|
+
params: import("@metamask/superstruct").Struct<import("../superstruct.cjs").ExactOptionalTag | import("@metamask/utils").Json[] | Record<string, import("@metamask/utils").Json>, null>;
|
32
32
|
}>;
|
33
33
|
}>;
|
34
34
|
/**
|
@@ -37,3 +37,4 @@ export declare const KeyringRequestStruct: import("@metamask/superstruct").Struc
|
|
37
37
|
* Represents a request made to the keyring for account-related operations.
|
38
38
|
*/
|
39
39
|
export type KeyringRequest = Infer<typeof KeyringRequestStruct>;
|
40
|
+
//# sourceMappingURL=request.d.cts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"request.d.cts","sourceRoot":"","sources":["../../src/api/request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAOnD,eAAO,MAAM,oBAAoB;;;;;;;;;IAC/B;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;;;EAOH,CAAC;AAEH;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
|
@@ -0,0 +1,40 @@
|
|
1
|
+
import type { Infer } from "@metamask/superstruct";
|
2
|
+
export declare const KeyringRequestStruct: import("@metamask/superstruct").Struct<{
|
3
|
+
id: string;
|
4
|
+
scope: string;
|
5
|
+
account: string;
|
6
|
+
request: {
|
7
|
+
method: string;
|
8
|
+
params?: import("@metamask/utils").Json[] | Record<string, import("@metamask/utils").Json>;
|
9
|
+
};
|
10
|
+
}, {
|
11
|
+
/**
|
12
|
+
* Keyring request ID (UUIDv4).
|
13
|
+
*/
|
14
|
+
id: import("@metamask/superstruct").Struct<string, null>;
|
15
|
+
/**
|
16
|
+
* Request's scope (CAIP-2 chain ID).
|
17
|
+
*/
|
18
|
+
scope: import("@metamask/superstruct").Struct<string, null>;
|
19
|
+
/**
|
20
|
+
* Account ID (UUIDv4).
|
21
|
+
*/
|
22
|
+
account: import("@metamask/superstruct").Struct<string, null>;
|
23
|
+
/**
|
24
|
+
* Inner request sent by the client application.
|
25
|
+
*/
|
26
|
+
request: import("@metamask/superstruct").Struct<{
|
27
|
+
method: string;
|
28
|
+
params?: import("@metamask/utils").Json[] | Record<string, import("@metamask/utils").Json>;
|
29
|
+
}, {
|
30
|
+
method: import("@metamask/superstruct").Struct<string, null>;
|
31
|
+
params: import("@metamask/superstruct").Struct<import("../superstruct.mjs").ExactOptionalTag | import("@metamask/utils").Json[] | Record<string, import("@metamask/utils").Json>, null>;
|
32
|
+
}>;
|
33
|
+
}>;
|
34
|
+
/**
|
35
|
+
* Keyring request.
|
36
|
+
*
|
37
|
+
* Represents a request made to the keyring for account-related operations.
|
38
|
+
*/
|
39
|
+
export type KeyringRequest = Infer<typeof KeyringRequestStruct>;
|
40
|
+
//# sourceMappingURL=request.d.mts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"request.d.mts","sourceRoot":"","sources":["../../src/api/request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAOnD,eAAO,MAAM,oBAAoB;;;;;;;;;IAC/B;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;;;EAOH,CAAC;AAEH;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import { array, record, string, union } from "@metamask/superstruct";
|
2
|
+
import { JsonStruct } from "@metamask/utils";
|
3
|
+
import { exactOptional, object } from "../superstruct.mjs";
|
4
|
+
import { UuidStruct } from "../utils/index.mjs";
|
5
|
+
export const KeyringRequestStruct = object({
|
6
|
+
/**
|
7
|
+
* Keyring request ID (UUIDv4).
|
8
|
+
*/
|
9
|
+
id: UuidStruct,
|
10
|
+
/**
|
11
|
+
* Request's scope (CAIP-2 chain ID).
|
12
|
+
*/
|
13
|
+
scope: string(),
|
14
|
+
/**
|
15
|
+
* Account ID (UUIDv4).
|
16
|
+
*/
|
17
|
+
account: UuidStruct,
|
18
|
+
/**
|
19
|
+
* Inner request sent by the client application.
|
20
|
+
*/
|
21
|
+
request: object({
|
22
|
+
method: string(),
|
23
|
+
params: exactOptional(union([array(JsonStruct), record(string(), JsonStruct)])),
|
24
|
+
}),
|
25
|
+
});
|
26
|
+
//# sourceMappingURL=request.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"request.mjs","sourceRoot":"","sources":["../../src/api/request.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,8BAA8B;AACrE,OAAO,EAAE,UAAU,EAAE,wBAAwB;AAE7C,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,2BAAuB;AACvD,OAAO,EAAE,UAAU,EAAE,2BAAiB;AAEtC,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC;IACzC;;OAEG;IACH,EAAE,EAAE,UAAU;IAEd;;OAEG;IACH,KAAK,EAAE,MAAM,EAAE;IAEf;;OAEG;IACH,OAAO,EAAE,UAAU;IAEnB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,EAAE;QAChB,MAAM,EAAE,aAAa,CACnB,KAAK,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,EAAE,UAAU,CAAC,CAAC,CAAC,CACzD;KACF,CAAC;CACH,CAAC,CAAC","sourcesContent":["import type { Infer } from '@metamask/superstruct';\nimport { array, record, string, union } from '@metamask/superstruct';\nimport { JsonStruct } from '@metamask/utils';\n\nimport { exactOptional, object } from '../superstruct';\nimport { UuidStruct } from '../utils';\n\nexport const KeyringRequestStruct = object({\n /**\n * Keyring request ID (UUIDv4).\n */\n id: UuidStruct,\n\n /**\n * Request's scope (CAIP-2 chain ID).\n */\n scope: string(),\n\n /**\n * Account ID (UUIDv4).\n */\n account: UuidStruct,\n\n /**\n * Inner request sent by the client application.\n */\n request: object({\n method: string(),\n params: exactOptional(\n union([array(JsonStruct), record(string(), JsonStruct)]),\n ),\n }),\n});\n\n/**\n * Keyring request.\n *\n * Represents a request made to the keyring for account-related operations.\n */\nexport type KeyringRequest = Infer<typeof KeyringRequestStruct>;\n"]}
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.KeyringResponseStruct = void 0;
|
4
4
|
const superstruct_1 = require("@metamask/superstruct");
|
5
5
|
const utils_1 = require("@metamask/utils");
|
6
|
-
const superstruct_2 = require("../superstruct");
|
6
|
+
const superstruct_2 = require("../superstruct.cjs");
|
7
7
|
exports.KeyringResponseStruct = (0, superstruct_1.union)([
|
8
8
|
(0, superstruct_2.object)({
|
9
9
|
/**
|
@@ -41,4 +41,4 @@ exports.KeyringResponseStruct = (0, superstruct_1.union)([
|
|
41
41
|
result: utils_1.JsonStruct,
|
42
42
|
}),
|
43
43
|
]);
|
44
|
-
//# sourceMappingURL=response.
|
44
|
+
//# sourceMappingURL=response.cjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"response.cjs","sourceRoot":"","sources":["../../src/api/response.ts"],"names":[],"mappings":";;;AACA,uDAA+D;AAC/D,2CAA6C;AAE7C,oDAAuD;AAE1C,QAAA,qBAAqB,GAAG,IAAA,mBAAK,EAAC;IACzC,IAAA,oBAAM,EAAC;QACL;;;;;;WAMG;QACH,OAAO,EAAE,IAAA,qBAAO,EAAC,IAAI,CAAC;QAEtB;;;;;;WAMG;QACH,QAAQ,EAAE,IAAA,2BAAa,EACrB,IAAA,oBAAM,EAAC;YACL,OAAO,EAAE,IAAA,2BAAa,EAAC,IAAA,oBAAM,GAAE,CAAC;YAChC,GAAG,EAAE,IAAA,2BAAa,EAAC,IAAA,oBAAM,GAAE,CAAC;SAC7B,CAAC,CACH;KACF,CAAC;IACF,IAAA,oBAAM,EAAC;QACL;;;;;;WAMG;QACH,OAAO,EAAE,IAAA,qBAAO,EAAC,KAAK,CAAC;QAEvB;;WAEG;QACH,MAAM,EAAE,kBAAU;KACnB,CAAC;CACH,CAAC,CAAC","sourcesContent":["import type { Infer } from '@metamask/superstruct';\nimport { literal, string, union } from '@metamask/superstruct';\nimport { JsonStruct } from '@metamask/utils';\n\nimport { exactOptional, object } from '../superstruct';\n\nexport const KeyringResponseStruct = union([\n object({\n /**\n * Pending flag.\n *\n * Setting the pending flag to true indicates that the request will be\n * handled asynchronously. The keyring must be called with `approveRequest`\n * or `rejectRequest` to resolve the request.\n */\n pending: literal(true),\n\n /**\n * Redirect URL.\n *\n * If present in the response, MetaMask will display a confirmation dialog\n * with a link to the redirect URL. The user can choose to follow the link\n * or cancel the request.\n */\n redirect: exactOptional(\n object({\n message: exactOptional(string()),\n url: exactOptional(string()),\n }),\n ),\n }),\n object({\n /**\n * Pending flag.\n *\n * Setting the pending flag to false indicates that the request will be\n * handled synchronously. The keyring must return the result of the\n * request execution.\n */\n pending: literal(false),\n\n /**\n * Request result.\n */\n result: JsonStruct,\n }),\n]);\n\n/**\n * Response to a call to `submitRequest`.\n *\n * Keyring implementations must return a response with `pending: true` if the\n * request will be handled asynchronously. Otherwise, the response must contain\n * the result of the request and `pending: false`.\n *\n * In the asynchronous case, the keyring can return a redirect URL and message\n * to be shown to the user. The user can choose to follow the link or cancel\n * the request. The main use case for this is to redirect the user to the snap\n * dapp to review the request.\n */\nexport type KeyringResponse = Infer<typeof KeyringResponseStruct>;\n"]}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import type { Infer } from
|
1
|
+
import type { Infer } from "@metamask/superstruct";
|
2
2
|
export declare const KeyringResponseStruct: import("@metamask/superstruct").Struct<{
|
3
3
|
pending: true;
|
4
4
|
redirect?: {
|
@@ -22,3 +22,4 @@ export declare const KeyringResponseStruct: import("@metamask/superstruct").Stru
|
|
22
22
|
* dapp to review the request.
|
23
23
|
*/
|
24
24
|
export type KeyringResponse = Infer<typeof KeyringResponseStruct>;
|
25
|
+
//# sourceMappingURL=response.d.cts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"response.d.cts","sourceRoot":"","sources":["../../src/api/response.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAMnD,eAAO,MAAM,qBAAqB;;;;;;;;;QAwChC,CAAC;AAEH;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,eAAe,GAAG,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
|
@@ -0,0 +1,25 @@
|
|
1
|
+
import type { Infer } from "@metamask/superstruct";
|
2
|
+
export declare const KeyringResponseStruct: import("@metamask/superstruct").Struct<{
|
3
|
+
pending: true;
|
4
|
+
redirect?: {
|
5
|
+
message?: string;
|
6
|
+
url?: string;
|
7
|
+
};
|
8
|
+
} | {
|
9
|
+
pending: false;
|
10
|
+
result: import("@metamask/utils").Json;
|
11
|
+
}, null>;
|
12
|
+
/**
|
13
|
+
* Response to a call to `submitRequest`.
|
14
|
+
*
|
15
|
+
* Keyring implementations must return a response with `pending: true` if the
|
16
|
+
* request will be handled asynchronously. Otherwise, the response must contain
|
17
|
+
* the result of the request and `pending: false`.
|
18
|
+
*
|
19
|
+
* In the asynchronous case, the keyring can return a redirect URL and message
|
20
|
+
* to be shown to the user. The user can choose to follow the link or cancel
|
21
|
+
* the request. The main use case for this is to redirect the user to the snap
|
22
|
+
* dapp to review the request.
|
23
|
+
*/
|
24
|
+
export type KeyringResponse = Infer<typeof KeyringResponseStruct>;
|
25
|
+
//# sourceMappingURL=response.d.mts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"response.d.mts","sourceRoot":"","sources":["../../src/api/response.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAMnD,eAAO,MAAM,qBAAqB;;;;;;;;;QAwChC,CAAC;AAEH;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,eAAe,GAAG,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
|
@@ -0,0 +1,41 @@
|
|
1
|
+
import { literal, string, union } from "@metamask/superstruct";
|
2
|
+
import { JsonStruct } from "@metamask/utils";
|
3
|
+
import { exactOptional, object } from "../superstruct.mjs";
|
4
|
+
export const KeyringResponseStruct = union([
|
5
|
+
object({
|
6
|
+
/**
|
7
|
+
* Pending flag.
|
8
|
+
*
|
9
|
+
* Setting the pending flag to true indicates that the request will be
|
10
|
+
* handled asynchronously. The keyring must be called with `approveRequest`
|
11
|
+
* or `rejectRequest` to resolve the request.
|
12
|
+
*/
|
13
|
+
pending: literal(true),
|
14
|
+
/**
|
15
|
+
* Redirect URL.
|
16
|
+
*
|
17
|
+
* If present in the response, MetaMask will display a confirmation dialog
|
18
|
+
* with a link to the redirect URL. The user can choose to follow the link
|
19
|
+
* or cancel the request.
|
20
|
+
*/
|
21
|
+
redirect: exactOptional(object({
|
22
|
+
message: exactOptional(string()),
|
23
|
+
url: exactOptional(string()),
|
24
|
+
})),
|
25
|
+
}),
|
26
|
+
object({
|
27
|
+
/**
|
28
|
+
* Pending flag.
|
29
|
+
*
|
30
|
+
* Setting the pending flag to false indicates that the request will be
|
31
|
+
* handled synchronously. The keyring must return the result of the
|
32
|
+
* request execution.
|
33
|
+
*/
|
34
|
+
pending: literal(false),
|
35
|
+
/**
|
36
|
+
* Request result.
|
37
|
+
*/
|
38
|
+
result: JsonStruct,
|
39
|
+
}),
|
40
|
+
]);
|
41
|
+
//# sourceMappingURL=response.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"response.mjs","sourceRoot":"","sources":["../../src/api/response.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,8BAA8B;AAC/D,OAAO,EAAE,UAAU,EAAE,wBAAwB;AAE7C,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,2BAAuB;AAEvD,MAAM,CAAC,MAAM,qBAAqB,GAAG,KAAK,CAAC;IACzC,MAAM,CAAC;QACL;;;;;;WAMG;QACH,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC;QAEtB;;;;;;WAMG;QACH,QAAQ,EAAE,aAAa,CACrB,MAAM,CAAC;YACL,OAAO,EAAE,aAAa,CAAC,MAAM,EAAE,CAAC;YAChC,GAAG,EAAE,aAAa,CAAC,MAAM,EAAE,CAAC;SAC7B,CAAC,CACH;KACF,CAAC;IACF,MAAM,CAAC;QACL;;;;;;WAMG;QACH,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC;QAEvB;;WAEG;QACH,MAAM,EAAE,UAAU;KACnB,CAAC;CACH,CAAC,CAAC","sourcesContent":["import type { Infer } from '@metamask/superstruct';\nimport { literal, string, union } from '@metamask/superstruct';\nimport { JsonStruct } from '@metamask/utils';\n\nimport { exactOptional, object } from '../superstruct';\n\nexport const KeyringResponseStruct = union([\n object({\n /**\n * Pending flag.\n *\n * Setting the pending flag to true indicates that the request will be\n * handled asynchronously. The keyring must be called with `approveRequest`\n * or `rejectRequest` to resolve the request.\n */\n pending: literal(true),\n\n /**\n * Redirect URL.\n *\n * If present in the response, MetaMask will display a confirmation dialog\n * with a link to the redirect URL. The user can choose to follow the link\n * or cancel the request.\n */\n redirect: exactOptional(\n object({\n message: exactOptional(string()),\n url: exactOptional(string()),\n }),\n ),\n }),\n object({\n /**\n * Pending flag.\n *\n * Setting the pending flag to false indicates that the request will be\n * handled synchronously. The keyring must return the result of the\n * request execution.\n */\n pending: literal(false),\n\n /**\n * Request result.\n */\n result: JsonStruct,\n }),\n]);\n\n/**\n * Response to a call to `submitRequest`.\n *\n * Keyring implementations must return a response with `pending: true` if the\n * request will be handled asynchronously. Otherwise, the response must contain\n * the result of the request and `pending: false`.\n *\n * In the asynchronous case, the keyring can return a redirect URL and message\n * to be shown to the user. The user can choose to follow the link or cancel\n * the request. The main use case for this is to redirect the user to the snap\n * dapp to review the request.\n */\nexport type KeyringResponse = Infer<typeof KeyringResponseStruct>;\n"]}
|
@@ -14,5 +14,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
15
15
|
};
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
17
|
-
__exportStar(require("./types"), exports);
|
18
|
-
//# sourceMappingURL=index.
|
17
|
+
__exportStar(require("./types.cjs"), exports);
|
18
|
+
//# sourceMappingURL=index.cjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../src/btc/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAAwB","sourcesContent":["export * from './types';\n"]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../src/btc/index.ts"],"names":[],"mappings":"AAAA,4BAAwB"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/btc/index.ts"],"names":[],"mappings":"AAAA,4BAAwB"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/btc/index.ts"],"names":[],"mappings":"AAAA,4BAAwB","sourcesContent":["export * from './types';\n"]}
|
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.BtcP2wpkhAccountStruct = exports.BtcMethod = exports.BtcP2wpkhAddressStruct = void 0;
|
4
4
|
const superstruct_1 = require("@metamask/superstruct");
|
5
5
|
const bech32_1 = require("bech32");
|
6
|
-
const api_1 = require("../api");
|
7
|
-
const superstruct_2 = require("../superstruct");
|
6
|
+
const api_1 = require("../api/index.cjs");
|
7
|
+
const superstruct_2 = require("../superstruct.cjs");
|
8
8
|
exports.BtcP2wpkhAddressStruct = (0, superstruct_1.refine)((0, superstruct_1.string)(), 'BtcP2wpkhAddressStruct', (address) => {
|
9
9
|
try {
|
10
10
|
bech32_1.bech32.decode(address);
|
@@ -37,4 +37,4 @@ exports.BtcP2wpkhAccountStruct = (0, superstruct_2.object)({
|
|
37
37
|
*/
|
38
38
|
methods: (0, superstruct_1.array)((0, superstruct_1.enums)([`${BtcMethod.SendBitcoin}`])),
|
39
39
|
});
|
40
|
-
//# sourceMappingURL=types.
|
40
|
+
//# sourceMappingURL=types.cjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"types.cjs","sourceRoot":"","sources":["../../src/btc/types.ts"],"names":[],"mappings":";;;AACA,uDAA8E;AAC9E,mCAAgC;AAEhC,0CAA8D;AAC9D,oDAAwC;AAE3B,QAAA,sBAAsB,GAAG,IAAA,oBAAM,EAC1C,IAAA,oBAAM,GAAE,EACR,wBAAwB,EACxB,CAAC,OAAe,EAAE,EAAE;IAClB,IAAI,CAAC;QACH,eAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACzB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,IAAI,KAAK,CACd,oCAAqC,KAAe,CAAC,OAAO,EAAE,CAC/D,CAAC;IACJ,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC,CACF,CAAC;AAEF;;GAEG;AACH,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,8BAA8B;IAC9B,wCAA2B,CAAA;AAC7B,CAAC,EAHW,SAAS,yBAAT,SAAS,QAGpB;AAEY,QAAA,sBAAsB,GAAG,IAAA,oBAAM,EAAC;IAC3C,GAAG,0BAAoB,CAAC,MAAM;IAE9B;;OAEG;IACH,OAAO,EAAE,8BAAsB;IAE/B;;OAEG;IACH,IAAI,EAAE,IAAA,qBAAO,EAAC,GAAG,oBAAc,CAAC,MAAM,EAAE,CAAC;IAEzC;;OAEG;IACH,OAAO,EAAE,IAAA,mBAAK,EAAC,IAAA,mBAAK,EAAC,CAAC,GAAG,SAAS,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;CACpD,CAAC,CAAC","sourcesContent":["import type { Infer } from '@metamask/superstruct';\nimport { string, array, enums, refine, literal } from '@metamask/superstruct';\nimport { bech32 } from 'bech32';\n\nimport { KeyringAccountStruct, BtcAccountType } from '../api';\nimport { object } from '../superstruct';\n\nexport const BtcP2wpkhAddressStruct = refine(\n string(),\n 'BtcP2wpkhAddressStruct',\n (address: string) => {\n try {\n bech32.decode(address);\n } catch (error) {\n return new Error(\n `Could not decode P2WPKH address: ${(error as Error).message}`,\n );\n }\n return true;\n },\n);\n\n/**\n * Supported Bitcoin methods.\n */\nexport enum BtcMethod {\n // General transaction methods\n SendBitcoin = 'sendBitcoin',\n}\n\nexport const BtcP2wpkhAccountStruct = object({\n ...KeyringAccountStruct.schema,\n\n /**\n * Account address.\n */\n address: BtcP2wpkhAddressStruct,\n\n /**\n * Account type.\n */\n type: literal(`${BtcAccountType.P2wpkh}`),\n\n /**\n * Account supported methods.\n */\n methods: array(enums([`${BtcMethod.SendBitcoin}`])),\n});\n\nexport type BtcP2wpkhAccount = Infer<typeof BtcP2wpkhAccountStruct>;\n"]}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import type { Infer } from
|
1
|
+
import type { Infer } from "@metamask/superstruct";
|
2
2
|
export declare const BtcP2wpkhAddressStruct: import("@metamask/superstruct").Struct<string, null>;
|
3
3
|
/**
|
4
4
|
* Supported Bitcoin methods.
|
@@ -31,3 +31,4 @@ export declare const BtcP2wpkhAccountStruct: import("@metamask/superstruct").Str
|
|
31
31
|
options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
|
32
32
|
}>;
|
33
33
|
export type BtcP2wpkhAccount = Infer<typeof BtcP2wpkhAccountStruct>;
|
34
|
+
//# sourceMappingURL=types.d.cts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"types.d.cts","sourceRoot":"","sources":["../../src/btc/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAOnD,eAAO,MAAM,sBAAsB,sDAalC,CAAC;AAEF;;GAEG;AACH,oBAAY,SAAS;IAEnB,WAAW,gBAAgB;CAC5B;AAED,eAAO,MAAM,sBAAsB;;;;;;;IAGjC;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;EAEH,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
|
@@ -0,0 +1,34 @@
|
|
1
|
+
import type { Infer } from "@metamask/superstruct";
|
2
|
+
export declare const BtcP2wpkhAddressStruct: import("@metamask/superstruct").Struct<string, null>;
|
3
|
+
/**
|
4
|
+
* Supported Bitcoin methods.
|
5
|
+
*/
|
6
|
+
export declare enum BtcMethod {
|
7
|
+
SendBitcoin = "sendBitcoin"
|
8
|
+
}
|
9
|
+
export declare const BtcP2wpkhAccountStruct: import("@metamask/superstruct").Struct<{
|
10
|
+
type: "bip122:p2wpkh";
|
11
|
+
id: string;
|
12
|
+
address: string;
|
13
|
+
options: Record<string, import("@metamask/utils").Json>;
|
14
|
+
methods: "sendBitcoin"[];
|
15
|
+
}, {
|
16
|
+
/**
|
17
|
+
* Account address.
|
18
|
+
*/
|
19
|
+
address: import("@metamask/superstruct").Struct<string, null>;
|
20
|
+
/**
|
21
|
+
* Account type.
|
22
|
+
*/
|
23
|
+
type: import("@metamask/superstruct").Struct<"bip122:p2wpkh", "bip122:p2wpkh">;
|
24
|
+
/**
|
25
|
+
* Account supported methods.
|
26
|
+
*/
|
27
|
+
methods: import("@metamask/superstruct").Struct<"sendBitcoin"[], import("@metamask/superstruct").Struct<"sendBitcoin", {
|
28
|
+
sendBitcoin: "sendBitcoin";
|
29
|
+
}>>;
|
30
|
+
id: import("@metamask/superstruct").Struct<string, null>;
|
31
|
+
options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
|
32
|
+
}>;
|
33
|
+
export type BtcP2wpkhAccount = Infer<typeof BtcP2wpkhAccountStruct>;
|
34
|
+
//# sourceMappingURL=types.d.mts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"types.d.mts","sourceRoot":"","sources":["../../src/btc/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAOnD,eAAO,MAAM,sBAAsB,sDAalC,CAAC;AAEF;;GAEG;AACH,oBAAY,SAAS;IAEnB,WAAW,gBAAgB;CAC5B;AAED,eAAO,MAAM,sBAAsB;;;;;;;IAGjC;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;EAEH,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
|
@@ -0,0 +1,37 @@
|
|
1
|
+
import { string, array, enums, refine, literal } from "@metamask/superstruct";
|
2
|
+
import { bech32 } from "bech32";
|
3
|
+
import { KeyringAccountStruct, BtcAccountType } from "../api/index.mjs";
|
4
|
+
import { object } from "../superstruct.mjs";
|
5
|
+
export const BtcP2wpkhAddressStruct = refine(string(), 'BtcP2wpkhAddressStruct', (address) => {
|
6
|
+
try {
|
7
|
+
bech32.decode(address);
|
8
|
+
}
|
9
|
+
catch (error) {
|
10
|
+
return new Error(`Could not decode P2WPKH address: ${error.message}`);
|
11
|
+
}
|
12
|
+
return true;
|
13
|
+
});
|
14
|
+
/**
|
15
|
+
* Supported Bitcoin methods.
|
16
|
+
*/
|
17
|
+
export var BtcMethod;
|
18
|
+
(function (BtcMethod) {
|
19
|
+
// General transaction methods
|
20
|
+
BtcMethod["SendBitcoin"] = "sendBitcoin";
|
21
|
+
})(BtcMethod || (BtcMethod = {}));
|
22
|
+
export const BtcP2wpkhAccountStruct = object({
|
23
|
+
...KeyringAccountStruct.schema,
|
24
|
+
/**
|
25
|
+
* Account address.
|
26
|
+
*/
|
27
|
+
address: BtcP2wpkhAddressStruct,
|
28
|
+
/**
|
29
|
+
* Account type.
|
30
|
+
*/
|
31
|
+
type: literal(`${BtcAccountType.P2wpkh}`),
|
32
|
+
/**
|
33
|
+
* Account supported methods.
|
34
|
+
*/
|
35
|
+
methods: array(enums([`${BtcMethod.SendBitcoin}`])),
|
36
|
+
});
|
37
|
+
//# sourceMappingURL=types.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"types.mjs","sourceRoot":"","sources":["../../src/btc/types.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,8BAA8B;AAC9E,OAAO,EAAE,MAAM,EAAE,eAAe;AAEhC,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,yBAAe;AAC9D,OAAO,EAAE,MAAM,EAAE,2BAAuB;AAExC,MAAM,CAAC,MAAM,sBAAsB,GAAG,MAAM,CAC1C,MAAM,EAAE,EACR,wBAAwB,EACxB,CAAC,OAAe,EAAE,EAAE;IAClB,IAAI,CAAC;QACH,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACzB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,IAAI,KAAK,CACd,oCAAqC,KAAe,CAAC,OAAO,EAAE,CAC/D,CAAC;IACJ,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC,CACF,CAAC;AAEF;;GAEG;AACH,MAAM,CAAN,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,8BAA8B;IAC9B,wCAA2B,CAAA;AAC7B,CAAC,EAHW,SAAS,KAAT,SAAS,QAGpB;AAED,MAAM,CAAC,MAAM,sBAAsB,GAAG,MAAM,CAAC;IAC3C,GAAG,oBAAoB,CAAC,MAAM;IAE9B;;OAEG;IACH,OAAO,EAAE,sBAAsB;IAE/B;;OAEG;IACH,IAAI,EAAE,OAAO,CAAC,GAAG,cAAc,CAAC,MAAM,EAAE,CAAC;IAEzC;;OAEG;IACH,OAAO,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,GAAG,SAAS,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;CACpD,CAAC,CAAC","sourcesContent":["import type { Infer } from '@metamask/superstruct';\nimport { string, array, enums, refine, literal } from '@metamask/superstruct';\nimport { bech32 } from 'bech32';\n\nimport { KeyringAccountStruct, BtcAccountType } from '../api';\nimport { object } from '../superstruct';\n\nexport const BtcP2wpkhAddressStruct = refine(\n string(),\n 'BtcP2wpkhAddressStruct',\n (address: string) => {\n try {\n bech32.decode(address);\n } catch (error) {\n return new Error(\n `Could not decode P2WPKH address: ${(error as Error).message}`,\n );\n }\n return true;\n },\n);\n\n/**\n * Supported Bitcoin methods.\n */\nexport enum BtcMethod {\n // General transaction methods\n SendBitcoin = 'sendBitcoin',\n}\n\nexport const BtcP2wpkhAccountStruct = object({\n ...KeyringAccountStruct.schema,\n\n /**\n * Account address.\n */\n address: BtcP2wpkhAddressStruct,\n\n /**\n * Account type.\n */\n type: literal(`${BtcAccountType.P2wpkh}`),\n\n /**\n * Account supported methods.\n */\n methods: array(enums([`${BtcMethod.SendBitcoin}`])),\n});\n\nexport type BtcP2wpkhAccount = Infer<typeof BtcP2wpkhAccountStruct>;\n"]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"contexts.cjs","sourceRoot":"","sources":["../src/contexts.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Context used by a Keyring implementation.\n */\nexport type KeyringExecutionContext = {\n /** The chain ID. */\n chainId: string;\n};\n"]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"contexts.d.cts","sourceRoot":"","sources":["../src/contexts.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG;IACpC,oBAAoB;IACpB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"contexts.d.mts","sourceRoot":"","sources":["../src/contexts.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG;IACpC,oBAAoB;IACpB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"contexts.mjs","sourceRoot":"","sources":["../src/contexts.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Context used by a Keyring implementation.\n */\nexport type KeyringExecutionContext = {\n /** The chain ID. */\n chainId: string;\n};\n"]}
|
@@ -14,5 +14,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
15
15
|
};
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
17
|
-
__exportStar(require("./types"), exports);
|
18
|
-
//# sourceMappingURL=index.
|
17
|
+
__exportStar(require("./types.cjs"), exports);
|
18
|
+
//# sourceMappingURL=index.cjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/eth/erc4337/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAAwB","sourcesContent":["export * from './types';\n"]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/eth/erc4337/index.ts"],"names":[],"mappings":"AAAA,4BAAwB"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/eth/erc4337/index.ts"],"names":[],"mappings":"AAAA,4BAAwB"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/eth/erc4337/index.ts"],"names":[],"mappings":"AAAA,4BAAwB","sourcesContent":["export * from './types';\n"]}
|
@@ -1,9 +1,9 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.EthUserOperationPatchStruct = exports.EthBaseUserOperationStruct = exports.EthBaseTransactionStruct = exports.EthUserOperationStruct = void 0;
|
4
|
-
const superstruct_1 = require("../../superstruct");
|
5
|
-
const utils_1 = require("../../utils");
|
6
|
-
const types_1 = require("../types");
|
4
|
+
const superstruct_1 = require("../../superstruct.cjs");
|
5
|
+
const utils_1 = require("../../utils/index.cjs");
|
6
|
+
const types_1 = require("../types.cjs");
|
7
7
|
/**
|
8
8
|
* Struct of a UserOperation as defined by ERC-4337.
|
9
9
|
*
|
@@ -59,4 +59,4 @@ exports.EthUserOperationPatchStruct = (0, superstruct_1.object)({
|
|
59
59
|
verificationGasLimit: (0, superstruct_1.exactOptional)(types_1.EthUint256Struct),
|
60
60
|
preVerificationGas: (0, superstruct_1.exactOptional)(types_1.EthUint256Struct),
|
61
61
|
});
|
62
|
-
//# sourceMappingURL=types.
|
62
|
+
//# sourceMappingURL=types.cjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"types.cjs","sourceRoot":"","sources":["../../../src/eth/erc4337/types.ts"],"names":[],"mappings":";;;AAEA,uDAA0D;AAC1D,iDAAwC;AACxC,wCAA8E;AAE9E;;;;GAIG;AACU,QAAA,sBAAsB,GAAG,IAAA,oBAAM,EAAC;IAC3C,MAAM,EAAE,wBAAgB;IACxB,KAAK,EAAE,wBAAgB;IACvB,QAAQ,EAAE,sBAAc;IACxB,QAAQ,EAAE,sBAAc;IACxB,YAAY,EAAE,wBAAgB;IAC9B,oBAAoB,EAAE,wBAAgB;IACtC,kBAAkB,EAAE,wBAAgB;IACpC,YAAY,EAAE,wBAAgB;IAC9B,oBAAoB,EAAE,wBAAgB;IACtC,gBAAgB,EAAE,sBAAc;IAChC,SAAS,EAAE,sBAAc;CAC1B,CAAC,CAAC;AAIH;;;GAGG;AACU,QAAA,wBAAwB,GAAG,IAAA,oBAAM,EAAC;IAC7C;;OAEG;IACH,EAAE,EAAE,wBAAgB;IAEpB;;OAEG;IACH,KAAK,EAAE,wBAAgB;IAEvB;;OAEG;IACH,IAAI,EAAE,sBAAc;CACrB,CAAC,CAAC;AAIU,QAAA,0BAA0B,GAAG,IAAA,oBAAM,EAAC;IAC/C,KAAK,EAAE,wBAAgB;IACvB,QAAQ,EAAE,sBAAc;IACxB,QAAQ,EAAE,sBAAc;IACxB,SAAS,EAAE,IAAA,2BAAa,EACtB,IAAA,oBAAM,EAAC;QACL,YAAY,EAAE,wBAAgB;QAC9B,oBAAoB,EAAE,wBAAgB;QACtC,kBAAkB,EAAE,wBAAgB;KACrC,CAAC,CACH;IACD,qBAAqB,EAAE,sBAAc;IACrC,cAAc,EAAE,sBAAc;IAC9B,UAAU,EAAE,iBAAS;CACtB,CAAC,CAAC;AAIU,QAAA,2BAA2B,GAAG,IAAA,oBAAM,EAAC;IAChD,gBAAgB,EAAE,sBAAc;IAChC,YAAY,EAAE,IAAA,2BAAa,EAAC,wBAAgB,CAAC;IAC7C,oBAAoB,EAAE,IAAA,2BAAa,EAAC,wBAAgB,CAAC;IACrD,kBAAkB,EAAE,IAAA,2BAAa,EAAC,wBAAgB,CAAC;CACpD,CAAC,CAAC","sourcesContent":["import { type Infer } from '@metamask/superstruct';\n\nimport { exactOptional, object } from '../../superstruct';\nimport { UrlStruct } from '../../utils';\nimport { EthAddressStruct, EthBytesStruct, EthUint256Struct } from '../types';\n\n/**\n * Struct of a UserOperation as defined by ERC-4337.\n *\n * @see https://eips.ethereum.org/EIPS/eip-4337#definitions\n */\nexport const EthUserOperationStruct = object({\n sender: EthAddressStruct,\n nonce: EthUint256Struct,\n initCode: EthBytesStruct,\n callData: EthBytesStruct,\n callGasLimit: EthUint256Struct,\n verificationGasLimit: EthUint256Struct,\n preVerificationGas: EthUint256Struct,\n maxFeePerGas: EthUint256Struct,\n maxPriorityFeePerGas: EthUint256Struct,\n paymasterAndData: EthBytesStruct,\n signature: EthBytesStruct,\n});\n\nexport type EthUserOperation = Infer<typeof EthUserOperationStruct>;\n\n/**\n * Struct containing the most basic transaction information required to\n * construct a UserOperation.\n */\nexport const EthBaseTransactionStruct = object({\n /**\n * Address of the transaction recipient.\n */\n to: EthAddressStruct,\n\n /**\n * Amount of wei to transfer to the recipient.\n */\n value: EthUint256Struct,\n\n /**\n * Data to pass to the recipient.\n */\n data: EthBytesStruct,\n});\n\nexport type EthBaseTransaction = Infer<typeof EthBaseTransactionStruct>;\n\nexport const EthBaseUserOperationStruct = object({\n nonce: EthUint256Struct,\n initCode: EthBytesStruct,\n callData: EthBytesStruct,\n gasLimits: exactOptional(\n object({\n callGasLimit: EthUint256Struct,\n verificationGasLimit: EthUint256Struct,\n preVerificationGas: EthUint256Struct,\n }),\n ),\n dummyPaymasterAndData: EthBytesStruct,\n dummySignature: EthBytesStruct,\n bundlerUrl: UrlStruct,\n});\n\nexport type EthBaseUserOperation = Infer<typeof EthBaseUserOperationStruct>;\n\nexport const EthUserOperationPatchStruct = object({\n paymasterAndData: EthBytesStruct,\n callGasLimit: exactOptional(EthUint256Struct),\n verificationGasLimit: exactOptional(EthUint256Struct),\n preVerificationGas: exactOptional(EthUint256Struct),\n});\n\nexport type EthUserOperationPatch = Infer<typeof EthUserOperationPatchStruct>;\n"]}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { type Infer } from
|
1
|
+
import { type Infer } from "@metamask/superstruct";
|
2
2
|
/**
|
3
3
|
* Struct of a UserOperation as defined by ERC-4337.
|
4
4
|
*
|
@@ -69,7 +69,7 @@ export declare const EthBaseUserOperationStruct: import("@metamask/superstruct")
|
|
69
69
|
nonce: import("@metamask/superstruct").Struct<string, null>;
|
70
70
|
initCode: import("@metamask/superstruct").Struct<string, null>;
|
71
71
|
callData: import("@metamask/superstruct").Struct<string, null>;
|
72
|
-
gasLimits: import("@metamask/superstruct").Struct<import("../../superstruct").ExactOptionalTag | {
|
72
|
+
gasLimits: import("@metamask/superstruct").Struct<import("../../superstruct.cjs").ExactOptionalTag | {
|
73
73
|
callGasLimit: string;
|
74
74
|
verificationGasLimit: string;
|
75
75
|
preVerificationGas: string;
|
@@ -90,8 +90,9 @@ export declare const EthUserOperationPatchStruct: import("@metamask/superstruct"
|
|
90
90
|
preVerificationGas?: string;
|
91
91
|
}, {
|
92
92
|
paymasterAndData: import("@metamask/superstruct").Struct<string, null>;
|
93
|
-
callGasLimit: import("@metamask/superstruct").Struct<string | import("../../superstruct").ExactOptionalTag, null>;
|
94
|
-
verificationGasLimit: import("@metamask/superstruct").Struct<string | import("../../superstruct").ExactOptionalTag, null>;
|
95
|
-
preVerificationGas: import("@metamask/superstruct").Struct<string | import("../../superstruct").ExactOptionalTag, null>;
|
93
|
+
callGasLimit: import("@metamask/superstruct").Struct<string | import("../../superstruct.cjs").ExactOptionalTag, null>;
|
94
|
+
verificationGasLimit: import("@metamask/superstruct").Struct<string | import("../../superstruct.cjs").ExactOptionalTag, null>;
|
95
|
+
preVerificationGas: import("@metamask/superstruct").Struct<string | import("../../superstruct.cjs").ExactOptionalTag, null>;
|
96
96
|
}>;
|
97
97
|
export type EthUserOperationPatch = Infer<typeof EthUserOperationPatchStruct>;
|
98
|
+
//# sourceMappingURL=types.d.cts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"types.d.cts","sourceRoot":"","sources":["../../../src/eth/erc4337/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,KAAK,EAAE,8BAA8B;AAMnD;;;;GAIG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;EAYjC,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEpE;;;GAGG;AACH,eAAO,MAAM,wBAAwB;;;;;IACnC;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;EAEH,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAExE,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAcrC,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE5E,eAAO,MAAM,2BAA2B;;;;;;;;;;EAKtC,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC"}
|