@metamask/keyring-api 22.0.0 → 23.0.1
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 +28 -1
- package/dist/api/account.cjs +15 -1
- package/dist/api/account.cjs.map +1 -1
- package/dist/api/account.d.cts +17 -4
- package/dist/api/account.d.cts.map +1 -1
- package/dist/api/account.d.mts +17 -4
- package/dist/api/account.d.mts.map +1 -1
- package/dist/api/account.mjs +14 -0
- package/dist/api/account.mjs.map +1 -1
- package/dist/api/index.cjs +1 -1
- package/dist/api/index.cjs.map +1 -1
- package/dist/api/index.d.cts +1 -1
- package/dist/api/index.d.cts.map +1 -1
- package/dist/api/index.d.mts +1 -1
- package/dist/api/index.d.mts.map +1 -1
- package/dist/api/index.mjs +1 -1
- package/dist/api/index.mjs.map +1 -1
- package/dist/api/keyring.cjs.map +1 -1
- package/dist/api/keyring.d.cts +1 -1
- package/dist/api/keyring.d.cts.map +1 -1
- package/dist/api/keyring.d.mts +1 -1
- package/dist/api/keyring.d.mts.map +1 -1
- package/dist/api/keyring.mjs.map +1 -1
- package/dist/events.d.cts +10 -8
- package/dist/events.d.cts.map +1 -1
- package/dist/events.d.mts +10 -8
- package/dist/events.d.mts.map +1 -1
- package/dist/index.cjs +1 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +1 -0
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +1 -0
- package/dist/index.mjs.map +1 -1
- package/dist/rpc.cjs +2 -1
- package/dist/rpc.cjs.map +1 -1
- package/dist/rpc.d.cts +23 -18
- package/dist/rpc.d.cts.map +1 -1
- package/dist/rpc.d.mts +23 -18
- package/dist/rpc.d.mts.map +1 -1
- package/dist/rpc.mjs +2 -1
- package/dist/rpc.mjs.map +1 -1
- package/dist/{api/v2 → v2/api}/create-account/bip44.cjs +1 -1
- package/dist/{api/v2/create-account/bip44.mjs.map → v2/api/create-account/bip44.cjs.map} +1 -1
- package/dist/{api/v2 → v2/api}/create-account/bip44.d.cts.map +1 -1
- package/dist/{api/v2 → v2/api}/create-account/bip44.d.mts.map +1 -1
- package/dist/{api/v2 → v2/api}/create-account/bip44.mjs +1 -1
- package/dist/v2/api/create-account/bip44.mjs.map +1 -0
- package/dist/{api/v2 → v2/api}/create-account/custom.cjs.map +1 -1
- package/dist/{api/v2 → v2/api}/create-account/custom.d.cts.map +1 -1
- package/dist/{api/v2 → v2/api}/create-account/custom.d.mts.map +1 -1
- package/dist/{api/v2 → v2/api}/create-account/custom.mjs.map +1 -1
- package/dist/{api/v2 → v2/api}/create-account/index.cjs.map +1 -1
- package/dist/{api/v2 → v2/api}/create-account/index.d.cts +1 -1
- package/dist/{api/v2 → v2/api}/create-account/index.d.cts.map +1 -1
- package/dist/{api/v2 → v2/api}/create-account/index.d.mts +1 -1
- package/dist/{api/v2 → v2/api}/create-account/index.d.mts.map +1 -1
- package/dist/{api/v2 → v2/api}/create-account/index.mjs.map +1 -1
- package/dist/{api/v2 → v2/api}/create-account/private-key.cjs +1 -1
- package/dist/v2/api/create-account/private-key.cjs.map +1 -0
- package/dist/{api/v2 → v2/api}/create-account/private-key.d.cts +3 -2
- package/dist/{api/v2 → v2/api}/create-account/private-key.d.cts.map +1 -1
- package/dist/{api/v2 → v2/api}/create-account/private-key.d.mts +3 -2
- package/dist/{api/v2 → v2/api}/create-account/private-key.d.mts.map +1 -1
- package/dist/{api/v2 → v2/api}/create-account/private-key.mjs +1 -1
- package/dist/v2/api/create-account/private-key.mjs.map +1 -0
- package/dist/{api/v2 → v2/api}/export-account/index.cjs.map +1 -1
- package/dist/{api/v2 → v2/api}/export-account/index.d.cts.map +1 -1
- package/dist/{api/v2 → v2/api}/export-account/index.d.mts.map +1 -1
- package/dist/{api/v2 → v2/api}/export-account/index.mjs.map +1 -1
- package/dist/{api/v2 → v2/api}/export-account/private-key.cjs.map +1 -1
- package/dist/{api/v2 → v2/api}/export-account/private-key.d.cts.map +1 -1
- package/dist/{api/v2 → v2/api}/export-account/private-key.d.mts.map +1 -1
- package/dist/{api/v2 → v2/api}/export-account/private-key.mjs.map +1 -1
- package/dist/{api/v2 → v2/api}/index.cjs +1 -0
- package/dist/v2/api/index.cjs.map +1 -0
- package/dist/{api/v2 → v2/api}/index.d.cts +1 -0
- package/dist/v2/api/index.d.cts.map +1 -0
- package/dist/{api/v2 → v2/api}/index.d.mts +1 -0
- package/dist/v2/api/index.d.mts.map +1 -0
- package/dist/{api/v2 → v2/api}/index.mjs +1 -0
- package/dist/v2/api/index.mjs.map +1 -0
- package/dist/{api/v2 → v2/api}/keyring-capabilities.cjs +2 -2
- package/dist/v2/api/keyring-capabilities.cjs.map +1 -0
- package/dist/{api/v2 → v2/api}/keyring-capabilities.d.cts +7 -6
- package/dist/v2/api/keyring-capabilities.d.cts.map +1 -0
- package/dist/{api/v2 → v2/api}/keyring-capabilities.d.mts +7 -6
- package/dist/v2/api/keyring-capabilities.d.mts.map +1 -0
- package/dist/{api/v2 → v2/api}/keyring-capabilities.mjs +2 -2
- package/dist/v2/api/keyring-capabilities.mjs.map +1 -0
- package/dist/v2/api/keyring-rpc.cjs +93 -0
- package/dist/v2/api/keyring-rpc.cjs.map +1 -0
- package/dist/v2/api/keyring-rpc.d.cts +443 -0
- package/dist/v2/api/keyring-rpc.d.cts.map +1 -0
- package/dist/v2/api/keyring-rpc.d.mts +443 -0
- package/dist/v2/api/keyring-rpc.d.mts.map +1 -0
- package/dist/v2/api/keyring-rpc.mjs +89 -0
- package/dist/v2/api/keyring-rpc.mjs.map +1 -0
- package/dist/{api/v2 → v2/api}/keyring-type.cjs.map +1 -1
- package/dist/{api/v2 → v2/api}/keyring-type.d.cts.map +1 -1
- package/dist/{api/v2 → v2/api}/keyring-type.d.mts.map +1 -1
- package/dist/{api/v2 → v2/api}/keyring-type.mjs.map +1 -1
- package/dist/v2/api/keyring.cjs.map +1 -0
- package/dist/{api/v2 → v2/api}/keyring.d.cts +4 -4
- package/dist/{api/v2 → v2/api}/keyring.d.cts.map +1 -1
- package/dist/{api/v2 → v2/api}/keyring.d.mts +4 -4
- package/dist/{api/v2 → v2/api}/keyring.d.mts.map +1 -1
- package/dist/v2/api/keyring.mjs.map +1 -0
- package/dist/{api/v2 → v2/api}/private-key.cjs +1 -1
- package/dist/v2/api/private-key.cjs.map +1 -0
- package/dist/{api/v2 → v2/api}/private-key.d.cts +3 -2
- package/dist/v2/api/private-key.d.cts.map +1 -0
- package/dist/{api/v2 → v2/api}/private-key.d.mts +3 -2
- package/dist/v2/api/private-key.d.mts.map +1 -0
- package/dist/{api/v2 → v2/api}/private-key.mjs +1 -1
- package/dist/v2/api/private-key.mjs.map +1 -0
- package/dist/v2/index.cjs +18 -0
- package/dist/v2/index.cjs.map +1 -0
- package/dist/v2/index.d.cts +2 -0
- package/dist/v2/index.d.cts.map +1 -0
- package/dist/v2/index.d.mts +2 -0
- package/dist/v2/index.d.mts.map +1 -0
- package/dist/v2/index.mjs +2 -0
- package/dist/v2/index.mjs.map +1 -0
- package/dist/xlm/constants.cjs +15 -0
- package/dist/xlm/constants.cjs.map +1 -0
- package/dist/xlm/constants.d.cts +10 -0
- package/dist/xlm/constants.d.cts.map +1 -0
- package/dist/xlm/constants.d.mts +10 -0
- package/dist/xlm/constants.d.mts.map +1 -0
- package/dist/xlm/constants.mjs +12 -0
- package/dist/xlm/constants.mjs.map +1 -0
- package/dist/xlm/index.cjs +19 -0
- package/dist/xlm/index.cjs.map +1 -0
- package/dist/xlm/index.d.cts +3 -0
- package/dist/xlm/index.d.cts.map +1 -0
- package/dist/xlm/index.d.mts +3 -0
- package/dist/xlm/index.d.mts.map +1 -0
- package/dist/xlm/index.mjs +3 -0
- package/dist/xlm/index.mjs.map +1 -0
- package/dist/xlm/types.cjs +42 -0
- package/dist/xlm/types.cjs.map +1 -0
- package/dist/xlm/types.d.cts +71 -0
- package/dist/xlm/types.d.cts.map +1 -0
- package/dist/xlm/types.d.mts +71 -0
- package/dist/xlm/types.d.mts.map +1 -0
- package/dist/xlm/types.mjs +39 -0
- package/dist/xlm/types.mjs.map +1 -0
- package/package.json +28 -12
- package/v2.js +3 -0
- package/dist/api/v2/create-account/bip44.cjs.map +0 -1
- package/dist/api/v2/create-account/private-key.cjs.map +0 -1
- package/dist/api/v2/create-account/private-key.mjs.map +0 -1
- package/dist/api/v2/index.cjs.map +0 -1
- package/dist/api/v2/index.d.cts.map +0 -1
- package/dist/api/v2/index.d.mts.map +0 -1
- package/dist/api/v2/index.mjs.map +0 -1
- package/dist/api/v2/keyring-capabilities.cjs.map +0 -1
- package/dist/api/v2/keyring-capabilities.d.cts.map +0 -1
- package/dist/api/v2/keyring-capabilities.d.mts.map +0 -1
- package/dist/api/v2/keyring-capabilities.mjs.map +0 -1
- package/dist/api/v2/keyring.cjs.map +0 -1
- package/dist/api/v2/keyring.mjs.map +0 -1
- package/dist/api/v2/private-key.cjs.map +0 -1
- package/dist/api/v2/private-key.d.cts.map +0 -1
- package/dist/api/v2/private-key.d.mts.map +0 -1
- package/dist/api/v2/private-key.mjs.map +0 -1
- /package/dist/{api/v2 → v2/api}/create-account/bip44.d.cts +0 -0
- /package/dist/{api/v2 → v2/api}/create-account/bip44.d.mts +0 -0
- /package/dist/{api/v2 → v2/api}/create-account/custom.cjs +0 -0
- /package/dist/{api/v2 → v2/api}/create-account/custom.d.cts +0 -0
- /package/dist/{api/v2 → v2/api}/create-account/custom.d.mts +0 -0
- /package/dist/{api/v2 → v2/api}/create-account/custom.mjs +0 -0
- /package/dist/{api/v2 → v2/api}/create-account/index.cjs +0 -0
- /package/dist/{api/v2 → v2/api}/create-account/index.mjs +0 -0
- /package/dist/{api/v2 → v2/api}/export-account/index.cjs +0 -0
- /package/dist/{api/v2 → v2/api}/export-account/index.d.cts +0 -0
- /package/dist/{api/v2 → v2/api}/export-account/index.d.mts +0 -0
- /package/dist/{api/v2 → v2/api}/export-account/index.mjs +0 -0
- /package/dist/{api/v2 → v2/api}/export-account/private-key.cjs +0 -0
- /package/dist/{api/v2 → v2/api}/export-account/private-key.d.cts +0 -0
- /package/dist/{api/v2 → v2/api}/export-account/private-key.d.mts +0 -0
- /package/dist/{api/v2 → v2/api}/export-account/private-key.mjs +0 -0
- /package/dist/{api/v2 → v2/api}/keyring-type.cjs +0 -0
- /package/dist/{api/v2 → v2/api}/keyring-type.d.cts +0 -0
- /package/dist/{api/v2 → v2/api}/keyring-type.d.mts +0 -0
- /package/dist/{api/v2 → v2/api}/keyring-type.mjs +0 -0
- /package/dist/{api/v2 → v2/api}/keyring.cjs +0 -0
- /package/dist/{api/v2 → v2/api}/keyring.mjs +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,31 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [23.0.1]
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- Workaround Browserify subpath export for `/v2` ([#516](https://github.com/MetaMask/accounts/pull/516))
|
|
15
|
+
|
|
16
|
+
## [23.0.0]
|
|
17
|
+
|
|
18
|
+
### Added
|
|
19
|
+
|
|
20
|
+
- Add Stellar (XLM) support ([#483](https://github.com/MetaMask/accounts/pull/483))
|
|
21
|
+
- Add `XlmScope`, `XlmAccountType` and `XlmAccount`.
|
|
22
|
+
- Add keyring v2 RPC types and structs (`KeyringRpcV2`, `KeyringRpcV2Method`, `isKeyringRpcV2Method`, and request/response structs) ([#408](https://github.com/MetaMask/accounts/pull/408))
|
|
23
|
+
- Add `./v2` subpath export for all keyring v2 types and structs ([#513](https://github.com/MetaMask/accounts/pull/513))
|
|
24
|
+
|
|
25
|
+
### Changed
|
|
26
|
+
|
|
27
|
+
- **BREAKING:** Move and rename all keyring v2 types and structs to the new `./v2` subpath export ([#513](https://github.com/MetaMask/accounts/pull/513))
|
|
28
|
+
- `KeyringV2` is now `Keyring` from `@metamask/keyring-api/v2`.
|
|
29
|
+
- `KeyringRpcV2`, `KeyringRpcV2Method`, and `isKeyringRpcV2Method` are now `KeyringRpc`, `KeyringRpcMethod`, and `isKeyringRpcMethod` from `@metamask/keyring-api/v2`.
|
|
30
|
+
- `KeyringCapabilities`, `KeyringType`, account creation options (except `CreateAccountOptions`), and account export options are now exclusively available from `@metamask/keyring-api/v2`.
|
|
31
|
+
- `CreateAccountOptions` and its subtypes (`Bip44CreateAccountOptions`, `PrivateKeyCreateAccountOptions`, `CustomCreateAccountOptions`) remain available from both `@metamask/keyring-api` and `@metamask/keyring-api/v2`.
|
|
32
|
+
- Improve return type of `isKeyringRpcMethod` to use type predicate `method is KeyringRpcMethod` ([#408](https://github.com/MetaMask/accounts/pull/408))
|
|
33
|
+
- Bump `@metamask/utils` from `^11.1.0` to `^11.11.0` ([#489](https://github.com/MetaMask/accounts/pull/489), [#483](https://github.com/MetaMask/accounts/pull/483))
|
|
34
|
+
|
|
10
35
|
## [22.0.0]
|
|
11
36
|
|
|
12
37
|
### Removed
|
|
@@ -718,7 +743,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
718
743
|
- SnapController keyring client. It is intended to be used by MetaMask to talk to the snap.
|
|
719
744
|
- Helper functions to create keyring handler in the snap.
|
|
720
745
|
|
|
721
|
-
[Unreleased]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@
|
|
746
|
+
[Unreleased]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@23.0.1...HEAD
|
|
747
|
+
[23.0.1]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@23.0.0...@metamask/keyring-api@23.0.1
|
|
748
|
+
[23.0.0]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@22.0.0...@metamask/keyring-api@23.0.0
|
|
722
749
|
[22.0.0]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@21.6.0...@metamask/keyring-api@22.0.0
|
|
723
750
|
[21.6.0]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@21.5.0...@metamask/keyring-api@21.6.0
|
|
724
751
|
[21.5.0]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@21.4.0...@metamask/keyring-api@21.5.0
|
package/dist/api/account.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.KeyringAccountStruct = exports.KeyringAccountTypeStruct = exports.AnyAccountType = exports.TrxAccountType = exports.SolAccountType = exports.BtcAccountType = exports.EthAccountType = void 0;
|
|
3
|
+
exports.KeyringAccountStruct = exports.KeyringAccountTypeStruct = exports.AnyAccountType = exports.XlmAccountType = exports.TrxAccountType = exports.SolAccountType = exports.BtcAccountType = exports.EthAccountType = void 0;
|
|
4
4
|
const keyring_utils_1 = require("@metamask/keyring-utils");
|
|
5
5
|
const superstruct_1 = require("@metamask/superstruct");
|
|
6
6
|
const account_options_1 = require("./account-options.cjs");
|
|
@@ -37,6 +37,18 @@ var TrxAccountType;
|
|
|
37
37
|
(function (TrxAccountType) {
|
|
38
38
|
TrxAccountType["Eoa"] = "tron:eoa";
|
|
39
39
|
})(TrxAccountType || (exports.TrxAccountType = TrxAccountType = {}));
|
|
40
|
+
/**
|
|
41
|
+
* Supported Stellar account types.
|
|
42
|
+
*
|
|
43
|
+
* We currently model only the standard Stellar account (G-address).
|
|
44
|
+
* This excludes advanced formats such as muxed (M...) accounts.
|
|
45
|
+
*
|
|
46
|
+
* See: https://developers.stellar.org/docs/build/guides/transactions/pooled-accounts-muxed-accounts-memos
|
|
47
|
+
*/
|
|
48
|
+
var XlmAccountType;
|
|
49
|
+
(function (XlmAccountType) {
|
|
50
|
+
XlmAccountType["Account"] = "stellar:account";
|
|
51
|
+
})(XlmAccountType || (exports.XlmAccountType = XlmAccountType = {}));
|
|
40
52
|
/**
|
|
41
53
|
* A generic account type. It can be used to represent any account type that is
|
|
42
54
|
* not covered by the other account types. It only applies to non-EVM chains.
|
|
@@ -57,6 +69,7 @@ exports.KeyringAccountTypeStruct = (0, superstruct_1.enums)([
|
|
|
57
69
|
`${BtcAccountType.P2tr}`,
|
|
58
70
|
`${SolAccountType.DataAccount}`,
|
|
59
71
|
`${TrxAccountType.Eoa}`,
|
|
72
|
+
`${XlmAccountType.Account}`,
|
|
60
73
|
`${AnyAccountType.Account}`,
|
|
61
74
|
]);
|
|
62
75
|
/**
|
|
@@ -83,6 +96,7 @@ exports.KeyringAccountStruct = (0, keyring_utils_1.object)({
|
|
|
83
96
|
`${BtcAccountType.P2tr}`,
|
|
84
97
|
`${SolAccountType.DataAccount}`,
|
|
85
98
|
`${TrxAccountType.Eoa}`,
|
|
99
|
+
`${XlmAccountType.Account}`,
|
|
86
100
|
`${AnyAccountType.Account}`,
|
|
87
101
|
]),
|
|
88
102
|
/**
|
package/dist/api/account.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account.cjs","sourceRoot":"","sources":["../../src/api/account.ts"],"names":[],"mappings":";;;AAAA,2DAAkE;AAElE,uDAAuE;AAEvE,2DAAgE;AAChE,qCAA2C;AAE3C;;GAEG;AACH,IAAY,cAGX;AAHD,WAAY,cAAc;IACxB,oCAAkB,CAAA;IAClB,4CAA0B,CAAA;AAC5B,CAAC,EAHW,cAAc,8BAAd,cAAc,QAGzB;AAED;;GAEG;AACH,IAAY,cAKX;AALD,WAAY,cAAc;IACxB,wCAAsB,CAAA;IACtB,sCAAoB,CAAA;IACpB,0CAAwB,CAAA;IACxB,sCAAoB,CAAA;AACtB,CAAC,EALW,cAAc,8BAAd,cAAc,QAKzB;AAED;;GAEG;AACH,IAAY,cAEX;AAFD,WAAY,cAAc;IACxB,qDAAmC,CAAA;AACrC,CAAC,EAFW,cAAc,8BAAd,cAAc,QAEzB;AAED;;GAEG;AACH,IAAY,cAEX;AAFD,WAAY,cAAc;IACxB,kCAAgB,CAAA;AAClB,CAAC,EAFW,cAAc,8BAAd,cAAc,QAEzB;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AAc,CAAC,MAAM,EAAE;IAC1B,GAAG,cAAc,CAAC,IAAI,EAAE;IACxB,GAAG,cAAc,CAAC,WAAW,EAAE;IAC/B,GAAG,cAAc,CAAC,GAAG,EAAE;IACvB,GAAG,cAAc,CAAC,OAAO,EAAE;IAC3B,GAAG,cAAc,CAAC,OAAO,EAAE;CAC5B,CAAC,CAAC;AAEH;;;;;;GAMG;AACU,QAAA,oBAAoB,GAAG,IAAA,sBAAM,EAAC;IACzC;;OAEG;IACH,EAAE,EAAE,+BAAe;IAEnB;;OAEG;IACH,IAAI,EAAE,IAAA,mBAAK,EAAC;QACV,GAAG,cAAc,CAAC,GAAG,EAAE;QACvB,GAAG,cAAc,CAAC,OAAO,EAAE;QAC3B,GAAG,cAAc,CAAC,KAAK,EAAE;QACzB,GAAG,cAAc,CAAC,IAAI,EAAE;QACxB,GAAG,cAAc,CAAC,MAAM,EAAE;QAC1B,GAAG,cAAc,CAAC,IAAI,EAAE;QACxB,GAAG,cAAc,CAAC,WAAW,EAAE;QAC/B,GAAG,cAAc,CAAC,GAAG,EAAE;QACvB,GAAG,cAAc,CAAC,OAAO,EAAE;QAC3B,GAAG,cAAc,CAAC,OAAO,EAAE;KAC5B,CAAC;IAEF;;OAEG;IACH,OAAO,EAAE,IAAA,oBAAM,GAAE;IAEjB;;OAEG;IACH,MAAM,EAAE,IAAA,sBAAQ,EAAC,IAAA,mBAAK,EAAC,wBAAiB,CAAC,CAAC;IAE1C;;OAEG;IACH,OAAO,EAAE,6CAA2B;IAEpC;;OAEG;IACH,OAAO,EAAE,IAAA,mBAAK,EAAC,IAAA,oBAAM,GAAE,CAAC;CACzB,CAAC,CAAC","sourcesContent":["import { AccountIdStruct, object } from '@metamask/keyring-utils';\nimport type { Infer } from '@metamask/superstruct';\nimport { nonempty, array, enums, string } from '@metamask/superstruct';\n\nimport { KeyringAccountOptionsStruct } from './account-options';\nimport { CaipChainIdStruct } from './caip';\n\n/**\n * Supported Ethereum account types.\n */\nexport enum EthAccountType {\n Eoa = 'eip155:eoa',\n Erc4337 = 'eip155:erc4337',\n}\n\n/**\n * Supported Bitcoin account types.\n */\nexport enum BtcAccountType {\n P2pkh = 'bip122:p2pkh',\n P2sh = 'bip122:p2sh',\n P2wpkh = 'bip122:p2wpkh',\n P2tr = 'bip122:p2tr',\n}\n\n/**\n * Supported Solana account types.\n */\nexport enum SolAccountType {\n DataAccount = 'solana:data-account',\n}\n\n/**\n * Supported Tron account types.\n */\nexport enum TrxAccountType {\n Eoa = 'tron:eoa',\n}\n\n/**\n * Supported Stellar account types.\n *\n * We currently model only the standard Stellar account (G-address).\n * This excludes advanced formats such as muxed (M...) accounts.\n *\n * See: https://developers.stellar.org/docs/build/guides/transactions/pooled-accounts-muxed-accounts-memos\n */\nexport enum XlmAccountType {\n Account = 'stellar:account',\n}\n\n/**\n * A generic account type. It can be used to represent any account type that is\n * not covered by the other account types. It only applies to non-EVM chains.\n */\nexport enum AnyAccountType {\n Account = 'any:account',\n}\n\n/**\n * Supported account types.\n */\nexport type KeyringAccountType =\n | `${EthAccountType.Eoa}`\n | `${EthAccountType.Erc4337}`\n | `${BtcAccountType.P2pkh}`\n | `${BtcAccountType.P2sh}`\n | `${BtcAccountType.P2wpkh}`\n | `${BtcAccountType.P2tr}`\n | `${SolAccountType.DataAccount}`\n | `${TrxAccountType.Eoa}`\n | `${XlmAccountType.Account}`\n | `${AnyAccountType.Account}`;\n\n/**\n * Struct for {@link KeyringAccountType}.\n */\nexport const KeyringAccountTypeStruct = enums([\n `${EthAccountType.Eoa}`,\n `${EthAccountType.Erc4337}`,\n `${BtcAccountType.P2pkh}`,\n `${BtcAccountType.P2sh}`,\n `${BtcAccountType.P2wpkh}`,\n `${BtcAccountType.P2tr}`,\n `${SolAccountType.DataAccount}`,\n `${TrxAccountType.Eoa}`,\n `${XlmAccountType.Account}`,\n `${AnyAccountType.Account}`,\n]);\n\n/**\n * A struct which represents a Keyring account object. It is abstract enough to\n * be used with any blockchain. Specific blockchain account types should extend\n * this struct.\n *\n * See {@link KeyringAccount}.\n */\nexport const KeyringAccountStruct = object({\n /**\n * Account ID (UUIDv4).\n */\n id: AccountIdStruct,\n\n /**\n * Account type.\n */\n type: enums([\n `${EthAccountType.Eoa}`,\n `${EthAccountType.Erc4337}`,\n `${BtcAccountType.P2pkh}`,\n `${BtcAccountType.P2sh}`,\n `${BtcAccountType.P2wpkh}`,\n `${BtcAccountType.P2tr}`,\n `${SolAccountType.DataAccount}`,\n `${TrxAccountType.Eoa}`,\n `${XlmAccountType.Account}`,\n `${AnyAccountType.Account}`,\n ]),\n\n /**\n * Account main address.\n */\n address: string(),\n\n /**\n * Account supported scopes (CAIP-2 chain IDs).\n */\n scopes: nonempty(array(CaipChainIdStruct)),\n\n /**\n * Account options.\n */\n options: KeyringAccountOptionsStruct,\n\n /**\n * Account supported methods.\n */\n methods: array(string()),\n});\n\n/**\n * Keyring Account type represents an account and its properties from the\n * point of view of the keyring.\n */\nexport type KeyringAccount = Infer<typeof KeyringAccountStruct>;\n"]}
|
package/dist/api/account.d.cts
CHANGED
|
@@ -27,6 +27,17 @@ export declare enum SolAccountType {
|
|
|
27
27
|
export declare enum TrxAccountType {
|
|
28
28
|
Eoa = "tron:eoa"
|
|
29
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* Supported Stellar account types.
|
|
32
|
+
*
|
|
33
|
+
* We currently model only the standard Stellar account (G-address).
|
|
34
|
+
* This excludes advanced formats such as muxed (M...) accounts.
|
|
35
|
+
*
|
|
36
|
+
* See: https://developers.stellar.org/docs/build/guides/transactions/pooled-accounts-muxed-accounts-memos
|
|
37
|
+
*/
|
|
38
|
+
export declare enum XlmAccountType {
|
|
39
|
+
Account = "stellar:account"
|
|
40
|
+
}
|
|
30
41
|
/**
|
|
31
42
|
* A generic account type. It can be used to represent any account type that is
|
|
32
43
|
* not covered by the other account types. It only applies to non-EVM chains.
|
|
@@ -37,11 +48,11 @@ export declare enum AnyAccountType {
|
|
|
37
48
|
/**
|
|
38
49
|
* Supported account types.
|
|
39
50
|
*/
|
|
40
|
-
export type KeyringAccountType = `${EthAccountType.Eoa}` | `${EthAccountType.Erc4337}` | `${BtcAccountType.P2pkh}` | `${BtcAccountType.P2sh}` | `${BtcAccountType.P2wpkh}` | `${BtcAccountType.P2tr}` | `${SolAccountType.DataAccount}` | `${TrxAccountType.Eoa}` | `${AnyAccountType.Account}`;
|
|
51
|
+
export type KeyringAccountType = `${EthAccountType.Eoa}` | `${EthAccountType.Erc4337}` | `${BtcAccountType.P2pkh}` | `${BtcAccountType.P2sh}` | `${BtcAccountType.P2wpkh}` | `${BtcAccountType.P2tr}` | `${SolAccountType.DataAccount}` | `${TrxAccountType.Eoa}` | `${XlmAccountType.Account}` | `${AnyAccountType.Account}`;
|
|
41
52
|
/**
|
|
42
53
|
* Struct for {@link KeyringAccountType}.
|
|
43
54
|
*/
|
|
44
|
-
export declare const KeyringAccountTypeStruct: import("@metamask/superstruct").Struct<"eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account", {
|
|
55
|
+
export declare const KeyringAccountTypeStruct: import("@metamask/superstruct").Struct<"eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "stellar:account" | "any:account", {
|
|
45
56
|
"eip155:eoa": "eip155:eoa";
|
|
46
57
|
"eip155:erc4337": "eip155:erc4337";
|
|
47
58
|
"bip122:p2pkh": "bip122:p2pkh";
|
|
@@ -50,6 +61,7 @@ export declare const KeyringAccountTypeStruct: import("@metamask/superstruct").S
|
|
|
50
61
|
"bip122:p2tr": "bip122:p2tr";
|
|
51
62
|
"solana:data-account": "solana:data-account";
|
|
52
63
|
"tron:eoa": "tron:eoa";
|
|
64
|
+
"stellar:account": "stellar:account";
|
|
53
65
|
"any:account": "any:account";
|
|
54
66
|
}>;
|
|
55
67
|
/**
|
|
@@ -60,7 +72,7 @@ export declare const KeyringAccountTypeStruct: import("@metamask/superstruct").S
|
|
|
60
72
|
* See {@link KeyringAccount}.
|
|
61
73
|
*/
|
|
62
74
|
export declare const KeyringAccountStruct: import("@metamask/superstruct").Struct<{
|
|
63
|
-
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account";
|
|
75
|
+
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "stellar:account" | "any:account";
|
|
64
76
|
id: string;
|
|
65
77
|
options: Record<string, import("@metamask/utils").Json> & {
|
|
66
78
|
entropy?: {
|
|
@@ -86,7 +98,7 @@ export declare const KeyringAccountStruct: import("@metamask/superstruct").Struc
|
|
|
86
98
|
/**
|
|
87
99
|
* Account type.
|
|
88
100
|
*/
|
|
89
|
-
type: import("@metamask/superstruct").Struct<"eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account", {
|
|
101
|
+
type: import("@metamask/superstruct").Struct<"eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "stellar:account" | "any:account", {
|
|
90
102
|
"eip155:eoa": "eip155:eoa";
|
|
91
103
|
"eip155:erc4337": "eip155:erc4337";
|
|
92
104
|
"bip122:p2pkh": "bip122:p2pkh";
|
|
@@ -95,6 +107,7 @@ export declare const KeyringAccountStruct: import("@metamask/superstruct").Struc
|
|
|
95
107
|
"bip122:p2tr": "bip122:p2tr";
|
|
96
108
|
"solana:data-account": "solana:data-account";
|
|
97
109
|
"tron:eoa": "tron:eoa";
|
|
110
|
+
"stellar:account": "stellar:account";
|
|
98
111
|
"any:account": "any:account";
|
|
99
112
|
}>;
|
|
100
113
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account.d.cts","sourceRoot":"","sources":["../../src/api/account.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAMnD;;GAEG;AACH,oBAAY,cAAc;IACxB,GAAG,eAAe;IAClB,OAAO,mBAAmB;CAC3B;AAED;;GAEG;AACH,oBAAY,cAAc;IACxB,KAAK,iBAAiB;IACtB,IAAI,gBAAgB;IACpB,MAAM,kBAAkB;IACxB,IAAI,gBAAgB;CACrB;AAED;;GAEG;AACH,oBAAY,cAAc;IACxB,WAAW,wBAAwB;CACpC;AAED;;GAEG;AACH,oBAAY,cAAc;IACxB,GAAG,aAAa;CACjB;AAED;;;GAGG;AACH,oBAAY,cAAc;IACxB,OAAO,gBAAgB;CACxB;AAED;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAC1B,GAAG,cAAc,CAAC,GAAG,EAAE,GACvB,GAAG,cAAc,CAAC,OAAO,EAAE,GAC3B,GAAG,cAAc,CAAC,KAAK,EAAE,GACzB,GAAG,cAAc,CAAC,IAAI,EAAE,GACxB,GAAG,cAAc,CAAC,MAAM,EAAE,GAC1B,GAAG,cAAc,CAAC,IAAI,EAAE,GACxB,GAAG,cAAc,CAAC,WAAW,EAAE,GAC/B,GAAG,cAAc,CAAC,GAAG,EAAE,GACvB,GAAG,cAAc,CAAC,OAAO,EAAE,CAAC;AAEhC;;GAEG;AACH,eAAO,MAAM,wBAAwB
|
|
1
|
+
{"version":3,"file":"account.d.cts","sourceRoot":"","sources":["../../src/api/account.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAMnD;;GAEG;AACH,oBAAY,cAAc;IACxB,GAAG,eAAe;IAClB,OAAO,mBAAmB;CAC3B;AAED;;GAEG;AACH,oBAAY,cAAc;IACxB,KAAK,iBAAiB;IACtB,IAAI,gBAAgB;IACpB,MAAM,kBAAkB;IACxB,IAAI,gBAAgB;CACrB;AAED;;GAEG;AACH,oBAAY,cAAc;IACxB,WAAW,wBAAwB;CACpC;AAED;;GAEG;AACH,oBAAY,cAAc;IACxB,GAAG,aAAa;CACjB;AAED;;;;;;;GAOG;AACH,oBAAY,cAAc;IACxB,OAAO,oBAAoB;CAC5B;AAED;;;GAGG;AACH,oBAAY,cAAc;IACxB,OAAO,gBAAgB;CACxB;AAED;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAC1B,GAAG,cAAc,CAAC,GAAG,EAAE,GACvB,GAAG,cAAc,CAAC,OAAO,EAAE,GAC3B,GAAG,cAAc,CAAC,KAAK,EAAE,GACzB,GAAG,cAAc,CAAC,IAAI,EAAE,GACxB,GAAG,cAAc,CAAC,MAAM,EAAE,GAC1B,GAAG,cAAc,CAAC,IAAI,EAAE,GACxB,GAAG,cAAc,CAAC,WAAW,EAAE,GAC/B,GAAG,cAAc,CAAC,GAAG,EAAE,GACvB,GAAG,cAAc,CAAC,OAAO,EAAE,GAC3B,GAAG,cAAc,CAAC,OAAO,EAAE,CAAC;AAEhC;;GAEG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;;EAWnC,CAAC;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;IAC/B;;OAEG;;IAGH;;OAEG;;;;;;;;;;;;;IAcH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;;;;;;;;;IAGH;;OAEG;;EAEH,CAAC;AAEH;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
|
package/dist/api/account.d.mts
CHANGED
|
@@ -27,6 +27,17 @@ export declare enum SolAccountType {
|
|
|
27
27
|
export declare enum TrxAccountType {
|
|
28
28
|
Eoa = "tron:eoa"
|
|
29
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* Supported Stellar account types.
|
|
32
|
+
*
|
|
33
|
+
* We currently model only the standard Stellar account (G-address).
|
|
34
|
+
* This excludes advanced formats such as muxed (M...) accounts.
|
|
35
|
+
*
|
|
36
|
+
* See: https://developers.stellar.org/docs/build/guides/transactions/pooled-accounts-muxed-accounts-memos
|
|
37
|
+
*/
|
|
38
|
+
export declare enum XlmAccountType {
|
|
39
|
+
Account = "stellar:account"
|
|
40
|
+
}
|
|
30
41
|
/**
|
|
31
42
|
* A generic account type. It can be used to represent any account type that is
|
|
32
43
|
* not covered by the other account types. It only applies to non-EVM chains.
|
|
@@ -37,11 +48,11 @@ export declare enum AnyAccountType {
|
|
|
37
48
|
/**
|
|
38
49
|
* Supported account types.
|
|
39
50
|
*/
|
|
40
|
-
export type KeyringAccountType = `${EthAccountType.Eoa}` | `${EthAccountType.Erc4337}` | `${BtcAccountType.P2pkh}` | `${BtcAccountType.P2sh}` | `${BtcAccountType.P2wpkh}` | `${BtcAccountType.P2tr}` | `${SolAccountType.DataAccount}` | `${TrxAccountType.Eoa}` | `${AnyAccountType.Account}`;
|
|
51
|
+
export type KeyringAccountType = `${EthAccountType.Eoa}` | `${EthAccountType.Erc4337}` | `${BtcAccountType.P2pkh}` | `${BtcAccountType.P2sh}` | `${BtcAccountType.P2wpkh}` | `${BtcAccountType.P2tr}` | `${SolAccountType.DataAccount}` | `${TrxAccountType.Eoa}` | `${XlmAccountType.Account}` | `${AnyAccountType.Account}`;
|
|
41
52
|
/**
|
|
42
53
|
* Struct for {@link KeyringAccountType}.
|
|
43
54
|
*/
|
|
44
|
-
export declare const KeyringAccountTypeStruct: import("@metamask/superstruct").Struct<"eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account", {
|
|
55
|
+
export declare const KeyringAccountTypeStruct: import("@metamask/superstruct").Struct<"eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "stellar:account" | "any:account", {
|
|
45
56
|
"eip155:eoa": "eip155:eoa";
|
|
46
57
|
"eip155:erc4337": "eip155:erc4337";
|
|
47
58
|
"bip122:p2pkh": "bip122:p2pkh";
|
|
@@ -50,6 +61,7 @@ export declare const KeyringAccountTypeStruct: import("@metamask/superstruct").S
|
|
|
50
61
|
"bip122:p2tr": "bip122:p2tr";
|
|
51
62
|
"solana:data-account": "solana:data-account";
|
|
52
63
|
"tron:eoa": "tron:eoa";
|
|
64
|
+
"stellar:account": "stellar:account";
|
|
53
65
|
"any:account": "any:account";
|
|
54
66
|
}>;
|
|
55
67
|
/**
|
|
@@ -60,7 +72,7 @@ export declare const KeyringAccountTypeStruct: import("@metamask/superstruct").S
|
|
|
60
72
|
* See {@link KeyringAccount}.
|
|
61
73
|
*/
|
|
62
74
|
export declare const KeyringAccountStruct: import("@metamask/superstruct").Struct<{
|
|
63
|
-
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account";
|
|
75
|
+
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "stellar:account" | "any:account";
|
|
64
76
|
id: string;
|
|
65
77
|
options: Record<string, import("@metamask/utils").Json> & {
|
|
66
78
|
entropy?: {
|
|
@@ -86,7 +98,7 @@ export declare const KeyringAccountStruct: import("@metamask/superstruct").Struc
|
|
|
86
98
|
/**
|
|
87
99
|
* Account type.
|
|
88
100
|
*/
|
|
89
|
-
type: import("@metamask/superstruct").Struct<"eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account", {
|
|
101
|
+
type: import("@metamask/superstruct").Struct<"eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "stellar:account" | "any:account", {
|
|
90
102
|
"eip155:eoa": "eip155:eoa";
|
|
91
103
|
"eip155:erc4337": "eip155:erc4337";
|
|
92
104
|
"bip122:p2pkh": "bip122:p2pkh";
|
|
@@ -95,6 +107,7 @@ export declare const KeyringAccountStruct: import("@metamask/superstruct").Struc
|
|
|
95
107
|
"bip122:p2tr": "bip122:p2tr";
|
|
96
108
|
"solana:data-account": "solana:data-account";
|
|
97
109
|
"tron:eoa": "tron:eoa";
|
|
110
|
+
"stellar:account": "stellar:account";
|
|
98
111
|
"any:account": "any:account";
|
|
99
112
|
}>;
|
|
100
113
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account.d.mts","sourceRoot":"","sources":["../../src/api/account.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAMnD;;GAEG;AACH,oBAAY,cAAc;IACxB,GAAG,eAAe;IAClB,OAAO,mBAAmB;CAC3B;AAED;;GAEG;AACH,oBAAY,cAAc;IACxB,KAAK,iBAAiB;IACtB,IAAI,gBAAgB;IACpB,MAAM,kBAAkB;IACxB,IAAI,gBAAgB;CACrB;AAED;;GAEG;AACH,oBAAY,cAAc;IACxB,WAAW,wBAAwB;CACpC;AAED;;GAEG;AACH,oBAAY,cAAc;IACxB,GAAG,aAAa;CACjB;AAED;;;GAGG;AACH,oBAAY,cAAc;IACxB,OAAO,gBAAgB;CACxB;AAED;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAC1B,GAAG,cAAc,CAAC,GAAG,EAAE,GACvB,GAAG,cAAc,CAAC,OAAO,EAAE,GAC3B,GAAG,cAAc,CAAC,KAAK,EAAE,GACzB,GAAG,cAAc,CAAC,IAAI,EAAE,GACxB,GAAG,cAAc,CAAC,MAAM,EAAE,GAC1B,GAAG,cAAc,CAAC,IAAI,EAAE,GACxB,GA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;;;IAC/B;;OAEG;;IAGH;;OAEG;;;;;;;;;;;;;IAcH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;;;;;;;;;IAGH;;OAEG;;EAEH,CAAC;AAEH;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
|
package/dist/api/account.mjs
CHANGED
|
@@ -34,6 +34,18 @@ export var TrxAccountType;
|
|
|
34
34
|
(function (TrxAccountType) {
|
|
35
35
|
TrxAccountType["Eoa"] = "tron:eoa";
|
|
36
36
|
})(TrxAccountType || (TrxAccountType = {}));
|
|
37
|
+
/**
|
|
38
|
+
* Supported Stellar account types.
|
|
39
|
+
*
|
|
40
|
+
* We currently model only the standard Stellar account (G-address).
|
|
41
|
+
* This excludes advanced formats such as muxed (M...) accounts.
|
|
42
|
+
*
|
|
43
|
+
* See: https://developers.stellar.org/docs/build/guides/transactions/pooled-accounts-muxed-accounts-memos
|
|
44
|
+
*/
|
|
45
|
+
export var XlmAccountType;
|
|
46
|
+
(function (XlmAccountType) {
|
|
47
|
+
XlmAccountType["Account"] = "stellar:account";
|
|
48
|
+
})(XlmAccountType || (XlmAccountType = {}));
|
|
37
49
|
/**
|
|
38
50
|
* A generic account type. It can be used to represent any account type that is
|
|
39
51
|
* not covered by the other account types. It only applies to non-EVM chains.
|
|
@@ -54,6 +66,7 @@ export const KeyringAccountTypeStruct = enums([
|
|
|
54
66
|
`${BtcAccountType.P2tr}`,
|
|
55
67
|
`${SolAccountType.DataAccount}`,
|
|
56
68
|
`${TrxAccountType.Eoa}`,
|
|
69
|
+
`${XlmAccountType.Account}`,
|
|
57
70
|
`${AnyAccountType.Account}`,
|
|
58
71
|
]);
|
|
59
72
|
/**
|
|
@@ -80,6 +93,7 @@ export const KeyringAccountStruct = object({
|
|
|
80
93
|
`${BtcAccountType.P2tr}`,
|
|
81
94
|
`${SolAccountType.DataAccount}`,
|
|
82
95
|
`${TrxAccountType.Eoa}`,
|
|
96
|
+
`${XlmAccountType.Account}`,
|
|
83
97
|
`${AnyAccountType.Account}`,
|
|
84
98
|
]),
|
|
85
99
|
/**
|
package/dist/api/account.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account.mjs","sourceRoot":"","sources":["../../src/api/account.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,gCAAgC;AAElE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,8BAA8B;AAEvE,OAAO,EAAE,2BAA2B,EAAE,8BAA0B;AAChE,OAAO,EAAE,iBAAiB,EAAE,mBAAe;AAE3C;;GAEG;AACH,MAAM,CAAN,IAAY,cAGX;AAHD,WAAY,cAAc;IACxB,oCAAkB,CAAA;IAClB,4CAA0B,CAAA;AAC5B,CAAC,EAHW,cAAc,KAAd,cAAc,QAGzB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,cAKX;AALD,WAAY,cAAc;IACxB,wCAAsB,CAAA;IACtB,sCAAoB,CAAA;IACpB,0CAAwB,CAAA;IACxB,sCAAoB,CAAA;AACtB,CAAC,EALW,cAAc,KAAd,cAAc,QAKzB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,cAEX;AAFD,WAAY,cAAc;IACxB,qDAAmC,CAAA;AACrC,CAAC,EAFW,cAAc,KAAd,cAAc,QAEzB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,cAEX;AAFD,WAAY,cAAc;IACxB,kCAAgB,CAAA;AAClB,CAAC,EAFW,cAAc,KAAd,cAAc,QAEzB;AAED;;;GAGG;AACH,MAAM,CAAN,IAAY,cAEX;AAFD,WAAY,cAAc;IACxB,yCAAuB,CAAA;AACzB,CAAC,EAFW,cAAc,KAAd,cAAc,QAEzB;
|
|
1
|
+
{"version":3,"file":"account.mjs","sourceRoot":"","sources":["../../src/api/account.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,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C,MAAM,EAAE;IAC1B,GAAG,cAAc,CAAC,IAAI,EAAE;IACxB,GAAG,cAAc,CAAC,WAAW,EAAE;IAC/B,GAAG,cAAc,CAAC,GAAG,EAAE;IACvB,GAAG,cAAc,CAAC,OAAO,EAAE;IAC3B,GAAG,cAAc,CAAC,OAAO,EAAE;CAC5B,CAAC,CAAC;AAEH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC;IACzC;;OAEG;IACH,EAAE,EAAE,eAAe;IAEnB;;OAEG;IACH,IAAI,EAAE,KAAK,CAAC;QACV,GAAG,cAAc,CAAC,GAAG,EAAE;QACvB,GAAG,cAAc,CAAC,OAAO,EAAE;QAC3B,GAAG,cAAc,CAAC,KAAK,EAAE;QACzB,GAAG,cAAc,CAAC,IAAI,EAAE;QACxB,GAAG,cAAc,CAAC,MAAM,EAAE;QAC1B,GAAG,cAAc,CAAC,IAAI,EAAE;QACxB,GAAG,cAAc,CAAC,WAAW,EAAE;QAC/B,GAAG,cAAc,CAAC,GAAG,EAAE;QACvB,GAAG,cAAc,CAAC,OAAO,EAAE;QAC3B,GAAG,cAAc,CAAC,OAAO,EAAE;KAC5B,CAAC;IAEF;;OAEG;IACH,OAAO,EAAE,MAAM,EAAE;IAEjB;;OAEG;IACH,MAAM,EAAE,QAAQ,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;IAE1C;;OAEG;IACH,OAAO,EAAE,2BAA2B;IAEpC;;OAEG;IACH,OAAO,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC;CACzB,CAAC,CAAC","sourcesContent":["import { AccountIdStruct, object } from '@metamask/keyring-utils';\nimport type { Infer } from '@metamask/superstruct';\nimport { nonempty, array, enums, string } from '@metamask/superstruct';\n\nimport { KeyringAccountOptionsStruct } from './account-options';\nimport { CaipChainIdStruct } from './caip';\n\n/**\n * Supported Ethereum account types.\n */\nexport enum EthAccountType {\n Eoa = 'eip155:eoa',\n Erc4337 = 'eip155:erc4337',\n}\n\n/**\n * Supported Bitcoin account types.\n */\nexport enum BtcAccountType {\n P2pkh = 'bip122:p2pkh',\n P2sh = 'bip122:p2sh',\n P2wpkh = 'bip122:p2wpkh',\n P2tr = 'bip122:p2tr',\n}\n\n/**\n * Supported Solana account types.\n */\nexport enum SolAccountType {\n DataAccount = 'solana:data-account',\n}\n\n/**\n * Supported Tron account types.\n */\nexport enum TrxAccountType {\n Eoa = 'tron:eoa',\n}\n\n/**\n * Supported Stellar account types.\n *\n * We currently model only the standard Stellar account (G-address).\n * This excludes advanced formats such as muxed (M...) accounts.\n *\n * See: https://developers.stellar.org/docs/build/guides/transactions/pooled-accounts-muxed-accounts-memos\n */\nexport enum XlmAccountType {\n Account = 'stellar:account',\n}\n\n/**\n * A generic account type. It can be used to represent any account type that is\n * not covered by the other account types. It only applies to non-EVM chains.\n */\nexport enum AnyAccountType {\n Account = 'any:account',\n}\n\n/**\n * Supported account types.\n */\nexport type KeyringAccountType =\n | `${EthAccountType.Eoa}`\n | `${EthAccountType.Erc4337}`\n | `${BtcAccountType.P2pkh}`\n | `${BtcAccountType.P2sh}`\n | `${BtcAccountType.P2wpkh}`\n | `${BtcAccountType.P2tr}`\n | `${SolAccountType.DataAccount}`\n | `${TrxAccountType.Eoa}`\n | `${XlmAccountType.Account}`\n | `${AnyAccountType.Account}`;\n\n/**\n * Struct for {@link KeyringAccountType}.\n */\nexport const KeyringAccountTypeStruct = enums([\n `${EthAccountType.Eoa}`,\n `${EthAccountType.Erc4337}`,\n `${BtcAccountType.P2pkh}`,\n `${BtcAccountType.P2sh}`,\n `${BtcAccountType.P2wpkh}`,\n `${BtcAccountType.P2tr}`,\n `${SolAccountType.DataAccount}`,\n `${TrxAccountType.Eoa}`,\n `${XlmAccountType.Account}`,\n `${AnyAccountType.Account}`,\n]);\n\n/**\n * A struct which represents a Keyring account object. It is abstract enough to\n * be used with any blockchain. Specific blockchain account types should extend\n * this struct.\n *\n * See {@link KeyringAccount}.\n */\nexport const KeyringAccountStruct = object({\n /**\n * Account ID (UUIDv4).\n */\n id: AccountIdStruct,\n\n /**\n * Account type.\n */\n type: enums([\n `${EthAccountType.Eoa}`,\n `${EthAccountType.Erc4337}`,\n `${BtcAccountType.P2pkh}`,\n `${BtcAccountType.P2sh}`,\n `${BtcAccountType.P2wpkh}`,\n `${BtcAccountType.P2tr}`,\n `${SolAccountType.DataAccount}`,\n `${TrxAccountType.Eoa}`,\n `${XlmAccountType.Account}`,\n `${AnyAccountType.Account}`,\n ]),\n\n /**\n * Account main address.\n */\n address: string(),\n\n /**\n * Account supported scopes (CAIP-2 chain IDs).\n */\n scopes: nonempty(array(CaipChainIdStruct)),\n\n /**\n * Account options.\n */\n options: KeyringAccountOptionsStruct,\n\n /**\n * Account supported methods.\n */\n methods: array(string()),\n});\n\n/**\n * Keyring Account type represents an account and its properties from the\n * point of view of the keyring.\n */\nexport type KeyringAccount = Infer<typeof KeyringAccountStruct>;\n"]}
|
package/dist/api/index.cjs
CHANGED
|
@@ -27,5 +27,5 @@ __exportStar(require("./response.cjs"), exports);
|
|
|
27
27
|
__exportStar(require("./transaction.cjs"), exports);
|
|
28
28
|
__exportStar(require("./pagination.cjs"), exports);
|
|
29
29
|
__exportStar(require("./options.cjs"), exports);
|
|
30
|
-
__exportStar(require("
|
|
30
|
+
__exportStar(require("../v2/api/create-account/index.cjs"), exports);
|
|
31
31
|
//# sourceMappingURL=index.cjs.map
|
package/dist/api/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA0B;AAC1B,wDAAkC;AAClC,gDAA0B;AAC1B,8CAAwB;AACxB,gDAA0B;AAC1B,6CAAuB;AACvB,kDAA4B;AAE5B,+CAAyB;AACzB,gDAA0B;AAC1B,iDAA2B;AAC3B,oDAA8B;AAC9B,mDAA6B;AAC7B,gDAA0B;AAE1B,
|
|
1
|
+
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA0B;AAC1B,wDAAkC;AAClC,gDAA0B;AAC1B,8CAAwB;AACxB,gDAA0B;AAC1B,6CAAuB;AACvB,kDAA4B;AAE5B,+CAAyB;AACzB,gDAA0B;AAC1B,iDAA2B;AAC3B,oDAA8B;AAC9B,mDAA6B;AAC7B,gDAA0B;AAE1B,qEAAyC","sourcesContent":["export * from './account';\nexport * from './account-options';\nexport * from './address';\nexport * from './asset';\nexport * from './balance';\nexport * from './caip';\nexport * from './discovery';\nexport type * from './entropy';\nexport * from './export';\nexport * from './request';\nexport * from './response';\nexport * from './transaction';\nexport * from './pagination';\nexport * from './options';\nexport type * from './keyring';\nexport * from '../v2/api/create-account';\n"]}
|
package/dist/api/index.d.cts
CHANGED
|
@@ -13,5 +13,5 @@ export * from "./transaction.cjs";
|
|
|
13
13
|
export * from "./pagination.cjs";
|
|
14
14
|
export * from "./options.cjs";
|
|
15
15
|
export type * from "./keyring.cjs";
|
|
16
|
-
export * from "
|
|
16
|
+
export * from "../v2/api/create-account/index.cjs";
|
|
17
17
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/api/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,8BAA0B;AAC1B,sCAAkC;AAClC,8BAA0B;AAC1B,4BAAwB;AACxB,8BAA0B;AAC1B,2BAAuB;AACvB,gCAA4B;AAC5B,mCAA+B;AAC/B,6BAAyB;AACzB,8BAA0B;AAC1B,+BAA2B;AAC3B,kCAA8B;AAC9B,iCAA6B;AAC7B,8BAA0B;AAC1B,mCAA+B;AAC/B
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,8BAA0B;AAC1B,sCAAkC;AAClC,8BAA0B;AAC1B,4BAAwB;AACxB,8BAA0B;AAC1B,2BAAuB;AACvB,gCAA4B;AAC5B,mCAA+B;AAC/B,6BAAyB;AACzB,8BAA0B;AAC1B,+BAA2B;AAC3B,kCAA8B;AAC9B,iCAA6B;AAC7B,8BAA0B;AAC1B,mCAA+B;AAC/B,mDAAyC"}
|
package/dist/api/index.d.mts
CHANGED
|
@@ -13,5 +13,5 @@ export * from "./transaction.mjs";
|
|
|
13
13
|
export * from "./pagination.mjs";
|
|
14
14
|
export * from "./options.mjs";
|
|
15
15
|
export type * from "./keyring.mjs";
|
|
16
|
-
export * from "
|
|
16
|
+
export * from "../v2/api/create-account/index.mjs";
|
|
17
17
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/api/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,8BAA0B;AAC1B,sCAAkC;AAClC,8BAA0B;AAC1B,4BAAwB;AACxB,8BAA0B;AAC1B,2BAAuB;AACvB,gCAA4B;AAC5B,mCAA+B;AAC/B,6BAAyB;AACzB,8BAA0B;AAC1B,+BAA2B;AAC3B,kCAA8B;AAC9B,iCAA6B;AAC7B,8BAA0B;AAC1B,mCAA+B;AAC/B
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,8BAA0B;AAC1B,sCAAkC;AAClC,8BAA0B;AAC1B,4BAAwB;AACxB,8BAA0B;AAC1B,2BAAuB;AACvB,gCAA4B;AAC5B,mCAA+B;AAC/B,6BAAyB;AACzB,8BAA0B;AAC1B,+BAA2B;AAC3B,kCAA8B;AAC9B,iCAA6B;AAC7B,8BAA0B;AAC1B,mCAA+B;AAC/B,mDAAyC"}
|
package/dist/api/index.mjs
CHANGED
|
@@ -11,5 +11,5 @@ export * from "./response.mjs";
|
|
|
11
11
|
export * from "./transaction.mjs";
|
|
12
12
|
export * from "./pagination.mjs";
|
|
13
13
|
export * from "./options.mjs";
|
|
14
|
-
export * from "
|
|
14
|
+
export * from "../v2/api/create-account/index.mjs";
|
|
15
15
|
//# sourceMappingURL=index.mjs.map
|
package/dist/api/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,8BAA0B;AAC1B,sCAAkC;AAClC,8BAA0B;AAC1B,4BAAwB;AACxB,8BAA0B;AAC1B,2BAAuB;AACvB,gCAA4B;AAE5B,6BAAyB;AACzB,8BAA0B;AAC1B,+BAA2B;AAC3B,kCAA8B;AAC9B,iCAA6B;AAC7B,8BAA0B;AAE1B
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,8BAA0B;AAC1B,sCAAkC;AAClC,8BAA0B;AAC1B,4BAAwB;AACxB,8BAA0B;AAC1B,2BAAuB;AACvB,gCAA4B;AAE5B,6BAAyB;AACzB,8BAA0B;AAC1B,+BAA2B;AAC3B,kCAA8B;AAC9B,iCAA6B;AAC7B,8BAA0B;AAE1B,mDAAyC","sourcesContent":["export * from './account';\nexport * from './account-options';\nexport * from './address';\nexport * from './asset';\nexport * from './balance';\nexport * from './caip';\nexport * from './discovery';\nexport type * from './entropy';\nexport * from './export';\nexport * from './request';\nexport * from './response';\nexport * from './transaction';\nexport * from './pagination';\nexport * from './options';\nexport type * from './keyring';\nexport * from '../v2/api/create-account';\n"]}
|
package/dist/api/keyring.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keyring.cjs","sourceRoot":"","sources":["../../src/api/keyring.ts"],"names":[],"mappings":"","sourcesContent":["import type { AccountId, JsonRpcRequest } from '@metamask/keyring-utils';\nimport type { Json } from '@metamask/utils';\n\nimport type { KeyringAccount } from './account';\nimport type { ResolvedAccountAddress } from './address';\nimport type { Balance } from './balance';\nimport type { CaipChainId, CaipAssetType, CaipAssetTypeOrId } from './caip';\nimport type { DiscoveredAccount } from './discovery';\nimport type { EntropySourceId } from './entropy';\nimport type { KeyringAccountData } from './export';\nimport type { MetaMaskOptions } from './options';\nimport type { Paginated, Pagination } from './pagination';\nimport type { KeyringRequest } from './request';\nimport type { KeyringResponse } from './response';\nimport type { Transaction } from './transaction';\nimport type { CreateAccountOptions } from '
|
|
1
|
+
{"version":3,"file":"keyring.cjs","sourceRoot":"","sources":["../../src/api/keyring.ts"],"names":[],"mappings":"","sourcesContent":["import type { AccountId, JsonRpcRequest } from '@metamask/keyring-utils';\nimport type { Json } from '@metamask/utils';\n\nimport type { KeyringAccount } from './account';\nimport type { ResolvedAccountAddress } from './address';\nimport type { Balance } from './balance';\nimport type { CaipChainId, CaipAssetType, CaipAssetTypeOrId } from './caip';\nimport type { DiscoveredAccount } from './discovery';\nimport type { EntropySourceId } from './entropy';\nimport type { KeyringAccountData } from './export';\nimport type { MetaMaskOptions } from './options';\nimport type { Paginated, Pagination } from './pagination';\nimport type { KeyringRequest } from './request';\nimport type { KeyringResponse } from './response';\nimport type { Transaction } from './transaction';\nimport type { CreateAccountOptions } from '../v2/api';\n\n/**\n * Keyring interface.\n *\n * Represents the functionality and operations related to managing accounts and\n * handling requests.\n */\nexport type Keyring = {\n /**\n * List accounts.\n *\n * Retrieves an array of KeyringAccount objects representing the available\n * accounts.\n *\n * @returns A promise that resolves to an array of KeyringAccount objects.\n */\n listAccounts(): Promise<KeyringAccount[]>;\n\n /**\n * Get an account.\n *\n * Retrieves the KeyringAccount object for the given account ID.\n *\n * @param id - The ID of the account to retrieve.\n * @returns A promise that resolves to the KeyringAccount object if found, or\n * undefined otherwise.\n */\n getAccount(id: string): Promise<KeyringAccount | undefined>;\n\n /**\n * Create an account.\n *\n * Creates a new account with optional, keyring-defined, account options.\n *\n * @param options - Keyring-defined options for the account (optional). The\n * 'metamask' internal options needs to be re-emitted during `notify:*` events.\n * @returns A promise that resolves to the newly created KeyringAccount\n * object without any private information.\n */\n createAccount(\n options?: Record<string, Json> & MetaMaskOptions,\n ): Promise<KeyringAccount>;\n\n /**\n * Creates one or more new accounts according to the provided options.\n *\n * Deterministic account creation MUST be idempotent, meaning that for\n * deterministic algorithms, like BIP-44, calling this method with the same\n * options should always return the same accounts, even if the accounts\n * already exist in the keyring.\n *\n * @param options - Options describing how to create the account(s).\n * @returns A promise that resolves to an array of the created account objects.\n */\n createAccounts?(options: CreateAccountOptions): Promise<KeyringAccount[]>;\n\n /**\n * Lists the assets of an account (fungibles and non-fungibles) represented\n * by their respective CAIP-19:\n * - Asset types for fungibles assets.\n * - Asset IDs for non-fungible ones.\n *\n * @param id - The ID of the account to list the assets for.\n * @returns A promise that resolves to list of assets for that account.\n */\n listAccountAssets?(id: string): Promise<CaipAssetTypeOrId[]>;\n\n /**\n * Lists the transactions of an account, paginated and ordered by the most\n * recent first.\n *\n * The pagination options are used to limit the number of transactions in the\n * response and to iterate over the results.\n *\n * @param id - The ID of the account to list the transactions for.\n * @param pagination - The pagination options.\n * @returns A promise that resolves to the next page of transactions.\n */\n listAccountTransactions?(\n id: string,\n pagination: Pagination,\n ): Promise<Paginated<Transaction>>;\n\n /**\n * Discover accounts.\n *\n * This method is called by the client to allow the keyring to discover\n * existing accounts based on the provided scopes and entropy source ID. Are\n * considered existing accounts, accounts that have at least one transaction,\n * as per BIP-44.\n *\n * The `groupIndex` is used to group accounts with the same value. In\n * strictly BIP-44 wallets, it matches `account_index`, but in wallets that\n * deviate from BIP-44 recommendations, it may align with a different path\n * level for compatibility.\n *\n * @param scopes - The list of scopes for account discovery.\n * @param entropySource - The ID of the entropy source used to derive the accounts.\n * @param groupIndex - The group index that should be used to derive the accounts.\n * @returns A promise resolving to a list of discovered accounts.\n */\n discoverAccounts?(\n scopes: CaipChainId[],\n entropySource: EntropySourceId,\n groupIndex: number,\n ): Promise<DiscoveredAccount[]>;\n\n /**\n * Retrieve the balances of a given account.\n *\n * This method fetches the balances of specified assets for a given account\n * ID. It returns a promise that resolves to an object where the keys are\n * asset types and the values are balance objects containing the amount and\n * unit.\n *\n * @example\n * ```ts\n * await keyring.getAccountBalances(\n * '43550276-c7d6-4fac-87c7-00390ad0ce90',\n * ['bip122:000000000019d6689c085ae165831e93/slip44:0']\n * );\n * // Returns something similar to:\n * // {\n * // 'bip122:000000000019d6689c085ae165831e93/slip44:0': {\n * // amount: '0.0001',\n * // unit: 'BTC',\n * // }\n * // }\n * ```\n * @param id - ID of the account to retrieve the balances for.\n * @param assets - Array of asset types (CAIP-19) to retrieve balances for.\n * @returns A promise that resolves to an object mapping asset types to their\n * respective balances.\n */\n getAccountBalances?(\n id: string,\n assets: CaipAssetType[],\n ): Promise<Record<CaipAssetType, Balance>>;\n\n /**\n * Resolves the address of an account from a signing request.\n *\n * This is required by the routing system of MetaMask to dispatch\n * incoming non-EVM dapp signing requests.\n *\n * @param scope - Request's scope (CAIP-2).\n * @param request - Signing request object.\n * @returns A Promise that resolves to the account address that must\n * be used to process this signing request, or null if none candidates\n * could be found.\n */\n resolveAccountAddress?(\n scope: CaipChainId,\n request: JsonRpcRequest,\n ): Promise<ResolvedAccountAddress | null>;\n\n /**\n * Set the selected accounts.\n *\n * @param accounts - The accounts to set as selected.\n */\n setSelectedAccounts?(accounts: AccountId[]): Promise<void>;\n\n /**\n * Filter supported chains for a given account.\n *\n * @param id - ID of the account to be checked.\n * @param chains - List of chains (CAIP-2) to be checked.\n * @returns A Promise that resolves to a filtered list of CAIP-2 IDs\n * representing the supported chains.\n */\n filterAccountChains(id: string, chains: string[]): Promise<string[]>;\n\n /**\n * Update an account.\n *\n * Updates the account with the given account object. Does nothing if the\n * account does not exist.\n *\n * @param account - The updated account object.\n * @returns A promise that resolves when the account is successfully updated.\n */\n updateAccount(account: KeyringAccount): Promise<void>;\n\n /**\n * Delete an account from the keyring.\n *\n * Deletes the account with the given ID from the keyring.\n *\n * @param id - The ID of the account to delete.\n * @returns A promise that resolves when the account is successfully deleted.\n */\n deleteAccount(id: string): Promise<void>;\n\n /**\n * Exports an account's private key.\n *\n * If the keyring cannot export a private key, this function should throw an\n * error.\n *\n * @param id - The ID of the account to export.\n * @returns A promise that resolves to the exported account.\n */\n exportAccount?(id: string): Promise<KeyringAccountData>;\n\n /**\n * List all submitted requests.\n *\n * Retrieves an array of KeyringRequest objects representing the submitted\n * requests.\n *\n * @returns A promise that resolves to an array of KeyringRequest objects.\n */\n listRequests?(): Promise<KeyringRequest[]>;\n\n /**\n * Get a request.\n *\n * Retrieves the KeyringRequest object for the given request ID.\n *\n * @param id - The ID of the request to retrieve.\n * @returns A promise that resolves to the KeyringRequest object if found, or\n * undefined otherwise.\n */\n getRequest?(id: string): Promise<KeyringRequest | undefined>;\n\n /**\n * Submit a request.\n *\n * Submits the given KeyringRequest object.\n *\n * @param request - The KeyringRequest object to submit.\n * @returns A promise that resolves to the request response.\n */\n submitRequest(request: KeyringRequest): Promise<KeyringResponse>;\n\n /**\n * Approve a request.\n *\n * Approves the request with the given ID and sets the response if provided.\n *\n * @param id - The ID of the request to approve.\n * @param data - The response to the request (optional).\n * @returns A promise that resolves when the request is successfully\n * approved.\n */\n approveRequest?(id: string, data?: Record<string, Json>): Promise<void>;\n\n /**\n * Reject a request.\n *\n * Rejects the request with the given ID.\n *\n * @param id - The ID of the request to reject.\n * @returns A promise that resolves when the request is successfully\n * rejected.\n */\n rejectRequest?(id: string): Promise<void>;\n};\n"]}
|
package/dist/api/keyring.d.cts
CHANGED
|
@@ -12,7 +12,7 @@ import type { Paginated, Pagination } from "./pagination.cjs";
|
|
|
12
12
|
import type { KeyringRequest } from "./request.cjs";
|
|
13
13
|
import type { KeyringResponse } from "./response.cjs";
|
|
14
14
|
import type { Transaction } from "./transaction.cjs";
|
|
15
|
-
import type { CreateAccountOptions } from "
|
|
15
|
+
import type { CreateAccountOptions } from "../v2/api/index.cjs";
|
|
16
16
|
/**
|
|
17
17
|
* Keyring interface.
|
|
18
18
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keyring.d.cts","sourceRoot":"","sources":["../../src/api/keyring.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,gCAAgC;AACzE,OAAO,KAAK,EAAE,IAAI,EAAE,wBAAwB;AAE5C,OAAO,KAAK,EAAE,cAAc,EAAE,sBAAkB;AAChD,OAAO,KAAK,EAAE,sBAAsB,EAAE,sBAAkB;AACxD,OAAO,KAAK,EAAE,OAAO,EAAE,sBAAkB;AACzC,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,iBAAiB,EAAE,mBAAe;AAC5E,OAAO,KAAK,EAAE,iBAAiB,EAAE,wBAAoB;AACrD,OAAO,KAAK,EAAE,eAAe,EAAE,sBAAkB;AACjD,OAAO,KAAK,EAAE,kBAAkB,EAAE,qBAAiB;AACnD,OAAO,KAAK,EAAE,eAAe,EAAE,sBAAkB;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,yBAAqB;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,sBAAkB;AAChD,OAAO,KAAK,EAAE,eAAe,EAAE,uBAAmB;AAClD,OAAO,KAAK,EAAE,WAAW,EAAE,0BAAsB;AACjD,OAAO,KAAK,EAAE,oBAAoB,EAAE,
|
|
1
|
+
{"version":3,"file":"keyring.d.cts","sourceRoot":"","sources":["../../src/api/keyring.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,gCAAgC;AACzE,OAAO,KAAK,EAAE,IAAI,EAAE,wBAAwB;AAE5C,OAAO,KAAK,EAAE,cAAc,EAAE,sBAAkB;AAChD,OAAO,KAAK,EAAE,sBAAsB,EAAE,sBAAkB;AACxD,OAAO,KAAK,EAAE,OAAO,EAAE,sBAAkB;AACzC,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,iBAAiB,EAAE,mBAAe;AAC5E,OAAO,KAAK,EAAE,iBAAiB,EAAE,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E,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAExE;;;;;;;;OAQG;IACH,aAAa,CAAC,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3C,CAAC"}
|
package/dist/api/keyring.d.mts
CHANGED
|
@@ -12,7 +12,7 @@ import type { Paginated, Pagination } from "./pagination.mjs";
|
|
|
12
12
|
import type { KeyringRequest } from "./request.mjs";
|
|
13
13
|
import type { KeyringResponse } from "./response.mjs";
|
|
14
14
|
import type { Transaction } from "./transaction.mjs";
|
|
15
|
-
import type { CreateAccountOptions } from "
|
|
15
|
+
import type { CreateAccountOptions } from "../v2/api/index.mjs";
|
|
16
16
|
/**
|
|
17
17
|
* Keyring interface.
|
|
18
18
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keyring.d.mts","sourceRoot":"","sources":["../../src/api/keyring.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,gCAAgC;AACzE,OAAO,KAAK,EAAE,IAAI,EAAE,wBAAwB;AAE5C,OAAO,KAAK,EAAE,cAAc,EAAE,sBAAkB;AAChD,OAAO,KAAK,EAAE,sBAAsB,EAAE,sBAAkB;AACxD,OAAO,KAAK,EAAE,OAAO,EAAE,sBAAkB;AACzC,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,iBAAiB,EAAE,mBAAe;AAC5E,OAAO,KAAK,EAAE,iBAAiB,EAAE,wBAAoB;AACrD,OAAO,KAAK,EAAE,eAAe,EAAE,sBAAkB;AACjD,OAAO,KAAK,EAAE,kBAAkB,EAAE,qBAAiB;AACnD,OAAO,KAAK,EAAE,eAAe,EAAE,sBAAkB;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,yBAAqB;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,sB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GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEtD;;;;;;;OAOG;IACH,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEzC;;;;;;;;OAQG;IACH,aAAa,CAAC,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAExD;;;;;;;OAOG;IACH,YAAY,CAAC,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC;IAE3C;;;;;;;;OAQG;IACH,UAAU,CAAC,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC,CAAC;IAE7D;;;;;;;OAOG;IACH,aAAa,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;IAEjE;;;;;;;;;OASG;IACH,cAAc,CAAC,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAExE;;;;;;;;OAQG;IACH,aAAa,CAAC,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3C,CAAC"}
|
package/dist/api/keyring.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keyring.mjs","sourceRoot":"","sources":["../../src/api/keyring.ts"],"names":[],"mappings":"","sourcesContent":["import type { AccountId, JsonRpcRequest } from '@metamask/keyring-utils';\nimport type { Json } from '@metamask/utils';\n\nimport type { KeyringAccount } from './account';\nimport type { ResolvedAccountAddress } from './address';\nimport type { Balance } from './balance';\nimport type { CaipChainId, CaipAssetType, CaipAssetTypeOrId } from './caip';\nimport type { DiscoveredAccount } from './discovery';\nimport type { EntropySourceId } from './entropy';\nimport type { KeyringAccountData } from './export';\nimport type { MetaMaskOptions } from './options';\nimport type { Paginated, Pagination } from './pagination';\nimport type { KeyringRequest } from './request';\nimport type { KeyringResponse } from './response';\nimport type { Transaction } from './transaction';\nimport type { CreateAccountOptions } from '
|
|
1
|
+
{"version":3,"file":"keyring.mjs","sourceRoot":"","sources":["../../src/api/keyring.ts"],"names":[],"mappings":"","sourcesContent":["import type { AccountId, JsonRpcRequest } from '@metamask/keyring-utils';\nimport type { Json } from '@metamask/utils';\n\nimport type { KeyringAccount } from './account';\nimport type { ResolvedAccountAddress } from './address';\nimport type { Balance } from './balance';\nimport type { CaipChainId, CaipAssetType, CaipAssetTypeOrId } from './caip';\nimport type { DiscoveredAccount } from './discovery';\nimport type { EntropySourceId } from './entropy';\nimport type { KeyringAccountData } from './export';\nimport type { MetaMaskOptions } from './options';\nimport type { Paginated, Pagination } from './pagination';\nimport type { KeyringRequest } from './request';\nimport type { KeyringResponse } from './response';\nimport type { Transaction } from './transaction';\nimport type { CreateAccountOptions } from '../v2/api';\n\n/**\n * Keyring interface.\n *\n * Represents the functionality and operations related to managing accounts and\n * handling requests.\n */\nexport type Keyring = {\n /**\n * List accounts.\n *\n * Retrieves an array of KeyringAccount objects representing the available\n * accounts.\n *\n * @returns A promise that resolves to an array of KeyringAccount objects.\n */\n listAccounts(): Promise<KeyringAccount[]>;\n\n /**\n * Get an account.\n *\n * Retrieves the KeyringAccount object for the given account ID.\n *\n * @param id - The ID of the account to retrieve.\n * @returns A promise that resolves to the KeyringAccount object if found, or\n * undefined otherwise.\n */\n getAccount(id: string): Promise<KeyringAccount | undefined>;\n\n /**\n * Create an account.\n *\n * Creates a new account with optional, keyring-defined, account options.\n *\n * @param options - Keyring-defined options for the account (optional). The\n * 'metamask' internal options needs to be re-emitted during `notify:*` events.\n * @returns A promise that resolves to the newly created KeyringAccount\n * object without any private information.\n */\n createAccount(\n options?: Record<string, Json> & MetaMaskOptions,\n ): Promise<KeyringAccount>;\n\n /**\n * Creates one or more new accounts according to the provided options.\n *\n * Deterministic account creation MUST be idempotent, meaning that for\n * deterministic algorithms, like BIP-44, calling this method with the same\n * options should always return the same accounts, even if the accounts\n * already exist in the keyring.\n *\n * @param options - Options describing how to create the account(s).\n * @returns A promise that resolves to an array of the created account objects.\n */\n createAccounts?(options: CreateAccountOptions): Promise<KeyringAccount[]>;\n\n /**\n * Lists the assets of an account (fungibles and non-fungibles) represented\n * by their respective CAIP-19:\n * - Asset types for fungibles assets.\n * - Asset IDs for non-fungible ones.\n *\n * @param id - The ID of the account to list the assets for.\n * @returns A promise that resolves to list of assets for that account.\n */\n listAccountAssets?(id: string): Promise<CaipAssetTypeOrId[]>;\n\n /**\n * Lists the transactions of an account, paginated and ordered by the most\n * recent first.\n *\n * The pagination options are used to limit the number of transactions in the\n * response and to iterate over the results.\n *\n * @param id - The ID of the account to list the transactions for.\n * @param pagination - The pagination options.\n * @returns A promise that resolves to the next page of transactions.\n */\n listAccountTransactions?(\n id: string,\n pagination: Pagination,\n ): Promise<Paginated<Transaction>>;\n\n /**\n * Discover accounts.\n *\n * This method is called by the client to allow the keyring to discover\n * existing accounts based on the provided scopes and entropy source ID. Are\n * considered existing accounts, accounts that have at least one transaction,\n * as per BIP-44.\n *\n * The `groupIndex` is used to group accounts with the same value. In\n * strictly BIP-44 wallets, it matches `account_index`, but in wallets that\n * deviate from BIP-44 recommendations, it may align with a different path\n * level for compatibility.\n *\n * @param scopes - The list of scopes for account discovery.\n * @param entropySource - The ID of the entropy source used to derive the accounts.\n * @param groupIndex - The group index that should be used to derive the accounts.\n * @returns A promise resolving to a list of discovered accounts.\n */\n discoverAccounts?(\n scopes: CaipChainId[],\n entropySource: EntropySourceId,\n groupIndex: number,\n ): Promise<DiscoveredAccount[]>;\n\n /**\n * Retrieve the balances of a given account.\n *\n * This method fetches the balances of specified assets for a given account\n * ID. It returns a promise that resolves to an object where the keys are\n * asset types and the values are balance objects containing the amount and\n * unit.\n *\n * @example\n * ```ts\n * await keyring.getAccountBalances(\n * '43550276-c7d6-4fac-87c7-00390ad0ce90',\n * ['bip122:000000000019d6689c085ae165831e93/slip44:0']\n * );\n * // Returns something similar to:\n * // {\n * // 'bip122:000000000019d6689c085ae165831e93/slip44:0': {\n * // amount: '0.0001',\n * // unit: 'BTC',\n * // }\n * // }\n * ```\n * @param id - ID of the account to retrieve the balances for.\n * @param assets - Array of asset types (CAIP-19) to retrieve balances for.\n * @returns A promise that resolves to an object mapping asset types to their\n * respective balances.\n */\n getAccountBalances?(\n id: string,\n assets: CaipAssetType[],\n ): Promise<Record<CaipAssetType, Balance>>;\n\n /**\n * Resolves the address of an account from a signing request.\n *\n * This is required by the routing system of MetaMask to dispatch\n * incoming non-EVM dapp signing requests.\n *\n * @param scope - Request's scope (CAIP-2).\n * @param request - Signing request object.\n * @returns A Promise that resolves to the account address that must\n * be used to process this signing request, or null if none candidates\n * could be found.\n */\n resolveAccountAddress?(\n scope: CaipChainId,\n request: JsonRpcRequest,\n ): Promise<ResolvedAccountAddress | null>;\n\n /**\n * Set the selected accounts.\n *\n * @param accounts - The accounts to set as selected.\n */\n setSelectedAccounts?(accounts: AccountId[]): Promise<void>;\n\n /**\n * Filter supported chains for a given account.\n *\n * @param id - ID of the account to be checked.\n * @param chains - List of chains (CAIP-2) to be checked.\n * @returns A Promise that resolves to a filtered list of CAIP-2 IDs\n * representing the supported chains.\n */\n filterAccountChains(id: string, chains: string[]): Promise<string[]>;\n\n /**\n * Update an account.\n *\n * Updates the account with the given account object. Does nothing if the\n * account does not exist.\n *\n * @param account - The updated account object.\n * @returns A promise that resolves when the account is successfully updated.\n */\n updateAccount(account: KeyringAccount): Promise<void>;\n\n /**\n * Delete an account from the keyring.\n *\n * Deletes the account with the given ID from the keyring.\n *\n * @param id - The ID of the account to delete.\n * @returns A promise that resolves when the account is successfully deleted.\n */\n deleteAccount(id: string): Promise<void>;\n\n /**\n * Exports an account's private key.\n *\n * If the keyring cannot export a private key, this function should throw an\n * error.\n *\n * @param id - The ID of the account to export.\n * @returns A promise that resolves to the exported account.\n */\n exportAccount?(id: string): Promise<KeyringAccountData>;\n\n /**\n * List all submitted requests.\n *\n * Retrieves an array of KeyringRequest objects representing the submitted\n * requests.\n *\n * @returns A promise that resolves to an array of KeyringRequest objects.\n */\n listRequests?(): Promise<KeyringRequest[]>;\n\n /**\n * Get a request.\n *\n * Retrieves the KeyringRequest object for the given request ID.\n *\n * @param id - The ID of the request to retrieve.\n * @returns A promise that resolves to the KeyringRequest object if found, or\n * undefined otherwise.\n */\n getRequest?(id: string): Promise<KeyringRequest | undefined>;\n\n /**\n * Submit a request.\n *\n * Submits the given KeyringRequest object.\n *\n * @param request - The KeyringRequest object to submit.\n * @returns A promise that resolves to the request response.\n */\n submitRequest(request: KeyringRequest): Promise<KeyringResponse>;\n\n /**\n * Approve a request.\n *\n * Approves the request with the given ID and sets the response if provided.\n *\n * @param id - The ID of the request to approve.\n * @param data - The response to the request (optional).\n * @returns A promise that resolves when the request is successfully\n * approved.\n */\n approveRequest?(id: string, data?: Record<string, Json>): Promise<void>;\n\n /**\n * Reject a request.\n *\n * Rejects the request with the given ID.\n *\n * @param id - The ID of the request to reject.\n * @returns A promise that resolves when the request is successfully\n * rejected.\n */\n rejectRequest?(id: string): Promise<void>;\n};\n"]}
|