@metamask-previews/keyring-api 9.0.0-f9cd26b → 11.0.0-22cd5fe
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 +24 -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} +7 -3
- package/dist/api/account.cjs.map +1 -0
- package/dist/api/{account.d.ts → account.d.cts} +7 -1
- package/dist/api/account.d.cts.map +1 -0
- package/dist/api/account.d.mts +75 -0
- package/dist/api/account.d.mts.map +1 -0
- package/dist/api/account.mjs +65 -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/btc/constants.cjs +13 -0
- package/dist/btc/constants.cjs.map +1 -0
- package/dist/btc/constants.d.cts +9 -0
- package/dist/btc/constants.d.cts.map +1 -0
- package/dist/btc/constants.d.mts +9 -0
- package/dist/btc/constants.d.mts.map +1 -0
- package/dist/btc/constants.mjs +10 -0
- package/dist/btc/constants.mjs.map +1 -0
- package/dist/{utils/index.js → btc/index.cjs} +3 -3
- package/dist/btc/index.cjs.map +1 -0
- package/dist/btc/index.d.cts +3 -0
- package/dist/btc/index.d.cts.map +1 -0
- package/dist/btc/index.d.mts +3 -0
- package/dist/btc/index.d.mts.map +1 -0
- package/dist/btc/index.mjs +3 -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} +4 -1
- package/dist/btc/types.d.cts.map +1 -0
- package/dist/btc/types.d.mts +36 -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/eth/constants.cjs +12 -0
- package/dist/eth/constants.cjs.map +1 -0
- package/dist/eth/constants.d.cts +8 -0
- package/dist/eth/constants.d.cts.map +1 -0
- package/dist/eth/constants.d.mts +8 -0
- package/dist/eth/constants.d.mts.map +1 -0
- package/dist/eth/constants.mjs +9 -0
- package/dist/eth/constants.mjs.map +1 -0
- package/dist/eth/erc4337/{index.js → 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} +5 -4
- package/dist/eth/index.cjs.map +1 -0
- package/dist/eth/index.d.cts +5 -0
- package/dist/eth/index.d.cts.map +1 -0
- package/dist/eth/index.d.mts +5 -0
- package/dist/eth/index.d.mts.map +1 -0
- package/dist/eth/index.mjs +5 -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} +6 -1
- package/dist/eth/types.d.cts.map +1 -0
- package/dist/eth/types.d.mts +85 -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} +16 -4
- package/dist/internal/api.d.cts.map +1 -0
- package/dist/internal/api.d.mts +431 -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} +11 -2
- package/dist/internal/events.d.cts.map +1 -0
- package/dist/internal/events.d.mts +170 -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} +31 -20
- package/dist/internal/types.d.cts.map +1 -0
- package/dist/internal/types.d.mts +402 -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/sol/constants.cjs +14 -0
- package/dist/sol/constants.cjs.map +1 -0
- package/dist/sol/constants.d.cts +10 -0
- package/dist/sol/constants.d.cts.map +1 -0
- package/dist/sol/constants.d.mts +10 -0
- package/dist/sol/constants.d.mts.map +1 -0
- package/dist/sol/constants.mjs +11 -0
- package/dist/sol/constants.mjs.map +1 -0
- package/dist/{btc/index.js → sol/index.cjs} +3 -2
- package/dist/sol/index.cjs.map +1 -0
- package/dist/sol/index.d.cts +3 -0
- package/dist/sol/index.d.cts.map +1 -0
- package/dist/sol/index.d.mts +3 -0
- package/dist/sol/index.d.mts.map +1 -0
- package/dist/sol/index.mjs +3 -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} +4 -1
- package/dist/sol/types.d.cts.map +1 -0
- package/dist/sol/types.d.mts +41 -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/{sol/index.js → utils/index.cjs} +3 -2
- 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,85 @@
|
|
|
1
|
+
import type { Infer } from "@metamask/superstruct";
|
|
2
|
+
export declare const EthBytesStruct: import("@metamask/superstruct").Struct<string, null>;
|
|
3
|
+
export declare const EthAddressStruct: import("@metamask/superstruct").Struct<string, null>;
|
|
4
|
+
export declare const EthUint256Struct: import("@metamask/superstruct").Struct<string, null>;
|
|
5
|
+
/**
|
|
6
|
+
* Supported Ethereum methods.
|
|
7
|
+
*/
|
|
8
|
+
export declare enum EthMethod {
|
|
9
|
+
PersonalSign = "personal_sign",
|
|
10
|
+
Sign = "eth_sign",
|
|
11
|
+
SignTransaction = "eth_signTransaction",
|
|
12
|
+
SignTypedDataV1 = "eth_signTypedData_v1",
|
|
13
|
+
SignTypedDataV3 = "eth_signTypedData_v3",
|
|
14
|
+
SignTypedDataV4 = "eth_signTypedData_v4",
|
|
15
|
+
PrepareUserOperation = "eth_prepareUserOperation",
|
|
16
|
+
PatchUserOperation = "eth_patchUserOperation",
|
|
17
|
+
SignUserOperation = "eth_signUserOperation"
|
|
18
|
+
}
|
|
19
|
+
export declare const EthEoaAccountStruct: import("@metamask/superstruct").Struct<{
|
|
20
|
+
type: "eip155:eoa";
|
|
21
|
+
id: string;
|
|
22
|
+
address: string;
|
|
23
|
+
scopes: string[];
|
|
24
|
+
options: Record<string, import("@metamask/utils").Json>;
|
|
25
|
+
methods: ("personal_sign" | "eth_sign" | "eth_signTransaction" | "eth_signTypedData_v1" | "eth_signTypedData_v3" | "eth_signTypedData_v4")[];
|
|
26
|
+
}, {
|
|
27
|
+
/**
|
|
28
|
+
* Account address.
|
|
29
|
+
*/
|
|
30
|
+
address: import("@metamask/superstruct").Struct<string, null>;
|
|
31
|
+
/**
|
|
32
|
+
* Account type.
|
|
33
|
+
*/
|
|
34
|
+
type: import("@metamask/superstruct").Struct<"eip155:eoa", "eip155:eoa">;
|
|
35
|
+
/**
|
|
36
|
+
* Account supported methods.
|
|
37
|
+
*/
|
|
38
|
+
methods: import("@metamask/superstruct").Struct<("personal_sign" | "eth_sign" | "eth_signTransaction" | "eth_signTypedData_v1" | "eth_signTypedData_v3" | "eth_signTypedData_v4")[], import("@metamask/superstruct").Struct<"personal_sign" | "eth_sign" | "eth_signTransaction" | "eth_signTypedData_v1" | "eth_signTypedData_v3" | "eth_signTypedData_v4", {
|
|
39
|
+
personal_sign: "personal_sign";
|
|
40
|
+
eth_sign: "eth_sign";
|
|
41
|
+
eth_signTransaction: "eth_signTransaction";
|
|
42
|
+
eth_signTypedData_v1: "eth_signTypedData_v1";
|
|
43
|
+
eth_signTypedData_v3: "eth_signTypedData_v3";
|
|
44
|
+
eth_signTypedData_v4: "eth_signTypedData_v4";
|
|
45
|
+
}>>;
|
|
46
|
+
id: import("@metamask/superstruct").Struct<string, null>;
|
|
47
|
+
scopes: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
|
|
48
|
+
options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
|
|
49
|
+
}>;
|
|
50
|
+
export type EthEoaAccount = Infer<typeof EthEoaAccountStruct>;
|
|
51
|
+
export declare const EthErc4337AccountStruct: import("@metamask/superstruct").Struct<{
|
|
52
|
+
type: "eip155:erc4337";
|
|
53
|
+
id: string;
|
|
54
|
+
address: string;
|
|
55
|
+
scopes: string[];
|
|
56
|
+
options: Record<string, import("@metamask/utils").Json>;
|
|
57
|
+
methods: ("personal_sign" | "eth_sign" | "eth_signTypedData_v1" | "eth_signTypedData_v3" | "eth_signTypedData_v4" | "eth_prepareUserOperation" | "eth_patchUserOperation" | "eth_signUserOperation")[];
|
|
58
|
+
}, {
|
|
59
|
+
/**
|
|
60
|
+
* Account address.
|
|
61
|
+
*/
|
|
62
|
+
address: import("@metamask/superstruct").Struct<string, null>;
|
|
63
|
+
/**
|
|
64
|
+
* Account type.
|
|
65
|
+
*/
|
|
66
|
+
type: import("@metamask/superstruct").Struct<"eip155:erc4337", "eip155:erc4337">;
|
|
67
|
+
/**
|
|
68
|
+
* Account supported methods.
|
|
69
|
+
*/
|
|
70
|
+
methods: import("@metamask/superstruct").Struct<("personal_sign" | "eth_sign" | "eth_signTypedData_v1" | "eth_signTypedData_v3" | "eth_signTypedData_v4" | "eth_prepareUserOperation" | "eth_patchUserOperation" | "eth_signUserOperation")[], import("@metamask/superstruct").Struct<"personal_sign" | "eth_sign" | "eth_signTypedData_v1" | "eth_signTypedData_v3" | "eth_signTypedData_v4" | "eth_prepareUserOperation" | "eth_patchUserOperation" | "eth_signUserOperation", {
|
|
71
|
+
personal_sign: "personal_sign";
|
|
72
|
+
eth_sign: "eth_sign";
|
|
73
|
+
eth_signTypedData_v1: "eth_signTypedData_v1";
|
|
74
|
+
eth_signTypedData_v3: "eth_signTypedData_v3";
|
|
75
|
+
eth_signTypedData_v4: "eth_signTypedData_v4";
|
|
76
|
+
eth_prepareUserOperation: "eth_prepareUserOperation";
|
|
77
|
+
eth_patchUserOperation: "eth_patchUserOperation";
|
|
78
|
+
eth_signUserOperation: "eth_signUserOperation";
|
|
79
|
+
}>>;
|
|
80
|
+
id: import("@metamask/superstruct").Struct<string, null>;
|
|
81
|
+
scopes: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
|
|
82
|
+
options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
|
|
83
|
+
}>;
|
|
84
|
+
export type EthErc4337Account = Infer<typeof EthErc4337AccountStruct>;
|
|
85
|
+
//# sourceMappingURL=types.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.mts","sourceRoot":"","sources":["../../src/eth/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAMnD,eAAO,MAAM,cAAc,sDAA+C,CAAC;AAE3E,eAAO,MAAM,gBAAgB,sDAG5B,CAAC;AAEF,eAAO,MAAM,gBAAgB,sDAG5B,CAAC;AAEF;;GAEG;AACH,oBAAY,SAAS;IAEnB,YAAY,kBAAkB;IAC9B,IAAI,aAAa;IACjB,eAAe,wBAAwB;IACvC,eAAe,yBAAyB;IACxC,eAAe,yBAAyB;IACxC,eAAe,yBAAyB;IAExC,oBAAoB,6BAA6B;IACjD,kBAAkB,2BAA2B;IAC7C,iBAAiB,0BAA0B;CAC5C;AAED,eAAO,MAAM,mBAAmB;;;;;;;;IAG9B;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;;;;;;;EAWH,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAE9D,eAAO,MAAM,uBAAuB;;;;;;;;IAGlC;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;;;;;;;;;EAaH,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { array, enums, literal } from "@metamask/superstruct";
|
|
2
|
+
import { EthAccountType, KeyringAccountStruct } from "../api/index.mjs";
|
|
3
|
+
import { object, definePattern } from "../superstruct.mjs";
|
|
4
|
+
export const EthBytesStruct = definePattern('EthBytes', /^0x[0-9a-f]*$/iu);
|
|
5
|
+
export const EthAddressStruct = definePattern('EthAddress', /^0x[0-9a-f]{40}$/iu);
|
|
6
|
+
export const EthUint256Struct = definePattern('EthUint256', /^0x([1-9a-f][0-9a-f]*|0)$/iu);
|
|
7
|
+
/**
|
|
8
|
+
* Supported Ethereum methods.
|
|
9
|
+
*/
|
|
10
|
+
export var EthMethod;
|
|
11
|
+
(function (EthMethod) {
|
|
12
|
+
// General signing methods
|
|
13
|
+
EthMethod["PersonalSign"] = "personal_sign";
|
|
14
|
+
EthMethod["Sign"] = "eth_sign";
|
|
15
|
+
EthMethod["SignTransaction"] = "eth_signTransaction";
|
|
16
|
+
EthMethod["SignTypedDataV1"] = "eth_signTypedData_v1";
|
|
17
|
+
EthMethod["SignTypedDataV3"] = "eth_signTypedData_v3";
|
|
18
|
+
EthMethod["SignTypedDataV4"] = "eth_signTypedData_v4";
|
|
19
|
+
// ERC-4337 methods
|
|
20
|
+
EthMethod["PrepareUserOperation"] = "eth_prepareUserOperation";
|
|
21
|
+
EthMethod["PatchUserOperation"] = "eth_patchUserOperation";
|
|
22
|
+
EthMethod["SignUserOperation"] = "eth_signUserOperation";
|
|
23
|
+
})(EthMethod || (EthMethod = {}));
|
|
24
|
+
export const EthEoaAccountStruct = object({
|
|
25
|
+
...KeyringAccountStruct.schema,
|
|
26
|
+
/**
|
|
27
|
+
* Account address.
|
|
28
|
+
*/
|
|
29
|
+
address: EthAddressStruct,
|
|
30
|
+
/**
|
|
31
|
+
* Account type.
|
|
32
|
+
*/
|
|
33
|
+
type: literal(`${EthAccountType.Eoa}`),
|
|
34
|
+
/**
|
|
35
|
+
* Account supported methods.
|
|
36
|
+
*/
|
|
37
|
+
methods: array(enums([
|
|
38
|
+
`${EthMethod.PersonalSign}`,
|
|
39
|
+
`${EthMethod.Sign}`,
|
|
40
|
+
`${EthMethod.SignTransaction}`,
|
|
41
|
+
`${EthMethod.SignTypedDataV1}`,
|
|
42
|
+
`${EthMethod.SignTypedDataV3}`,
|
|
43
|
+
`${EthMethod.SignTypedDataV4}`,
|
|
44
|
+
])),
|
|
45
|
+
});
|
|
46
|
+
export const EthErc4337AccountStruct = object({
|
|
47
|
+
...KeyringAccountStruct.schema,
|
|
48
|
+
/**
|
|
49
|
+
* Account address.
|
|
50
|
+
*/
|
|
51
|
+
address: EthAddressStruct,
|
|
52
|
+
/**
|
|
53
|
+
* Account type.
|
|
54
|
+
*/
|
|
55
|
+
type: literal(`${EthAccountType.Erc4337}`),
|
|
56
|
+
/**
|
|
57
|
+
* Account supported methods.
|
|
58
|
+
*/
|
|
59
|
+
methods: array(enums([
|
|
60
|
+
`${EthMethod.PersonalSign}`,
|
|
61
|
+
`${EthMethod.Sign}`,
|
|
62
|
+
`${EthMethod.SignTypedDataV1}`,
|
|
63
|
+
`${EthMethod.SignTypedDataV3}`,
|
|
64
|
+
`${EthMethod.SignTypedDataV4}`,
|
|
65
|
+
`${EthMethod.PrepareUserOperation}`,
|
|
66
|
+
`${EthMethod.PatchUserOperation}`,
|
|
67
|
+
`${EthMethod.SignUserOperation}`,
|
|
68
|
+
])),
|
|
69
|
+
});
|
|
70
|
+
//# sourceMappingURL=types.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.mjs","sourceRoot":"","sources":["../../src/eth/types.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,8BAA8B;AAE9D,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,yBAAe;AAC9D,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,2BAAuB;AAEvD,MAAM,CAAC,MAAM,cAAc,GAAG,aAAa,CAAC,UAAU,EAAE,iBAAiB,CAAC,CAAC;AAE3E,MAAM,CAAC,MAAM,gBAAgB,GAAG,aAAa,CAC3C,YAAY,EACZ,oBAAoB,CACrB,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG,aAAa,CAC3C,Y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E;QAC9B,GAAG,SAAS,CAAC,eAAe,EAAE;QAC9B,GAAG,SAAS,CAAC,eAAe,EAAE;QAC9B,GAAG,SAAS,CAAC,oBAAoB,EAAE;QACnC,GAAG,SAAS,CAAC,kBAAkB,EAAE;QACjC,GAAG,SAAS,CAAC,iBAAiB,EAAE;KACjC,CAAC,CACH;CACF,CAAC,CAAC","sourcesContent":["import type { Infer } from '@metamask/superstruct';\nimport { array, enums, literal } from '@metamask/superstruct';\n\nimport { EthAccountType, KeyringAccountStruct } from '../api';\nimport { object, definePattern } from '../superstruct';\n\nexport const EthBytesStruct = definePattern('EthBytes', /^0x[0-9a-f]*$/iu);\n\nexport const EthAddressStruct = definePattern(\n 'EthAddress',\n /^0x[0-9a-f]{40}$/iu,\n);\n\nexport const EthUint256Struct = definePattern(\n 'EthUint256',\n /^0x([1-9a-f][0-9a-f]*|0)$/iu,\n);\n\n/**\n * Supported Ethereum methods.\n */\nexport enum EthMethod {\n // General signing methods\n PersonalSign = 'personal_sign',\n Sign = 'eth_sign',\n SignTransaction = 'eth_signTransaction',\n SignTypedDataV1 = 'eth_signTypedData_v1',\n SignTypedDataV3 = 'eth_signTypedData_v3',\n SignTypedDataV4 = 'eth_signTypedData_v4',\n // ERC-4337 methods\n PrepareUserOperation = 'eth_prepareUserOperation',\n PatchUserOperation = 'eth_patchUserOperation',\n SignUserOperation = 'eth_signUserOperation',\n}\n\nexport const EthEoaAccountStruct = object({\n ...KeyringAccountStruct.schema,\n\n /**\n * Account address.\n */\n address: EthAddressStruct,\n\n /**\n * Account type.\n */\n type: literal(`${EthAccountType.Eoa}`),\n\n /**\n * Account supported methods.\n */\n methods: array(\n enums([\n `${EthMethod.PersonalSign}`,\n `${EthMethod.Sign}`,\n `${EthMethod.SignTransaction}`,\n `${EthMethod.SignTypedDataV1}`,\n `${EthMethod.SignTypedDataV3}`,\n `${EthMethod.SignTypedDataV4}`,\n ]),\n ),\n});\n\nexport type EthEoaAccount = Infer<typeof EthEoaAccountStruct>;\n\nexport const EthErc4337AccountStruct = object({\n ...KeyringAccountStruct.schema,\n\n /**\n * Account address.\n */\n address: EthAddressStruct,\n\n /**\n * Account type.\n */\n type: literal(`${EthAccountType.Erc4337}`),\n\n /**\n * Account supported methods.\n */\n methods: array(\n enums([\n `${EthMethod.PersonalSign}`,\n `${EthMethod.Sign}`,\n `${EthMethod.SignTypedDataV1}`,\n `${EthMethod.SignTypedDataV3}`,\n `${EthMethod.SignTypedDataV4}`,\n `${EthMethod.PrepareUserOperation}`,\n `${EthMethod.PatchUserOperation}`,\n `${EthMethod.SignUserOperation}`,\n ]),\n ),\n});\n\nexport type EthErc4337Account = Infer<typeof EthErc4337AccountStruct>;\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isEvmAccountType =
|
|
4
|
-
const api_1 = require("../api");
|
|
3
|
+
exports.isEvmAccountType = isEvmAccountType;
|
|
4
|
+
const api_1 = require("../api/index.cjs");
|
|
5
5
|
/**
|
|
6
6
|
* Checks if the given type is an EVM account type.
|
|
7
7
|
*
|
|
@@ -11,5 +11,4 @@ const api_1 = require("../api");
|
|
|
11
11
|
function isEvmAccountType(type) {
|
|
12
12
|
return type === api_1.EthAccountType.Eoa || type === api_1.EthAccountType.Erc4337;
|
|
13
13
|
}
|
|
14
|
-
|
|
15
|
-
//# sourceMappingURL=utils.js.map
|
|
14
|
+
//# sourceMappingURL=utils.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.
|
|
1
|
+
{"version":3,"file":"utils.cjs","sourceRoot":"","sources":["../../src/eth/utils.ts"],"names":[],"mappings":";;AASA,4CAEC;AAVD,0CAAwC;AAExC;;;;;GAKG;AACH,SAAgB,gBAAgB,CAAC,IAAwB;IACvD,OAAO,IAAI,KAAK,oBAAc,CAAC,GAAG,IAAI,IAAI,KAAK,oBAAc,CAAC,OAAO,CAAC;AACxE,CAAC","sourcesContent":["import type { KeyringAccountType } from '../api';\nimport { EthAccountType } from '../api';\n\n/**\n * Checks if the given type is an EVM account type.\n *\n * @param type - The type to check.\n * @returns Returns true if the type is an EVM account type, false otherwise.\n */\nexport function isEvmAccountType(type: KeyringAccountType): boolean {\n return type === EthAccountType.Eoa || type === EthAccountType.Erc4337;\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { KeyringAccountType } from
|
|
1
|
+
import type { KeyringAccountType } from "../api/index.cjs";
|
|
2
2
|
/**
|
|
3
3
|
* Checks if the given type is an EVM account type.
|
|
4
4
|
*
|
|
@@ -6,3 +6,4 @@ import type { KeyringAccountType } from '../api';
|
|
|
6
6
|
* @returns Returns true if the type is an EVM account type, false otherwise.
|
|
7
7
|
*/
|
|
8
8
|
export declare function isEvmAccountType(type: KeyringAccountType): boolean;
|
|
9
|
+
//# sourceMappingURL=utils.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.cts","sourceRoot":"","sources":["../../src/eth/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,yBAAe;AAGjD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAElE"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { KeyringAccountType } from "../api/index.mjs";
|
|
2
|
+
/**
|
|
3
|
+
* Checks if the given type is an EVM account type.
|
|
4
|
+
*
|
|
5
|
+
* @param type - The type to check.
|
|
6
|
+
* @returns Returns true if the type is an EVM account type, false otherwise.
|
|
7
|
+
*/
|
|
8
|
+
export declare function isEvmAccountType(type: KeyringAccountType): boolean;
|
|
9
|
+
//# sourceMappingURL=utils.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.mts","sourceRoot":"","sources":["../../src/eth/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,yBAAe;AAGjD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAElE"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { EthAccountType } from "../api/index.mjs";
|
|
2
|
+
/**
|
|
3
|
+
* Checks if the given type is an EVM account type.
|
|
4
|
+
*
|
|
5
|
+
* @param type - The type to check.
|
|
6
|
+
* @returns Returns true if the type is an EVM account type, false otherwise.
|
|
7
|
+
*/
|
|
8
|
+
export function isEvmAccountType(type) {
|
|
9
|
+
return type === EthAccountType.Eoa || type === EthAccountType.Erc4337;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=utils.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.mjs","sourceRoot":"","sources":["../../src/eth/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,yBAAe;AAExC;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAwB;IACvD,OAAO,IAAI,KAAK,cAAc,CAAC,GAAG,IAAI,IAAI,KAAK,cAAc,CAAC,OAAO,CAAC;AACxE,CAAC","sourcesContent":["import type { KeyringAccountType } from '../api';\nimport { EthAccountType } from '../api';\n\n/**\n * Checks if the given type is an EVM account type.\n *\n * @param type - The type to check.\n * @returns Returns true if the type is an EVM account type, false otherwise.\n */\nexport function isEvmAccountType(type: KeyringAccountType): boolean {\n return type === EthAccountType.Eoa || type === EthAccountType.Erc4337;\n}\n"]}
|
|
@@ -14,4 +14,4 @@ var KeyringEvent;
|
|
|
14
14
|
KeyringEvent["RequestApproved"] = "notify:requestApproved";
|
|
15
15
|
KeyringEvent["RequestRejected"] = "notify:requestRejected";
|
|
16
16
|
})(KeyringEvent || (exports.KeyringEvent = KeyringEvent = {}));
|
|
17
|
-
//# sourceMappingURL=events.
|
|
17
|
+
//# sourceMappingURL=events.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.cjs","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,IAAY,YASX;AATD,WAAY,YAAY;IACtB,iBAAiB;IACjB,wDAAwC,CAAA;IACxC,wDAAwC,CAAA;IACxC,wDAAwC,CAAA;IAExC,iBAAiB;IACjB,0DAA0C,CAAA;IAC1C,0DAA0C,CAAA;AAC5C,CAAC,EATW,YAAY,4BAAZ,YAAY,QASvB","sourcesContent":["/**\n * Supported keyring events.\n */\nexport enum KeyringEvent {\n // Account events\n AccountCreated = 'notify:accountCreated',\n AccountUpdated = 'notify:accountUpdated',\n AccountDeleted = 'notify:accountDeleted',\n\n // Request events\n RequestApproved = 'notify:requestApproved',\n RequestRejected = 'notify:requestRejected',\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.d.cts","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,oBAAY,YAAY;IAEtB,cAAc,0BAA0B;IACxC,cAAc,0BAA0B;IACxC,cAAc,0BAA0B;IAGxC,eAAe,2BAA2B;IAC1C,eAAe,2BAA2B;CAC3C"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Supported keyring events.
|
|
3
|
+
*/
|
|
4
|
+
export declare enum KeyringEvent {
|
|
5
|
+
AccountCreated = "notify:accountCreated",
|
|
6
|
+
AccountUpdated = "notify:accountUpdated",
|
|
7
|
+
AccountDeleted = "notify:accountDeleted",
|
|
8
|
+
RequestApproved = "notify:requestApproved",
|
|
9
|
+
RequestRejected = "notify:requestRejected"
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=events.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.d.mts","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,oBAAY,YAAY;IAEtB,cAAc,0BAA0B;IACxC,cAAc,0BAA0B;IACxC,cAAc,0BAA0B;IAGxC,eAAe,2BAA2B;IAC1C,eAAe,2BAA2B;CAC3C"}
|
package/dist/events.mjs
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Supported keyring events.
|
|
3
|
+
*/
|
|
4
|
+
export var KeyringEvent;
|
|
5
|
+
(function (KeyringEvent) {
|
|
6
|
+
// Account events
|
|
7
|
+
KeyringEvent["AccountCreated"] = "notify:accountCreated";
|
|
8
|
+
KeyringEvent["AccountUpdated"] = "notify:accountUpdated";
|
|
9
|
+
KeyringEvent["AccountDeleted"] = "notify:accountDeleted";
|
|
10
|
+
// Request events
|
|
11
|
+
KeyringEvent["RequestApproved"] = "notify:requestApproved";
|
|
12
|
+
KeyringEvent["RequestRejected"] = "notify:requestRejected";
|
|
13
|
+
})(KeyringEvent || (KeyringEvent = {}));
|
|
14
|
+
//# sourceMappingURL=events.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.mjs","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAN,IAAY,YASX;AATD,WAAY,YAAY;IACtB,iBAAiB;IACjB,wDAAwC,CAAA;IACxC,wDAAwC,CAAA;IACxC,wDAAwC,CAAA;IAExC,iBAAiB;IACjB,0DAA0C,CAAA;IAC1C,0DAA0C,CAAA;AAC5C,CAAC,EATW,YAAY,KAAZ,YAAY,QASvB","sourcesContent":["/**\n * Supported keyring events.\n */\nexport enum KeyringEvent {\n // Account events\n AccountCreated = 'notify:accountCreated',\n AccountUpdated = 'notify:accountUpdated',\n AccountDeleted = 'notify:accountDeleted',\n\n // Request events\n RequestApproved = 'notify:requestApproved',\n RequestRejected = 'notify:requestRejected',\n}\n"]}
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./api/index.cjs"), exports);
|
|
18
|
+
__exportStar(require("./btc/index.cjs"), exports);
|
|
19
|
+
__exportStar(require("./eth/index.cjs"), exports);
|
|
20
|
+
__exportStar(require("./sol/index.cjs"), exports);
|
|
21
|
+
__exportStar(require("./events.cjs"), exports);
|
|
22
|
+
__exportStar(require("./internal/index.cjs"), exports);
|
|
23
|
+
__exportStar(require("./JsonRpcRequest.cjs"), exports);
|
|
24
|
+
__exportStar(require("./KeyringClient.cjs"), exports);
|
|
25
|
+
__exportStar(require("./KeyringSnapRpcClient.cjs"), exports);
|
|
26
|
+
__exportStar(require("./rpc-handler.cjs"), exports);
|
|
27
|
+
__exportStar(require("./snap-utils.cjs"), exports);
|
|
28
|
+
__exportStar(require("./superstruct.cjs"), exports);
|
|
29
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAAsB;AACtB,kDAAsB;AAEtB,kDAAsB;AACtB,kDAAsB;AACtB,+CAAyB;AACzB,uDAA2B;AAC3B,uDAAiC;AACjC,sDAAgC;AAChC,6DAAuC;AACvC,oDAA8B;AAC9B,mDAA6B;AAC7B,oDAA8B","sourcesContent":["export * from './api';\nexport * from './btc';\nexport type * from './contexts';\nexport * from './eth';\nexport * from './sol';\nexport * from './events';\nexport * from './internal';\nexport * from './JsonRpcRequest';\nexport * from './KeyringClient';\nexport * from './KeyringSnapRpcClient';\nexport * from './rpc-handler';\nexport * from './snap-utils';\nexport * from './superstruct';\n"]}
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export * from "./api/index.cjs";
|
|
2
|
+
export * from "./btc/index.cjs";
|
|
3
|
+
export type * from "./contexts.cjs";
|
|
4
|
+
export * from "./eth/index.cjs";
|
|
5
|
+
export * from "./sol/index.cjs";
|
|
6
|
+
export * from "./events.cjs";
|
|
7
|
+
export * from "./internal/index.cjs";
|
|
8
|
+
export * from "./JsonRpcRequest.cjs";
|
|
9
|
+
export * from "./KeyringClient.cjs";
|
|
10
|
+
export * from "./KeyringSnapRpcClient.cjs";
|
|
11
|
+
export * from "./rpc-handler.cjs";
|
|
12
|
+
export * from "./snap-utils.cjs";
|
|
13
|
+
export * from "./superstruct.cjs";
|
|
14
|
+
//# sourceMappingURL=index.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,gCAAsB;AACtB,gCAAsB;AACtB,oCAAgC;AAChC,gCAAsB;AACtB,gCAAsB;AACtB,6BAAyB;AACzB,qCAA2B;AAC3B,qCAAiC;AACjC,oCAAgC;AAChC,2CAAuC;AACvC,kCAA8B;AAC9B,iCAA6B;AAC7B,kCAA8B"}
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export * from "./api/index.mjs";
|
|
2
|
+
export * from "./btc/index.mjs";
|
|
3
|
+
export type * from "./contexts.mjs";
|
|
4
|
+
export * from "./eth/index.mjs";
|
|
5
|
+
export * from "./sol/index.mjs";
|
|
6
|
+
export * from "./events.mjs";
|
|
7
|
+
export * from "./internal/index.mjs";
|
|
8
|
+
export * from "./JsonRpcRequest.mjs";
|
|
9
|
+
export * from "./KeyringClient.mjs";
|
|
10
|
+
export * from "./KeyringSnapRpcClient.mjs";
|
|
11
|
+
export * from "./rpc-handler.mjs";
|
|
12
|
+
export * from "./snap-utils.mjs";
|
|
13
|
+
export * from "./superstruct.mjs";
|
|
14
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,gCAAsB;AACtB,gCAAsB;AACtB,oCAAgC;AAChC,gCAAsB;AACtB,gCAAsB;AACtB,6BAAyB;AACzB,qCAA2B;AAC3B,qCAAiC;AACjC,oCAAgC;AAChC,2CAAuC;AACvC,kCAA8B;AAC9B,iCAA6B;AAC7B,kCAA8B"}
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export * from "./api/index.mjs";
|
|
2
|
+
export * from "./btc/index.mjs";
|
|
3
|
+
export * from "./eth/index.mjs";
|
|
4
|
+
export * from "./sol/index.mjs";
|
|
5
|
+
export * from "./events.mjs";
|
|
6
|
+
export * from "./internal/index.mjs";
|
|
7
|
+
export * from "./JsonRpcRequest.mjs";
|
|
8
|
+
export * from "./KeyringClient.mjs";
|
|
9
|
+
export * from "./KeyringSnapRpcClient.mjs";
|
|
10
|
+
export * from "./rpc-handler.mjs";
|
|
11
|
+
export * from "./snap-utils.mjs";
|
|
12
|
+
export * from "./superstruct.mjs";
|
|
13
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,gCAAsB;AACtB,gCAAsB;AAEtB,gCAAsB;AACtB,gCAAsB;AACtB,6BAAyB;AACzB,qCAA2B;AAC3B,qCAAiC;AACjC,oCAAgC;AAChC,2CAAuC;AACvC,kCAA8B;AAC9B,iCAA6B;AAC7B,kCAA8B","sourcesContent":["export * from './api';\nexport * from './btc';\nexport type * from './contexts';\nexport * from './eth';\nexport * from './sol';\nexport * from './events';\nexport * from './internal';\nexport * from './JsonRpcRequest';\nexport * from './KeyringClient';\nexport * from './KeyringSnapRpcClient';\nexport * from './rpc-handler';\nexport * from './snap-utils';\nexport * from './superstruct';\n"]}
|
|
@@ -3,10 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.RejectRequestResponseStruct = exports.RejectRequestRequestStruct = exports.ApproveRequestResponseStruct = exports.ApproveRequestRequestStruct = exports.SubmitRequestResponseStruct = exports.SubmitRequestRequestStruct = exports.GetRequestResponseStruct = exports.GetRequestRequestStruct = exports.ListRequestsResponseStruct = exports.ListRequestsRequestStruct = exports.ExportAccountResponseStruct = exports.ExportAccountRequestStruct = exports.DeleteAccountResponseStruct = exports.DeleteAccountRequestStruct = exports.UpdateAccountResponseStruct = exports.UpdateAccountRequestStruct = exports.FilterAccountChainsResponseStruct = exports.FilterAccountChainsStruct = exports.GetAccountBalancesResponseStruct = exports.GetAccountBalancesRequestStruct = exports.CreateAccountResponseStruct = exports.CreateAccountRequestStruct = exports.GetAccountResponseStruct = exports.GetAccountRequestStruct = exports.ListAccountsResponseStruct = exports.ListAccountsRequestStruct = void 0;
|
|
4
4
|
const superstruct_1 = require("@metamask/superstruct");
|
|
5
5
|
const utils_1 = require("@metamask/utils");
|
|
6
|
-
const rpc_1 = require("./rpc");
|
|
7
|
-
const api_1 = require("../api");
|
|
8
|
-
const superstruct_2 = require("../superstruct");
|
|
9
|
-
const utils_2 = require("../utils");
|
|
6
|
+
const rpc_1 = require("./rpc.cjs");
|
|
7
|
+
const api_1 = require("../api/index.cjs");
|
|
8
|
+
const superstruct_2 = require("../superstruct.cjs");
|
|
9
|
+
const utils_2 = require("../utils/index.cjs");
|
|
10
10
|
const CommonHeader = {
|
|
11
11
|
jsonrpc: (0, superstruct_1.literal)('2.0'),
|
|
12
12
|
id: (0, superstruct_1.union)([(0, superstruct_1.string)(), (0, superstruct_1.number)(), (0, superstruct_1.literal)(null)]),
|
|
@@ -136,4 +136,4 @@ exports.RejectRequestRequestStruct = (0, superstruct_2.object)({
|
|
|
136
136
|
}),
|
|
137
137
|
});
|
|
138
138
|
exports.RejectRequestResponseStruct = (0, superstruct_1.literal)(null);
|
|
139
|
-
//# sourceMappingURL=api.
|
|
139
|
+
//# sourceMappingURL=api.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.cjs","sourceRoot":"","sources":["../../src/internal/api.ts"],"names":[],"mappings":";;;AACA,uDAO+B;AAC/B,2CAA6C;AAE7C,mCAAyC;AACzC,0CAOgB;AAChB,oDAAwC;AACxC,8CAAsC;AAEtC,MAAM,YAAY,GAAG;IACnB,OAAO,EAAE,IAAA,qBAAO,EAAC,KAAK,CAAC;IACvB,EAAE,EAAE,IAAA,mBAAK,EAAC,CAAC,IAAA,oBAAM,GAAE,EAAE,IAAA,oBAAM,GAAE,EAAE,IAAA,qBAAO,EAAC,IAAI,CAAC,CAAC,CAAC;CAC/C,CAAC;AAEF,+EAA+E;AAC/E,gBAAgB;AAEH,QAAA,yBAAyB,GAAG,IAAA,oBAAM,EAAC;IAC9C,GAAG,YAAY;IACf,MAAM,EAAE,IAAA,qBAAO,EAAC,sBAAsB,CAAC;CACxC,CAAC,CAAC;AAIU,QAAA,0BAA0B,GAAG,IAAA,mBAAK,EAAC,0BAAoB,CAAC,CAAC;AAItE,+EAA+E;AAC/E,cAAc;AAED,QAAA,uBAAuB,GAAG,IAAA,oBAAM,EAAC;IAC5C,GAAG,YAAY;IACf,MAAM,EAAE,IAAA,qBAAO,EAAC,oBAAoB,CAAC;IACrC,MAAM,EAAE,IAAA,oBAAM,EAAC;QACb,EAAE,E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EAAC;QACb,EAAE,EAAE,kBAAU;KACf,CAAC;CACH,CAAC,CAAC;AAIU,QAAA,wBAAwB,GAAG,0BAAoB,CAAC;AAI7D,+EAA+E;AAC/E,iBAAiB;AAEJ,QAAA,0BAA0B,GAAG,IAAA,oBAAM,EAAC;IAC/C,GAAG,YAAY;IACf,MAAM,EAAE,IAAA,qBAAO,EAAC,uBAAuB,CAAC;IACxC,MAAM,EAAE,0BAAoB;CAC7B,CAAC,CAAC;AAIU,QAAA,2BAA2B,GAAG,2BAAqB,CAAC;AAIjE,+EAA+E;AAC/E,kBAAkB;AAEL,QAAA,2BAA2B,GAAG,IAAA,oBAAM,EAAC;IAChD,GAAG,YAAY;IACf,MAAM,EAAE,IAAA,qBAAO,EAAC,wBAAwB,CAAC;IACzC,MAAM,EAAE,IAAA,oBAAM,EAAC;QACb,EAAE,EAAE,kBAAU;QACd,IAAI,EAAE,IAAA,oBAAM,EAAC,IAAA,oBAAM,GAAE,EAAE,kBAAU,CAAC;KACnC,CAAC;CACH,CAAC,CAAC;AAIU,QAAA,4BAA4B,GAAG,IAAA,qBAAO,EAAC,IAAI,CAAC,CAAC;AAI1D,+EAA+E;AAC/E,iBAAiB;AAEJ,QAAA,0BAA0B,GAAG,IAAA,oBAAM,EAAC;IAC/C,GAAG,YAAY;IACf,MAAM,EAAE,IAAA,qBAAO,EAAC,uBAAuB,CAAC;IACxC,MAAM,EAAE,IAAA,oBAAM,EAAC;QACb,EAAE,EAAE,kBAAU;KACf,CAAC;CACH,CAAC,CAAC;AAIU,QAAA,2BAA2B,GAAG,IAAA,qBAAO,EAAC,IAAI,CAAC,CAAC","sourcesContent":["import type { Infer } from '@metamask/superstruct';\nimport {\n array,\n literal,\n number,\n record,\n string,\n union,\n} from '@metamask/superstruct';\nimport { JsonStruct } from '@metamask/utils';\n\nimport { KeyringRpcMethod } from './rpc';\nimport {\n BalanceStruct,\n CaipAssetTypeStruct,\n KeyringAccountDataStruct,\n KeyringAccountStruct,\n KeyringRequestStruct,\n KeyringResponseStruct,\n} from '../api';\nimport { object } from '../superstruct';\nimport { UuidStruct } from '../utils';\n\nconst CommonHeader = {\n jsonrpc: literal('2.0'),\n id: union([string(), number(), literal(null)]),\n};\n\n// ----------------------------------------------------------------------------\n// List accounts\n\nexport const ListAccountsRequestStruct = object({\n ...CommonHeader,\n method: literal('keyring_listAccounts'),\n});\n\nexport type ListAccountsRequest = Infer<typeof ListAccountsRequestStruct>;\n\nexport const ListAccountsResponseStruct = array(KeyringAccountStruct);\n\nexport type ListAccountsResponse = Infer<typeof ListAccountsResponseStruct>;\n\n// ----------------------------------------------------------------------------\n// Get account\n\nexport const GetAccountRequestStruct = object({\n ...CommonHeader,\n method: literal('keyring_getAccount'),\n params: object({\n id: UuidStruct,\n }),\n});\n\nexport type GetAccountRequest = Infer<typeof GetAccountRequestStruct>;\n\nexport const GetAccountResponseStruct = KeyringAccountStruct;\n\nexport type GetAccountResponse = Infer<typeof GetAccountResponseStruct>;\n\n// ----------------------------------------------------------------------------\n// Create account\n\nexport const CreateAccountRequestStruct = object({\n ...CommonHeader,\n method: literal('keyring_createAccount'),\n params: object({\n options: record(string(), JsonStruct),\n }),\n});\n\nexport type CreateAccountRequest = Infer<typeof CreateAccountRequestStruct>;\n\nexport const CreateAccountResponseStruct = KeyringAccountStruct;\n\nexport type CreateAccountResponse = Infer<typeof CreateAccountResponseStruct>;\n\n// ----------------------------------------------------------------------------\n// Get account balances\n\nexport const GetAccountBalancesRequestStruct = object({\n ...CommonHeader,\n method: literal(`${KeyringRpcMethod.GetAccountBalances}`),\n params: object({\n id: UuidStruct,\n assets: array(CaipAssetTypeStruct),\n }),\n});\n\nexport type GetAccountBalancesRequest = Infer<\n typeof GetAccountBalancesRequestStruct\n>;\n\nexport const GetAccountBalancesResponseStruct = record(\n CaipAssetTypeStruct,\n BalanceStruct,\n);\n\nexport type GetAccountBalancesResponse = Infer<\n typeof GetAccountBalancesResponseStruct\n>;\n\n// ----------------------------------------------------------------------------\n// Filter account chains\n\nexport const FilterAccountChainsStruct = object({\n ...CommonHeader,\n method: literal('keyring_filterAccountChains'),\n params: object({\n id: UuidStruct,\n chains: array(string()),\n }),\n});\n\nexport type FilterAccountChainsRequest = Infer<\n typeof FilterAccountChainsStruct\n>;\n\nexport const FilterAccountChainsResponseStruct = array(string());\n\nexport type FilterAccountChainsResponse = Infer<\n typeof FilterAccountChainsResponseStruct\n>;\n\n// ----------------------------------------------------------------------------\n// Update account\n\nexport const UpdateAccountRequestStruct = object({\n ...CommonHeader,\n method: literal('keyring_updateAccount'),\n params: object({\n account: KeyringAccountStruct,\n }),\n});\n\nexport type UpdateAccountRequest = Infer<typeof UpdateAccountRequestStruct>;\n\nexport const UpdateAccountResponseStruct = literal(null);\n\nexport type UpdateAccountResponse = Infer<typeof UpdateAccountResponseStruct>;\n\n// ----------------------------------------------------------------------------\n// Delete account\n\nexport const DeleteAccountRequestStruct = object({\n ...CommonHeader,\n method: literal('keyring_deleteAccount'),\n params: object({\n id: UuidStruct,\n }),\n});\n\nexport type DeleteAccountRequest = Infer<typeof DeleteAccountRequestStruct>;\n\nexport const DeleteAccountResponseStruct = literal(null);\n\nexport type DeleteAccountResponse = Infer<typeof DeleteAccountResponseStruct>;\n\n// ----------------------------------------------------------------------------\n// Export account\n\nexport const ExportAccountRequestStruct = object({\n ...CommonHeader,\n method: literal('keyring_exportAccount'),\n params: object({\n id: UuidStruct,\n }),\n});\n\nexport type ExportAccountRequest = Infer<typeof ExportAccountRequestStruct>;\n\nexport const ExportAccountResponseStruct = KeyringAccountDataStruct;\n\nexport type ExportAccountResponse = Infer<typeof ExportAccountResponseStruct>;\n\n// ----------------------------------------------------------------------------\n// List requests\n\nexport const ListRequestsRequestStruct = object({\n ...CommonHeader,\n method: literal('keyring_listRequests'),\n});\n\nexport type ListRequestsRequest = Infer<typeof ListRequestsRequestStruct>;\n\nexport const ListRequestsResponseStruct = array(KeyringRequestStruct);\n\nexport type ListRequestsResponse = Infer<typeof ListRequestsResponseStruct>;\n\n// ----------------------------------------------------------------------------\n// Get request\n\nexport const GetRequestRequestStruct = object({\n ...CommonHeader,\n method: literal('keyring_getRequest'),\n params: object({\n id: UuidStruct,\n }),\n});\n\nexport type GetRequestRequest = Infer<typeof GetRequestRequestStruct>;\n\nexport const GetRequestResponseStruct = KeyringRequestStruct;\n\nexport type GetRequestResponse = Infer<typeof GetRequestResponseStruct>;\n\n// ----------------------------------------------------------------------------\n// Submit request\n\nexport const SubmitRequestRequestStruct = object({\n ...CommonHeader,\n method: literal('keyring_submitRequest'),\n params: KeyringRequestStruct,\n});\n\nexport type SubmitRequestRequest = Infer<typeof SubmitRequestRequestStruct>;\n\nexport const SubmitRequestResponseStruct = KeyringResponseStruct;\n\nexport type SubmitRequestResponse = Infer<typeof SubmitRequestResponseStruct>;\n\n// ----------------------------------------------------------------------------\n// Approve request\n\nexport const ApproveRequestRequestStruct = object({\n ...CommonHeader,\n method: literal('keyring_approveRequest'),\n params: object({\n id: UuidStruct,\n data: record(string(), JsonStruct),\n }),\n});\n\nexport type ApproveRequestRequest = Infer<typeof ApproveRequestRequestStruct>;\n\nexport const ApproveRequestResponseStruct = literal(null);\n\nexport type ApproveRequestResponse = Infer<typeof ApproveRequestResponseStruct>;\n\n// ----------------------------------------------------------------------------\n// Reject request\n\nexport const RejectRequestRequestStruct = object({\n ...CommonHeader,\n method: literal('keyring_rejectRequest'),\n params: object({\n id: UuidStruct,\n }),\n});\n\nexport type RejectRequestRequest = Infer<typeof RejectRequestRequestStruct>;\n\nexport const RejectRequestResponseStruct = literal(null);\n\nexport type RejectRequestResponse = Infer<typeof RejectRequestResponseStruct>;\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Infer } from
|
|
1
|
+
import type { Infer } from "@metamask/superstruct";
|
|
2
2
|
export declare const ListAccountsRequestStruct: import("@metamask/superstruct").Struct<{
|
|
3
3
|
jsonrpc: "2.0";
|
|
4
4
|
id: string | number | null;
|
|
@@ -13,12 +13,14 @@ export declare const ListAccountsResponseStruct: import("@metamask/superstruct")
|
|
|
13
13
|
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2wpkh" | "solana:data-account";
|
|
14
14
|
id: string;
|
|
15
15
|
address: string;
|
|
16
|
+
scopes: string[];
|
|
16
17
|
options: Record<string, import("@metamask/utils").Json>;
|
|
17
18
|
methods: string[];
|
|
18
19
|
}[], import("@metamask/superstruct").Struct<{
|
|
19
20
|
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2wpkh" | "solana:data-account";
|
|
20
21
|
id: string;
|
|
21
22
|
address: string;
|
|
23
|
+
scopes: string[];
|
|
22
24
|
options: Record<string, import("@metamask/utils").Json>;
|
|
23
25
|
methods: string[];
|
|
24
26
|
}, {
|
|
@@ -30,6 +32,7 @@ export declare const ListAccountsResponseStruct: import("@metamask/superstruct")
|
|
|
30
32
|
"solana:data-account": "solana:data-account";
|
|
31
33
|
}>;
|
|
32
34
|
address: import("@metamask/superstruct").Struct<string, null>;
|
|
35
|
+
scopes: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
|
|
33
36
|
options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
|
|
34
37
|
methods: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
|
|
35
38
|
}>>;
|
|
@@ -56,6 +59,7 @@ export declare const GetAccountResponseStruct: import("@metamask/superstruct").S
|
|
|
56
59
|
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2wpkh" | "solana:data-account";
|
|
57
60
|
id: string;
|
|
58
61
|
address: string;
|
|
62
|
+
scopes: string[];
|
|
59
63
|
options: Record<string, import("@metamask/utils").Json>;
|
|
60
64
|
methods: string[];
|
|
61
65
|
}, {
|
|
@@ -67,6 +71,7 @@ export declare const GetAccountResponseStruct: import("@metamask/superstruct").S
|
|
|
67
71
|
"solana:data-account": "solana:data-account";
|
|
68
72
|
}>;
|
|
69
73
|
address: import("@metamask/superstruct").Struct<string, null>;
|
|
74
|
+
scopes: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
|
|
70
75
|
options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
|
|
71
76
|
methods: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
|
|
72
77
|
}>;
|
|
@@ -93,6 +98,7 @@ export declare const CreateAccountResponseStruct: import("@metamask/superstruct"
|
|
|
93
98
|
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2wpkh" | "solana:data-account";
|
|
94
99
|
id: string;
|
|
95
100
|
address: string;
|
|
101
|
+
scopes: string[];
|
|
96
102
|
options: Record<string, import("@metamask/utils").Json>;
|
|
97
103
|
methods: string[];
|
|
98
104
|
}, {
|
|
@@ -104,6 +110,7 @@ export declare const CreateAccountResponseStruct: import("@metamask/superstruct"
|
|
|
104
110
|
"solana:data-account": "solana:data-account";
|
|
105
111
|
}>;
|
|
106
112
|
address: import("@metamask/superstruct").Struct<string, null>;
|
|
113
|
+
scopes: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
|
|
107
114
|
options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
|
|
108
115
|
methods: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
|
|
109
116
|
}>;
|
|
@@ -166,6 +173,7 @@ export declare const UpdateAccountRequestStruct: import("@metamask/superstruct")
|
|
|
166
173
|
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2wpkh" | "solana:data-account";
|
|
167
174
|
id: string;
|
|
168
175
|
address: string;
|
|
176
|
+
scopes: string[];
|
|
169
177
|
options: Record<string, import("@metamask/utils").Json>;
|
|
170
178
|
methods: string[];
|
|
171
179
|
};
|
|
@@ -177,6 +185,7 @@ export declare const UpdateAccountRequestStruct: import("@metamask/superstruct")
|
|
|
177
185
|
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2wpkh" | "solana:data-account";
|
|
178
186
|
id: string;
|
|
179
187
|
address: string;
|
|
188
|
+
scopes: string[];
|
|
180
189
|
options: Record<string, import("@metamask/utils").Json>;
|
|
181
190
|
methods: string[];
|
|
182
191
|
};
|
|
@@ -185,6 +194,7 @@ export declare const UpdateAccountRequestStruct: import("@metamask/superstruct")
|
|
|
185
194
|
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2wpkh" | "solana:data-account";
|
|
186
195
|
id: string;
|
|
187
196
|
address: string;
|
|
197
|
+
scopes: string[];
|
|
188
198
|
options: Record<string, import("@metamask/utils").Json>;
|
|
189
199
|
methods: string[];
|
|
190
200
|
}, {
|
|
@@ -196,6 +206,7 @@ export declare const UpdateAccountRequestStruct: import("@metamask/superstruct")
|
|
|
196
206
|
"solana:data-account": "solana:data-account";
|
|
197
207
|
}>;
|
|
198
208
|
address: import("@metamask/superstruct").Struct<string, null>;
|
|
209
|
+
scopes: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
|
|
199
210
|
options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
|
|
200
211
|
methods: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
|
|
201
212
|
}>;
|
|
@@ -281,7 +292,7 @@ export declare const ListRequestsResponseStruct: import("@metamask/superstruct")
|
|
|
281
292
|
params?: import("@metamask/utils").Json[] | Record<string, import("@metamask/utils").Json>;
|
|
282
293
|
}, {
|
|
283
294
|
method: import("@metamask/superstruct").Struct<string, null>;
|
|
284
|
-
params: import("@metamask/superstruct").Struct<import("../superstruct").ExactOptionalTag | import("@metamask/utils").Json[] | Record<string, import("@metamask/utils").Json>, null>;
|
|
295
|
+
params: import("@metamask/superstruct").Struct<import("../superstruct.cjs").ExactOptionalTag | import("@metamask/utils").Json[] | Record<string, import("@metamask/utils").Json>, null>;
|
|
285
296
|
}>;
|
|
286
297
|
}>>;
|
|
287
298
|
export type ListRequestsResponse = Infer<typeof ListRequestsResponseStruct>;
|
|
@@ -320,7 +331,7 @@ export declare const GetRequestResponseStruct: import("@metamask/superstruct").S
|
|
|
320
331
|
params?: import("@metamask/utils").Json[] | Record<string, import("@metamask/utils").Json>;
|
|
321
332
|
}, {
|
|
322
333
|
method: import("@metamask/superstruct").Struct<string, null>;
|
|
323
|
-
params: import("@metamask/superstruct").Struct<import("../superstruct").ExactOptionalTag | import("@metamask/utils").Json[] | Record<string, import("@metamask/utils").Json>, null>;
|
|
334
|
+
params: import("@metamask/superstruct").Struct<import("../superstruct.cjs").ExactOptionalTag | import("@metamask/utils").Json[] | Record<string, import("@metamask/utils").Json>, null>;
|
|
324
335
|
}>;
|
|
325
336
|
}>;
|
|
326
337
|
export type GetRequestResponse = Infer<typeof GetRequestResponseStruct>;
|
|
@@ -356,7 +367,7 @@ export declare const SubmitRequestRequestStruct: import("@metamask/superstruct")
|
|
|
356
367
|
params?: import("@metamask/utils").Json[] | Record<string, import("@metamask/utils").Json>;
|
|
357
368
|
}, {
|
|
358
369
|
method: import("@metamask/superstruct").Struct<string, null>;
|
|
359
|
-
params: import("@metamask/superstruct").Struct<import("../superstruct").ExactOptionalTag | import("@metamask/utils").Json[] | Record<string, import("@metamask/utils").Json>, null>;
|
|
370
|
+
params: import("@metamask/superstruct").Struct<import("../superstruct.cjs").ExactOptionalTag | import("@metamask/utils").Json[] | Record<string, import("@metamask/utils").Json>, null>;
|
|
360
371
|
}>;
|
|
361
372
|
}>;
|
|
362
373
|
jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
|
|
@@ -417,3 +428,4 @@ export declare const RejectRequestRequestStruct: import("@metamask/superstruct")
|
|
|
417
428
|
export type RejectRequestRequest = Infer<typeof RejectRequestRequestStruct>;
|
|
418
429
|
export declare const RejectRequestResponseStruct: import("@metamask/superstruct").Struct<null, null>;
|
|
419
430
|
export type RejectRequestResponse = Infer<typeof RejectRequestResponseStruct>;
|
|
431
|
+
//# sourceMappingURL=api.d.cts.map
|
|
@@ -0,0 +1 @@
|
|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