@metamask-previews/keyring-internal-api 0.0.1-11541a9
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/api.cjs +138 -0
- package/dist/api.cjs.map +1 -0
- package/dist/api.d.cts +420 -0
- package/dist/api.d.cts.map +1 -0
- package/dist/api.d.mts +420 -0
- package/dist/api.d.mts.map +1 -0
- package/dist/api.mjs +135 -0
- package/dist/api.mjs.map +1 -0
- package/dist/btc/index.cjs +18 -0
- package/dist/btc/index.cjs.map +1 -0
- package/dist/btc/index.d.cts +2 -0
- package/dist/btc/index.d.cts.map +1 -0
- package/dist/btc/index.d.mts +2 -0
- package/dist/btc/index.d.mts.map +1 -0
- package/dist/btc/index.mjs +2 -0
- package/dist/btc/index.mjs.map +1 -0
- package/dist/btc/types.cjs +40 -0
- package/dist/btc/types.cjs.map +1 -0
- package/dist/btc/types.d.cts +34 -0
- package/dist/btc/types.d.cts.map +1 -0
- package/dist/btc/types.d.mts +34 -0
- package/dist/btc/types.d.mts.map +1 -0
- package/dist/btc/types.mjs +37 -0
- package/dist/btc/types.mjs.map +1 -0
- package/dist/eth/EthKeyring.cjs +3 -0
- package/dist/eth/EthKeyring.cjs.map +1 -0
- package/dist/eth/EthKeyring.d.cts +34 -0
- package/dist/eth/EthKeyring.d.cts.map +1 -0
- package/dist/eth/EthKeyring.d.mts +34 -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/eth/erc4337/index.cjs +18 -0
- package/dist/eth/erc4337/index.cjs.map +1 -0
- package/dist/eth/erc4337/index.d.cts +2 -0
- package/dist/eth/erc4337/index.d.cts.map +1 -0
- package/dist/eth/erc4337/index.d.mts +2 -0
- package/dist/eth/erc4337/index.d.mts.map +1 -0
- package/dist/eth/erc4337/index.mjs +2 -0
- package/dist/eth/erc4337/index.mjs.map +1 -0
- package/dist/eth/erc4337/types.cjs +61 -0
- package/dist/eth/erc4337/types.cjs.map +1 -0
- package/dist/eth/erc4337/types.d.cts +98 -0
- package/dist/eth/erc4337/types.d.cts.map +1 -0
- package/dist/eth/erc4337/types.d.mts +98 -0
- package/dist/eth/erc4337/types.d.mts.map +1 -0
- package/dist/eth/erc4337/types.mjs +58 -0
- package/dist/eth/erc4337/types.mjs.map +1 -0
- package/dist/eth/index.cjs +20 -0
- package/dist/eth/index.cjs.map +1 -0
- package/dist/eth/index.d.cts +5 -0
- package/dist/eth/index.d.cts.map +1 -0
- package/dist/eth/index.d.mts +5 -0
- package/dist/eth/index.d.mts.map +1 -0
- package/dist/eth/index.mjs +4 -0
- package/dist/eth/index.mjs.map +1 -0
- package/dist/eth/types.cjs +73 -0
- package/dist/eth/types.cjs.map +1 -0
- package/dist/eth/types.d.cts +81 -0
- package/dist/eth/types.d.cts.map +1 -0
- package/dist/eth/types.d.mts +81 -0
- package/dist/eth/types.d.mts.map +1 -0
- package/dist/eth/types.mjs +70 -0
- package/dist/eth/types.mjs.map +1 -0
- package/dist/eth/utils.cjs +14 -0
- package/dist/eth/utils.cjs.map +1 -0
- package/dist/eth/utils.d.cts +9 -0
- package/dist/eth/utils.d.cts.map +1 -0
- package/dist/eth/utils.d.mts +9 -0
- package/dist/eth/utils.d.mts.map +1 -0
- package/dist/eth/utils.mjs +11 -0
- package/dist/eth/utils.mjs.map +1 -0
- package/dist/events.cjs +83 -0
- package/dist/events.cjs.map +1 -0
- package/dist/events.d.cts +172 -0
- package/dist/events.d.cts.map +1 -0
- package/dist/events.d.mts +172 -0
- package/dist/events.d.mts.map +1 -0
- package/dist/events.mjs +80 -0
- package/dist/events.mjs.map +1 -0
- package/dist/index.cjs +24 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +8 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +8 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +8 -0
- package/dist/index.mjs.map +1 -0
- package/dist/rpc.cjs +33 -0
- package/dist/rpc.cjs.map +1 -0
- package/dist/rpc.d.cts +26 -0
- package/dist/rpc.d.cts.map +1 -0
- package/dist/rpc.d.mts +26 -0
- package/dist/rpc.d.mts.map +1 -0
- package/dist/rpc.mjs +29 -0
- package/dist/rpc.mjs.map +1 -0
- package/dist/sol/index.cjs +18 -0
- package/dist/sol/index.cjs.map +1 -0
- package/dist/sol/index.d.cts +2 -0
- package/dist/sol/index.d.cts.map +1 -0
- package/dist/sol/index.d.mts +2 -0
- package/dist/sol/index.d.mts.map +1 -0
- package/dist/sol/index.mjs +2 -0
- package/dist/sol/index.mjs.map +1 -0
- package/dist/sol/types.cjs +36 -0
- package/dist/sol/types.cjs.map +1 -0
- package/dist/sol/types.d.cts +39 -0
- package/dist/sol/types.d.cts.map +1 -0
- package/dist/sol/types.d.mts +39 -0
- package/dist/sol/types.d.mts.map +1 -0
- package/dist/sol/types.mjs +33 -0
- package/dist/sol/types.mjs.map +1 -0
- package/dist/types.cjs +56 -0
- package/dist/types.cjs.map +1 -0
- package/dist/types.d.cts +392 -0
- 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 +53 -0
- package/dist/types.mjs.map +1 -0
- package/package.json +90 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
[Unreleased]: https://github.com/MetaMask/accounts/
|
package/README.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# MetaMask Keyring Internal API
|
|
2
|
+
|
|
3
|
+
Keyring internal API that holds internal types and implementations.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
`yarn add @metamask/keyring-internal-api`
|
|
8
|
+
|
|
9
|
+
or
|
|
10
|
+
|
|
11
|
+
`npm install @metamask/keyring-internal-api`
|
|
12
|
+
|
|
13
|
+
## Contributing
|
|
14
|
+
|
|
15
|
+
This package is part of a monorepo. Instructions for contributing can be found in the [monorepo README](https://github.com/MetaMask/accounts#readme).
|
package/dist/api.cjs
ADDED
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RejectRequestResponseStruct = exports.RejectRequestRequestStruct = exports.ApproveRequestResponseStruct = exports.ApproveRequestRequestStruct = exports.SubmitRequestResponseStruct = exports.SubmitRequestRequestStruct = exports.GetRequestResponseStruct = exports.GetRequestRequestStruct = exports.ListRequestsResponseStruct = exports.ListRequestsRequestStruct = exports.ExportAccountResponseStruct = exports.ExportAccountRequestStruct = exports.DeleteAccountResponseStruct = exports.DeleteAccountRequestStruct = exports.UpdateAccountResponseStruct = exports.UpdateAccountRequestStruct = exports.FilterAccountChainsResponseStruct = exports.FilterAccountChainsStruct = exports.GetAccountBalancesResponseStruct = exports.GetAccountBalancesRequestStruct = exports.CreateAccountResponseStruct = exports.CreateAccountRequestStruct = exports.GetAccountResponseStruct = exports.GetAccountRequestStruct = exports.ListAccountsResponseStruct = exports.ListAccountsRequestStruct = void 0;
|
|
4
|
+
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
|
+
const rpc_1 = require("./rpc.cjs");
|
|
9
|
+
const CommonHeader = {
|
|
10
|
+
jsonrpc: (0, superstruct_1.literal)('2.0'),
|
|
11
|
+
id: (0, superstruct_1.union)([(0, superstruct_1.string)(), (0, superstruct_1.number)(), (0, superstruct_1.literal)(null)]),
|
|
12
|
+
};
|
|
13
|
+
// ----------------------------------------------------------------------------
|
|
14
|
+
// List accounts
|
|
15
|
+
exports.ListAccountsRequestStruct = (0, keyring_utils_1.object)({
|
|
16
|
+
...CommonHeader,
|
|
17
|
+
method: (0, superstruct_1.literal)('keyring_listAccounts'),
|
|
18
|
+
});
|
|
19
|
+
exports.ListAccountsResponseStruct = (0, superstruct_1.array)(keyring_api_1.KeyringAccountStruct);
|
|
20
|
+
// ----------------------------------------------------------------------------
|
|
21
|
+
// Get account
|
|
22
|
+
exports.GetAccountRequestStruct = (0, keyring_utils_1.object)({
|
|
23
|
+
...CommonHeader,
|
|
24
|
+
method: (0, superstruct_1.literal)('keyring_getAccount'),
|
|
25
|
+
params: (0, keyring_utils_1.object)({
|
|
26
|
+
id: keyring_utils_1.UuidStruct,
|
|
27
|
+
}),
|
|
28
|
+
});
|
|
29
|
+
exports.GetAccountResponseStruct = keyring_api_1.KeyringAccountStruct;
|
|
30
|
+
// ----------------------------------------------------------------------------
|
|
31
|
+
// Create account
|
|
32
|
+
exports.CreateAccountRequestStruct = (0, keyring_utils_1.object)({
|
|
33
|
+
...CommonHeader,
|
|
34
|
+
method: (0, superstruct_1.literal)('keyring_createAccount'),
|
|
35
|
+
params: (0, keyring_utils_1.object)({
|
|
36
|
+
options: (0, superstruct_1.record)((0, superstruct_1.string)(), utils_1.JsonStruct),
|
|
37
|
+
}),
|
|
38
|
+
});
|
|
39
|
+
exports.CreateAccountResponseStruct = keyring_api_1.KeyringAccountStruct;
|
|
40
|
+
// ----------------------------------------------------------------------------
|
|
41
|
+
// Get account balances
|
|
42
|
+
exports.GetAccountBalancesRequestStruct = (0, keyring_utils_1.object)({
|
|
43
|
+
...CommonHeader,
|
|
44
|
+
method: (0, superstruct_1.literal)(`${rpc_1.KeyringRpcMethod.GetAccountBalances}`),
|
|
45
|
+
params: (0, keyring_utils_1.object)({
|
|
46
|
+
id: keyring_utils_1.UuidStruct,
|
|
47
|
+
assets: (0, superstruct_1.array)(keyring_api_1.CaipAssetTypeStruct),
|
|
48
|
+
}),
|
|
49
|
+
});
|
|
50
|
+
exports.GetAccountBalancesResponseStruct = (0, superstruct_1.record)(keyring_api_1.CaipAssetTypeStruct, keyring_api_1.BalanceStruct);
|
|
51
|
+
// ----------------------------------------------------------------------------
|
|
52
|
+
// Filter account chains
|
|
53
|
+
exports.FilterAccountChainsStruct = (0, keyring_utils_1.object)({
|
|
54
|
+
...CommonHeader,
|
|
55
|
+
method: (0, superstruct_1.literal)('keyring_filterAccountChains'),
|
|
56
|
+
params: (0, keyring_utils_1.object)({
|
|
57
|
+
id: keyring_utils_1.UuidStruct,
|
|
58
|
+
chains: (0, superstruct_1.array)((0, superstruct_1.string)()),
|
|
59
|
+
}),
|
|
60
|
+
});
|
|
61
|
+
exports.FilterAccountChainsResponseStruct = (0, superstruct_1.array)((0, superstruct_1.string)());
|
|
62
|
+
// ----------------------------------------------------------------------------
|
|
63
|
+
// Update account
|
|
64
|
+
exports.UpdateAccountRequestStruct = (0, keyring_utils_1.object)({
|
|
65
|
+
...CommonHeader,
|
|
66
|
+
method: (0, superstruct_1.literal)('keyring_updateAccount'),
|
|
67
|
+
params: (0, keyring_utils_1.object)({
|
|
68
|
+
account: keyring_api_1.KeyringAccountStruct,
|
|
69
|
+
}),
|
|
70
|
+
});
|
|
71
|
+
exports.UpdateAccountResponseStruct = (0, superstruct_1.literal)(null);
|
|
72
|
+
// ----------------------------------------------------------------------------
|
|
73
|
+
// Delete account
|
|
74
|
+
exports.DeleteAccountRequestStruct = (0, keyring_utils_1.object)({
|
|
75
|
+
...CommonHeader,
|
|
76
|
+
method: (0, superstruct_1.literal)('keyring_deleteAccount'),
|
|
77
|
+
params: (0, keyring_utils_1.object)({
|
|
78
|
+
id: keyring_utils_1.UuidStruct,
|
|
79
|
+
}),
|
|
80
|
+
});
|
|
81
|
+
exports.DeleteAccountResponseStruct = (0, superstruct_1.literal)(null);
|
|
82
|
+
// ----------------------------------------------------------------------------
|
|
83
|
+
// Export account
|
|
84
|
+
exports.ExportAccountRequestStruct = (0, keyring_utils_1.object)({
|
|
85
|
+
...CommonHeader,
|
|
86
|
+
method: (0, superstruct_1.literal)('keyring_exportAccount'),
|
|
87
|
+
params: (0, keyring_utils_1.object)({
|
|
88
|
+
id: keyring_utils_1.UuidStruct,
|
|
89
|
+
}),
|
|
90
|
+
});
|
|
91
|
+
exports.ExportAccountResponseStruct = keyring_api_1.KeyringAccountDataStruct;
|
|
92
|
+
// ----------------------------------------------------------------------------
|
|
93
|
+
// List requests
|
|
94
|
+
exports.ListRequestsRequestStruct = (0, keyring_utils_1.object)({
|
|
95
|
+
...CommonHeader,
|
|
96
|
+
method: (0, superstruct_1.literal)('keyring_listRequests'),
|
|
97
|
+
});
|
|
98
|
+
exports.ListRequestsResponseStruct = (0, superstruct_1.array)(keyring_api_1.KeyringRequestStruct);
|
|
99
|
+
// ----------------------------------------------------------------------------
|
|
100
|
+
// Get request
|
|
101
|
+
exports.GetRequestRequestStruct = (0, keyring_utils_1.object)({
|
|
102
|
+
...CommonHeader,
|
|
103
|
+
method: (0, superstruct_1.literal)('keyring_getRequest'),
|
|
104
|
+
params: (0, keyring_utils_1.object)({
|
|
105
|
+
id: keyring_utils_1.UuidStruct,
|
|
106
|
+
}),
|
|
107
|
+
});
|
|
108
|
+
exports.GetRequestResponseStruct = keyring_api_1.KeyringRequestStruct;
|
|
109
|
+
// ----------------------------------------------------------------------------
|
|
110
|
+
// Submit request
|
|
111
|
+
exports.SubmitRequestRequestStruct = (0, keyring_utils_1.object)({
|
|
112
|
+
...CommonHeader,
|
|
113
|
+
method: (0, superstruct_1.literal)('keyring_submitRequest'),
|
|
114
|
+
params: keyring_api_1.KeyringRequestStruct,
|
|
115
|
+
});
|
|
116
|
+
exports.SubmitRequestResponseStruct = keyring_api_1.KeyringResponseStruct;
|
|
117
|
+
// ----------------------------------------------------------------------------
|
|
118
|
+
// Approve request
|
|
119
|
+
exports.ApproveRequestRequestStruct = (0, keyring_utils_1.object)({
|
|
120
|
+
...CommonHeader,
|
|
121
|
+
method: (0, superstruct_1.literal)('keyring_approveRequest'),
|
|
122
|
+
params: (0, keyring_utils_1.object)({
|
|
123
|
+
id: keyring_utils_1.UuidStruct,
|
|
124
|
+
data: (0, superstruct_1.record)((0, superstruct_1.string)(), utils_1.JsonStruct),
|
|
125
|
+
}),
|
|
126
|
+
});
|
|
127
|
+
exports.ApproveRequestResponseStruct = (0, superstruct_1.literal)(null);
|
|
128
|
+
// ----------------------------------------------------------------------------
|
|
129
|
+
// Reject request
|
|
130
|
+
exports.RejectRequestRequestStruct = (0, keyring_utils_1.object)({
|
|
131
|
+
...CommonHeader,
|
|
132
|
+
method: (0, superstruct_1.literal)('keyring_rejectRequest'),
|
|
133
|
+
params: (0, keyring_utils_1.object)({
|
|
134
|
+
id: keyring_utils_1.UuidStruct,
|
|
135
|
+
}),
|
|
136
|
+
});
|
|
137
|
+
exports.RejectRequestResponseStruct = (0, superstruct_1.literal)(null);
|
|
138
|
+
//# sourceMappingURL=api.cjs.map
|
package/dist/api.cjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.cjs","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":";;;AAAA,uDAO+B;AAC/B,2DAA6D;AAE7D,uDAO+B;AAC/B,2CAA6C;AAE7C,mCAAyC;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,MA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AU;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"]}
|
package/dist/api.d.cts
ADDED
|
@@ -0,0 +1,420 @@
|
|
|
1
|
+
import type { Infer } from "@metamask/superstruct";
|
|
2
|
+
export declare const ListAccountsRequestStruct: import("@metamask/superstruct").Struct<{
|
|
3
|
+
method: "keyring_listAccounts";
|
|
4
|
+
jsonrpc: "2.0";
|
|
5
|
+
id: string | number | null;
|
|
6
|
+
}, {
|
|
7
|
+
method: import("@metamask/superstruct").Struct<"keyring_listAccounts", "keyring_listAccounts">;
|
|
8
|
+
jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
|
|
9
|
+
id: import("@metamask/superstruct").Struct<string | number | null, null>;
|
|
10
|
+
}>;
|
|
11
|
+
export type ListAccountsRequest = Infer<typeof ListAccountsRequestStruct>;
|
|
12
|
+
export declare const ListAccountsResponseStruct: import("@metamask/superstruct").Struct<{
|
|
13
|
+
id: string;
|
|
14
|
+
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2wpkh" | "solana:data-account";
|
|
15
|
+
address: string;
|
|
16
|
+
options: Record<string, import("@metamask/utils").Json>;
|
|
17
|
+
methods: string[];
|
|
18
|
+
}[], import("@metamask/superstruct").Struct<{
|
|
19
|
+
id: string;
|
|
20
|
+
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2wpkh" | "solana:data-account";
|
|
21
|
+
address: string;
|
|
22
|
+
options: Record<string, import("@metamask/utils").Json>;
|
|
23
|
+
methods: string[];
|
|
24
|
+
}, {
|
|
25
|
+
id: import("@metamask/superstruct").Struct<string, null>;
|
|
26
|
+
type: import("@metamask/superstruct").Struct<"eip155:eoa" | "eip155:erc4337" | "bip122:p2wpkh" | "solana:data-account", {
|
|
27
|
+
"eip155:eoa": "eip155:eoa";
|
|
28
|
+
"eip155:erc4337": "eip155:erc4337";
|
|
29
|
+
"bip122:p2wpkh": "bip122:p2wpkh";
|
|
30
|
+
"solana:data-account": "solana:data-account";
|
|
31
|
+
}>;
|
|
32
|
+
address: import("@metamask/superstruct").Struct<string, null>;
|
|
33
|
+
options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
|
|
34
|
+
methods: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
|
|
35
|
+
}>>;
|
|
36
|
+
export type ListAccountsResponse = Infer<typeof ListAccountsResponseStruct>;
|
|
37
|
+
export declare const GetAccountRequestStruct: import("@metamask/superstruct").Struct<{
|
|
38
|
+
method: "keyring_getAccount";
|
|
39
|
+
jsonrpc: "2.0";
|
|
40
|
+
id: string | number | null;
|
|
41
|
+
params: {
|
|
42
|
+
id: string;
|
|
43
|
+
};
|
|
44
|
+
}, {
|
|
45
|
+
method: import("@metamask/superstruct").Struct<"keyring_getAccount", "keyring_getAccount">;
|
|
46
|
+
params: import("@metamask/superstruct").Struct<{
|
|
47
|
+
id: string;
|
|
48
|
+
}, {
|
|
49
|
+
id: import("@metamask/superstruct").Struct<string, null>;
|
|
50
|
+
}>;
|
|
51
|
+
jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
|
|
52
|
+
id: import("@metamask/superstruct").Struct<string | number | null, null>;
|
|
53
|
+
}>;
|
|
54
|
+
export type GetAccountRequest = Infer<typeof GetAccountRequestStruct>;
|
|
55
|
+
export declare const GetAccountResponseStruct: import("@metamask/superstruct").Struct<{
|
|
56
|
+
id: string;
|
|
57
|
+
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2wpkh" | "solana:data-account";
|
|
58
|
+
address: string;
|
|
59
|
+
options: Record<string, import("@metamask/utils").Json>;
|
|
60
|
+
methods: string[];
|
|
61
|
+
}, {
|
|
62
|
+
id: import("@metamask/superstruct").Struct<string, null>;
|
|
63
|
+
type: import("@metamask/superstruct").Struct<"eip155:eoa" | "eip155:erc4337" | "bip122:p2wpkh" | "solana:data-account", {
|
|
64
|
+
"eip155:eoa": "eip155:eoa";
|
|
65
|
+
"eip155:erc4337": "eip155:erc4337";
|
|
66
|
+
"bip122:p2wpkh": "bip122:p2wpkh";
|
|
67
|
+
"solana:data-account": "solana:data-account";
|
|
68
|
+
}>;
|
|
69
|
+
address: import("@metamask/superstruct").Struct<string, null>;
|
|
70
|
+
options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
|
|
71
|
+
methods: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
|
|
72
|
+
}>;
|
|
73
|
+
export type GetAccountResponse = Infer<typeof GetAccountResponseStruct>;
|
|
74
|
+
export declare const CreateAccountRequestStruct: import("@metamask/superstruct").Struct<{
|
|
75
|
+
method: "keyring_createAccount";
|
|
76
|
+
jsonrpc: "2.0";
|
|
77
|
+
id: string | number | null;
|
|
78
|
+
params: {
|
|
79
|
+
options: Record<string, import("@metamask/utils").Json>;
|
|
80
|
+
};
|
|
81
|
+
}, {
|
|
82
|
+
method: import("@metamask/superstruct").Struct<"keyring_createAccount", "keyring_createAccount">;
|
|
83
|
+
params: import("@metamask/superstruct").Struct<{
|
|
84
|
+
options: Record<string, import("@metamask/utils").Json>;
|
|
85
|
+
}, {
|
|
86
|
+
options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
|
|
87
|
+
}>;
|
|
88
|
+
jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
|
|
89
|
+
id: import("@metamask/superstruct").Struct<string | number | null, null>;
|
|
90
|
+
}>;
|
|
91
|
+
export type CreateAccountRequest = Infer<typeof CreateAccountRequestStruct>;
|
|
92
|
+
export declare const CreateAccountResponseStruct: import("@metamask/superstruct").Struct<{
|
|
93
|
+
id: string;
|
|
94
|
+
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2wpkh" | "solana:data-account";
|
|
95
|
+
address: string;
|
|
96
|
+
options: Record<string, import("@metamask/utils").Json>;
|
|
97
|
+
methods: string[];
|
|
98
|
+
}, {
|
|
99
|
+
id: import("@metamask/superstruct").Struct<string, null>;
|
|
100
|
+
type: import("@metamask/superstruct").Struct<"eip155:eoa" | "eip155:erc4337" | "bip122:p2wpkh" | "solana:data-account", {
|
|
101
|
+
"eip155:eoa": "eip155:eoa";
|
|
102
|
+
"eip155:erc4337": "eip155:erc4337";
|
|
103
|
+
"bip122:p2wpkh": "bip122:p2wpkh";
|
|
104
|
+
"solana:data-account": "solana:data-account";
|
|
105
|
+
}>;
|
|
106
|
+
address: import("@metamask/superstruct").Struct<string, null>;
|
|
107
|
+
options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
|
|
108
|
+
methods: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
|
|
109
|
+
}>;
|
|
110
|
+
export type CreateAccountResponse = Infer<typeof CreateAccountResponseStruct>;
|
|
111
|
+
export declare const GetAccountBalancesRequestStruct: import("@metamask/superstruct").Struct<{
|
|
112
|
+
method: "keyring_getAccountBalances";
|
|
113
|
+
jsonrpc: "2.0";
|
|
114
|
+
id: string | number | null;
|
|
115
|
+
params: {
|
|
116
|
+
id: string;
|
|
117
|
+
assets: string[];
|
|
118
|
+
};
|
|
119
|
+
}, {
|
|
120
|
+
method: import("@metamask/superstruct").Struct<"keyring_getAccountBalances", "keyring_getAccountBalances">;
|
|
121
|
+
params: import("@metamask/superstruct").Struct<{
|
|
122
|
+
id: string;
|
|
123
|
+
assets: string[];
|
|
124
|
+
}, {
|
|
125
|
+
id: import("@metamask/superstruct").Struct<string, null>;
|
|
126
|
+
assets: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
|
|
127
|
+
}>;
|
|
128
|
+
jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
|
|
129
|
+
id: import("@metamask/superstruct").Struct<string | number | null, null>;
|
|
130
|
+
}>;
|
|
131
|
+
export type GetAccountBalancesRequest = Infer<typeof GetAccountBalancesRequestStruct>;
|
|
132
|
+
export declare const GetAccountBalancesResponseStruct: import("@metamask/superstruct").Struct<Record<string, {
|
|
133
|
+
amount: string;
|
|
134
|
+
unit: string;
|
|
135
|
+
}>, null>;
|
|
136
|
+
export type GetAccountBalancesResponse = Infer<typeof GetAccountBalancesResponseStruct>;
|
|
137
|
+
export declare const FilterAccountChainsStruct: import("@metamask/superstruct").Struct<{
|
|
138
|
+
method: "keyring_filterAccountChains";
|
|
139
|
+
jsonrpc: "2.0";
|
|
140
|
+
id: string | number | null;
|
|
141
|
+
params: {
|
|
142
|
+
id: string;
|
|
143
|
+
chains: string[];
|
|
144
|
+
};
|
|
145
|
+
}, {
|
|
146
|
+
method: import("@metamask/superstruct").Struct<"keyring_filterAccountChains", "keyring_filterAccountChains">;
|
|
147
|
+
params: import("@metamask/superstruct").Struct<{
|
|
148
|
+
id: string;
|
|
149
|
+
chains: string[];
|
|
150
|
+
}, {
|
|
151
|
+
id: import("@metamask/superstruct").Struct<string, null>;
|
|
152
|
+
chains: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
|
|
153
|
+
}>;
|
|
154
|
+
jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
|
|
155
|
+
id: import("@metamask/superstruct").Struct<string | number | null, null>;
|
|
156
|
+
}>;
|
|
157
|
+
export type FilterAccountChainsRequest = Infer<typeof FilterAccountChainsStruct>;
|
|
158
|
+
export declare const FilterAccountChainsResponseStruct: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
|
|
159
|
+
export type FilterAccountChainsResponse = Infer<typeof FilterAccountChainsResponseStruct>;
|
|
160
|
+
export declare const UpdateAccountRequestStruct: import("@metamask/superstruct").Struct<{
|
|
161
|
+
method: "keyring_updateAccount";
|
|
162
|
+
jsonrpc: "2.0";
|
|
163
|
+
id: string | number | null;
|
|
164
|
+
params: {
|
|
165
|
+
account: {
|
|
166
|
+
id: string;
|
|
167
|
+
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2wpkh" | "solana:data-account";
|
|
168
|
+
address: string;
|
|
169
|
+
options: Record<string, import("@metamask/utils").Json>;
|
|
170
|
+
methods: string[];
|
|
171
|
+
};
|
|
172
|
+
};
|
|
173
|
+
}, {
|
|
174
|
+
method: import("@metamask/superstruct").Struct<"keyring_updateAccount", "keyring_updateAccount">;
|
|
175
|
+
params: import("@metamask/superstruct").Struct<{
|
|
176
|
+
account: {
|
|
177
|
+
id: string;
|
|
178
|
+
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2wpkh" | "solana:data-account";
|
|
179
|
+
address: string;
|
|
180
|
+
options: Record<string, import("@metamask/utils").Json>;
|
|
181
|
+
methods: string[];
|
|
182
|
+
};
|
|
183
|
+
}, {
|
|
184
|
+
account: import("@metamask/superstruct").Struct<{
|
|
185
|
+
id: string;
|
|
186
|
+
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2wpkh" | "solana:data-account";
|
|
187
|
+
address: string;
|
|
188
|
+
options: Record<string, import("@metamask/utils").Json>;
|
|
189
|
+
methods: string[];
|
|
190
|
+
}, {
|
|
191
|
+
id: import("@metamask/superstruct").Struct<string, null>;
|
|
192
|
+
type: import("@metamask/superstruct").Struct<"eip155:eoa" | "eip155:erc4337" | "bip122:p2wpkh" | "solana:data-account", {
|
|
193
|
+
"eip155:eoa": "eip155:eoa";
|
|
194
|
+
"eip155:erc4337": "eip155:erc4337";
|
|
195
|
+
"bip122:p2wpkh": "bip122:p2wpkh";
|
|
196
|
+
"solana:data-account": "solana:data-account";
|
|
197
|
+
}>;
|
|
198
|
+
address: import("@metamask/superstruct").Struct<string, null>;
|
|
199
|
+
options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
|
|
200
|
+
methods: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
|
|
201
|
+
}>;
|
|
202
|
+
}>;
|
|
203
|
+
jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
|
|
204
|
+
id: import("@metamask/superstruct").Struct<string | number | null, null>;
|
|
205
|
+
}>;
|
|
206
|
+
export type UpdateAccountRequest = Infer<typeof UpdateAccountRequestStruct>;
|
|
207
|
+
export declare const UpdateAccountResponseStruct: import("@metamask/superstruct").Struct<null, null>;
|
|
208
|
+
export type UpdateAccountResponse = Infer<typeof UpdateAccountResponseStruct>;
|
|
209
|
+
export declare const DeleteAccountRequestStruct: import("@metamask/superstruct").Struct<{
|
|
210
|
+
method: "keyring_deleteAccount";
|
|
211
|
+
jsonrpc: "2.0";
|
|
212
|
+
id: string | number | null;
|
|
213
|
+
params: {
|
|
214
|
+
id: string;
|
|
215
|
+
};
|
|
216
|
+
}, {
|
|
217
|
+
method: import("@metamask/superstruct").Struct<"keyring_deleteAccount", "keyring_deleteAccount">;
|
|
218
|
+
params: import("@metamask/superstruct").Struct<{
|
|
219
|
+
id: string;
|
|
220
|
+
}, {
|
|
221
|
+
id: import("@metamask/superstruct").Struct<string, null>;
|
|
222
|
+
}>;
|
|
223
|
+
jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
|
|
224
|
+
id: import("@metamask/superstruct").Struct<string | number | null, null>;
|
|
225
|
+
}>;
|
|
226
|
+
export type DeleteAccountRequest = Infer<typeof DeleteAccountRequestStruct>;
|
|
227
|
+
export declare const DeleteAccountResponseStruct: import("@metamask/superstruct").Struct<null, null>;
|
|
228
|
+
export type DeleteAccountResponse = Infer<typeof DeleteAccountResponseStruct>;
|
|
229
|
+
export declare const ExportAccountRequestStruct: import("@metamask/superstruct").Struct<{
|
|
230
|
+
method: "keyring_exportAccount";
|
|
231
|
+
jsonrpc: "2.0";
|
|
232
|
+
id: string | number | null;
|
|
233
|
+
params: {
|
|
234
|
+
id: string;
|
|
235
|
+
};
|
|
236
|
+
}, {
|
|
237
|
+
method: import("@metamask/superstruct").Struct<"keyring_exportAccount", "keyring_exportAccount">;
|
|
238
|
+
params: import("@metamask/superstruct").Struct<{
|
|
239
|
+
id: string;
|
|
240
|
+
}, {
|
|
241
|
+
id: import("@metamask/superstruct").Struct<string, null>;
|
|
242
|
+
}>;
|
|
243
|
+
jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
|
|
244
|
+
id: import("@metamask/superstruct").Struct<string | number | null, null>;
|
|
245
|
+
}>;
|
|
246
|
+
export type ExportAccountRequest = Infer<typeof ExportAccountRequestStruct>;
|
|
247
|
+
export declare const ExportAccountResponseStruct: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
|
|
248
|
+
export type ExportAccountResponse = Infer<typeof ExportAccountResponseStruct>;
|
|
249
|
+
export declare const ListRequestsRequestStruct: import("@metamask/superstruct").Struct<{
|
|
250
|
+
method: "keyring_listRequests";
|
|
251
|
+
jsonrpc: "2.0";
|
|
252
|
+
id: string | number | null;
|
|
253
|
+
}, {
|
|
254
|
+
method: import("@metamask/superstruct").Struct<"keyring_listRequests", "keyring_listRequests">;
|
|
255
|
+
jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
|
|
256
|
+
id: import("@metamask/superstruct").Struct<string | number | null, null>;
|
|
257
|
+
}>;
|
|
258
|
+
export type ListRequestsRequest = Infer<typeof ListRequestsRequestStruct>;
|
|
259
|
+
export declare const ListRequestsResponseStruct: import("@metamask/superstruct").Struct<{
|
|
260
|
+
id: string;
|
|
261
|
+
scope: string;
|
|
262
|
+
account: string;
|
|
263
|
+
request: {
|
|
264
|
+
method: string;
|
|
265
|
+
params?: Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[];
|
|
266
|
+
};
|
|
267
|
+
}[], import("@metamask/superstruct").Struct<{
|
|
268
|
+
id: string;
|
|
269
|
+
scope: string;
|
|
270
|
+
account: string;
|
|
271
|
+
request: {
|
|
272
|
+
method: string;
|
|
273
|
+
params?: Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[];
|
|
274
|
+
};
|
|
275
|
+
}, {
|
|
276
|
+
id: import("@metamask/superstruct").Struct<string, null>;
|
|
277
|
+
scope: import("@metamask/superstruct").Struct<string, null>;
|
|
278
|
+
account: import("@metamask/superstruct").Struct<string, null>;
|
|
279
|
+
request: import("@metamask/superstruct").Struct<{
|
|
280
|
+
method: string;
|
|
281
|
+
params?: Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[];
|
|
282
|
+
}, {
|
|
283
|
+
method: import("@metamask/superstruct").Struct<string, null>;
|
|
284
|
+
params: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json> | import("@metamask/keyring-utils").ExactOptionalTag | import("@metamask/utils").Json[], null>;
|
|
285
|
+
}>;
|
|
286
|
+
}>>;
|
|
287
|
+
export type ListRequestsResponse = Infer<typeof ListRequestsResponseStruct>;
|
|
288
|
+
export declare const GetRequestRequestStruct: import("@metamask/superstruct").Struct<{
|
|
289
|
+
method: "keyring_getRequest";
|
|
290
|
+
jsonrpc: "2.0";
|
|
291
|
+
id: string | number | null;
|
|
292
|
+
params: {
|
|
293
|
+
id: string;
|
|
294
|
+
};
|
|
295
|
+
}, {
|
|
296
|
+
method: import("@metamask/superstruct").Struct<"keyring_getRequest", "keyring_getRequest">;
|
|
297
|
+
params: import("@metamask/superstruct").Struct<{
|
|
298
|
+
id: string;
|
|
299
|
+
}, {
|
|
300
|
+
id: import("@metamask/superstruct").Struct<string, null>;
|
|
301
|
+
}>;
|
|
302
|
+
jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
|
|
303
|
+
id: import("@metamask/superstruct").Struct<string | number | null, null>;
|
|
304
|
+
}>;
|
|
305
|
+
export type GetRequestRequest = Infer<typeof GetRequestRequestStruct>;
|
|
306
|
+
export declare const GetRequestResponseStruct: import("@metamask/superstruct").Struct<{
|
|
307
|
+
id: string;
|
|
308
|
+
scope: string;
|
|
309
|
+
account: string;
|
|
310
|
+
request: {
|
|
311
|
+
method: string;
|
|
312
|
+
params?: Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[];
|
|
313
|
+
};
|
|
314
|
+
}, {
|
|
315
|
+
id: import("@metamask/superstruct").Struct<string, null>;
|
|
316
|
+
scope: import("@metamask/superstruct").Struct<string, null>;
|
|
317
|
+
account: import("@metamask/superstruct").Struct<string, null>;
|
|
318
|
+
request: import("@metamask/superstruct").Struct<{
|
|
319
|
+
method: string;
|
|
320
|
+
params?: Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[];
|
|
321
|
+
}, {
|
|
322
|
+
method: import("@metamask/superstruct").Struct<string, null>;
|
|
323
|
+
params: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json> | import("@metamask/keyring-utils").ExactOptionalTag | import("@metamask/utils").Json[], null>;
|
|
324
|
+
}>;
|
|
325
|
+
}>;
|
|
326
|
+
export type GetRequestResponse = Infer<typeof GetRequestResponseStruct>;
|
|
327
|
+
export declare const SubmitRequestRequestStruct: import("@metamask/superstruct").Struct<{
|
|
328
|
+
method: "keyring_submitRequest";
|
|
329
|
+
jsonrpc: "2.0";
|
|
330
|
+
id: string | number | null;
|
|
331
|
+
params: {
|
|
332
|
+
id: string;
|
|
333
|
+
scope: string;
|
|
334
|
+
account: string;
|
|
335
|
+
request: {
|
|
336
|
+
method: string;
|
|
337
|
+
params?: Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[];
|
|
338
|
+
};
|
|
339
|
+
};
|
|
340
|
+
}, {
|
|
341
|
+
method: import("@metamask/superstruct").Struct<"keyring_submitRequest", "keyring_submitRequest">;
|
|
342
|
+
params: import("@metamask/superstruct").Struct<{
|
|
343
|
+
id: string;
|
|
344
|
+
scope: string;
|
|
345
|
+
account: string;
|
|
346
|
+
request: {
|
|
347
|
+
method: string;
|
|
348
|
+
params?: Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[];
|
|
349
|
+
};
|
|
350
|
+
}, {
|
|
351
|
+
id: import("@metamask/superstruct").Struct<string, null>;
|
|
352
|
+
scope: import("@metamask/superstruct").Struct<string, null>;
|
|
353
|
+
account: import("@metamask/superstruct").Struct<string, null>;
|
|
354
|
+
request: import("@metamask/superstruct").Struct<{
|
|
355
|
+
method: string;
|
|
356
|
+
params?: Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[];
|
|
357
|
+
}, {
|
|
358
|
+
method: import("@metamask/superstruct").Struct<string, null>;
|
|
359
|
+
params: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json> | import("@metamask/keyring-utils").ExactOptionalTag | import("@metamask/utils").Json[], null>;
|
|
360
|
+
}>;
|
|
361
|
+
}>;
|
|
362
|
+
jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
|
|
363
|
+
id: import("@metamask/superstruct").Struct<string | number | null, null>;
|
|
364
|
+
}>;
|
|
365
|
+
export type SubmitRequestRequest = Infer<typeof SubmitRequestRequestStruct>;
|
|
366
|
+
export declare const SubmitRequestResponseStruct: import("@metamask/superstruct").Struct<{
|
|
367
|
+
pending: true;
|
|
368
|
+
redirect?: {
|
|
369
|
+
message?: string;
|
|
370
|
+
url?: string;
|
|
371
|
+
};
|
|
372
|
+
} | {
|
|
373
|
+
pending: false;
|
|
374
|
+
result: import("@metamask/utils").Json;
|
|
375
|
+
}, null>;
|
|
376
|
+
export type SubmitRequestResponse = Infer<typeof SubmitRequestResponseStruct>;
|
|
377
|
+
export declare const ApproveRequestRequestStruct: import("@metamask/superstruct").Struct<{
|
|
378
|
+
method: "keyring_approveRequest";
|
|
379
|
+
jsonrpc: "2.0";
|
|
380
|
+
id: string | number | null;
|
|
381
|
+
params: {
|
|
382
|
+
id: string;
|
|
383
|
+
data: Record<string, import("@metamask/utils").Json>;
|
|
384
|
+
};
|
|
385
|
+
}, {
|
|
386
|
+
method: import("@metamask/superstruct").Struct<"keyring_approveRequest", "keyring_approveRequest">;
|
|
387
|
+
params: import("@metamask/superstruct").Struct<{
|
|
388
|
+
id: string;
|
|
389
|
+
data: Record<string, import("@metamask/utils").Json>;
|
|
390
|
+
}, {
|
|
391
|
+
id: import("@metamask/superstruct").Struct<string, null>;
|
|
392
|
+
data: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
|
|
393
|
+
}>;
|
|
394
|
+
jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
|
|
395
|
+
id: import("@metamask/superstruct").Struct<string | number | null, null>;
|
|
396
|
+
}>;
|
|
397
|
+
export type ApproveRequestRequest = Infer<typeof ApproveRequestRequestStruct>;
|
|
398
|
+
export declare const ApproveRequestResponseStruct: import("@metamask/superstruct").Struct<null, null>;
|
|
399
|
+
export type ApproveRequestResponse = Infer<typeof ApproveRequestResponseStruct>;
|
|
400
|
+
export declare const RejectRequestRequestStruct: import("@metamask/superstruct").Struct<{
|
|
401
|
+
method: "keyring_rejectRequest";
|
|
402
|
+
jsonrpc: "2.0";
|
|
403
|
+
id: string | number | null;
|
|
404
|
+
params: {
|
|
405
|
+
id: string;
|
|
406
|
+
};
|
|
407
|
+
}, {
|
|
408
|
+
method: import("@metamask/superstruct").Struct<"keyring_rejectRequest", "keyring_rejectRequest">;
|
|
409
|
+
params: import("@metamask/superstruct").Struct<{
|
|
410
|
+
id: string;
|
|
411
|
+
}, {
|
|
412
|
+
id: import("@metamask/superstruct").Struct<string, null>;
|
|
413
|
+
}>;
|
|
414
|
+
jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
|
|
415
|
+
id: import("@metamask/superstruct").Struct<string | number | null, null>;
|
|
416
|
+
}>;
|
|
417
|
+
export type RejectRequestRequest = Infer<typeof RejectRequestRequestStruct>;
|
|
418
|
+
export declare const RejectRequestResponseStruct: import("@metamask/superstruct").Struct<null, null>;
|
|
419
|
+
export type RejectRequestResponse = Infer<typeof RejectRequestResponseStruct>;
|
|
420
|
+
//# sourceMappingURL=api.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.d.cts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAqBnD,eAAO,MAAM,yBAAyB;;;;;;;;EAGpC,CAAC;AAEH,MAAM,M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