@metamask-previews/keyring-internal-api 0.0.1-672cc7b
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 +10 -0
- package/README.md +15 -0
- package/dist/btc/index.d.ts +1 -0
- package/dist/btc/index.js +18 -0
- package/dist/btc/index.js.map +1 -0
- package/dist/btc/types.d.ts +33 -0
- package/dist/btc/types.js +40 -0
- package/dist/btc/types.js.map +1 -0
- package/dist/eth/erc4337/index.d.ts +1 -0
- package/dist/eth/erc4337/index.js +18 -0
- package/dist/eth/erc4337/index.js.map +1 -0
- package/dist/eth/erc4337/types.d.ts +97 -0
- package/dist/eth/erc4337/types.js +61 -0
- package/dist/eth/erc4337/types.js.map +1 -0
- package/dist/eth/index.d.ts +3 -0
- package/dist/eth/index.js +20 -0
- package/dist/eth/index.js.map +1 -0
- package/dist/eth/types.d.ts +80 -0
- package/dist/eth/types.js +73 -0
- package/dist/eth/types.js.map +1 -0
- package/dist/eth/utils.d.ts +8 -0
- package/dist/eth/utils.js +15 -0
- package/dist/eth/utils.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +20 -0
- package/dist/index.js.map +1 -0
- package/dist/internal/api.d.ts +415 -0
- package/dist/internal/api.js +138 -0
- package/dist/internal/api.js.map +1 -0
- package/dist/internal/eth/EthKeyring.d.ts +33 -0
- package/dist/internal/eth/EthKeyring.js +3 -0
- package/dist/internal/eth/EthKeyring.js.map +1 -0
- package/dist/internal/eth/index.d.ts +1 -0
- package/dist/internal/eth/index.js +18 -0
- package/dist/internal/eth/index.js.map +1 -0
- package/dist/internal/events.d.ts +169 -0
- package/dist/internal/events.js +83 -0
- package/dist/internal/events.js.map +1 -0
- package/dist/internal/index.d.ts +5 -0
- package/dist/internal/index.js +22 -0
- package/dist/internal/index.js.map +1 -0
- package/dist/internal/rpc.d.ts +25 -0
- package/dist/internal/rpc.js +33 -0
- package/dist/internal/rpc.js.map +1 -0
- package/dist/internal/types.d.ts +330 -0
- package/dist/internal/types.js +49 -0
- package/dist/internal/types.js.map +1 -0
- package/package.json +78 -0
|
@@ -0,0 +1,169 @@
|
|
|
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
|
+
export declare const AccountCreatedEventStruct: import("@metamask/superstruct").Struct<{
|
|
12
|
+
method: "notify:accountCreated";
|
|
13
|
+
params: {
|
|
14
|
+
account: {
|
|
15
|
+
id: string;
|
|
16
|
+
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2wpkh";
|
|
17
|
+
address: string;
|
|
18
|
+
options: Record<string, import("@metamask/utils").Json>;
|
|
19
|
+
methods: string[];
|
|
20
|
+
};
|
|
21
|
+
accountNameSuggestion?: string;
|
|
22
|
+
displayConfirmation?: boolean;
|
|
23
|
+
};
|
|
24
|
+
}, {
|
|
25
|
+
method: import("@metamask/superstruct").Struct<"notify:accountCreated", "notify:accountCreated">;
|
|
26
|
+
params: import("@metamask/superstruct").Struct<{
|
|
27
|
+
account: {
|
|
28
|
+
id: string;
|
|
29
|
+
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2wpkh";
|
|
30
|
+
address: string;
|
|
31
|
+
options: Record<string, import("@metamask/utils").Json>;
|
|
32
|
+
methods: string[];
|
|
33
|
+
};
|
|
34
|
+
accountNameSuggestion?: string;
|
|
35
|
+
displayConfirmation?: boolean;
|
|
36
|
+
}, {
|
|
37
|
+
/**
|
|
38
|
+
* New account object.
|
|
39
|
+
*/
|
|
40
|
+
account: import("@metamask/superstruct").Struct<{
|
|
41
|
+
id: string;
|
|
42
|
+
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2wpkh";
|
|
43
|
+
address: string;
|
|
44
|
+
options: Record<string, import("@metamask/utils").Json>;
|
|
45
|
+
methods: string[];
|
|
46
|
+
}, {
|
|
47
|
+
id: import("@metamask/superstruct").Struct<string, null>;
|
|
48
|
+
type: import("@metamask/superstruct").Struct<"eip155:eoa" | "eip155:erc4337" | "bip122:p2wpkh", {
|
|
49
|
+
"eip155:eoa": "eip155:eoa";
|
|
50
|
+
"eip155:erc4337": "eip155:erc4337";
|
|
51
|
+
"bip122:p2wpkh": "bip122:p2wpkh";
|
|
52
|
+
}>;
|
|
53
|
+
address: import("@metamask/superstruct").Struct<string, null>;
|
|
54
|
+
options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
|
|
55
|
+
methods: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
|
|
56
|
+
}>;
|
|
57
|
+
/**
|
|
58
|
+
* Account name suggestion provided to the MetaMask client.
|
|
59
|
+
*
|
|
60
|
+
* The keyring can suggest a name for the account, but it's up to the
|
|
61
|
+
* client to decide whether to use it. The keyring won't be informed if the
|
|
62
|
+
* client decides to use a different name.
|
|
63
|
+
*/
|
|
64
|
+
accountNameSuggestion: import("@metamask/superstruct").Struct<string | import("@metamask/keyring-utils").ExactOptionalTag, null>;
|
|
65
|
+
/**
|
|
66
|
+
* Instructs MetaMask to display the add account confirmation dialog in the UI.
|
|
67
|
+
* **Note:** This is not guaranteed to be honored by the MetaMask client.
|
|
68
|
+
*/
|
|
69
|
+
displayConfirmation: import("@metamask/superstruct").Struct<boolean | import("@metamask/keyring-utils").ExactOptionalTag, null>;
|
|
70
|
+
}>;
|
|
71
|
+
}>;
|
|
72
|
+
export declare const AccountUpdatedEventStruct: import("@metamask/superstruct").Struct<{
|
|
73
|
+
method: "notify:accountUpdated";
|
|
74
|
+
params: {
|
|
75
|
+
account: {
|
|
76
|
+
id: string;
|
|
77
|
+
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2wpkh";
|
|
78
|
+
address: string;
|
|
79
|
+
options: Record<string, import("@metamask/utils").Json>;
|
|
80
|
+
methods: string[];
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
}, {
|
|
84
|
+
method: import("@metamask/superstruct").Struct<"notify:accountUpdated", "notify:accountUpdated">;
|
|
85
|
+
params: import("@metamask/superstruct").Struct<{
|
|
86
|
+
account: {
|
|
87
|
+
id: string;
|
|
88
|
+
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2wpkh";
|
|
89
|
+
address: string;
|
|
90
|
+
options: Record<string, import("@metamask/utils").Json>;
|
|
91
|
+
methods: string[];
|
|
92
|
+
};
|
|
93
|
+
}, {
|
|
94
|
+
/**
|
|
95
|
+
* Updated account object.
|
|
96
|
+
*/
|
|
97
|
+
account: import("@metamask/superstruct").Struct<{
|
|
98
|
+
id: string;
|
|
99
|
+
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2wpkh";
|
|
100
|
+
address: string;
|
|
101
|
+
options: Record<string, import("@metamask/utils").Json>;
|
|
102
|
+
methods: string[];
|
|
103
|
+
}, {
|
|
104
|
+
id: import("@metamask/superstruct").Struct<string, null>;
|
|
105
|
+
type: import("@metamask/superstruct").Struct<"eip155:eoa" | "eip155:erc4337" | "bip122:p2wpkh", {
|
|
106
|
+
"eip155:eoa": "eip155:eoa";
|
|
107
|
+
"eip155:erc4337": "eip155:erc4337";
|
|
108
|
+
"bip122:p2wpkh": "bip122:p2wpkh";
|
|
109
|
+
}>;
|
|
110
|
+
address: import("@metamask/superstruct").Struct<string, null>;
|
|
111
|
+
options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
|
|
112
|
+
methods: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
|
|
113
|
+
}>;
|
|
114
|
+
}>;
|
|
115
|
+
}>;
|
|
116
|
+
export declare const AccountDeletedEventStruct: import("@metamask/superstruct").Struct<{
|
|
117
|
+
method: "notify:accountDeleted";
|
|
118
|
+
params: {
|
|
119
|
+
id: string;
|
|
120
|
+
};
|
|
121
|
+
}, {
|
|
122
|
+
method: import("@metamask/superstruct").Struct<"notify:accountDeleted", "notify:accountDeleted">;
|
|
123
|
+
params: import("@metamask/superstruct").Struct<{
|
|
124
|
+
id: string;
|
|
125
|
+
}, {
|
|
126
|
+
/**
|
|
127
|
+
* Deleted account ID.
|
|
128
|
+
*/
|
|
129
|
+
id: import("@metamask/superstruct").Struct<string, null>;
|
|
130
|
+
}>;
|
|
131
|
+
}>;
|
|
132
|
+
export declare const RequestApprovedEventStruct: import("@metamask/superstruct").Struct<{
|
|
133
|
+
method: "notify:requestApproved";
|
|
134
|
+
params: {
|
|
135
|
+
id: string;
|
|
136
|
+
result: import("@metamask/utils").Json;
|
|
137
|
+
};
|
|
138
|
+
}, {
|
|
139
|
+
method: import("@metamask/superstruct").Struct<"notify:requestApproved", "notify:requestApproved">;
|
|
140
|
+
params: import("@metamask/superstruct").Struct<{
|
|
141
|
+
id: string;
|
|
142
|
+
result: import("@metamask/utils").Json;
|
|
143
|
+
}, {
|
|
144
|
+
/**
|
|
145
|
+
* Request ID.
|
|
146
|
+
*/
|
|
147
|
+
id: import("@metamask/superstruct").Struct<string, null>;
|
|
148
|
+
/**
|
|
149
|
+
* Request result.
|
|
150
|
+
*/
|
|
151
|
+
result: import("@metamask/superstruct").Struct<import("@metamask/utils").Json, unknown>;
|
|
152
|
+
}>;
|
|
153
|
+
}>;
|
|
154
|
+
export declare const RequestRejectedEventStruct: import("@metamask/superstruct").Struct<{
|
|
155
|
+
method: "notify:requestRejected";
|
|
156
|
+
params: {
|
|
157
|
+
id: string;
|
|
158
|
+
};
|
|
159
|
+
}, {
|
|
160
|
+
method: import("@metamask/superstruct").Struct<"notify:requestRejected", "notify:requestRejected">;
|
|
161
|
+
params: import("@metamask/superstruct").Struct<{
|
|
162
|
+
id: string;
|
|
163
|
+
}, {
|
|
164
|
+
/**
|
|
165
|
+
* Request ID.
|
|
166
|
+
*/
|
|
167
|
+
id: import("@metamask/superstruct").Struct<string, null>;
|
|
168
|
+
}>;
|
|
169
|
+
}>;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RequestRejectedEventStruct = exports.RequestApprovedEventStruct = exports.AccountDeletedEventStruct = exports.AccountUpdatedEventStruct = exports.AccountCreatedEventStruct = exports.KeyringEvent = 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
|
+
const utils_1 = require("@metamask/utils");
|
|
8
|
+
/**
|
|
9
|
+
* Supported keyring events.
|
|
10
|
+
*/
|
|
11
|
+
var KeyringEvent;
|
|
12
|
+
(function (KeyringEvent) {
|
|
13
|
+
// Account events
|
|
14
|
+
KeyringEvent["AccountCreated"] = "notify:accountCreated";
|
|
15
|
+
KeyringEvent["AccountUpdated"] = "notify:accountUpdated";
|
|
16
|
+
KeyringEvent["AccountDeleted"] = "notify:accountDeleted";
|
|
17
|
+
// Request events
|
|
18
|
+
KeyringEvent["RequestApproved"] = "notify:requestApproved";
|
|
19
|
+
KeyringEvent["RequestRejected"] = "notify:requestRejected";
|
|
20
|
+
})(KeyringEvent = exports.KeyringEvent || (exports.KeyringEvent = {}));
|
|
21
|
+
exports.AccountCreatedEventStruct = (0, keyring_utils_1.object)({
|
|
22
|
+
method: (0, superstruct_1.literal)(`${KeyringEvent.AccountCreated}`),
|
|
23
|
+
params: (0, keyring_utils_1.object)({
|
|
24
|
+
/**
|
|
25
|
+
* New account object.
|
|
26
|
+
*/
|
|
27
|
+
account: keyring_api_1.KeyringAccountStruct,
|
|
28
|
+
/**
|
|
29
|
+
* Account name suggestion provided to the MetaMask client.
|
|
30
|
+
*
|
|
31
|
+
* The keyring can suggest a name for the account, but it's up to the
|
|
32
|
+
* client to decide whether to use it. The keyring won't be informed if the
|
|
33
|
+
* client decides to use a different name.
|
|
34
|
+
*/
|
|
35
|
+
accountNameSuggestion: (0, keyring_utils_1.exactOptional)((0, superstruct_1.string)()),
|
|
36
|
+
/**
|
|
37
|
+
* Instructs MetaMask to display the add account confirmation dialog in the UI.
|
|
38
|
+
* **Note:** This is not guaranteed to be honored by the MetaMask client.
|
|
39
|
+
*/
|
|
40
|
+
displayConfirmation: (0, keyring_utils_1.exactOptional)((0, superstruct_1.boolean)()),
|
|
41
|
+
}),
|
|
42
|
+
});
|
|
43
|
+
exports.AccountUpdatedEventStruct = (0, keyring_utils_1.object)({
|
|
44
|
+
method: (0, superstruct_1.literal)(`${KeyringEvent.AccountUpdated}`),
|
|
45
|
+
params: (0, keyring_utils_1.object)({
|
|
46
|
+
/**
|
|
47
|
+
* Updated account object.
|
|
48
|
+
*/
|
|
49
|
+
account: keyring_api_1.KeyringAccountStruct,
|
|
50
|
+
}),
|
|
51
|
+
});
|
|
52
|
+
exports.AccountDeletedEventStruct = (0, keyring_utils_1.object)({
|
|
53
|
+
method: (0, superstruct_1.literal)(`${KeyringEvent.AccountDeleted}`),
|
|
54
|
+
params: (0, keyring_utils_1.object)({
|
|
55
|
+
/**
|
|
56
|
+
* Deleted account ID.
|
|
57
|
+
*/
|
|
58
|
+
id: keyring_utils_1.UuidStruct,
|
|
59
|
+
}),
|
|
60
|
+
});
|
|
61
|
+
exports.RequestApprovedEventStruct = (0, keyring_utils_1.object)({
|
|
62
|
+
method: (0, superstruct_1.literal)(`${KeyringEvent.RequestApproved}`),
|
|
63
|
+
params: (0, keyring_utils_1.object)({
|
|
64
|
+
/**
|
|
65
|
+
* Request ID.
|
|
66
|
+
*/
|
|
67
|
+
id: keyring_utils_1.UuidStruct,
|
|
68
|
+
/**
|
|
69
|
+
* Request result.
|
|
70
|
+
*/
|
|
71
|
+
result: utils_1.JsonStruct,
|
|
72
|
+
}),
|
|
73
|
+
});
|
|
74
|
+
exports.RequestRejectedEventStruct = (0, keyring_utils_1.object)({
|
|
75
|
+
method: (0, superstruct_1.literal)(`${KeyringEvent.RequestRejected}`),
|
|
76
|
+
params: (0, keyring_utils_1.object)({
|
|
77
|
+
/**
|
|
78
|
+
* Request ID.
|
|
79
|
+
*/
|
|
80
|
+
id: keyring_utils_1.UuidStruct,
|
|
81
|
+
}),
|
|
82
|
+
});
|
|
83
|
+
//# sourceMappingURL=events.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/internal/events.ts"],"names":[],"mappings":";;;AAAA,uDAA6D;AAC7D,2DAA4E;AAC5E,uDAAiE;AACjE,2CAA6C;AAE7C;;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,GAAZ,oBAAY,KAAZ,oBAAY,QASvB;AAEY,QAAA,yBAAyB,GAAG,IAAA,sBAAM,EAAC;IAC9C,MAAM,EAAE,IAAA,qBAAO,EAAC,GAAG,YAAY,CAAC,cAAc,EAAE,CAAC;IACjD,MAAM,EAAE,IAAA,sBAAM,EAAC;QACb;;WAEG;QACH,OAAO,EAAE,kCAAoB;QAE7B;;;;;;WAMG;QACH,qBAAqB,EAAE,IAAA,6BAAa,EAAC,IAAA,oBAAM,GAAE,CAAC;QAE9C;;;WAGG;QACH,mBAAmB,EAAE,IAAA,6BAAa,EAAC,IAAA,qBAAO,GAAE,CAAC;KAC9C,CAAC;CACH,CAAC,CAAC;AAEU,QAAA,yBAAyB,GAAG,IAAA,sBAAM,EAAC;IAC9C,MAAM,EAAE,IAAA,qBAAO,EAAC,GAAG,YAAY,CAAC,cAAc,EAAE,CAAC;IACjD,MAAM,EAAE,IAAA,sBAAM,EAAC;QACb;;WAEG;QACH,OAAO,EAAE,kCAAoB;KAC9B,CAAC;CACH,CAAC,CAAC;AAEU,QAAA,yBAAyB,GAAG,IAAA,sBAAM,EAAC;IAC9C,MAAM,EAAE,IAAA,qBAAO,EAAC,GAAG,YAAY,CAAC,cAAc,EAAE,CAAC;IACjD,MAAM,EAAE,IAAA,sBAAM,EAAC;QACb;;WAEG;QACH,EAAE,EAAE,0BAAU;KACf,CAAC;CACH,CAAC,CAAC;AAEU,QAAA,0BAA0B,GAAG,IAAA,sBAAM,EAAC;IAC/C,MAAM,EAAE,IAAA,qBAAO,EAAC,GAAG,YAAY,CAAC,eAAe,EAAE,CAAC;IAClD,MAAM,EAAE,IAAA,sBAAM,EAAC;QACb;;WAEG;QACH,EAAE,EAAE,0BAAU;QAEd;;WAEG;QACH,MAAM,EAAE,kBAAU;KACnB,CAAC;CACH,CAAC,CAAC;AAEU,QAAA,0BAA0B,GAAG,IAAA,sBAAM,EAAC;IAC/C,MAAM,EAAE,IAAA,qBAAO,EAAC,GAAG,YAAY,CAAC,eAAe,EAAE,CAAC;IAClD,MAAM,EAAE,IAAA,sBAAM,EAAC;QACb;;WAEG;QACH,EAAE,EAAE,0BAAU;KACf,CAAC;CACH,CAAC,CAAC","sourcesContent":["import { KeyringAccountStruct } from '@metamask/keyring-api';\nimport { exactOptional, object, UuidStruct } from '@metamask/keyring-utils';\nimport { boolean, literal, string } from '@metamask/superstruct';\nimport { JsonStruct } from '@metamask/utils';\n\n/**\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\nexport const AccountCreatedEventStruct = object({\n method: literal(`${KeyringEvent.AccountCreated}`),\n params: object({\n /**\n * New account object.\n */\n account: KeyringAccountStruct,\n\n /**\n * Account name suggestion provided to the MetaMask client.\n *\n * The keyring can suggest a name for the account, but it's up to the\n * client to decide whether to use it. The keyring won't be informed if the\n * client decides to use a different name.\n */\n accountNameSuggestion: exactOptional(string()),\n\n /**\n * Instructs MetaMask to display the add account confirmation dialog in the UI.\n * **Note:** This is not guaranteed to be honored by the MetaMask client.\n */\n displayConfirmation: exactOptional(boolean()),\n }),\n});\n\nexport const AccountUpdatedEventStruct = object({\n method: literal(`${KeyringEvent.AccountUpdated}`),\n params: object({\n /**\n * Updated account object.\n */\n account: KeyringAccountStruct,\n }),\n});\n\nexport const AccountDeletedEventStruct = object({\n method: literal(`${KeyringEvent.AccountDeleted}`),\n params: object({\n /**\n * Deleted account ID.\n */\n id: UuidStruct,\n }),\n});\n\nexport const RequestApprovedEventStruct = object({\n method: literal(`${KeyringEvent.RequestApproved}`),\n params: object({\n /**\n * Request ID.\n */\n id: UuidStruct,\n\n /**\n * Request result.\n */\n result: JsonStruct,\n }),\n});\n\nexport const RequestRejectedEventStruct = object({\n method: literal(`${KeyringEvent.RequestRejected}`),\n params: object({\n /**\n * Request ID.\n */\n id: UuidStruct,\n }),\n});\n"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
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"), exports);
|
|
18
|
+
__exportStar(require("./eth"), exports);
|
|
19
|
+
__exportStar(require("./events"), exports);
|
|
20
|
+
__exportStar(require("./rpc"), exports);
|
|
21
|
+
__exportStar(require("./types"), exports);
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/internal/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wCAAsB;AACtB,wCAAsB;AACtB,2CAAyB;AACzB,wCAAsB;AACtB,0CAAwB","sourcesContent":["export * from './api';\nexport * from './eth';\nexport * from './events';\nexport * from './rpc';\nexport * from './types';\n"]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Keyring RPC methods used by the API.
|
|
3
|
+
*/
|
|
4
|
+
export declare enum KeyringRpcMethod {
|
|
5
|
+
ListAccounts = "keyring_listAccounts",
|
|
6
|
+
GetAccount = "keyring_getAccount",
|
|
7
|
+
CreateAccount = "keyring_createAccount",
|
|
8
|
+
GetAccountBalances = "keyring_getAccountBalances",
|
|
9
|
+
FilterAccountChains = "keyring_filterAccountChains",
|
|
10
|
+
UpdateAccount = "keyring_updateAccount",
|
|
11
|
+
DeleteAccount = "keyring_deleteAccount",
|
|
12
|
+
ExportAccount = "keyring_exportAccount",
|
|
13
|
+
ListRequests = "keyring_listRequests",
|
|
14
|
+
GetRequest = "keyring_getRequest",
|
|
15
|
+
SubmitRequest = "keyring_submitRequest",
|
|
16
|
+
ApproveRequest = "keyring_approveRequest",
|
|
17
|
+
RejectRequest = "keyring_rejectRequest"
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Check if a method is a keyring RPC method.
|
|
21
|
+
*
|
|
22
|
+
* @param method - Method to check.
|
|
23
|
+
* @returns Whether the method is a keyring RPC method.
|
|
24
|
+
*/
|
|
25
|
+
export declare function isKeyringRpcMethod(method: string): boolean;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isKeyringRpcMethod = exports.KeyringRpcMethod = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Keyring RPC methods used by the API.
|
|
6
|
+
*/
|
|
7
|
+
var KeyringRpcMethod;
|
|
8
|
+
(function (KeyringRpcMethod) {
|
|
9
|
+
KeyringRpcMethod["ListAccounts"] = "keyring_listAccounts";
|
|
10
|
+
KeyringRpcMethod["GetAccount"] = "keyring_getAccount";
|
|
11
|
+
KeyringRpcMethod["CreateAccount"] = "keyring_createAccount";
|
|
12
|
+
KeyringRpcMethod["GetAccountBalances"] = "keyring_getAccountBalances";
|
|
13
|
+
KeyringRpcMethod["FilterAccountChains"] = "keyring_filterAccountChains";
|
|
14
|
+
KeyringRpcMethod["UpdateAccount"] = "keyring_updateAccount";
|
|
15
|
+
KeyringRpcMethod["DeleteAccount"] = "keyring_deleteAccount";
|
|
16
|
+
KeyringRpcMethod["ExportAccount"] = "keyring_exportAccount";
|
|
17
|
+
KeyringRpcMethod["ListRequests"] = "keyring_listRequests";
|
|
18
|
+
KeyringRpcMethod["GetRequest"] = "keyring_getRequest";
|
|
19
|
+
KeyringRpcMethod["SubmitRequest"] = "keyring_submitRequest";
|
|
20
|
+
KeyringRpcMethod["ApproveRequest"] = "keyring_approveRequest";
|
|
21
|
+
KeyringRpcMethod["RejectRequest"] = "keyring_rejectRequest";
|
|
22
|
+
})(KeyringRpcMethod = exports.KeyringRpcMethod || (exports.KeyringRpcMethod = {}));
|
|
23
|
+
/**
|
|
24
|
+
* Check if a method is a keyring RPC method.
|
|
25
|
+
*
|
|
26
|
+
* @param method - Method to check.
|
|
27
|
+
* @returns Whether the method is a keyring RPC method.
|
|
28
|
+
*/
|
|
29
|
+
function isKeyringRpcMethod(method) {
|
|
30
|
+
return Object.values(KeyringRpcMethod).includes(method);
|
|
31
|
+
}
|
|
32
|
+
exports.isKeyringRpcMethod = isKeyringRpcMethod;
|
|
33
|
+
//# sourceMappingURL=rpc.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rpc.js","sourceRoot":"","sources":["../../src/internal/rpc.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,IAAY,gBAcX;AAdD,WAAY,gBAAgB;IAC1B,yDAAqC,CAAA;IACrC,qDAAiC,CAAA;IACjC,2DAAuC,CAAA;IACvC,qEAAiD,CAAA;IACjD,uEAAmD,CAAA;IACnD,2DAAuC,CAAA;IACvC,2DAAuC,CAAA;IACvC,2DAAuC,CAAA;IACvC,yDAAqC,CAAA;IACrC,qDAAiC,CAAA;IACjC,2DAAuC,CAAA;IACvC,6DAAyC,CAAA;IACzC,2DAAuC,CAAA;AACzC,CAAC,EAdW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAc3B;AAED;;;;;GAKG;AACH,SAAgB,kBAAkB,CAAC,MAAc;IAC/C,OAAO,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC,QAAQ,CAAC,MAA0B,CAAC,CAAC;AAC9E,CAAC;AAFD,gDAEC","sourcesContent":["/**\n * Keyring RPC methods used by the API.\n */\nexport enum KeyringRpcMethod {\n ListAccounts = 'keyring_listAccounts',\n GetAccount = 'keyring_getAccount',\n CreateAccount = 'keyring_createAccount',\n GetAccountBalances = 'keyring_getAccountBalances',\n FilterAccountChains = 'keyring_filterAccountChains',\n UpdateAccount = 'keyring_updateAccount',\n DeleteAccount = 'keyring_deleteAccount',\n ExportAccount = 'keyring_exportAccount',\n ListRequests = 'keyring_listRequests',\n GetRequest = 'keyring_getRequest',\n SubmitRequest = 'keyring_submitRequest',\n ApproveRequest = 'keyring_approveRequest',\n RejectRequest = 'keyring_rejectRequest',\n}\n\n/**\n * Check if a method is a keyring RPC method.\n *\n * @param method - Method to check.\n * @returns Whether the method is a keyring RPC method.\n */\nexport function isKeyringRpcMethod(method: string): boolean {\n return Object.values(KeyringRpcMethod).includes(method as KeyringRpcMethod);\n}\n"]}
|