@metamask-previews/keyring-internal-api 0.0.1-672cc7b → 0.0.1-72196d6
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/dist/{internal/api.js → api.cjs} +14 -4
- package/dist/api.cjs.map +1 -0
- package/dist/{internal/api.d.ts → api.d.cts} +394 -72
- package/dist/api.d.cts.map +1 -0
- package/dist/api.d.mts +737 -0
- package/dist/api.d.mts.map +1 -0
- package/dist/api.mjs +145 -0
- package/dist/api.mjs.map +1 -0
- package/dist/eth/EthKeyring.cjs +3 -0
- package/dist/eth/EthKeyring.cjs.map +1 -0
- package/dist/{internal/eth/EthKeyring.d.ts → eth/EthKeyring.d.cts} +4 -4
- package/dist/eth/EthKeyring.d.cts.map +1 -0
- package/dist/eth/EthKeyring.d.mts +33 -0
- package/dist/eth/EthKeyring.d.mts.map +1 -0
- package/dist/eth/EthKeyring.mjs +2 -0
- package/dist/eth/EthKeyring.mjs.map +1 -0
- package/dist/{internal/eth/EthKeyring.js → eth/index.cjs} +1 -1
- package/dist/eth/index.cjs.map +1 -0
- package/dist/eth/index.d.cts +2 -0
- package/dist/eth/index.d.cts.map +1 -0
- package/dist/eth/index.d.mts +2 -0
- package/dist/eth/index.d.mts.map +1 -0
- package/dist/eth/index.mjs +2 -0
- package/dist/eth/index.mjs.map +1 -0
- package/dist/{btc/index.js → index.cjs} +3 -2
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +4 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +4 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +3 -0
- package/dist/index.mjs.map +1 -0
- package/dist/{internal/types.js → types.cjs} +23 -19
- package/dist/types.cjs.map +1 -0
- package/dist/{internal/types.d.ts → types.d.cts} +131 -69
- package/dist/types.d.cts.map +1 -0
- package/dist/types.d.mts +392 -0
- package/dist/types.d.mts.map +1 -0
- package/dist/types.mjs +50 -0
- package/dist/types.mjs.map +1 -0
- package/package.json +31 -20
- package/dist/btc/index.d.ts +0 -1
- package/dist/btc/index.js.map +0 -1
- package/dist/btc/types.d.ts +0 -33
- package/dist/btc/types.js +0 -40
- package/dist/btc/types.js.map +0 -1
- package/dist/eth/erc4337/index.d.ts +0 -1
- package/dist/eth/erc4337/index.js +0 -18
- package/dist/eth/erc4337/index.js.map +0 -1
- package/dist/eth/erc4337/types.d.ts +0 -97
- package/dist/eth/erc4337/types.js +0 -61
- package/dist/eth/erc4337/types.js.map +0 -1
- package/dist/eth/index.d.ts +0 -3
- package/dist/eth/index.js +0 -20
- package/dist/eth/index.js.map +0 -1
- package/dist/eth/types.d.ts +0 -80
- package/dist/eth/types.js +0 -73
- package/dist/eth/types.js.map +0 -1
- package/dist/eth/utils.d.ts +0 -8
- package/dist/eth/utils.js +0 -15
- package/dist/eth/utils.js.map +0 -1
- package/dist/index.d.ts +0 -3
- package/dist/index.js +0 -20
- 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 +0 -18
- package/dist/internal/eth/index.js.map +0 -1
- package/dist/internal/events.d.ts +0 -169
- package/dist/internal/events.js +0 -83
- package/dist/internal/events.js.map +0 -1
- package/dist/internal/index.d.ts +0 -5
- package/dist/internal/index.js +0 -22
- package/dist/internal/index.js.map +0 -1
- package/dist/internal/rpc.d.ts +0 -25
- package/dist/internal/rpc.js +0 -33
- package/dist/internal/rpc.js.map +0 -1
- package/dist/internal/types.js.map +0 -1
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import { type Infer } from '@metamask/superstruct';
|
|
2
|
-
/**
|
|
3
|
-
* Struct of a UserOperation as defined by ERC-4337.
|
|
4
|
-
*
|
|
5
|
-
* @see https://eips.ethereum.org/EIPS/eip-4337#definitions
|
|
6
|
-
*/
|
|
7
|
-
export declare const EthUserOperationStruct: import("@metamask/superstruct").Struct<{
|
|
8
|
-
sender: string;
|
|
9
|
-
nonce: string;
|
|
10
|
-
initCode: string;
|
|
11
|
-
callData: string;
|
|
12
|
-
callGasLimit: string;
|
|
13
|
-
verificationGasLimit: string;
|
|
14
|
-
preVerificationGas: string;
|
|
15
|
-
maxFeePerGas: string;
|
|
16
|
-
maxPriorityFeePerGas: string;
|
|
17
|
-
paymasterAndData: string;
|
|
18
|
-
signature: string;
|
|
19
|
-
}, {
|
|
20
|
-
sender: import("@metamask/superstruct").Struct<string, null>;
|
|
21
|
-
nonce: import("@metamask/superstruct").Struct<string, null>;
|
|
22
|
-
initCode: import("@metamask/superstruct").Struct<string, null>;
|
|
23
|
-
callData: import("@metamask/superstruct").Struct<string, null>;
|
|
24
|
-
callGasLimit: import("@metamask/superstruct").Struct<string, null>;
|
|
25
|
-
verificationGasLimit: import("@metamask/superstruct").Struct<string, null>;
|
|
26
|
-
preVerificationGas: import("@metamask/superstruct").Struct<string, null>;
|
|
27
|
-
maxFeePerGas: import("@metamask/superstruct").Struct<string, null>;
|
|
28
|
-
maxPriorityFeePerGas: import("@metamask/superstruct").Struct<string, null>;
|
|
29
|
-
paymasterAndData: import("@metamask/superstruct").Struct<string, null>;
|
|
30
|
-
signature: import("@metamask/superstruct").Struct<string, null>;
|
|
31
|
-
}>;
|
|
32
|
-
export declare type EthUserOperation = Infer<typeof EthUserOperationStruct>;
|
|
33
|
-
/**
|
|
34
|
-
* Struct containing the most basic transaction information required to
|
|
35
|
-
* construct a UserOperation.
|
|
36
|
-
*/
|
|
37
|
-
export declare const EthBaseTransactionStruct: import("@metamask/superstruct").Struct<{
|
|
38
|
-
data: string;
|
|
39
|
-
to: string;
|
|
40
|
-
value: string;
|
|
41
|
-
}, {
|
|
42
|
-
/**
|
|
43
|
-
* Address of the transaction recipient.
|
|
44
|
-
*/
|
|
45
|
-
to: import("@metamask/superstruct").Struct<string, null>;
|
|
46
|
-
/**
|
|
47
|
-
* Amount of wei to transfer to the recipient.
|
|
48
|
-
*/
|
|
49
|
-
value: import("@metamask/superstruct").Struct<string, null>;
|
|
50
|
-
/**
|
|
51
|
-
* Data to pass to the recipient.
|
|
52
|
-
*/
|
|
53
|
-
data: import("@metamask/superstruct").Struct<string, null>;
|
|
54
|
-
}>;
|
|
55
|
-
export declare type EthBaseTransaction = Infer<typeof EthBaseTransactionStruct>;
|
|
56
|
-
export declare const EthBaseUserOperationStruct: import("@metamask/superstruct").Struct<{
|
|
57
|
-
nonce: string;
|
|
58
|
-
initCode: string;
|
|
59
|
-
callData: string;
|
|
60
|
-
dummyPaymasterAndData: string;
|
|
61
|
-
dummySignature: string;
|
|
62
|
-
bundlerUrl: string;
|
|
63
|
-
gasLimits?: {
|
|
64
|
-
callGasLimit: string;
|
|
65
|
-
verificationGasLimit: string;
|
|
66
|
-
preVerificationGas: string;
|
|
67
|
-
};
|
|
68
|
-
}, {
|
|
69
|
-
nonce: import("@metamask/superstruct").Struct<string, null>;
|
|
70
|
-
initCode: import("@metamask/superstruct").Struct<string, null>;
|
|
71
|
-
callData: import("@metamask/superstruct").Struct<string, null>;
|
|
72
|
-
gasLimits: import("@metamask/superstruct").Struct<import("@metamask/keyring-utils").ExactOptionalTag | {
|
|
73
|
-
callGasLimit: string;
|
|
74
|
-
verificationGasLimit: string;
|
|
75
|
-
preVerificationGas: string;
|
|
76
|
-
}, {
|
|
77
|
-
callGasLimit: import("@metamask/superstruct").Struct<string, null>;
|
|
78
|
-
verificationGasLimit: import("@metamask/superstruct").Struct<string, null>;
|
|
79
|
-
preVerificationGas: import("@metamask/superstruct").Struct<string, null>;
|
|
80
|
-
}>;
|
|
81
|
-
dummyPaymasterAndData: import("@metamask/superstruct").Struct<string, null>;
|
|
82
|
-
dummySignature: import("@metamask/superstruct").Struct<string, null>;
|
|
83
|
-
bundlerUrl: import("@metamask/superstruct").Struct<string, null>;
|
|
84
|
-
}>;
|
|
85
|
-
export declare type EthBaseUserOperation = Infer<typeof EthBaseUserOperationStruct>;
|
|
86
|
-
export declare const EthUserOperationPatchStruct: import("@metamask/superstruct").Struct<{
|
|
87
|
-
paymasterAndData: string;
|
|
88
|
-
callGasLimit?: string;
|
|
89
|
-
verificationGasLimit?: string;
|
|
90
|
-
preVerificationGas?: string;
|
|
91
|
-
}, {
|
|
92
|
-
paymasterAndData: import("@metamask/superstruct").Struct<string, null>;
|
|
93
|
-
callGasLimit: import("@metamask/superstruct").Struct<string | import("@metamask/keyring-utils").ExactOptionalTag, null>;
|
|
94
|
-
verificationGasLimit: import("@metamask/superstruct").Struct<string | import("@metamask/keyring-utils").ExactOptionalTag, null>;
|
|
95
|
-
preVerificationGas: import("@metamask/superstruct").Struct<string | import("@metamask/keyring-utils").ExactOptionalTag, null>;
|
|
96
|
-
}>;
|
|
97
|
-
export declare type EthUserOperationPatch = Infer<typeof EthUserOperationPatchStruct>;
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EthUserOperationPatchStruct = exports.EthBaseUserOperationStruct = exports.EthBaseTransactionStruct = exports.EthUserOperationStruct = void 0;
|
|
4
|
-
const keyring_utils_1 = require("@metamask/keyring-utils");
|
|
5
|
-
const types_1 = require("../types");
|
|
6
|
-
/**
|
|
7
|
-
* Struct of a UserOperation as defined by ERC-4337.
|
|
8
|
-
*
|
|
9
|
-
* @see https://eips.ethereum.org/EIPS/eip-4337#definitions
|
|
10
|
-
*/
|
|
11
|
-
exports.EthUserOperationStruct = (0, keyring_utils_1.object)({
|
|
12
|
-
sender: types_1.EthAddressStruct,
|
|
13
|
-
nonce: types_1.EthUint256Struct,
|
|
14
|
-
initCode: types_1.EthBytesStruct,
|
|
15
|
-
callData: types_1.EthBytesStruct,
|
|
16
|
-
callGasLimit: types_1.EthUint256Struct,
|
|
17
|
-
verificationGasLimit: types_1.EthUint256Struct,
|
|
18
|
-
preVerificationGas: types_1.EthUint256Struct,
|
|
19
|
-
maxFeePerGas: types_1.EthUint256Struct,
|
|
20
|
-
maxPriorityFeePerGas: types_1.EthUint256Struct,
|
|
21
|
-
paymasterAndData: types_1.EthBytesStruct,
|
|
22
|
-
signature: types_1.EthBytesStruct,
|
|
23
|
-
});
|
|
24
|
-
/**
|
|
25
|
-
* Struct containing the most basic transaction information required to
|
|
26
|
-
* construct a UserOperation.
|
|
27
|
-
*/
|
|
28
|
-
exports.EthBaseTransactionStruct = (0, keyring_utils_1.object)({
|
|
29
|
-
/**
|
|
30
|
-
* Address of the transaction recipient.
|
|
31
|
-
*/
|
|
32
|
-
to: types_1.EthAddressStruct,
|
|
33
|
-
/**
|
|
34
|
-
* Amount of wei to transfer to the recipient.
|
|
35
|
-
*/
|
|
36
|
-
value: types_1.EthUint256Struct,
|
|
37
|
-
/**
|
|
38
|
-
* Data to pass to the recipient.
|
|
39
|
-
*/
|
|
40
|
-
data: types_1.EthBytesStruct,
|
|
41
|
-
});
|
|
42
|
-
exports.EthBaseUserOperationStruct = (0, keyring_utils_1.object)({
|
|
43
|
-
nonce: types_1.EthUint256Struct,
|
|
44
|
-
initCode: types_1.EthBytesStruct,
|
|
45
|
-
callData: types_1.EthBytesStruct,
|
|
46
|
-
gasLimits: (0, keyring_utils_1.exactOptional)((0, keyring_utils_1.object)({
|
|
47
|
-
callGasLimit: types_1.EthUint256Struct,
|
|
48
|
-
verificationGasLimit: types_1.EthUint256Struct,
|
|
49
|
-
preVerificationGas: types_1.EthUint256Struct,
|
|
50
|
-
})),
|
|
51
|
-
dummyPaymasterAndData: types_1.EthBytesStruct,
|
|
52
|
-
dummySignature: types_1.EthBytesStruct,
|
|
53
|
-
bundlerUrl: keyring_utils_1.UrlStruct,
|
|
54
|
-
});
|
|
55
|
-
exports.EthUserOperationPatchStruct = (0, keyring_utils_1.object)({
|
|
56
|
-
paymasterAndData: types_1.EthBytesStruct,
|
|
57
|
-
callGasLimit: (0, keyring_utils_1.exactOptional)(types_1.EthUint256Struct),
|
|
58
|
-
verificationGasLimit: (0, keyring_utils_1.exactOptional)(types_1.EthUint256Struct),
|
|
59
|
-
preVerificationGas: (0, keyring_utils_1.exactOptional)(types_1.EthUint256Struct),
|
|
60
|
-
});
|
|
61
|
-
//# sourceMappingURL=types.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/eth/erc4337/types.ts"],"names":[],"mappings":";;;AAAA,2DAA2E;AAG3E,oCAA8E;AAE9E;;;;GAIG;AACU,QAAA,sBAAsB,GAAG,IAAA,sBAAM,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,sBAAM,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,sBAAM,EAAC;IAC/C,KAAK,EAAE,wBAAgB;IACvB,QAAQ,EAAE,sBAAc;IACxB,QAAQ,EAAE,sBAAc;IACxB,SAAS,EAAE,IAAA,6BAAa,EACtB,IAAA,sBAAM,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,yBAAS;CACtB,CAAC,CAAC;AAIU,QAAA,2BAA2B,GAAG,IAAA,sBAAM,EAAC;IAChD,gBAAgB,EAAE,sBAAc;IAChC,YAAY,EAAE,IAAA,6BAAa,EAAC,wBAAgB,CAAC;IAC7C,oBAAoB,EAAE,IAAA,6BAAa,EAAC,wBAAgB,CAAC;IACrD,kBAAkB,EAAE,IAAA,6BAAa,EAAC,wBAAgB,CAAC;CACpD,CAAC,CAAC","sourcesContent":["import { exactOptional, object, UrlStruct } from '@metamask/keyring-utils';\nimport { type Infer } from '@metamask/superstruct';\n\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/index.d.ts
DELETED
package/dist/eth/index.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
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("./erc4337"), exports);
|
|
18
|
-
__exportStar(require("./types"), exports);
|
|
19
|
-
__exportStar(require("./utils"), exports);
|
|
20
|
-
//# sourceMappingURL=index.js.map
|
package/dist/eth/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/eth/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAA0B;AAC1B,0CAAwB;AACxB,0CAAwB","sourcesContent":["export * from './erc4337';\nexport * from './types';\nexport * from './utils';\n"]}
|
package/dist/eth/types.d.ts
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
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
|
-
id: string;
|
|
21
|
-
options: Record<string, import("@metamask/utils").Json>;
|
|
22
|
-
address: string;
|
|
23
|
-
type: "eip155:eoa";
|
|
24
|
-
methods: ("personal_sign" | "eth_sign" | "eth_signTransaction" | "eth_signTypedData_v1" | "eth_signTypedData_v3" | "eth_signTypedData_v4")[];
|
|
25
|
-
}, {
|
|
26
|
-
/**
|
|
27
|
-
* Account address.
|
|
28
|
-
*/
|
|
29
|
-
address: import("@metamask/superstruct").Struct<string, null>;
|
|
30
|
-
/**
|
|
31
|
-
* Account type.
|
|
32
|
-
*/
|
|
33
|
-
type: import("@metamask/superstruct").Struct<"eip155:eoa", "eip155:eoa">;
|
|
34
|
-
/**
|
|
35
|
-
* Account supported methods.
|
|
36
|
-
*/
|
|
37
|
-
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", {
|
|
38
|
-
personal_sign: "personal_sign";
|
|
39
|
-
eth_sign: "eth_sign";
|
|
40
|
-
eth_signTransaction: "eth_signTransaction";
|
|
41
|
-
eth_signTypedData_v1: "eth_signTypedData_v1";
|
|
42
|
-
eth_signTypedData_v3: "eth_signTypedData_v3";
|
|
43
|
-
eth_signTypedData_v4: "eth_signTypedData_v4";
|
|
44
|
-
}>>;
|
|
45
|
-
id: import("@metamask/superstruct").Struct<string, null>;
|
|
46
|
-
options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
|
|
47
|
-
}>;
|
|
48
|
-
export declare type EthEoaAccount = Infer<typeof EthEoaAccountStruct>;
|
|
49
|
-
export declare const EthErc4337AccountStruct: import("@metamask/superstruct").Struct<{
|
|
50
|
-
id: string;
|
|
51
|
-
options: Record<string, import("@metamask/utils").Json>;
|
|
52
|
-
address: string;
|
|
53
|
-
type: "eip155:erc4337";
|
|
54
|
-
methods: ("personal_sign" | "eth_sign" | "eth_signTypedData_v1" | "eth_signTypedData_v3" | "eth_signTypedData_v4" | "eth_prepareUserOperation" | "eth_patchUserOperation" | "eth_signUserOperation")[];
|
|
55
|
-
}, {
|
|
56
|
-
/**
|
|
57
|
-
* Account address.
|
|
58
|
-
*/
|
|
59
|
-
address: import("@metamask/superstruct").Struct<string, null>;
|
|
60
|
-
/**
|
|
61
|
-
* Account type.
|
|
62
|
-
*/
|
|
63
|
-
type: import("@metamask/superstruct").Struct<"eip155:erc4337", "eip155:erc4337">;
|
|
64
|
-
/**
|
|
65
|
-
* Account supported methods.
|
|
66
|
-
*/
|
|
67
|
-
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", {
|
|
68
|
-
personal_sign: "personal_sign";
|
|
69
|
-
eth_sign: "eth_sign";
|
|
70
|
-
eth_signTypedData_v1: "eth_signTypedData_v1";
|
|
71
|
-
eth_signTypedData_v3: "eth_signTypedData_v3";
|
|
72
|
-
eth_signTypedData_v4: "eth_signTypedData_v4";
|
|
73
|
-
eth_prepareUserOperation: "eth_prepareUserOperation";
|
|
74
|
-
eth_patchUserOperation: "eth_patchUserOperation";
|
|
75
|
-
eth_signUserOperation: "eth_signUserOperation";
|
|
76
|
-
}>>;
|
|
77
|
-
id: import("@metamask/superstruct").Struct<string, null>;
|
|
78
|
-
options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
|
|
79
|
-
}>;
|
|
80
|
-
export declare type EthErc4337Account = Infer<typeof EthErc4337AccountStruct>;
|
package/dist/eth/types.js
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EthErc4337AccountStruct = exports.EthEoaAccountStruct = exports.EthMethod = exports.EthUint256Struct = exports.EthAddressStruct = exports.EthBytesStruct = void 0;
|
|
4
|
-
const keyring_api_1 = require("@metamask/keyring-api");
|
|
5
|
-
const keyring_utils_1 = require("@metamask/keyring-utils");
|
|
6
|
-
const superstruct_1 = require("@metamask/superstruct");
|
|
7
|
-
exports.EthBytesStruct = (0, keyring_utils_1.definePattern)('EthBytes', /^0x[0-9a-f]*$/iu);
|
|
8
|
-
exports.EthAddressStruct = (0, keyring_utils_1.definePattern)('EthAddress', /^0x[0-9a-f]{40}$/iu);
|
|
9
|
-
exports.EthUint256Struct = (0, keyring_utils_1.definePattern)('EthUint256', /^0x([1-9a-f][0-9a-f]*|0)$/iu);
|
|
10
|
-
/**
|
|
11
|
-
* Supported Ethereum methods.
|
|
12
|
-
*/
|
|
13
|
-
var EthMethod;
|
|
14
|
-
(function (EthMethod) {
|
|
15
|
-
// General signing methods
|
|
16
|
-
EthMethod["PersonalSign"] = "personal_sign";
|
|
17
|
-
EthMethod["Sign"] = "eth_sign";
|
|
18
|
-
EthMethod["SignTransaction"] = "eth_signTransaction";
|
|
19
|
-
EthMethod["SignTypedDataV1"] = "eth_signTypedData_v1";
|
|
20
|
-
EthMethod["SignTypedDataV3"] = "eth_signTypedData_v3";
|
|
21
|
-
EthMethod["SignTypedDataV4"] = "eth_signTypedData_v4";
|
|
22
|
-
// ERC-4337 methods
|
|
23
|
-
EthMethod["PrepareUserOperation"] = "eth_prepareUserOperation";
|
|
24
|
-
EthMethod["PatchUserOperation"] = "eth_patchUserOperation";
|
|
25
|
-
EthMethod["SignUserOperation"] = "eth_signUserOperation";
|
|
26
|
-
})(EthMethod = exports.EthMethod || (exports.EthMethod = {}));
|
|
27
|
-
exports.EthEoaAccountStruct = (0, keyring_utils_1.object)({
|
|
28
|
-
...keyring_api_1.KeyringAccountStruct.schema,
|
|
29
|
-
/**
|
|
30
|
-
* Account address.
|
|
31
|
-
*/
|
|
32
|
-
address: exports.EthAddressStruct,
|
|
33
|
-
/**
|
|
34
|
-
* Account type.
|
|
35
|
-
*/
|
|
36
|
-
type: (0, superstruct_1.literal)(`${keyring_api_1.EthAccountType.Eoa}`),
|
|
37
|
-
/**
|
|
38
|
-
* Account supported methods.
|
|
39
|
-
*/
|
|
40
|
-
methods: (0, superstruct_1.array)((0, superstruct_1.enums)([
|
|
41
|
-
`${EthMethod.PersonalSign}`,
|
|
42
|
-
`${EthMethod.Sign}`,
|
|
43
|
-
`${EthMethod.SignTransaction}`,
|
|
44
|
-
`${EthMethod.SignTypedDataV1}`,
|
|
45
|
-
`${EthMethod.SignTypedDataV3}`,
|
|
46
|
-
`${EthMethod.SignTypedDataV4}`,
|
|
47
|
-
])),
|
|
48
|
-
});
|
|
49
|
-
exports.EthErc4337AccountStruct = (0, keyring_utils_1.object)({
|
|
50
|
-
...keyring_api_1.KeyringAccountStruct.schema,
|
|
51
|
-
/**
|
|
52
|
-
* Account address.
|
|
53
|
-
*/
|
|
54
|
-
address: exports.EthAddressStruct,
|
|
55
|
-
/**
|
|
56
|
-
* Account type.
|
|
57
|
-
*/
|
|
58
|
-
type: (0, superstruct_1.literal)(`${keyring_api_1.EthAccountType.Erc4337}`),
|
|
59
|
-
/**
|
|
60
|
-
* Account supported methods.
|
|
61
|
-
*/
|
|
62
|
-
methods: (0, superstruct_1.array)((0, superstruct_1.enums)([
|
|
63
|
-
`${EthMethod.PersonalSign}`,
|
|
64
|
-
`${EthMethod.Sign}`,
|
|
65
|
-
`${EthMethod.SignTypedDataV1}`,
|
|
66
|
-
`${EthMethod.SignTypedDataV3}`,
|
|
67
|
-
`${EthMethod.SignTypedDataV4}`,
|
|
68
|
-
`${EthMethod.PrepareUserOperation}`,
|
|
69
|
-
`${EthMethod.PatchUserOperation}`,
|
|
70
|
-
`${EthMethod.SignUserOperation}`,
|
|
71
|
-
])),
|
|
72
|
-
});
|
|
73
|
-
//# sourceMappingURL=types.js.map
|
package/dist/eth/types.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/eth/types.ts"],"names":[],"mappings":";;;AAAA,uDAA6E;AAC7E,2DAAgE;AAEhE,uDAA8D;AAEjD,QAAA,cAAc,GAAG,IAAA,6BAAa,EAAC,UAAU,EAAE,iBAAiB,CAAC,CAAC;AAE9D,QAAA,gBAAgB,GAAG,IAAA,6BAAa,EAC3C,YAAY,EACZ,oBAAoB,CACrB,CAAC;AAEW,QAAA,gBAAgB,GAAG,I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G,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 { EthAccountType, KeyringAccountStruct } from '@metamask/keyring-api';\nimport { object, definePattern } from '@metamask/keyring-utils';\nimport type { Infer } from '@metamask/superstruct';\nimport { array, enums, literal } from '@metamask/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/eth/utils.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { KeyringAccountType } from '@metamask/keyring-api';
|
|
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;
|
package/dist/eth/utils.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isEvmAccountType = void 0;
|
|
4
|
-
const keyring_api_1 = require("@metamask/keyring-api");
|
|
5
|
-
/**
|
|
6
|
-
* Checks if the given type is an EVM account type.
|
|
7
|
-
*
|
|
8
|
-
* @param type - The type to check.
|
|
9
|
-
* @returns Returns true if the type is an EVM account type, false otherwise.
|
|
10
|
-
*/
|
|
11
|
-
function isEvmAccountType(type) {
|
|
12
|
-
return type === keyring_api_1.EthAccountType.Eoa || type === keyring_api_1.EthAccountType.Erc4337;
|
|
13
|
-
}
|
|
14
|
-
exports.isEvmAccountType = isEvmAccountType;
|
|
15
|
-
//# sourceMappingURL=utils.js.map
|
package/dist/eth/utils.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/eth/utils.ts"],"names":[],"mappings":";;;AACA,uDAAuD;AAEvD;;;;;GAKG;AACH,SAAgB,gBAAgB,CAAC,IAAwB;IACvD,OAAO,IAAI,KAAK,4BAAc,CAAC,GAAG,IAAI,IAAI,KAAK,4BAAc,CAAC,OAAO,CAAC;AACxE,CAAC;AAFD,4CAEC","sourcesContent":["import type { KeyringAccountType } from '@metamask/keyring-api';\nimport { EthAccountType } from '@metamask/keyring-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"]}
|
package/dist/index.d.ts
DELETED
package/dist/index.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
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("./internal"), exports);
|
|
18
|
-
__exportStar(require("./btc"), exports);
|
|
19
|
-
__exportStar(require("./eth"), exports);
|
|
20
|
-
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA2B;AAC3B,wCAAsB;AACtB,wCAAsB","sourcesContent":["export * from './internal';\nexport * from './btc';\nexport * from './eth';\n"]}
|
package/dist/internal/api.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/internal/api.ts"],"names":[],"mappings":";;;AAAA,uDAO+B;AAC/B,2DAA6D;AAE7D,uDAO+B;AAC/B,2CAA6C;AAE7C,+BAAyC;AAEzC,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,sBAAM,EAAC;IAC9C,GAAG,YAAY;IACf,MAAM,EAAE,IAAA,qBAAO,EAAC,sBAAsB,CAAC;CACxC,CAAC,CAAC;AAIU,QAAA,0BAA0B,GAAG,IAAA,mBAAK,EAAC,kCAAoB,CAAC,CAAC;AAItE,+EAA+E;AAC/E,cAAc;AAED,QAAA,uBAAuB,GAAG,IAAA,sBAAM,EAAC;IAC5C,GAAG,YAAY;IACf,MAAM,EAAE,IAAA,qBAAO,EAAC,oBAAoB,CAAC;IACrC,MAAM,EAAE,IAAA,sBAAM,EAAC;QACb,EA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AAM,EAAC;QACb,EAAE,EAAE,0BAAU;KACf,CAAC;CACH,CAAC,CAAC;AAIU,QAAA,wBAAwB,GAAG,kCAAoB,CAAC;AAI7D,+EAA+E;AAC/E,iBAAiB;AAEJ,QAAA,0BAA0B,GAAG,IAAA,sBAAM,EAAC;IAC/C,GAAG,YAAY;IACf,MAAM,EAAE,IAAA,qBAAO,EAAC,uBAAuB,CAAC;IACxC,MAAM,EAAE,kCAAoB;CAC7B,CAAC,CAAC;AAIU,QAAA,2BAA2B,GAAG,mCAAqB,CAAC;AAIjE,+EAA+E;AAC/E,kBAAkB;AAEL,QAAA,2BAA2B,GAAG,IAAA,sBAAM,EAAC;IAChD,GAAG,YAAY;IACf,MAAM,EAAE,IAAA,qBAAO,EAAC,wBAAwB,CAAC;IACzC,MAAM,EAAE,IAAA,sBAAM,EAAC;QACb,EAAE,EAAE,0BAAU;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,sBAAM,EAAC;IAC/C,GAAG,YAAY;IACf,MAAM,EAAE,IAAA,qBAAO,EAAC,uBAAuB,CAAC;IACxC,MAAM,EAAE,IAAA,sBAAM,EAAC;QACb,EAAE,EAAE,0BAAU;KACf,CAAC;CACH,CAAC,CAAC;AAIU,QAAA,2BAA2B,GAAG,IAAA,qBAAO,EAAC,IAAI,CAAC,CAAC","sourcesContent":["import {\n BalanceStruct,\n CaipAssetTypeStruct,\n KeyringAccountDataStruct,\n KeyringAccountStruct,\n KeyringRequestStruct,\n KeyringResponseStruct,\n} from '@metamask/keyring-api';\nimport { object, UuidStruct } from '@metamask/keyring-utils';\nimport 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';\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 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"EthKeyring.js","sourceRoot":"","sources":["../../../src/internal/eth/EthKeyring.ts"],"names":[],"mappings":"","sourcesContent":["import type { KeyringExecutionContext } from '@metamask/keyring-api';\nimport type { Json, Keyring } from '@metamask/utils';\n\nimport type {\n EthBaseTransaction,\n EthBaseUserOperation,\n EthUserOperation,\n EthUserOperationPatch,\n} from '../../eth';\n\nexport type EthKeyring<State extends Json> = Keyring<State> & {\n /**\n * Convert a base transaction to a base UserOperation.\n *\n * @param address - Address of the sender.\n * @param transactions - Base transactions to include in the UserOperation.\n * @param context - Keyring execution context.\n * @returns A pseudo-UserOperation that can be used to construct a real.\n */\n prepareUserOperation?(\n address: string,\n transactions: EthBaseTransaction[],\n context: KeyringExecutionContext,\n ): Promise<EthBaseUserOperation>;\n\n /**\n * Patches properties of a UserOperation. Currently, only the\n * `paymasterAndData` can be patched.\n *\n * @param address - Address of the sender.\n * @param userOp - UserOperation to patch.\n * @param context - Keyring execution context.\n * @returns A patch to apply to the UserOperation.\n */\n patchUserOperation?(\n address: string,\n userOp: EthUserOperation,\n context: KeyringExecutionContext,\n ): Promise<EthUserOperationPatch>;\n\n /**\n * Signs an UserOperation.\n *\n * @param address - Address of the sender.\n * @param userOp - UserOperation to sign.\n * @param context - Keyring execution context.\n * @returns The signature of the UserOperation.\n */\n signUserOperation?(\n address: string,\n userOp: EthUserOperation,\n context: KeyringExecutionContext,\n ): Promise<string>;\n};\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './EthKeyring';
|
|
@@ -1,18 +0,0 @@
|
|
|
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("./EthKeyring"), exports);
|
|
18
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/internal/eth/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B","sourcesContent":["export * from './EthKeyring';\n"]}
|