@metamask/keyring-api 11.1.0 → 13.0.0
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 +25 -1
- package/dist/api/account.cjs +7 -4
- package/dist/api/account.cjs.map +1 -1
- package/dist/api/account.d.cts +6 -1
- package/dist/api/account.d.cts.map +1 -1
- package/dist/api/account.d.mts +6 -1
- package/dist/api/account.d.mts.map +1 -1
- package/dist/api/account.mjs +7 -4
- package/dist/api/account.mjs.map +1 -1
- package/dist/api/asset.cjs +5 -6
- package/dist/api/asset.cjs.map +1 -1
- package/dist/api/asset.d.cts +2 -2
- package/dist/api/asset.d.cts.map +1 -1
- package/dist/api/asset.d.mts +2 -2
- package/dist/api/asset.d.mts.map +1 -1
- package/dist/api/asset.mjs +1 -2
- package/dist/api/asset.mjs.map +1 -1
- package/dist/api/balance.cjs +3 -4
- package/dist/api/balance.cjs.map +1 -1
- package/dist/api/balance.d.cts.map +1 -1
- package/dist/api/balance.d.mts.map +1 -1
- package/dist/api/balance.mjs +1 -2
- package/dist/api/balance.mjs.map +1 -1
- package/dist/api/caip.cjs +3 -3
- package/dist/api/caip.cjs.map +1 -1
- package/dist/api/caip.d.cts.map +1 -1
- package/dist/api/caip.d.mts.map +1 -1
- package/dist/api/caip.mjs +1 -1
- package/dist/api/caip.mjs.map +1 -1
- package/dist/api/index.cjs +1 -0
- package/dist/api/index.cjs.map +1 -1
- package/dist/api/index.d.cts +1 -0
- package/dist/api/index.d.cts.map +1 -1
- package/dist/api/index.d.mts +1 -0
- package/dist/api/index.d.mts.map +1 -1
- package/dist/api/index.mjs +1 -0
- package/dist/api/index.mjs.map +1 -1
- package/dist/api/keyring.cjs +2 -0
- 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 +2 -0
- package/dist/api/keyring.mjs.map +1 -1
- package/dist/{utils → api}/pagination.cjs +3 -3
- package/dist/api/pagination.cjs.map +1 -0
- package/dist/{utils → api}/pagination.d.cts +1 -1
- package/dist/api/pagination.d.cts.map +1 -0
- package/dist/{utils → api}/pagination.d.mts +1 -1
- package/dist/api/pagination.d.mts.map +1 -0
- package/dist/{utils → api}/pagination.mjs +1 -1
- package/dist/api/pagination.mjs.map +1 -0
- package/dist/api/request.cjs +6 -7
- package/dist/api/request.cjs.map +1 -1
- package/dist/api/request.d.cts +5 -5
- package/dist/api/request.d.cts.map +1 -1
- package/dist/api/request.d.mts +5 -5
- package/dist/api/request.d.mts.map +1 -1
- package/dist/api/request.mjs +1 -2
- package/dist/api/request.mjs.map +1 -1
- package/dist/api/response.cjs +6 -6
- package/dist/api/response.cjs.map +1 -1
- package/dist/api/response.d.cts +1 -1
- package/dist/api/response.d.cts.map +1 -1
- package/dist/api/response.d.mts +1 -1
- package/dist/api/response.d.mts.map +1 -1
- package/dist/api/response.mjs +1 -1
- package/dist/api/response.mjs.map +1 -1
- package/dist/api/transaction.cjs +7 -8
- package/dist/api/transaction.cjs.map +1 -1
- package/dist/api/transaction.d.cts +65 -65
- package/dist/api/transaction.d.cts.map +1 -1
- package/dist/api/transaction.d.mts +65 -65
- package/dist/api/transaction.d.mts.map +1 -1
- package/dist/api/transaction.mjs +1 -2
- package/dist/api/transaction.mjs.map +1 -1
- package/dist/btc/constants.cjs +17 -0
- package/dist/btc/constants.cjs.map +1 -0
- package/dist/btc/constants.d.cts +12 -0
- package/dist/btc/constants.d.cts.map +1 -0
- package/dist/btc/constants.d.mts +12 -0
- package/dist/btc/constants.d.mts.map +1 -0
- package/dist/btc/constants.mjs +14 -0
- package/dist/btc/constants.mjs.map +1 -0
- package/dist/btc/index.cjs +1 -0
- package/dist/btc/index.cjs.map +1 -1
- package/dist/btc/index.d.cts +1 -0
- package/dist/btc/index.d.cts.map +1 -1
- package/dist/btc/index.d.mts +1 -0
- package/dist/btc/index.d.mts.map +1 -1
- package/dist/btc/index.mjs +1 -0
- package/dist/btc/index.mjs.map +1 -1
- package/dist/btc/types.cjs +2 -2
- package/dist/btc/types.cjs.map +1 -1
- package/dist/btc/types.d.cts +3 -1
- package/dist/btc/types.d.cts.map +1 -1
- package/dist/btc/types.d.mts +3 -1
- package/dist/btc/types.d.mts.map +1 -1
- package/dist/btc/types.mjs +2 -2
- package/dist/btc/types.mjs.map +1 -1
- package/dist/eth/constants.cjs +13 -0
- package/dist/eth/constants.cjs.map +1 -0
- package/dist/eth/constants.d.cts +8 -0
- package/dist/eth/constants.d.cts.map +1 -0
- package/dist/eth/constants.d.mts +8 -0
- package/dist/eth/constants.d.mts.map +1 -0
- package/dist/eth/constants.mjs +10 -0
- package/dist/eth/constants.mjs.map +1 -0
- package/dist/eth/erc4337/types.cjs +10 -11
- package/dist/eth/erc4337/types.cjs.map +1 -1
- package/dist/eth/erc4337/types.d.cts +5 -5
- package/dist/eth/erc4337/types.d.cts.map +1 -1
- package/dist/eth/erc4337/types.d.mts +5 -5
- package/dist/eth/erc4337/types.d.mts.map +1 -1
- package/dist/eth/erc4337/types.mjs +1 -2
- package/dist/eth/erc4337/types.mjs.map +1 -1
- package/dist/eth/index.cjs +1 -0
- package/dist/eth/index.cjs.map +1 -1
- package/dist/eth/index.d.cts +1 -0
- package/dist/eth/index.d.cts.map +1 -1
- package/dist/eth/index.d.mts +1 -0
- package/dist/eth/index.d.mts.map +1 -1
- package/dist/eth/index.mjs +1 -0
- package/dist/eth/index.mjs.map +1 -1
- package/dist/eth/types.cjs +11 -6
- package/dist/eth/types.cjs.map +1 -1
- package/dist/eth/types.d.cts +10 -2
- package/dist/eth/types.d.cts.map +1 -1
- package/dist/eth/types.d.mts +10 -2
- package/dist/eth/types.d.mts.map +1 -1
- package/dist/eth/types.mjs +7 -2
- package/dist/eth/types.mjs.map +1 -1
- package/dist/eth/utils.cjs.map +1 -1
- package/dist/eth/utils.d.cts.map +1 -1
- package/dist/eth/utils.d.mts.map +1 -1
- package/dist/eth/utils.mjs.map +1 -1
- package/dist/events.cjs +67 -1
- package/dist/events.cjs.map +1 -1
- package/dist/events.d.cts +169 -0
- package/dist/events.d.cts.map +1 -1
- package/dist/events.d.mts +169 -0
- package/dist/events.d.mts.map +1 -1
- package/dist/events.mjs +66 -0
- package/dist/events.mjs.map +1 -1
- package/dist/index.cjs +2 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -9
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +3 -9
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +2 -8
- package/dist/index.mjs.map +1 -1
- package/dist/{internal/api.cjs → rpc.cjs} +71 -42
- package/dist/rpc.cjs.map +1 -0
- package/dist/{internal/api.d.cts → rpc.d.cts} +141 -104
- package/dist/rpc.d.cts.map +1 -0
- package/dist/{internal/api.d.mts → rpc.d.mts} +141 -104
- package/dist/rpc.d.mts.map +1 -0
- package/dist/{internal/api.mjs → rpc.mjs} +33 -5
- package/dist/rpc.mjs.map +1 -0
- package/dist/sol/constants.cjs +15 -0
- package/dist/sol/constants.cjs.map +1 -0
- package/dist/sol/constants.d.cts +10 -0
- package/dist/sol/constants.d.cts.map +1 -0
- package/dist/sol/constants.d.mts +10 -0
- package/dist/sol/constants.d.mts.map +1 -0
- package/dist/sol/constants.mjs +12 -0
- package/dist/sol/constants.mjs.map +1 -0
- package/dist/sol/index.cjs +1 -0
- package/dist/sol/index.cjs.map +1 -1
- package/dist/sol/index.d.cts +1 -0
- package/dist/sol/index.d.cts.map +1 -1
- package/dist/sol/index.d.mts +1 -0
- package/dist/sol/index.d.mts.map +1 -1
- package/dist/sol/index.mjs +1 -0
- package/dist/sol/index.mjs.map +1 -1
- package/dist/sol/types.cjs +3 -3
- package/dist/sol/types.cjs.map +1 -1
- package/dist/sol/types.d.cts +3 -1
- package/dist/sol/types.d.cts.map +1 -1
- package/dist/sol/types.d.mts +3 -1
- package/dist/sol/types.d.mts.map +1 -1
- package/dist/sol/types.mjs +1 -1
- package/dist/sol/types.mjs.map +1 -1
- package/package.json +11 -14
- package/dist/JsonRpcRequest.cjs +0 -13
- package/dist/JsonRpcRequest.cjs.map +0 -1
- package/dist/JsonRpcRequest.d.cts +0 -17
- package/dist/JsonRpcRequest.d.cts.map +0 -1
- package/dist/JsonRpcRequest.d.mts +0 -17
- package/dist/JsonRpcRequest.d.mts.map +0 -1
- package/dist/JsonRpcRequest.mjs +0 -10
- package/dist/JsonRpcRequest.mjs.map +0 -1
- package/dist/KeyringClient.cjs +0 -130
- package/dist/KeyringClient.cjs.map +0 -1
- package/dist/KeyringClient.d.cts +0 -31
- package/dist/KeyringClient.d.cts.map +0 -1
- package/dist/KeyringClient.d.mts +0 -31
- package/dist/KeyringClient.d.mts.map +0 -1
- package/dist/KeyringClient.mjs +0 -126
- package/dist/KeyringClient.mjs.map +0 -1
- package/dist/KeyringSnapRpcClient.cjs +0 -68
- package/dist/KeyringSnapRpcClient.cjs.map +0 -1
- package/dist/KeyringSnapRpcClient.d.cts +0 -40
- package/dist/KeyringSnapRpcClient.d.cts.map +0 -1
- package/dist/KeyringSnapRpcClient.d.mts +0 -40
- package/dist/KeyringSnapRpcClient.d.mts.map +0 -1
- package/dist/KeyringSnapRpcClient.mjs +0 -63
- package/dist/KeyringSnapRpcClient.mjs.map +0 -1
- package/dist/internal/api.cjs.map +0 -1
- package/dist/internal/api.d.cts.map +0 -1
- package/dist/internal/api.d.mts.map +0 -1
- package/dist/internal/api.mjs.map +0 -1
- package/dist/internal/eth/EthKeyring.cjs +0 -3
- package/dist/internal/eth/EthKeyring.cjs.map +0 -1
- package/dist/internal/eth/EthKeyring.d.cts +0 -34
- package/dist/internal/eth/EthKeyring.d.cts.map +0 -1
- package/dist/internal/eth/EthKeyring.d.mts +0 -34
- package/dist/internal/eth/EthKeyring.d.mts.map +0 -1
- package/dist/internal/eth/EthKeyring.mjs +0 -2
- package/dist/internal/eth/EthKeyring.mjs.map +0 -1
- package/dist/internal/eth/index.cjs +0 -3
- package/dist/internal/eth/index.cjs.map +0 -1
- package/dist/internal/eth/index.d.cts +0 -2
- package/dist/internal/eth/index.d.cts.map +0 -1
- package/dist/internal/eth/index.d.mts +0 -2
- package/dist/internal/eth/index.d.mts.map +0 -1
- package/dist/internal/eth/index.mjs +0 -2
- package/dist/internal/eth/index.mjs.map +0 -1
- package/dist/internal/events.cjs +0 -72
- package/dist/internal/events.cjs.map +0 -1
- package/dist/internal/events.d.cts +0 -162
- package/dist/internal/events.d.cts.map +0 -1
- package/dist/internal/events.d.mts +0 -162
- package/dist/internal/events.d.mts.map +0 -1
- package/dist/internal/events.mjs +0 -69
- package/dist/internal/events.mjs.map +0 -1
- package/dist/internal/index.cjs +0 -21
- package/dist/internal/index.cjs.map +0 -1
- package/dist/internal/index.d.cts +0 -6
- package/dist/internal/index.d.cts.map +0 -1
- package/dist/internal/index.d.mts +0 -6
- package/dist/internal/index.d.mts.map +0 -1
- package/dist/internal/index.mjs +0 -5
- package/dist/internal/index.mjs.map +0 -1
- package/dist/internal/rpc.cjs +0 -34
- package/dist/internal/rpc.cjs.map +0 -1
- package/dist/internal/rpc.d.cts +0 -27
- package/dist/internal/rpc.d.cts.map +0 -1
- package/dist/internal/rpc.d.mts +0 -27
- package/dist/internal/rpc.d.mts.map +0 -1
- package/dist/internal/rpc.mjs +0 -30
- package/dist/internal/rpc.mjs.map +0 -1
- package/dist/internal/types.cjs +0 -52
- package/dist/internal/types.cjs.map +0 -1
- package/dist/internal/types.d.cts +0 -392
- package/dist/internal/types.d.cts.map +0 -1
- package/dist/internal/types.d.mts +0 -392
- package/dist/internal/types.d.mts.map +0 -1
- package/dist/internal/types.mjs +0 -49
- package/dist/internal/types.mjs.map +0 -1
- package/dist/rpc-handler.cjs +0 -143
- package/dist/rpc-handler.cjs.map +0 -1
- package/dist/rpc-handler.d.cts +0 -30
- package/dist/rpc-handler.d.cts.map +0 -1
- package/dist/rpc-handler.d.mts +0 -30
- package/dist/rpc-handler.d.mts.map +0 -1
- package/dist/rpc-handler.mjs +0 -138
- package/dist/rpc-handler.mjs.map +0 -1
- package/dist/snap-utils.cjs +0 -20
- package/dist/snap-utils.cjs.map +0 -1
- package/dist/snap-utils.d.cts +0 -12
- package/dist/snap-utils.d.cts.map +0 -1
- package/dist/snap-utils.d.mts +0 -12
- package/dist/snap-utils.d.mts.map +0 -1
- package/dist/snap-utils.mjs +0 -17
- package/dist/snap-utils.mjs.map +0 -1
- package/dist/superstruct.cjs +0 -109
- package/dist/superstruct.cjs.map +0 -1
- package/dist/superstruct.d.cts +0 -102
- package/dist/superstruct.d.cts.map +0 -1
- package/dist/superstruct.d.mts +0 -102
- package/dist/superstruct.d.mts.map +0 -1
- package/dist/superstruct.mjs +0 -102
- package/dist/superstruct.mjs.map +0 -1
- package/dist/utils/index.cjs +0 -20
- package/dist/utils/index.cjs.map +0 -1
- package/dist/utils/index.d.cts +0 -4
- package/dist/utils/index.d.cts.map +0 -1
- package/dist/utils/index.d.mts +0 -4
- package/dist/utils/index.d.mts.map +0 -1
- package/dist/utils/index.mjs +0 -4
- package/dist/utils/index.mjs.map +0 -1
- package/dist/utils/pagination.cjs.map +0 -1
- package/dist/utils/pagination.d.cts.map +0 -1
- package/dist/utils/pagination.d.mts.map +0 -1
- package/dist/utils/pagination.mjs.map +0 -1
- package/dist/utils/types.cjs +0 -29
- package/dist/utils/types.cjs.map +0 -1
- package/dist/utils/types.d.cts +0 -42
- package/dist/utils/types.d.cts.map +0 -1
- package/dist/utils/types.d.mts +0 -42
- package/dist/utils/types.d.mts.map +0 -1
- package/dist/utils/types.mjs +0 -26
- package/dist/utils/types.mjs.map +0 -1
- package/dist/utils/typing.cjs +0 -20
- package/dist/utils/typing.cjs.map +0 -1
- package/dist/utils/typing.d.cts +0 -33
- package/dist/utils/typing.d.cts.map +0 -1
- package/dist/utils/typing.d.mts +0 -33
- package/dist/utils/typing.d.mts.map +0 -1
- package/dist/utils/typing.mjs +0 -17
- package/dist/utils/typing.mjs.map +0 -1
package/dist/api/keyring.d.mts
CHANGED
@@ -3,10 +3,10 @@ import type { KeyringAccount } from "./account.mjs";
|
|
3
3
|
import type { Balance } from "./balance.mjs";
|
4
4
|
import type { CaipAssetType } from "./caip.mjs";
|
5
5
|
import type { KeyringAccountData } from "./export.mjs";
|
6
|
+
import type { Paginated, Pagination } from "./pagination.mjs";
|
6
7
|
import type { KeyringRequest } from "./request.mjs";
|
7
8
|
import type { KeyringResponse } from "./response.mjs";
|
8
9
|
import type { Transaction } from "./transaction.mjs";
|
9
|
-
import type { Paginated, Pagination } from "../utils/index.mjs";
|
10
10
|
/**
|
11
11
|
* Keyring interface.
|
12
12
|
*
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"keyring.d.mts","sourceRoot":"","sources":["../../src/api/keyring.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"keyring.d.mts","sourceRoot":"","sources":["../../src/api/keyring.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAAE,wBAAwB;AAE5C,OAAO,KAAK,EAAE,cAAc,EAAE,sBAAkB;AAChD,OAAO,KAAK,EAAE,OAAO,EAAE,sBAAkB;AACzC,OAAO,KAAK,EAAE,aAAa,EAAE,mBAAe;AAC5C,OAAO,KAAK,EAAE,kBAAkB,EAAE,qBAAiB;AACnD,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;AAEjD;;;;;GAKG;AACH,MAAM,MAAM,OAAO,GAAG;IACpB;;;;;;;OAOG;IACH,YAAY,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC;IAE1C;;;;;;;;OAQG;IACH,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC,CAAC;IAE5D;;;;;;;;OAQG;IACH,aAAa,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IAEvE;;;;;;;;;;OAUG;IACH,uBAAuB,CAAC,CACtB,EAAE,EAAE,MAAM,EACV,UAAU,EAAE,UAAU,GACrB,OAAO,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC;IAEnC;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACH,kBAAkB,CAAC,CACjB,EAAE,EAAE,MAAM,EACV,MAAM,EAAE,aAAa,EAAE,GACtB,OAAO,CAAC,MAAM,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC,CAAC;IAE3C;;;;;;;OAOG;IACH,mBAAmB,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IAErE;;;;;;;;OAQG;IACH,aAAa,CAAC,OAAO,EAAE,cAAc,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
CHANGED
package/dist/api/keyring.mjs.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"keyring.mjs","sourceRoot":"","sources":["../../src/api/keyring.ts"],"names":[],"mappings":"","sourcesContent":["
|
1
|
+
{"version":3,"file":"keyring.mjs","sourceRoot":"","sources":["../../src/api/keyring.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,6EAA6E","sourcesContent":["/* eslint-disable @typescript-eslint/no-redundant-type-constituents */\n// This rule seems to be triggering a false positive on the `KeyringAccount`.\n\nimport type { Json } from '@metamask/utils';\n\nimport type { KeyringAccount } from './account';\nimport type { Balance } from './balance';\nimport type { CaipAssetType } from './caip';\nimport type { KeyringAccountData } from './export';\nimport type { Paginated, Pagination } from './pagination';\nimport type { KeyringRequest } from './request';\nimport type { KeyringResponse } from './response';\nimport type { Transaction } from './transaction';\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).\n * @returns A promise that resolves to the newly created KeyringAccount\n * object without any private information.\n */\n createAccount(options?: Record<string, Json>): Promise<KeyringAccount>;\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 * 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 * 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"]}
|
@@ -1,8 +1,8 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.PaginationStruct = void 0;
|
4
|
+
const keyring_utils_1 = require("@metamask/keyring-utils");
|
4
5
|
const superstruct_1 = require("@metamask/superstruct");
|
5
|
-
const superstruct_2 = require("../superstruct.cjs");
|
6
6
|
/**
|
7
7
|
* Pagination struct. This struct is used to specify the limit of items to
|
8
8
|
* return and the next cursor to iterate over the results.
|
@@ -15,7 +15,7 @@ const superstruct_2 = require("../superstruct.cjs");
|
|
15
15
|
* }
|
16
16
|
* ```
|
17
17
|
*/
|
18
|
-
exports.PaginationStruct = (0,
|
18
|
+
exports.PaginationStruct = (0, keyring_utils_1.object)({
|
19
19
|
/**
|
20
20
|
* Maximum number of items to return.
|
21
21
|
*/
|
@@ -23,6 +23,6 @@ exports.PaginationStruct = (0, superstruct_2.object)({
|
|
23
23
|
/**
|
24
24
|
* Next cursor to iterate over the results.
|
25
25
|
*/
|
26
|
-
next: (0,
|
26
|
+
next: (0, keyring_utils_1.exactOptional)((0, superstruct_1.nullable)((0, superstruct_1.string)())),
|
27
27
|
});
|
28
28
|
//# sourceMappingURL=pagination.cjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"pagination.cjs","sourceRoot":"","sources":["../../src/api/pagination.ts"],"names":[],"mappings":";;;AAAA,2DAAgE;AAEhE,uDAAiE;AAEjE;;;;;;;;;;;GAWG;AACU,QAAA,gBAAgB,GAAG,IAAA,sBAAM,EAAC;IACrC;;OAEG;IACH,KAAK,EAAE,IAAA,oBAAM,GAAE;IAEf;;OAEG;IACH,IAAI,EAAE,IAAA,6BAAa,EAAC,IAAA,sBAAQ,EAAC,IAAA,oBAAM,GAAE,CAAC,CAAC;CACxC,CAAC,CAAC","sourcesContent":["import { exactOptional, object } from '@metamask/keyring-utils';\nimport type { Infer } from '@metamask/superstruct';\nimport { nullable, number, string } from '@metamask/superstruct';\n\n/**\n * Pagination struct. This struct is used to specify the limit of items to\n * return and the next cursor to iterate over the results.\n *\n * @example\n * ```ts\n * {\n * limit: 10,\n * next: 'c3y1Q6QtqtstbxKX+oqVdEW6',\n * }\n * ```\n */\nexport const PaginationStruct = object({\n /**\n * Maximum number of items to return.\n */\n limit: number(),\n\n /**\n * Next cursor to iterate over the results.\n */\n next: exactOptional(nullable(string())),\n});\n\n/**\n * Pagination object.\n *\n * See {@link PaginationStruct}.\n */\nexport type Pagination = Infer<typeof PaginationStruct>;\n\n/**\n * Page of results. It includes the data and the next cursor to iterate over\n * the results.\n *\n * @example\n * ```ts\n * {\n * data: [\n * {\n * // Item object\n * }\n * ],\n * next: 'c3y1Q6QtqtstbxKX+oqVdEW6',\n * }\n * ```\n */\nexport type Paginated<Type> = {\n /**\n * The list of items for this page.\n */\n data: Type[];\n\n /**\n * Next cursor to iterate over the results if any, will be `null` otherwise.\n */\n next: string | null;\n};\n"]}
|
@@ -22,7 +22,7 @@ export declare const PaginationStruct: import("@metamask/superstruct").Struct<{
|
|
22
22
|
/**
|
23
23
|
* Next cursor to iterate over the results.
|
24
24
|
*/
|
25
|
-
next: import("@metamask/superstruct").Struct<string | import("
|
25
|
+
next: import("@metamask/superstruct").Struct<string | import("@metamask/keyring-utils").ExactOptionalTag | null, null>;
|
26
26
|
}>;
|
27
27
|
/**
|
28
28
|
* Pagination object.
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"pagination.d.cts","sourceRoot":"","sources":["../../src/api/pagination.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAGnD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,gBAAgB;;;;IAC3B;;OAEG;;IAGH;;OAEG;;EAEH,CAAC;AAEH;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAExD;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,SAAS,CAAC,IAAI,IAAI;IAC5B;;OAEG;IACH,IAAI,EAAE,IAAI,EAAE,CAAC;IAEb;;OAEG;IACH,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB,CAAC"}
|
@@ -22,7 +22,7 @@ export declare const PaginationStruct: import("@metamask/superstruct").Struct<{
|
|
22
22
|
/**
|
23
23
|
* Next cursor to iterate over the results.
|
24
24
|
*/
|
25
|
-
next: import("@metamask/superstruct").Struct<string | import("
|
25
|
+
next: import("@metamask/superstruct").Struct<string | import("@metamask/keyring-utils").ExactOptionalTag | null, null>;
|
26
26
|
}>;
|
27
27
|
/**
|
28
28
|
* Pagination object.
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"pagination.d.mts","sourceRoot":"","sources":["../../src/api/pagination.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAGnD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,gBAAgB;;;;IAC3B;;OAEG;;IAGH;;OAEG;;EAEH,CAAC;AAEH;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAExD;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,SAAS,CAAC,IAAI,IAAI;IAC5B;;OAEG;IACH,IAAI,EAAE,IAAI,EAAE,CAAC;IAEb;;OAEG;IACH,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB,CAAC"}
|
@@ -1,5 +1,5 @@
|
|
1
|
+
import { exactOptional, object } from "@metamask/keyring-utils";
|
1
2
|
import { nullable, number, string } from "@metamask/superstruct";
|
2
|
-
import { exactOptional, object } from "../superstruct.mjs";
|
3
3
|
/**
|
4
4
|
* Pagination struct. This struct is used to specify the limit of items to
|
5
5
|
* return and the next cursor to iterate over the results.
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"pagination.mjs","sourceRoot":"","sources":["../../src/api/pagination.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,gCAAgC;AAEhE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,8BAA8B;AAEjE;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC;IACrC;;OAEG;IACH,KAAK,EAAE,MAAM,EAAE;IAEf;;OAEG;IACH,IAAI,EAAE,aAAa,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;CACxC,CAAC,CAAC","sourcesContent":["import { exactOptional, object } from '@metamask/keyring-utils';\nimport type { Infer } from '@metamask/superstruct';\nimport { nullable, number, string } from '@metamask/superstruct';\n\n/**\n * Pagination struct. This struct is used to specify the limit of items to\n * return and the next cursor to iterate over the results.\n *\n * @example\n * ```ts\n * {\n * limit: 10,\n * next: 'c3y1Q6QtqtstbxKX+oqVdEW6',\n * }\n * ```\n */\nexport const PaginationStruct = object({\n /**\n * Maximum number of items to return.\n */\n limit: number(),\n\n /**\n * Next cursor to iterate over the results.\n */\n next: exactOptional(nullable(string())),\n});\n\n/**\n * Pagination object.\n *\n * See {@link PaginationStruct}.\n */\nexport type Pagination = Infer<typeof PaginationStruct>;\n\n/**\n * Page of results. It includes the data and the next cursor to iterate over\n * the results.\n *\n * @example\n * ```ts\n * {\n * data: [\n * {\n * // Item object\n * }\n * ],\n * next: 'c3y1Q6QtqtstbxKX+oqVdEW6',\n * }\n * ```\n */\nexport type Paginated<Type> = {\n /**\n * The list of items for this page.\n */\n data: Type[];\n\n /**\n * Next cursor to iterate over the results if any, will be `null` otherwise.\n */\n next: string | null;\n};\n"]}
|
package/dist/api/request.cjs
CHANGED
@@ -1,15 +1,14 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.KeyringRequestStruct = void 0;
|
4
|
+
const keyring_utils_1 = require("@metamask/keyring-utils");
|
4
5
|
const superstruct_1 = require("@metamask/superstruct");
|
5
6
|
const utils_1 = require("@metamask/utils");
|
6
|
-
|
7
|
-
const utils_2 = require("../utils/index.cjs");
|
8
|
-
exports.KeyringRequestStruct = (0, superstruct_2.object)({
|
7
|
+
exports.KeyringRequestStruct = (0, keyring_utils_1.object)({
|
9
8
|
/**
|
10
9
|
* Keyring request ID (UUIDv4).
|
11
10
|
*/
|
12
|
-
id:
|
11
|
+
id: keyring_utils_1.UuidStruct,
|
13
12
|
/**
|
14
13
|
* Request's scope (CAIP-2 chain ID).
|
15
14
|
*/
|
@@ -17,13 +16,13 @@ exports.KeyringRequestStruct = (0, superstruct_2.object)({
|
|
17
16
|
/**
|
18
17
|
* Account ID (UUIDv4).
|
19
18
|
*/
|
20
|
-
account:
|
19
|
+
account: keyring_utils_1.UuidStruct,
|
21
20
|
/**
|
22
21
|
* Inner request sent by the client application.
|
23
22
|
*/
|
24
|
-
request: (0,
|
23
|
+
request: (0, keyring_utils_1.object)({
|
25
24
|
method: (0, superstruct_1.string)(),
|
26
|
-
params: (0,
|
25
|
+
params: (0, keyring_utils_1.exactOptional)((0, superstruct_1.union)([(0, superstruct_1.array)(utils_1.JsonStruct), (0, superstruct_1.record)((0, superstruct_1.string)(), utils_1.JsonStruct)])),
|
27
26
|
}),
|
28
27
|
});
|
29
28
|
//# sourceMappingURL=request.cjs.map
|
package/dist/api/request.cjs.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"request.cjs","sourceRoot":"","sources":["../../src/api/request.ts"],"names":[],"mappings":";;;
|
1
|
+
{"version":3,"file":"request.cjs","sourceRoot":"","sources":["../../src/api/request.ts"],"names":[],"mappings":";;;AAAA,2DAA4E;AAE5E,uDAAqE;AACrE,2CAA6C;AAEhC,QAAA,oBAAoB,GAAG,IAAA,sBAAM,EAAC;IACzC;;OAEG;IACH,EAAE,EAAE,0BAAU;IAEd;;OAEG;IACH,KAAK,EAAE,IAAA,oBAAM,GAAE;IAEf;;OAEG;IACH,OAAO,EAAE,0BAAU;IAEnB;;OAEG;IACH,OAAO,EAAE,IAAA,sBAAM,EAAC;QACd,MAAM,EAAE,IAAA,oBAAM,GAAE;QAChB,MAAM,EAAE,IAAA,6BAAa,EACnB,IAAA,mBAAK,EAAC,CAAC,IAAA,mBAAK,EAAC,kBAAU,CAAC,EAAE,IAAA,oBAAM,EAAC,IAAA,oBAAM,GAAE,EAAE,kBAAU,CAAC,CAAC,CAAC,CACzD;KACF,CAAC;CACH,CAAC,CAAC","sourcesContent":["import { exactOptional, object, UuidStruct } from '@metamask/keyring-utils';\nimport type { Infer } from '@metamask/superstruct';\nimport { array, record, string, union } from '@metamask/superstruct';\nimport { JsonStruct } from '@metamask/utils';\n\nexport const KeyringRequestStruct = object({\n /**\n * Keyring request ID (UUIDv4).\n */\n id: UuidStruct,\n\n /**\n * Request's scope (CAIP-2 chain ID).\n */\n scope: string(),\n\n /**\n * Account ID (UUIDv4).\n */\n account: UuidStruct,\n\n /**\n * Inner request sent by the client application.\n */\n request: object({\n method: string(),\n params: exactOptional(\n union([array(JsonStruct), record(string(), JsonStruct)]),\n ),\n }),\n});\n\n/**\n * Keyring request.\n *\n * Represents a request made to the keyring for account-related operations.\n */\nexport type KeyringRequest = Infer<typeof KeyringRequestStruct>;\n"]}
|
package/dist/api/request.d.cts
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
import type { Infer } from "@metamask/superstruct";
|
2
2
|
export declare const KeyringRequestStruct: import("@metamask/superstruct").Struct<{
|
3
3
|
id: string;
|
4
|
-
scope: string;
|
5
|
-
account: string;
|
6
4
|
request: {
|
7
5
|
method: string;
|
8
|
-
params?: import("@metamask/utils").Json
|
6
|
+
params?: Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[];
|
9
7
|
};
|
8
|
+
scope: string;
|
9
|
+
account: string;
|
10
10
|
}, {
|
11
11
|
/**
|
12
12
|
* Keyring request ID (UUIDv4).
|
@@ -25,10 +25,10 @@ export declare const KeyringRequestStruct: import("@metamask/superstruct").Struc
|
|
25
25
|
*/
|
26
26
|
request: import("@metamask/superstruct").Struct<{
|
27
27
|
method: string;
|
28
|
-
params?: import("@metamask/utils").Json
|
28
|
+
params?: Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[];
|
29
29
|
}, {
|
30
30
|
method: import("@metamask/superstruct").Struct<string, null>;
|
31
|
-
params: import("@metamask/superstruct").Struct<import("
|
31
|
+
params: import("@metamask/superstruct").Struct<import("@metamask/keyring-utils").ExactOptionalTag | Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[], null>;
|
32
32
|
}>;
|
33
33
|
}>;
|
34
34
|
/**
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"request.d.cts","sourceRoot":"","sources":["../../src/api/request.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"request.d.cts","sourceRoot":"","sources":["../../src/api/request.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAInD,eAAO,MAAM,oBAAoB;;;;;;;;;IAC/B;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;;;EAOH,CAAC;AAEH;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
|
package/dist/api/request.d.mts
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
import type { Infer } from "@metamask/superstruct";
|
2
2
|
export declare const KeyringRequestStruct: import("@metamask/superstruct").Struct<{
|
3
3
|
id: string;
|
4
|
-
scope: string;
|
5
|
-
account: string;
|
6
4
|
request: {
|
7
5
|
method: string;
|
8
|
-
params?: import("@metamask/utils").Json
|
6
|
+
params?: Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[];
|
9
7
|
};
|
8
|
+
scope: string;
|
9
|
+
account: string;
|
10
10
|
}, {
|
11
11
|
/**
|
12
12
|
* Keyring request ID (UUIDv4).
|
@@ -25,10 +25,10 @@ export declare const KeyringRequestStruct: import("@metamask/superstruct").Struc
|
|
25
25
|
*/
|
26
26
|
request: import("@metamask/superstruct").Struct<{
|
27
27
|
method: string;
|
28
|
-
params?: import("@metamask/utils").Json
|
28
|
+
params?: Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[];
|
29
29
|
}, {
|
30
30
|
method: import("@metamask/superstruct").Struct<string, null>;
|
31
|
-
params: import("@metamask/superstruct").Struct<import("
|
31
|
+
params: import("@metamask/superstruct").Struct<import("@metamask/keyring-utils").ExactOptionalTag | Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[], null>;
|
32
32
|
}>;
|
33
33
|
}>;
|
34
34
|
/**
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"request.d.mts","sourceRoot":"","sources":["../../src/api/request.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"request.d.mts","sourceRoot":"","sources":["../../src/api/request.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAInD,eAAO,MAAM,oBAAoB;;;;;;;;;IAC/B;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;;;EAOH,CAAC;AAEH;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
|
package/dist/api/request.mjs
CHANGED
@@ -1,7 +1,6 @@
|
|
1
|
+
import { exactOptional, object, UuidStruct } from "@metamask/keyring-utils";
|
1
2
|
import { array, record, string, union } from "@metamask/superstruct";
|
2
3
|
import { JsonStruct } from "@metamask/utils";
|
3
|
-
import { exactOptional, object } from "../superstruct.mjs";
|
4
|
-
import { UuidStruct } from "../utils/index.mjs";
|
5
4
|
export const KeyringRequestStruct = object({
|
6
5
|
/**
|
7
6
|
* Keyring request ID (UUIDv4).
|
package/dist/api/request.mjs.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"request.mjs","sourceRoot":"","sources":["../../src/api/request.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"request.mjs","sourceRoot":"","sources":["../../src/api/request.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,UAAU,EAAE,gCAAgC;AAE5E,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,8BAA8B;AACrE,OAAO,EAAE,UAAU,EAAE,wBAAwB;AAE7C,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC;IACzC;;OAEG;IACH,EAAE,EAAE,UAAU;IAEd;;OAEG;IACH,KAAK,EAAE,MAAM,EAAE;IAEf;;OAEG;IACH,OAAO,EAAE,UAAU;IAEnB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,EAAE;QAChB,MAAM,EAAE,aAAa,CACnB,KAAK,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,EAAE,UAAU,CAAC,CAAC,CAAC,CACzD;KACF,CAAC;CACH,CAAC,CAAC","sourcesContent":["import { exactOptional, object, UuidStruct } from '@metamask/keyring-utils';\nimport type { Infer } from '@metamask/superstruct';\nimport { array, record, string, union } from '@metamask/superstruct';\nimport { JsonStruct } from '@metamask/utils';\n\nexport const KeyringRequestStruct = object({\n /**\n * Keyring request ID (UUIDv4).\n */\n id: UuidStruct,\n\n /**\n * Request's scope (CAIP-2 chain ID).\n */\n scope: string(),\n\n /**\n * Account ID (UUIDv4).\n */\n account: UuidStruct,\n\n /**\n * Inner request sent by the client application.\n */\n request: object({\n method: string(),\n params: exactOptional(\n union([array(JsonStruct), record(string(), JsonStruct)]),\n ),\n }),\n});\n\n/**\n * Keyring request.\n *\n * Represents a request made to the keyring for account-related operations.\n */\nexport type KeyringRequest = Infer<typeof KeyringRequestStruct>;\n"]}
|
package/dist/api/response.cjs
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.KeyringResponseStruct = void 0;
|
4
|
+
const keyring_utils_1 = require("@metamask/keyring-utils");
|
4
5
|
const superstruct_1 = require("@metamask/superstruct");
|
5
6
|
const utils_1 = require("@metamask/utils");
|
6
|
-
const superstruct_2 = require("../superstruct.cjs");
|
7
7
|
exports.KeyringResponseStruct = (0, superstruct_1.union)([
|
8
|
-
(0,
|
8
|
+
(0, keyring_utils_1.object)({
|
9
9
|
/**
|
10
10
|
* Pending flag.
|
11
11
|
*
|
@@ -21,12 +21,12 @@ exports.KeyringResponseStruct = (0, superstruct_1.union)([
|
|
21
21
|
* with a link to the redirect URL. The user can choose to follow the link
|
22
22
|
* or cancel the request.
|
23
23
|
*/
|
24
|
-
redirect: (0,
|
25
|
-
message: (0,
|
26
|
-
url: (0,
|
24
|
+
redirect: (0, keyring_utils_1.exactOptional)((0, keyring_utils_1.object)({
|
25
|
+
message: (0, keyring_utils_1.exactOptional)((0, superstruct_1.string)()),
|
26
|
+
url: (0, keyring_utils_1.exactOptional)((0, superstruct_1.string)()),
|
27
27
|
})),
|
28
28
|
}),
|
29
|
-
(0,
|
29
|
+
(0, keyring_utils_1.object)({
|
30
30
|
/**
|
31
31
|
* Pending flag.
|
32
32
|
*
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"response.cjs","sourceRoot":"","sources":["../../src/api/response.ts"],"names":[],"mappings":";;;
|
1
|
+
{"version":3,"file":"response.cjs","sourceRoot":"","sources":["../../src/api/response.ts"],"names":[],"mappings":";;;AAAA,2DAAgE;AAEhE,uDAA+D;AAC/D,2CAA6C;AAEhC,QAAA,qBAAqB,GAAG,IAAA,mBAAK,EAAC;IACzC,IAAA,sBAAM,EAAC;QACL;;;;;;WAMG;QACH,OAAO,EAAE,IAAA,qBAAO,EAAC,IAAI,CAAC;QAEtB;;;;;;WAMG;QACH,QAAQ,EAAE,IAAA,6BAAa,EACrB,IAAA,sBAAM,EAAC;YACL,OAAO,EAAE,IAAA,6BAAa,EAAC,IAAA,oBAAM,GAAE,CAAC;YAChC,GAAG,EAAE,IAAA,6BAAa,EAAC,IAAA,oBAAM,GAAE,CAAC;SAC7B,CAAC,CACH;KACF,CAAC;IACF,IAAA,sBAAM,EAAC;QACL;;;;;;WAMG;QACH,OAAO,EAAE,IAAA,qBAAO,EAAC,KAAK,CAAC;QAEvB;;WAEG;QACH,MAAM,EAAE,kBAAU;KACnB,CAAC;CACH,CAAC,CAAC","sourcesContent":["import { exactOptional, object } from '@metamask/keyring-utils';\nimport type { Infer } from '@metamask/superstruct';\nimport { literal, string, union } from '@metamask/superstruct';\nimport { JsonStruct } from '@metamask/utils';\n\nexport const KeyringResponseStruct = union([\n object({\n /**\n * Pending flag.\n *\n * Setting the pending flag to true indicates that the request will be\n * handled asynchronously. The keyring must be called with `approveRequest`\n * or `rejectRequest` to resolve the request.\n */\n pending: literal(true),\n\n /**\n * Redirect URL.\n *\n * If present in the response, MetaMask will display a confirmation dialog\n * with a link to the redirect URL. The user can choose to follow the link\n * or cancel the request.\n */\n redirect: exactOptional(\n object({\n message: exactOptional(string()),\n url: exactOptional(string()),\n }),\n ),\n }),\n object({\n /**\n * Pending flag.\n *\n * Setting the pending flag to false indicates that the request will be\n * handled synchronously. The keyring must return the result of the\n * request execution.\n */\n pending: literal(false),\n\n /**\n * Request result.\n */\n result: JsonStruct,\n }),\n]);\n\n/**\n * Response to a call to `submitRequest`.\n *\n * Keyring implementations must return a response with `pending: true` if the\n * request will be handled asynchronously. Otherwise, the response must contain\n * the result of the request and `pending: false`.\n *\n * In the asynchronous case, the keyring can return a redirect URL and message\n * to be shown to the user. The user can choose to follow the link or cancel\n * the request. The main use case for this is to redirect the user to the snap\n * dapp to review the request.\n */\nexport type KeyringResponse = Infer<typeof KeyringResponseStruct>;\n"]}
|
package/dist/api/response.d.cts
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"response.d.cts","sourceRoot":"","sources":["../../src/api/response.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"response.d.cts","sourceRoot":"","sources":["../../src/api/response.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAInD,eAAO,MAAM,qBAAqB;;;;;;;;;QAwChC,CAAC;AAEH;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,eAAe,GAAG,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
|
package/dist/api/response.d.mts
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"response.d.mts","sourceRoot":"","sources":["../../src/api/response.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"response.d.mts","sourceRoot":"","sources":["../../src/api/response.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAInD,eAAO,MAAM,qBAAqB;;;;;;;;;QAwChC,CAAC;AAEH;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,eAAe,GAAG,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
|
package/dist/api/response.mjs
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
+
import { exactOptional, object } from "@metamask/keyring-utils";
|
1
2
|
import { literal, string, union } from "@metamask/superstruct";
|
2
3
|
import { JsonStruct } from "@metamask/utils";
|
3
|
-
import { exactOptional, object } from "../superstruct.mjs";
|
4
4
|
export const KeyringResponseStruct = union([
|
5
5
|
object({
|
6
6
|
/**
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"response.mjs","sourceRoot":"","sources":["../../src/api/response.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"response.mjs","sourceRoot":"","sources":["../../src/api/response.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,gCAAgC;AAEhE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,8BAA8B;AAC/D,OAAO,EAAE,UAAU,EAAE,wBAAwB;AAE7C,MAAM,CAAC,MAAM,qBAAqB,GAAG,KAAK,CAAC;IACzC,MAAM,CAAC;QACL;;;;;;WAMG;QACH,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC;QAEtB;;;;;;WAMG;QACH,QAAQ,EAAE,aAAa,CACrB,MAAM,CAAC;YACL,OAAO,EAAE,aAAa,CAAC,MAAM,EAAE,CAAC;YAChC,GAAG,EAAE,aAAa,CAAC,MAAM,EAAE,CAAC;SAC7B,CAAC,CACH;KACF,CAAC;IACF,MAAM,CAAC;QACL;;;;;;WAMG;QACH,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC;QAEvB;;WAEG;QACH,MAAM,EAAE,UAAU;KACnB,CAAC;CACH,CAAC,CAAC","sourcesContent":["import { exactOptional, object } from '@metamask/keyring-utils';\nimport type { Infer } from '@metamask/superstruct';\nimport { literal, string, union } from '@metamask/superstruct';\nimport { JsonStruct } from '@metamask/utils';\n\nexport const KeyringResponseStruct = union([\n object({\n /**\n * Pending flag.\n *\n * Setting the pending flag to true indicates that the request will be\n * handled asynchronously. The keyring must be called with `approveRequest`\n * or `rejectRequest` to resolve the request.\n */\n pending: literal(true),\n\n /**\n * Redirect URL.\n *\n * If present in the response, MetaMask will display a confirmation dialog\n * with a link to the redirect URL. The user can choose to follow the link\n * or cancel the request.\n */\n redirect: exactOptional(\n object({\n message: exactOptional(string()),\n url: exactOptional(string()),\n }),\n ),\n }),\n object({\n /**\n * Pending flag.\n *\n * Setting the pending flag to false indicates that the request will be\n * handled synchronously. The keyring must return the result of the\n * request execution.\n */\n pending: literal(false),\n\n /**\n * Request result.\n */\n result: JsonStruct,\n }),\n]);\n\n/**\n * Response to a call to `submitRequest`.\n *\n * Keyring implementations must return a response with `pending: true` if the\n * request will be handled asynchronously. Otherwise, the response must contain\n * the result of the request and `pending: false`.\n *\n * In the asynchronous case, the keyring can return a redirect URL and message\n * to be shown to the user. The user can choose to follow the link or cancel\n * the request. The main use case for this is to redirect the user to the snap\n * dapp to review the request.\n */\nexport type KeyringResponse = Infer<typeof KeyringResponseStruct>;\n"]}
|
package/dist/api/transaction.cjs
CHANGED
@@ -1,11 +1,10 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.TransactionsPageStruct = exports.TransactionStruct = exports.TransactionEventStruct = exports.TransactionType = exports.TransactionStatus = exports.FeeType = void 0;
|
4
|
+
const keyring_utils_1 = require("@metamask/keyring-utils");
|
4
5
|
const superstruct_1 = require("@metamask/superstruct");
|
5
6
|
const utils_1 = require("@metamask/utils");
|
6
7
|
const asset_1 = require("./asset.cjs");
|
7
|
-
const superstruct_2 = require("../superstruct.cjs");
|
8
|
-
const utils_2 = require("../utils/index.cjs");
|
9
8
|
/**
|
10
9
|
* This struct represents a participant in a transaction.
|
11
10
|
*
|
@@ -41,7 +40,7 @@ const utils_2 = require("../utils/index.cjs");
|
|
41
40
|
* },
|
42
41
|
* ```
|
43
42
|
*/
|
44
|
-
const ParticipantStruct = (0,
|
43
|
+
const ParticipantStruct = (0, keyring_utils_1.object)({
|
45
44
|
/**
|
46
45
|
* Participant address.
|
47
46
|
*/
|
@@ -75,7 +74,7 @@ var FeeType;
|
|
75
74
|
/**
|
76
75
|
* This struct represents a transaction fee.
|
77
76
|
*/
|
78
|
-
const FeeStruct = (0,
|
77
|
+
const FeeStruct = (0, keyring_utils_1.object)({
|
79
78
|
/**
|
80
79
|
* Fee type {@see FeeType}.
|
81
80
|
*/
|
@@ -129,7 +128,7 @@ var TransactionType;
|
|
129
128
|
/**
|
130
129
|
* This struct represents a transaction event.
|
131
130
|
*/
|
132
|
-
exports.TransactionEventStruct = (0,
|
131
|
+
exports.TransactionEventStruct = (0, keyring_utils_1.object)({
|
133
132
|
/**
|
134
133
|
* New status of the transaction.
|
135
134
|
*/
|
@@ -201,7 +200,7 @@ exports.TransactionEventStruct = (0, superstruct_2.object)({
|
|
201
200
|
* };
|
202
201
|
* ```
|
203
202
|
*/
|
204
|
-
exports.TransactionStruct = (0,
|
203
|
+
exports.TransactionStruct = (0, keyring_utils_1.object)({
|
205
204
|
/**
|
206
205
|
* Chain-specific transaction ID.
|
207
206
|
*/
|
@@ -213,7 +212,7 @@ exports.TransactionStruct = (0, superstruct_2.object)({
|
|
213
212
|
/**
|
214
213
|
* Account ID (UUIDv4).
|
215
214
|
*/
|
216
|
-
account:
|
215
|
+
account: keyring_utils_1.UuidStruct,
|
217
216
|
/**
|
218
217
|
* Transaction status {@see TransactionStatus}.
|
219
218
|
*/
|
@@ -281,7 +280,7 @@ exports.TransactionStruct = (0, superstruct_2.object)({
|
|
281
280
|
* }**
|
282
281
|
* ```
|
283
282
|
*/
|
284
|
-
exports.TransactionsPageStruct = (0,
|
283
|
+
exports.TransactionsPageStruct = (0, keyring_utils_1.object)({
|
285
284
|
/**
|
286
285
|
* List of transactions.
|
287
286
|
*/
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"transaction.cjs","sourceRoot":"","sources":["../../src/api/transaction.ts"],"names":[],"mappings":";;;AACA,uDAA+E;AAC/E,2CAAoD;AAEpD,uCAAsC;
|
1
|
+
{"version":3,"file":"transaction.cjs","sourceRoot":"","sources":["../../src/api/transaction.ts"],"names":[],"mappings":";;;AACA,2DAA6D;AAE7D,uDAA+E;AAC/E,2CAAoD;AAEpD,uCAAsC;AAGtC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,MAAM,iBAAiB,GAAG,IAAA,sBAAM,EAAC;IAC/B;;OAEG;IACH,OAAO,EAAE,IAAA,oBAAM,GAAE;IAEjB;;OAEG;IACH,KAAK,EAAE,IAAA,sBAAQ,EAAC,mBAAW,CAAC;CAC7B,CAAC,CAAC;AAEH;;GAEG;AACH,IAAY,OAiBX;AAjBD,WAAY,OAAO;IACjB;;;;;;OAMG;IACH,wBAAa,CAAA;IAEb;;;;;OAKG;IACH,gCAAqB,CAAA;AACvB,CAAC,EAjBW,OAAO,uBAAP,OAAO,QAiBlB;AAED;;GAEG;AACH,MAAM,SAAS,GAAG,IAAA,sBAAM,EAAC;IACvB;;OAEG;IACH,IAAI,EAAE,IAAA,mBAAK,EAAC,CAAC,GAAG,OAAO,CAAC,IAAI,EAAE,EAAE,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;IAEvD;;OAEG;IACH,KAAK,EAAE,mBAAW;CACnB,CAAC,CAAC;AAEH;;GAEG;AACH,IAAY,iBAsBX;AAtBD,WAAY,iBAAiB;IAC3B;;;OAGG;IACH,4CAAuB,CAAA;IAEvB;;;OAGG;IACH,gDAA2B,CAAA;IAE3B;;OAEG;IACH,4CAAuB,CAAA;IAEvB;;OAEG;IACH,sCAAiB,CAAA;AACnB,CAAC,EAtBW,iBAAiB,iCAAjB,iBAAiB,QAsB5B;AAED;;GAEG;AACH,IAAY,eAaX;AAbD,WAAY,eAAe;IACzB;;;;OAIG;IACH,gCAAa,CAAA;IAEb;;;OAGG;IACH,sCAAmB,CAAA;AACrB,CAAC,EAbW,eAAe,+BAAf,eAAe,QAa1B;AAED;;GAEG;AACU,QAAA,sBAAsB,GAAG,IAAA,sBAAM,EAAC;IAC3C;;OAEG;IACH,MAAM,EAAE,IAAA,mBAAK,EAAC;QACZ,GAAG,iBAAiB,CAAC,SAAS,EAAE;QAChC,GAAG,iBAAiB,CAAC,WAAW,EAAE;QAClC,GAAG,iBAAiB,CAAC,SAAS,EAAE;QAChC,GAAG,iBAAiB,CAAC,MAAM,EAAE;KAC9B,CAAC;IAEF;;OAEG;IACH,SAAS,EAAE,IAAA,sBAAQ,EAAC,IAAA,oBAAM,GAAE,CAAC;CAC9B,CAAC,CAAC;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AACU,QAAA,iBAAiB,GAAG,IAAA,sBAAM,EAAC;IACtC;;OAEG;IACH,EAAE,EAAE,IAAA,oBAAM,GAAE;IAEZ;;OAEG;IACH,KAAK,EAAE,yBAAiB;IAExB;;OAEG;IACH,OAAO,EAAE,0BAAU;IAEnB;;OAEG;IACH,MAAM,EAAE,IAAA,mBAAK,EAAC;QACZ,GAAG,iBAAiB,CAAC,SAAS,EAAE;QAChC,GAAG,iBAAiB,CAAC,WAAW,EAAE;QAClC,GAAG,iBAAiB,CAAC,SAAS,EAAE;QAChC,GAAG,iBAAiB,CAAC,MAAM,EAAE;KAC9B,CAAC;IAEF;;;;OAIG;IACH,SAAS,EAAE,IAAA,sBAAQ,EAAC,IAAA,oBAAM,GAAE,CAAC;IAE7B;;;OAGG;IACH,IAAI,EAAE,IAAA,mBAAK,EAAC,CAAC,GAAG,eAAe,CAAC,IAAI,EAAE,EAAE,GAAG,eAAe,CAAC,OAAO,EAAE,CAAC,CAAC;IAEtE;;OAEG;IACH,IAAI,EAAE,IAAA,mBAAK,EAAC,iBAAiB,CAAC;IAE9B;;OAEG;IACH,EAAE,EAAE,IAAA,mBAAK,EAAC,iBAAiB,CAAC;IAE5B;;OAEG;IACH,IAAI,EAAE,IAAA,mBAAK,EAAC,SAAS,CAAC;IAEtB;;;;;OAKG;IACH,MAAM,EAAE,IAAA,mBAAK,EAAC,8BAAsB,CAAC;CACtC,CAAC,CAAC;AASH;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACU,QAAA,sBAAsB,GAAG,IAAA,sBAAM,EAAC;IAC3C;;OAEG;IACH,IAAI,EAAE,IAAA,mBAAK,EAAC,yBAAiB,CAAC;IAE9B;;;OAGG;IACH,IAAI,EAAE,IAAA,sBAAQ,EAAC,IAAA,oBAAM,GAAE,CAAC;CACzB,CAAC,CAAC","sourcesContent":["import type { InferEquals } from '@metamask/keyring-utils';\nimport { object, UuidStruct } from '@metamask/keyring-utils';\nimport type { Infer } from '@metamask/superstruct';\nimport { array, enums, nullable, number, string } from '@metamask/superstruct';\nimport { CaipChainIdStruct } from '@metamask/utils';\n\nimport { AssetStruct } from './asset';\nimport type { Paginated } from './pagination';\n\n/**\n * This struct represents a participant in a transaction.\n *\n * @example\n * ```ts\n * {\n * address: '0x1234...',\n * asset: {\n * fungible: true,\n * type: 'eip155:1/slip44:60',\n * unit: 'ETH',\n * amount: '0.01',\n * },\n * },\n * ```\n *\n * @example\n * ```ts\n * {\n * address: '0x1234...',\n * asset: {\n * fungible: false,\n * id: 'eip155:1/erc721:0x06012c8cf97BEaD5deAe237070F9587f8E7A266d/771769',\n * },\n * },\n * ```\n *\n * @example\n * ```ts\n * {\n * address: '0x1234...',\n * asset: null,\n * },\n * ```\n */\nconst ParticipantStruct = object({\n /**\n * Participant address.\n */\n address: string(),\n\n /**\n * Asset being transferred.\n */\n asset: nullable(AssetStruct),\n});\n\n/**\n * Fee types.\n */\nexport enum FeeType {\n /**\n * Base fee. It is the minimum fee required to include a transaction in the\n * blockchain.\n *\n * For non-confirmed transactions, it must be the maximum base fee. For\n * confirmed transactions, it must be the actual base fee paid.\n */\n Base = 'base',\n\n /**\n * Priority fee. It is an optional fee used to prioritize the transaction.\n *\n * For non-confirmed transactions, it must be the maximum priority fee. For\n * confirmed transactions, it must be the actual priority fee paid.\n */\n Priority = 'priority',\n}\n\n/**\n * This struct represents a transaction fee.\n */\nconst FeeStruct = object({\n /**\n * Fee type {@see FeeType}.\n */\n type: enums([`${FeeType.Base}`, `${FeeType.Priority}`]),\n\n /**\n * Asset used to pay for the fee.\n */\n asset: AssetStruct,\n});\n\n/**\n * Transaction statuses.\n */\nexport enum TransactionStatus {\n /**\n * The transaction has been submitted but is not yet in the\n * blockchain. For example, it can be in the mempool.\n */\n Submitted = 'submitted',\n\n /**\n * The transaction is in the blockchain but has not been\n * confirmed yet.\n */\n Unconfirmed = 'unconfirmed',\n\n /**\n * The transaction has been confirmed.\n */\n Confirmed = 'confirmed',\n\n /**\n * The transaction has failed. For example, it has been reverted.\n */\n Failed = 'failed',\n}\n\n/**\n * Transaction types.\n */\nexport enum TransactionType {\n /**\n * The transaction was originated by the account. If the transaction\n * has a change output that goes back to the same account, it must be tagged\n * as a send transaction.\n */\n Send = 'send',\n\n /**\n * The transaction was received by the account, but originated by\n * another account.\n */\n Receive = 'receive',\n}\n\n/**\n * This struct represents a transaction event.\n */\nexport const TransactionEventStruct = object({\n /**\n * New status of the transaction.\n */\n status: enums([\n `${TransactionStatus.Submitted}`,\n `${TransactionStatus.Unconfirmed}`,\n `${TransactionStatus.Confirmed}`,\n `${TransactionStatus.Failed}`,\n ]),\n\n /**\n * UNIX timestamp of when the event occurred.\n */\n timestamp: nullable(number()),\n});\n\n/**\n * This struct represents a blockchain transaction.\n *\n * @example\n * ```ts\n * const tx = {\n * id: 'f5d8ee39a430901c91a5917b9f2dc19d6d1a0e9cea205b009ca73dd04470b9a6',\n * chain: 'bip122:000000000019d6689c085ae165831e93',\n * account: 'b9beb861-9761-4b97-89ce-d992be5f34da',\n * status: 'confirmed',\n * timestamp: 1716367781,\n * type: 'send',\n * from: [\n * {\n * address: 'bc1qrp0yzgkf8rawkuvdlhnjfj2fnjwm0m8727kgah',\n * asset: {\n * fungible: true,\n * type: 'bip122:000000000019d6689c085ae165831e93/slip44:0',\n * unit: 'BTC',\n * amount: '0.1',\n * },\n * },\n * ],\n * to: [\n * {\n * address: 'bc1qrp0yzgkf8rawkuvdlhnjfj2fnjwm0m8727kgah',\n * asset: {\n * fungible: true,\n * type: 'bip122:000000000019d6689c085ae165831e93/slip44:0',\n * unit: 'BTC',\n * amount: '0.1',\n * },\n * },\n * {\n * address: 'bc1qwl8399fz829uqvqly9tcatgrgtwp3udnhxfq4k',\n * asset: {\n * fungible: true,\n * type: 'bip122:000000000019d6689c085ae165831e93/slip44:0',\n * unit: 'BTC',\n * amount: '0.1',\n * },\n * },\n * ],\n * fees: [\n * {\n * type: 'priority',\n * asset: {\n * fungible: true,\n * type: 'bip122:000000000019d6689c085ae165831e93/slip44:0',\n * unit: 'BTC',\n * amount: '0.1',\n * },\n * },\n * ],\n * };\n * ```\n */\nexport const TransactionStruct = object({\n /**\n * Chain-specific transaction ID.\n */\n id: string(),\n\n /**\n * Chain ID (CAIP-2).\n */\n chain: CaipChainIdStruct,\n\n /**\n * Account ID (UUIDv4).\n */\n account: UuidStruct,\n\n /**\n * Transaction status {@see TransactionStatus}.\n */\n status: enums([\n `${TransactionStatus.Submitted}`,\n `${TransactionStatus.Unconfirmed}`,\n `${TransactionStatus.Confirmed}`,\n `${TransactionStatus.Failed}`,\n ]),\n\n /**\n * UNIX timestamp of when the transaction was added to the blockchain. The\n * timestamp can be null if the transaction has not been included in the\n * blockchain yet.\n */\n timestamp: nullable(number()),\n\n /**\n * Transaction type {@see TransactionType}. This will be used by MetaMask to enrich the transaction\n * details on the UI.\n */\n type: enums([`${TransactionType.Send}`, `${TransactionType.Receive}`]),\n\n /**\n * Transaction sender addresses and amounts.\n */\n from: array(ParticipantStruct),\n\n /**\n * Transaction receiver addresses and amounts.\n */\n to: array(ParticipantStruct),\n\n /**\n * Total transaction fee.\n */\n fees: array(FeeStruct),\n\n /**\n * List of events related to the transaction {@see TransactionEventStruct}.\n *\n * The events are tracked in a best-effort basis and may not be available for\n * all transactions.\n */\n events: array(TransactionEventStruct),\n});\n\n/**\n * Transaction object.\n *\n * See {@link TransactionStruct}.\n */\nexport type Transaction = Infer<typeof TransactionStruct>;\n\n/**\n * This struct represents a page of transactions.\n *\n * @example\n * ```ts\n * {\n * data: [\n * {\n * // Transaction object\n * }\n * ],\n * next: 'c3y1Q6QtqtstbxKX+oqVdEW6',\n * }\n * ```\n *\n * @example\n * ```ts\n * {\n * data: [\n * {\n * // Transaction object\n * }\n * ],\n * next: null, // No more results\n * }**\n * ```\n */\nexport const TransactionsPageStruct = object({\n /**\n * List of transactions.\n */\n data: array(TransactionStruct),\n\n /**\n * Next cursor to iterate over the results. If null, there are no more\n * results.\n */\n next: nullable(string()),\n});\n\n/**\n * Transactions page object.\n *\n * See {@link TransactionsPageStruct}.\n */\nexport type TransactionsPage = InferEquals<\n typeof TransactionsPageStruct,\n Paginated<Transaction>\n>;\n"]}
|