@metamask-previews/keyring-api 8.1.0-preview-e65b905 → 8.1.3-84e4c35
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 +26 -1
- package/dist/JsonRpcRequest.d.ts +2 -2
- package/dist/JsonRpcRequest.js +3 -3
- package/dist/JsonRpcRequest.js.map +1 -1
- package/dist/KeyringClient.d.ts +1 -1
- package/dist/KeyringClient.js +10 -10
- package/dist/KeyringClient.js.map +1 -1
- package/dist/KeyringSnapRpcClient.js.map +1 -1
- package/dist/api/account.d.ts +3 -3
- package/dist/api/account.js +6 -5
- package/dist/api/account.js.map +1 -1
- package/dist/api/balance.d.ts +1 -1
- package/dist/api/balance.js +4 -3
- package/dist/api/balance.js.map +1 -1
- package/dist/api/caip.d.ts +2 -2
- package/dist/api/caip.js +3 -3
- package/dist/api/caip.js.map +1 -1
- package/dist/api/export.d.ts +1 -1
- package/dist/api/index.d.ts +1 -1
- package/dist/api/index.js +0 -1
- package/dist/api/index.js.map +1 -1
- package/dist/api/keyring.d.ts +1 -1
- package/dist/api/request.d.ts +2 -2
- package/dist/api/request.js +7 -6
- package/dist/api/request.js.map +1 -1
- package/dist/api/response.d.ts +1 -1
- package/dist/api/response.js +6 -6
- package/dist/api/response.js.map +1 -1
- package/dist/btc/types.d.ts +2 -2
- package/dist/btc/types.js +3 -3
- package/dist/btc/types.js.map +1 -1
- package/dist/contexts.d.ts +1 -1
- package/dist/eth/erc4337/types.d.ts +10 -9
- package/dist/eth/erc4337/types.js +12 -10
- package/dist/eth/erc4337/types.js.map +1 -1
- package/dist/eth/types.d.ts +4 -4
- package/dist/eth/types.js +7 -7
- package/dist/eth/types.js.map +1 -1
- package/dist/events.js +1 -1
- package/dist/events.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/internal/api.d.ts +36 -36
- package/dist/internal/api.js +34 -33
- package/dist/internal/api.js.map +1 -1
- package/dist/internal/eth/EthKeyring.d.ts +1 -1
- package/dist/internal/eth/index.d.ts +1 -1
- package/dist/internal/eth/index.js +0 -15
- package/dist/internal/eth/index.js.map +1 -1
- package/dist/internal/events.d.ts +8 -8
- package/dist/internal/events.js +17 -16
- package/dist/internal/events.js.map +1 -1
- package/dist/internal/index.d.ts +1 -1
- package/dist/internal/index.js +0 -1
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/rpc.js +1 -1
- package/dist/internal/rpc.js.map +1 -1
- package/dist/internal/types.d.ts +58 -61
- package/dist/internal/types.js +20 -23
- package/dist/internal/types.js.map +1 -1
- package/dist/rpc-handler.js +13 -13
- package/dist/rpc-handler.js.map +1 -1
- package/dist/superstruct.d.ts +83 -0
- package/dist/superstruct.js +81 -0
- package/dist/superstruct.js.map +1 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.js +19 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/types.d.ts +17 -0
- package/dist/utils/types.js +29 -0
- package/dist/utils/types.js.map +1 -0
- package/dist/utils/typing.d.ts +32 -0
- package/dist/utils/typing.js +21 -0
- package/dist/utils/typing.js.map +1 -0
- package/package.json +16 -14
package/dist/contexts.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type Infer } from '@metamask/superstruct';
|
|
2
2
|
/**
|
|
3
3
|
* Struct of a UserOperation as defined by ERC-4337.
|
|
4
|
+
*
|
|
4
5
|
* @see https://eips.ethereum.org/EIPS/eip-4337#definitions
|
|
5
6
|
*/
|
|
6
7
|
export declare const EthUserOperationStruct: import("@metamask/superstruct").Struct<{
|
|
@@ -28,14 +29,14 @@ export declare const EthUserOperationStruct: import("@metamask/superstruct").Str
|
|
|
28
29
|
paymasterAndData: import("@metamask/superstruct").Struct<string, null>;
|
|
29
30
|
signature: import("@metamask/superstruct").Struct<string, null>;
|
|
30
31
|
}>;
|
|
31
|
-
export
|
|
32
|
+
export type EthUserOperation = Infer<typeof EthUserOperationStruct>;
|
|
32
33
|
/**
|
|
33
34
|
* Struct containing the most basic transaction information required to
|
|
34
35
|
* construct a UserOperation.
|
|
35
36
|
*/
|
|
36
37
|
export declare const EthBaseTransactionStruct: import("@metamask/superstruct").Struct<{
|
|
37
|
-
data: string;
|
|
38
38
|
value: string;
|
|
39
|
+
data: string;
|
|
39
40
|
to: string;
|
|
40
41
|
}, {
|
|
41
42
|
/**
|
|
@@ -51,7 +52,7 @@ export declare const EthBaseTransactionStruct: import("@metamask/superstruct").S
|
|
|
51
52
|
*/
|
|
52
53
|
data: import("@metamask/superstruct").Struct<string, null>;
|
|
53
54
|
}>;
|
|
54
|
-
export
|
|
55
|
+
export type EthBaseTransaction = Infer<typeof EthBaseTransactionStruct>;
|
|
55
56
|
export declare const EthBaseUserOperationStruct: import("@metamask/superstruct").Struct<{
|
|
56
57
|
nonce: string;
|
|
57
58
|
initCode: string;
|
|
@@ -68,7 +69,7 @@ export declare const EthBaseUserOperationStruct: import("@metamask/superstruct")
|
|
|
68
69
|
nonce: import("@metamask/superstruct").Struct<string, null>;
|
|
69
70
|
initCode: import("@metamask/superstruct").Struct<string, null>;
|
|
70
71
|
callData: import("@metamask/superstruct").Struct<string, null>;
|
|
71
|
-
gasLimits: import("@metamask/superstruct").Struct<import("
|
|
72
|
+
gasLimits: import("@metamask/superstruct").Struct<import("../../superstruct").ExactOptionalTag | {
|
|
72
73
|
callGasLimit: string;
|
|
73
74
|
verificationGasLimit: string;
|
|
74
75
|
preVerificationGas: string;
|
|
@@ -81,7 +82,7 @@ export declare const EthBaseUserOperationStruct: import("@metamask/superstruct")
|
|
|
81
82
|
dummySignature: import("@metamask/superstruct").Struct<string, null>;
|
|
82
83
|
bundlerUrl: import("@metamask/superstruct").Struct<string, null>;
|
|
83
84
|
}>;
|
|
84
|
-
export
|
|
85
|
+
export type EthBaseUserOperation = Infer<typeof EthBaseUserOperationStruct>;
|
|
85
86
|
export declare const EthUserOperationPatchStruct: import("@metamask/superstruct").Struct<{
|
|
86
87
|
paymasterAndData: string;
|
|
87
88
|
callGasLimit?: string;
|
|
@@ -89,8 +90,8 @@ export declare const EthUserOperationPatchStruct: import("@metamask/superstruct"
|
|
|
89
90
|
preVerificationGas?: string;
|
|
90
91
|
}, {
|
|
91
92
|
paymasterAndData: import("@metamask/superstruct").Struct<string, null>;
|
|
92
|
-
callGasLimit: import("@metamask/superstruct").Struct<string | import("
|
|
93
|
-
verificationGasLimit: import("@metamask/superstruct").Struct<string | import("
|
|
94
|
-
preVerificationGas: import("@metamask/superstruct").Struct<string | import("
|
|
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>;
|
|
95
96
|
}>;
|
|
96
|
-
export
|
|
97
|
+
export type EthUserOperationPatch = Infer<typeof EthUserOperationPatchStruct>;
|
|
@@ -1,13 +1,15 @@
|
|
|
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
|
|
4
|
+
const superstruct_1 = require("../../superstruct");
|
|
5
|
+
const utils_1 = require("../../utils");
|
|
5
6
|
const types_1 = require("../types");
|
|
6
7
|
/**
|
|
7
8
|
* Struct of a UserOperation as defined by ERC-4337.
|
|
9
|
+
*
|
|
8
10
|
* @see https://eips.ethereum.org/EIPS/eip-4337#definitions
|
|
9
11
|
*/
|
|
10
|
-
exports.EthUserOperationStruct = (0,
|
|
12
|
+
exports.EthUserOperationStruct = (0, superstruct_1.object)({
|
|
11
13
|
sender: types_1.EthAddressStruct,
|
|
12
14
|
nonce: types_1.EthUint256Struct,
|
|
13
15
|
initCode: types_1.EthBytesStruct,
|
|
@@ -24,7 +26,7 @@ exports.EthUserOperationStruct = (0, keyring_utils_1.object)({
|
|
|
24
26
|
* Struct containing the most basic transaction information required to
|
|
25
27
|
* construct a UserOperation.
|
|
26
28
|
*/
|
|
27
|
-
exports.EthBaseTransactionStruct = (0,
|
|
29
|
+
exports.EthBaseTransactionStruct = (0, superstruct_1.object)({
|
|
28
30
|
/**
|
|
29
31
|
* Address of the transaction recipient.
|
|
30
32
|
*/
|
|
@@ -38,23 +40,23 @@ exports.EthBaseTransactionStruct = (0, keyring_utils_1.object)({
|
|
|
38
40
|
*/
|
|
39
41
|
data: types_1.EthBytesStruct,
|
|
40
42
|
});
|
|
41
|
-
exports.EthBaseUserOperationStruct = (0,
|
|
43
|
+
exports.EthBaseUserOperationStruct = (0, superstruct_1.object)({
|
|
42
44
|
nonce: types_1.EthUint256Struct,
|
|
43
45
|
initCode: types_1.EthBytesStruct,
|
|
44
46
|
callData: types_1.EthBytesStruct,
|
|
45
|
-
gasLimits: (0,
|
|
47
|
+
gasLimits: (0, superstruct_1.exactOptional)((0, superstruct_1.object)({
|
|
46
48
|
callGasLimit: types_1.EthUint256Struct,
|
|
47
49
|
verificationGasLimit: types_1.EthUint256Struct,
|
|
48
50
|
preVerificationGas: types_1.EthUint256Struct,
|
|
49
51
|
})),
|
|
50
52
|
dummyPaymasterAndData: types_1.EthBytesStruct,
|
|
51
53
|
dummySignature: types_1.EthBytesStruct,
|
|
52
|
-
bundlerUrl:
|
|
54
|
+
bundlerUrl: utils_1.UrlStruct,
|
|
53
55
|
});
|
|
54
|
-
exports.EthUserOperationPatchStruct = (0,
|
|
56
|
+
exports.EthUserOperationPatchStruct = (0, superstruct_1.object)({
|
|
55
57
|
paymasterAndData: types_1.EthBytesStruct,
|
|
56
|
-
callGasLimit: (0,
|
|
57
|
-
verificationGasLimit: (0,
|
|
58
|
-
preVerificationGas: (0,
|
|
58
|
+
callGasLimit: (0, superstruct_1.exactOptional)(types_1.EthUint256Struct),
|
|
59
|
+
verificationGasLimit: (0, superstruct_1.exactOptional)(types_1.EthUint256Struct),
|
|
60
|
+
preVerificationGas: (0, superstruct_1.exactOptional)(types_1.EthUint256Struct),
|
|
59
61
|
});
|
|
60
62
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/eth/erc4337/types.ts"],"names":[],"mappings":";;;AAEA,
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/eth/erc4337/types.ts"],"names":[],"mappings":";;;AAEA,mDAA0D;AAC1D,uCAAwC;AACxC,oCAA8E;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"]}
|
package/dist/eth/types.d.ts
CHANGED
|
@@ -17,8 +17,8 @@ export declare enum EthMethod {
|
|
|
17
17
|
SignUserOperation = "eth_signUserOperation"
|
|
18
18
|
}
|
|
19
19
|
export declare const EthEoaAccountStruct: import("@metamask/superstruct").Struct<{
|
|
20
|
-
id: string;
|
|
21
20
|
type: "eip155:eoa";
|
|
21
|
+
id: string;
|
|
22
22
|
address: string;
|
|
23
23
|
options: Record<string, import("@metamask/utils").Json>;
|
|
24
24
|
methods: ("personal_sign" | "eth_sign" | "eth_signTransaction" | "eth_signTypedData_v1" | "eth_signTypedData_v3" | "eth_signTypedData_v4")[];
|
|
@@ -45,10 +45,10 @@ export declare const EthEoaAccountStruct: import("@metamask/superstruct").Struct
|
|
|
45
45
|
id: import("@metamask/superstruct").Struct<string, null>;
|
|
46
46
|
options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
|
|
47
47
|
}>;
|
|
48
|
-
export
|
|
48
|
+
export type EthEoaAccount = Infer<typeof EthEoaAccountStruct>;
|
|
49
49
|
export declare const EthErc4337AccountStruct: import("@metamask/superstruct").Struct<{
|
|
50
|
-
id: string;
|
|
51
50
|
type: "eip155:erc4337";
|
|
51
|
+
id: string;
|
|
52
52
|
address: string;
|
|
53
53
|
options: Record<string, import("@metamask/utils").Json>;
|
|
54
54
|
methods: ("personal_sign" | "eth_sign" | "eth_signTypedData_v1" | "eth_signTypedData_v3" | "eth_signTypedData_v4" | "eth_prepareUserOperation" | "eth_patchUserOperation" | "eth_signUserOperation")[];
|
|
@@ -77,4 +77,4 @@ export declare const EthErc4337AccountStruct: import("@metamask/superstruct").St
|
|
|
77
77
|
id: import("@metamask/superstruct").Struct<string, null>;
|
|
78
78
|
options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
|
|
79
79
|
}>;
|
|
80
|
-
export
|
|
80
|
+
export type EthErc4337Account = Infer<typeof EthErc4337AccountStruct>;
|
package/dist/eth/types.js
CHANGED
|
@@ -3,10 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.EthErc4337AccountStruct = exports.EthEoaAccountStruct = exports.EthMethod = exports.EthUint256Struct = exports.EthAddressStruct = exports.EthBytesStruct = void 0;
|
|
4
4
|
const superstruct_1 = require("@metamask/superstruct");
|
|
5
5
|
const api_1 = require("../api");
|
|
6
|
-
const
|
|
7
|
-
exports.EthBytesStruct = (0,
|
|
8
|
-
exports.EthAddressStruct = (0,
|
|
9
|
-
exports.EthUint256Struct = (0,
|
|
6
|
+
const superstruct_2 = require("../superstruct");
|
|
7
|
+
exports.EthBytesStruct = (0, superstruct_2.definePattern)('EthBytes', /^0x[0-9a-f]*$/iu);
|
|
8
|
+
exports.EthAddressStruct = (0, superstruct_2.definePattern)('EthAddress', /^0x[0-9a-f]{40}$/iu);
|
|
9
|
+
exports.EthUint256Struct = (0, superstruct_2.definePattern)('EthUint256', /^0x([1-9a-f][0-9a-f]*|0)$/iu);
|
|
10
10
|
/**
|
|
11
11
|
* Supported Ethereum methods.
|
|
12
12
|
*/
|
|
@@ -23,8 +23,8 @@ var EthMethod;
|
|
|
23
23
|
EthMethod["PrepareUserOperation"] = "eth_prepareUserOperation";
|
|
24
24
|
EthMethod["PatchUserOperation"] = "eth_patchUserOperation";
|
|
25
25
|
EthMethod["SignUserOperation"] = "eth_signUserOperation";
|
|
26
|
-
})(EthMethod
|
|
27
|
-
exports.EthEoaAccountStruct = (0,
|
|
26
|
+
})(EthMethod || (exports.EthMethod = EthMethod = {}));
|
|
27
|
+
exports.EthEoaAccountStruct = (0, superstruct_2.object)({
|
|
28
28
|
...api_1.KeyringAccountStruct.schema,
|
|
29
29
|
/**
|
|
30
30
|
* Account address.
|
|
@@ -46,7 +46,7 @@ exports.EthEoaAccountStruct = (0, keyring_utils_1.object)({
|
|
|
46
46
|
`${EthMethod.SignTypedDataV4}`,
|
|
47
47
|
])),
|
|
48
48
|
});
|
|
49
|
-
exports.EthErc4337AccountStruct = (0,
|
|
49
|
+
exports.EthErc4337AccountStruct = (0, superstruct_2.object)({
|
|
50
50
|
...api_1.KeyringAccountStruct.schema,
|
|
51
51
|
/**
|
|
52
52
|
* Account address.
|
package/dist/eth/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/eth/types.ts"],"names":[],"mappings":";;;AACA,uDAA8D;AAE9D,gCAA8D;AAC9D,
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/eth/types.ts"],"names":[],"mappings":";;;AACA,uDAA8D;AAE9D,gCAA8D;AAC9D,gDAAuD;AAE1C,QAAA,cAAc,GAAG,IAAA,2BAAa,EAAC,UAAU,EAAE,iBAAiB,CAAC,CAAC;AAE9D,QAAA,gBAAgB,GAAG,IAAA,2BAAa,EAC3C,YAAY,EACZ,oBAAoB,CACrB,CAAC;AAEW,QAAA,gBAAgB,GAAG,IAAA,2BAAa,EAC3C,YAAY,EACZ,6BAA6B,CAC9B,CAAC;AAEF;;GAEG;AACH,IAAY,SAYX;AAZD,WAAY,SAAS;IACnB,0BAA0B;IAC1B,2CAA8B,CAAA;IAC9B,8BAAiB,CAAA;IACjB,oDAAuC,CAAA;IACvC,qDAAwC,CAAA;IACxC,qDAAwC,CAAA;IACxC,qDAAwC,CAAA;IACxC,mBAAmB;IACnB,8DAAiD,CAAA;IACjD,0DAA6C,CAAA;IAC7C,wDAA2C,CAAA;AAC7C,CAAC,EAZW,SAAS,yBAAT,SAAS,QAYpB;AAEY,QAAA,mBAAmB,GAAG,IAAA,oBAAM,EAAC;IACxC,GAAG,0BAAoB,CAAC,MAAM;IAE9B;;OAEG;IACH,OAAO,EAAE,wBAAgB;IAEzB;;OAEG;IACH,IAAI,EAAE,IAAA,qBAAO,EAAC,GAAG,oBAAc,CAAC,GAAG,EAAE,CAAC;IAEtC;;OAEG;IACH,OAAO,EAAE,IAAA,mBAAK,EACZ,IAAA,mBAAK,EAAC;QACJ,GAAG,SAAS,CAAC,YAAY,EAAE;QAC3B,GAAG,SAAS,CAAC,IAAI,EAAE;QACnB,GAAG,SAAS,CAAC,eAAe,EAAE;QAC9B,GAAG,SAAS,CAAC,eAAe,EAAE;QAC9B,GAAG,SAAS,CAAC,eAAe,EAAE;QAC9B,GAAG,SAAS,CAAC,eAAe,EAAE;KAC/B,CAAC,CACH;CACF,CAAC,CAAC;AAIU,QAAA,uBAAuB,GAAG,IAAA,oBAAM,EAAC;IAC5C,GAAG,0BAAoB,CAAC,MAAM;IAE9B;;OAEG;IACH,OAAO,EAAE,wBAAgB;IAEzB;;OAEG;IACH,IAAI,EAAE,IAAA,qBAAO,EAAC,GAAG,oBAAc,CAAC,OAAO,EAAE,CAAC;IAE1C;;OAEG;IACH,OAAO,EAAE,IAAA,mBAAK,EACZ,IAAA,mBAAK,EAAC;QACJ,GAAG,SAAS,CAAC,YAAY,EAAE;QAC3B,GAAG,SAAS,CAAC,IAAI,EAAE;QACnB,GAAG,SAAS,CAAC,eAAe,EAAE;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"]}
|
package/dist/events.js
CHANGED
|
@@ -13,5 +13,5 @@ var KeyringEvent;
|
|
|
13
13
|
// Request events
|
|
14
14
|
KeyringEvent["RequestApproved"] = "notify:requestApproved";
|
|
15
15
|
KeyringEvent["RequestRejected"] = "notify:requestRejected";
|
|
16
|
-
})(KeyringEvent
|
|
16
|
+
})(KeyringEvent || (exports.KeyringEvent = KeyringEvent = {}));
|
|
17
17
|
//# sourceMappingURL=events.js.map
|
package/dist/events.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.js","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,
|
|
1
|
+
{"version":3,"file":"events.js","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"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * from './api';
|
|
2
2
|
export * from './btc';
|
|
3
|
-
export * from './contexts';
|
|
3
|
+
export type * from './contexts';
|
|
4
4
|
export * from './eth';
|
|
5
5
|
export * from './events';
|
|
6
6
|
export * from './internal';
|
|
@@ -8,3 +8,4 @@ export * from './KeyringClient';
|
|
|
8
8
|
export * from './KeyringSnapRpcClient';
|
|
9
9
|
export * from './rpc-handler';
|
|
10
10
|
export * from './snap-utils';
|
|
11
|
+
export * from './superstruct';
|
package/dist/index.js
CHANGED
|
@@ -16,7 +16,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./api"), exports);
|
|
18
18
|
__exportStar(require("./btc"), exports);
|
|
19
|
-
__exportStar(require("./contexts"), exports);
|
|
20
19
|
__exportStar(require("./eth"), exports);
|
|
21
20
|
__exportStar(require("./events"), exports);
|
|
22
21
|
__exportStar(require("./internal"), exports);
|
|
@@ -24,4 +23,5 @@ __exportStar(require("./KeyringClient"), exports);
|
|
|
24
23
|
__exportStar(require("./KeyringSnapRpcClient"), exports);
|
|
25
24
|
__exportStar(require("./rpc-handler"), exports);
|
|
26
25
|
__exportStar(require("./snap-utils"), exports);
|
|
26
|
+
__exportStar(require("./superstruct"), exports);
|
|
27
27
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wCAAsB;AACtB,wCAAsB;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wCAAsB;AACtB,wCAAsB;AAEtB,wCAAsB;AACtB,2CAAyB;AACzB,6CAA2B;AAC3B,kDAAgC;AAChC,yDAAuC;AACvC,gDAA8B;AAC9B,+CAA6B;AAC7B,gDAA8B","sourcesContent":["export * from './api';\nexport * from './btc';\nexport type * from './contexts';\nexport * from './eth';\nexport * from './events';\nexport * from './internal';\nexport * from './KeyringClient';\nexport * from './KeyringSnapRpcClient';\nexport * from './rpc-handler';\nexport * from './snap-utils';\nexport * from './superstruct';\n"]}
|
package/dist/internal/api.d.ts
CHANGED
|
@@ -8,16 +8,16 @@ export declare const ListAccountsRequestStruct: import("@metamask/superstruct").
|
|
|
8
8
|
jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
|
|
9
9
|
id: import("@metamask/superstruct").Struct<string | number | null, null>;
|
|
10
10
|
}>;
|
|
11
|
-
export
|
|
11
|
+
export type ListAccountsRequest = Infer<typeof ListAccountsRequestStruct>;
|
|
12
12
|
export declare const ListAccountsResponseStruct: import("@metamask/superstruct").Struct<{
|
|
13
|
-
id: string;
|
|
14
13
|
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2wpkh";
|
|
14
|
+
id: string;
|
|
15
15
|
address: string;
|
|
16
16
|
options: Record<string, import("@metamask/utils").Json>;
|
|
17
17
|
methods: string[];
|
|
18
18
|
}[], import("@metamask/superstruct").Struct<{
|
|
19
|
-
id: string;
|
|
20
19
|
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2wpkh";
|
|
20
|
+
id: string;
|
|
21
21
|
address: string;
|
|
22
22
|
options: Record<string, import("@metamask/utils").Json>;
|
|
23
23
|
methods: string[];
|
|
@@ -32,7 +32,7 @@ export declare const ListAccountsResponseStruct: import("@metamask/superstruct")
|
|
|
32
32
|
options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
|
|
33
33
|
methods: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
|
|
34
34
|
}>>;
|
|
35
|
-
export
|
|
35
|
+
export type ListAccountsResponse = Infer<typeof ListAccountsResponseStruct>;
|
|
36
36
|
export declare const GetAccountRequestStruct: import("@metamask/superstruct").Struct<{
|
|
37
37
|
jsonrpc: "2.0";
|
|
38
38
|
id: string | number | null;
|
|
@@ -50,10 +50,10 @@ export declare const GetAccountRequestStruct: import("@metamask/superstruct").St
|
|
|
50
50
|
jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
|
|
51
51
|
id: import("@metamask/superstruct").Struct<string | number | null, null>;
|
|
52
52
|
}>;
|
|
53
|
-
export
|
|
53
|
+
export type GetAccountRequest = Infer<typeof GetAccountRequestStruct>;
|
|
54
54
|
export declare const GetAccountResponseStruct: import("@metamask/superstruct").Struct<{
|
|
55
|
-
id: string;
|
|
56
55
|
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2wpkh";
|
|
56
|
+
id: string;
|
|
57
57
|
address: string;
|
|
58
58
|
options: Record<string, import("@metamask/utils").Json>;
|
|
59
59
|
methods: string[];
|
|
@@ -68,7 +68,7 @@ export declare const GetAccountResponseStruct: import("@metamask/superstruct").S
|
|
|
68
68
|
options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
|
|
69
69
|
methods: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
|
|
70
70
|
}>;
|
|
71
|
-
export
|
|
71
|
+
export type GetAccountResponse = Infer<typeof GetAccountResponseStruct>;
|
|
72
72
|
export declare const CreateAccountRequestStruct: import("@metamask/superstruct").Struct<{
|
|
73
73
|
jsonrpc: "2.0";
|
|
74
74
|
id: string | number | null;
|
|
@@ -86,10 +86,10 @@ export declare const CreateAccountRequestStruct: import("@metamask/superstruct")
|
|
|
86
86
|
jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
|
|
87
87
|
id: import("@metamask/superstruct").Struct<string | number | null, null>;
|
|
88
88
|
}>;
|
|
89
|
-
export
|
|
89
|
+
export type CreateAccountRequest = Infer<typeof CreateAccountRequestStruct>;
|
|
90
90
|
export declare const CreateAccountResponseStruct: import("@metamask/superstruct").Struct<{
|
|
91
|
-
id: string;
|
|
92
91
|
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2wpkh";
|
|
92
|
+
id: string;
|
|
93
93
|
address: string;
|
|
94
94
|
options: Record<string, import("@metamask/utils").Json>;
|
|
95
95
|
methods: string[];
|
|
@@ -104,7 +104,7 @@ export declare const CreateAccountResponseStruct: import("@metamask/superstruct"
|
|
|
104
104
|
options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
|
|
105
105
|
methods: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
|
|
106
106
|
}>;
|
|
107
|
-
export
|
|
107
|
+
export type CreateAccountResponse = Infer<typeof CreateAccountResponseStruct>;
|
|
108
108
|
export declare const GetAccountBalancesRequestStruct: import("@metamask/superstruct").Struct<{
|
|
109
109
|
jsonrpc: "2.0";
|
|
110
110
|
id: string | number | null;
|
|
@@ -125,12 +125,12 @@ export declare const GetAccountBalancesRequestStruct: import("@metamask/superstr
|
|
|
125
125
|
jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
|
|
126
126
|
id: import("@metamask/superstruct").Struct<string | number | null, null>;
|
|
127
127
|
}>;
|
|
128
|
-
export
|
|
128
|
+
export type GetAccountBalancesRequest = Infer<typeof GetAccountBalancesRequestStruct>;
|
|
129
129
|
export declare const GetAccountBalancesResponseStruct: import("@metamask/superstruct").Struct<Record<string, {
|
|
130
130
|
amount: string;
|
|
131
131
|
unit: string;
|
|
132
132
|
}>, null>;
|
|
133
|
-
export
|
|
133
|
+
export type GetAccountBalancesResponse = Infer<typeof GetAccountBalancesResponseStruct>;
|
|
134
134
|
export declare const FilterAccountChainsStruct: import("@metamask/superstruct").Struct<{
|
|
135
135
|
jsonrpc: "2.0";
|
|
136
136
|
id: string | number | null;
|
|
@@ -151,17 +151,17 @@ export declare const FilterAccountChainsStruct: import("@metamask/superstruct").
|
|
|
151
151
|
jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
|
|
152
152
|
id: import("@metamask/superstruct").Struct<string | number | null, null>;
|
|
153
153
|
}>;
|
|
154
|
-
export
|
|
154
|
+
export type FilterAccountChainsRequest = Infer<typeof FilterAccountChainsStruct>;
|
|
155
155
|
export declare const FilterAccountChainsResponseStruct: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
|
|
156
|
-
export
|
|
156
|
+
export type FilterAccountChainsResponse = Infer<typeof FilterAccountChainsResponseStruct>;
|
|
157
157
|
export declare const UpdateAccountRequestStruct: import("@metamask/superstruct").Struct<{
|
|
158
158
|
jsonrpc: "2.0";
|
|
159
159
|
id: string | number | null;
|
|
160
160
|
method: "keyring_updateAccount";
|
|
161
161
|
params: {
|
|
162
162
|
account: {
|
|
163
|
-
id: string;
|
|
164
163
|
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2wpkh";
|
|
164
|
+
id: string;
|
|
165
165
|
address: string;
|
|
166
166
|
options: Record<string, import("@metamask/utils").Json>;
|
|
167
167
|
methods: string[];
|
|
@@ -171,16 +171,16 @@ export declare const UpdateAccountRequestStruct: import("@metamask/superstruct")
|
|
|
171
171
|
method: import("@metamask/superstruct").Struct<"keyring_updateAccount", "keyring_updateAccount">;
|
|
172
172
|
params: import("@metamask/superstruct").Struct<{
|
|
173
173
|
account: {
|
|
174
|
-
id: string;
|
|
175
174
|
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2wpkh";
|
|
175
|
+
id: string;
|
|
176
176
|
address: string;
|
|
177
177
|
options: Record<string, import("@metamask/utils").Json>;
|
|
178
178
|
methods: string[];
|
|
179
179
|
};
|
|
180
180
|
}, {
|
|
181
181
|
account: import("@metamask/superstruct").Struct<{
|
|
182
|
-
id: string;
|
|
183
182
|
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2wpkh";
|
|
183
|
+
id: string;
|
|
184
184
|
address: string;
|
|
185
185
|
options: Record<string, import("@metamask/utils").Json>;
|
|
186
186
|
methods: string[];
|
|
@@ -199,9 +199,9 @@ export declare const UpdateAccountRequestStruct: import("@metamask/superstruct")
|
|
|
199
199
|
jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
|
|
200
200
|
id: import("@metamask/superstruct").Struct<string | number | null, null>;
|
|
201
201
|
}>;
|
|
202
|
-
export
|
|
202
|
+
export type UpdateAccountRequest = Infer<typeof UpdateAccountRequestStruct>;
|
|
203
203
|
export declare const UpdateAccountResponseStruct: import("@metamask/superstruct").Struct<null, null>;
|
|
204
|
-
export
|
|
204
|
+
export type UpdateAccountResponse = Infer<typeof UpdateAccountResponseStruct>;
|
|
205
205
|
export declare const DeleteAccountRequestStruct: import("@metamask/superstruct").Struct<{
|
|
206
206
|
jsonrpc: "2.0";
|
|
207
207
|
id: string | number | null;
|
|
@@ -219,9 +219,9 @@ export declare const DeleteAccountRequestStruct: import("@metamask/superstruct")
|
|
|
219
219
|
jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
|
|
220
220
|
id: import("@metamask/superstruct").Struct<string | number | null, null>;
|
|
221
221
|
}>;
|
|
222
|
-
export
|
|
222
|
+
export type DeleteAccountRequest = Infer<typeof DeleteAccountRequestStruct>;
|
|
223
223
|
export declare const DeleteAccountResponseStruct: import("@metamask/superstruct").Struct<null, null>;
|
|
224
|
-
export
|
|
224
|
+
export type DeleteAccountResponse = Infer<typeof DeleteAccountResponseStruct>;
|
|
225
225
|
export declare const ExportAccountRequestStruct: import("@metamask/superstruct").Struct<{
|
|
226
226
|
jsonrpc: "2.0";
|
|
227
227
|
id: string | number | null;
|
|
@@ -239,9 +239,9 @@ export declare const ExportAccountRequestStruct: import("@metamask/superstruct")
|
|
|
239
239
|
jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
|
|
240
240
|
id: import("@metamask/superstruct").Struct<string | number | null, null>;
|
|
241
241
|
}>;
|
|
242
|
-
export
|
|
242
|
+
export type ExportAccountRequest = Infer<typeof ExportAccountRequestStruct>;
|
|
243
243
|
export declare const ExportAccountResponseStruct: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
|
|
244
|
-
export
|
|
244
|
+
export type ExportAccountResponse = Infer<typeof ExportAccountResponseStruct>;
|
|
245
245
|
export declare const ListRequestsRequestStruct: import("@metamask/superstruct").Struct<{
|
|
246
246
|
jsonrpc: "2.0";
|
|
247
247
|
id: string | number | null;
|
|
@@ -251,7 +251,7 @@ export declare const ListRequestsRequestStruct: import("@metamask/superstruct").
|
|
|
251
251
|
jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
|
|
252
252
|
id: import("@metamask/superstruct").Struct<string | number | null, null>;
|
|
253
253
|
}>;
|
|
254
|
-
export
|
|
254
|
+
export type ListRequestsRequest = Infer<typeof ListRequestsRequestStruct>;
|
|
255
255
|
export declare const ListRequestsResponseStruct: import("@metamask/superstruct").Struct<{
|
|
256
256
|
id: string;
|
|
257
257
|
scope: string;
|
|
@@ -277,10 +277,10 @@ export declare const ListRequestsResponseStruct: import("@metamask/superstruct")
|
|
|
277
277
|
params?: import("@metamask/utils").Json[] | Record<string, import("@metamask/utils").Json>;
|
|
278
278
|
}, {
|
|
279
279
|
method: import("@metamask/superstruct").Struct<string, null>;
|
|
280
|
-
params: import("@metamask/superstruct").Struct<import("
|
|
280
|
+
params: import("@metamask/superstruct").Struct<import("../superstruct").ExactOptionalTag | import("@metamask/utils").Json[] | Record<string, import("@metamask/utils").Json>, null>;
|
|
281
281
|
}>;
|
|
282
282
|
}>>;
|
|
283
|
-
export
|
|
283
|
+
export type ListRequestsResponse = Infer<typeof ListRequestsResponseStruct>;
|
|
284
284
|
export declare const GetRequestRequestStruct: import("@metamask/superstruct").Struct<{
|
|
285
285
|
jsonrpc: "2.0";
|
|
286
286
|
id: string | number | null;
|
|
@@ -298,7 +298,7 @@ export declare const GetRequestRequestStruct: import("@metamask/superstruct").St
|
|
|
298
298
|
jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
|
|
299
299
|
id: import("@metamask/superstruct").Struct<string | number | null, null>;
|
|
300
300
|
}>;
|
|
301
|
-
export
|
|
301
|
+
export type GetRequestRequest = Infer<typeof GetRequestRequestStruct>;
|
|
302
302
|
export declare const GetRequestResponseStruct: import("@metamask/superstruct").Struct<{
|
|
303
303
|
id: string;
|
|
304
304
|
scope: string;
|
|
@@ -316,10 +316,10 @@ export declare const GetRequestResponseStruct: import("@metamask/superstruct").S
|
|
|
316
316
|
params?: import("@metamask/utils").Json[] | Record<string, import("@metamask/utils").Json>;
|
|
317
317
|
}, {
|
|
318
318
|
method: import("@metamask/superstruct").Struct<string, null>;
|
|
319
|
-
params: import("@metamask/superstruct").Struct<import("
|
|
319
|
+
params: import("@metamask/superstruct").Struct<import("../superstruct").ExactOptionalTag | import("@metamask/utils").Json[] | Record<string, import("@metamask/utils").Json>, null>;
|
|
320
320
|
}>;
|
|
321
321
|
}>;
|
|
322
|
-
export
|
|
322
|
+
export type GetRequestResponse = Infer<typeof GetRequestResponseStruct>;
|
|
323
323
|
export declare const SubmitRequestRequestStruct: import("@metamask/superstruct").Struct<{
|
|
324
324
|
jsonrpc: "2.0";
|
|
325
325
|
id: string | number | null;
|
|
@@ -352,13 +352,13 @@ export declare const SubmitRequestRequestStruct: import("@metamask/superstruct")
|
|
|
352
352
|
params?: import("@metamask/utils").Json[] | Record<string, import("@metamask/utils").Json>;
|
|
353
353
|
}, {
|
|
354
354
|
method: import("@metamask/superstruct").Struct<string, null>;
|
|
355
|
-
params: import("@metamask/superstruct").Struct<import("
|
|
355
|
+
params: import("@metamask/superstruct").Struct<import("../superstruct").ExactOptionalTag | import("@metamask/utils").Json[] | Record<string, import("@metamask/utils").Json>, null>;
|
|
356
356
|
}>;
|
|
357
357
|
}>;
|
|
358
358
|
jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
|
|
359
359
|
id: import("@metamask/superstruct").Struct<string | number | null, null>;
|
|
360
360
|
}>;
|
|
361
|
-
export
|
|
361
|
+
export type SubmitRequestRequest = Infer<typeof SubmitRequestRequestStruct>;
|
|
362
362
|
export declare const SubmitRequestResponseStruct: import("@metamask/superstruct").Struct<{
|
|
363
363
|
pending: true;
|
|
364
364
|
redirect?: {
|
|
@@ -369,7 +369,7 @@ export declare const SubmitRequestResponseStruct: import("@metamask/superstruct"
|
|
|
369
369
|
pending: false;
|
|
370
370
|
result: import("@metamask/utils").Json;
|
|
371
371
|
}, null>;
|
|
372
|
-
export
|
|
372
|
+
export type SubmitRequestResponse = Infer<typeof SubmitRequestResponseStruct>;
|
|
373
373
|
export declare const ApproveRequestRequestStruct: import("@metamask/superstruct").Struct<{
|
|
374
374
|
jsonrpc: "2.0";
|
|
375
375
|
id: string | number | null;
|
|
@@ -390,9 +390,9 @@ export declare const ApproveRequestRequestStruct: import("@metamask/superstruct"
|
|
|
390
390
|
jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
|
|
391
391
|
id: import("@metamask/superstruct").Struct<string | number | null, null>;
|
|
392
392
|
}>;
|
|
393
|
-
export
|
|
393
|
+
export type ApproveRequestRequest = Infer<typeof ApproveRequestRequestStruct>;
|
|
394
394
|
export declare const ApproveRequestResponseStruct: import("@metamask/superstruct").Struct<null, null>;
|
|
395
|
-
export
|
|
395
|
+
export type ApproveRequestResponse = Infer<typeof ApproveRequestResponseStruct>;
|
|
396
396
|
export declare const RejectRequestRequestStruct: import("@metamask/superstruct").Struct<{
|
|
397
397
|
jsonrpc: "2.0";
|
|
398
398
|
id: string | number | null;
|
|
@@ -410,6 +410,6 @@ export declare const RejectRequestRequestStruct: import("@metamask/superstruct")
|
|
|
410
410
|
jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
|
|
411
411
|
id: import("@metamask/superstruct").Struct<string | number | null, null>;
|
|
412
412
|
}>;
|
|
413
|
-
export
|
|
413
|
+
export type RejectRequestRequest = Infer<typeof RejectRequestRequestStruct>;
|
|
414
414
|
export declare const RejectRequestResponseStruct: import("@metamask/superstruct").Struct<null, null>;
|
|
415
|
-
export
|
|
415
|
+
export type RejectRequestResponse = Infer<typeof RejectRequestResponseStruct>;
|