@metamask-previews/core-backend 9.0.0-preview-5b293ee50 → 9.0.0-preview-3866c0ff1
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 +5 -0
- package/dist/{ApiPlatformClientService-method-action-types.d.mts → ApiPlatformClientService-method-action-types.d.ts} +2 -2
- package/dist/ApiPlatformClientService-method-action-types.d.ts.map +1 -0
- package/dist/{ApiPlatformClientService-method-action-types.mjs → ApiPlatformClientService-method-action-types.js} +1 -1
- package/dist/ApiPlatformClientService-method-action-types.js.map +1 -0
- package/dist/{ApiPlatformClientService.d.cts → ApiPlatformClientService.d.ts} +5 -5
- package/dist/ApiPlatformClientService.d.ts.map +1 -0
- package/dist/{ApiPlatformClientService.mjs → ApiPlatformClientService.js} +9 -21
- package/dist/ApiPlatformClientService.js.map +1 -0
- package/dist/api/{ApiPlatformClient.d.cts → ApiPlatformClient.d.ts} +8 -8
- package/dist/api/ApiPlatformClient.d.ts.map +1 -0
- package/dist/api/{ApiPlatformClient.mjs → ApiPlatformClient.js} +53 -45
- package/dist/api/{ApiPlatformClient.cjs.map → ApiPlatformClient.js.map} +1 -1
- package/dist/api/accounts/{client.d.cts → client.d.ts} +5 -5
- package/dist/api/accounts/client.d.ts.map +1 -0
- package/dist/api/accounts/{client.mjs → client.js} +3 -3
- package/dist/api/accounts/client.js.map +1 -0
- package/dist/api/accounts/{index.d.mts → index.d.ts} +4 -4
- package/dist/api/accounts/index.d.ts.map +1 -0
- package/dist/api/accounts/index.js +6 -0
- package/dist/api/accounts/index.js.map +1 -0
- package/dist/api/accounts/{types.d.cts → types.d.ts} +3 -3
- package/dist/api/accounts/types.d.ts.map +1 -0
- package/dist/api/accounts/{types.mjs → types.js} +1 -1
- package/dist/api/accounts/types.js.map +1 -0
- package/dist/api/{base-client.d.cts → base-client.d.ts} +6 -5
- package/dist/api/base-client.d.ts.map +1 -0
- package/dist/api/{base-client.mjs → base-client.js} +23 -32
- package/dist/api/base-client.js.map +1 -0
- package/dist/api/{index.d.cts → index.d.ts} +14 -14
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/index.js +18 -0
- package/dist/api/index.js.map +1 -0
- package/dist/api/prices/{client.d.mts → client.d.ts} +5 -5
- package/dist/api/prices/client.d.ts.map +1 -0
- package/dist/api/prices/{client.mjs → client.js} +3 -3
- package/dist/api/prices/client.js.map +1 -0
- package/dist/api/prices/{index.d.mts → index.d.ts} +3 -3
- package/dist/api/prices/index.d.ts.map +1 -0
- package/dist/api/prices/index.js +5 -0
- package/dist/api/prices/index.js.map +1 -0
- package/dist/api/prices/{types.d.cts → types.d.ts} +1 -1
- package/dist/api/prices/types.d.ts.map +1 -0
- package/dist/api/prices/{types.mjs → types.js} +1 -1
- package/dist/api/prices/types.js.map +1 -0
- package/dist/api/{shared-types.d.cts → shared-types.d.ts} +6 -6
- package/dist/api/shared-types.d.ts.map +1 -0
- package/dist/api/{shared-types.mjs → shared-types.js} +6 -2
- package/dist/api/shared-types.js.map +1 -0
- package/dist/api/{test-utils.d.cts → test-utils.d.ts} +2 -3
- package/dist/api/test-utils.d.ts.map +1 -0
- package/dist/api/{test-utils.mjs → test-utils.js} +3 -3
- package/dist/api/test-utils.js.map +1 -0
- package/dist/api/token/{client.d.mts → client.d.ts} +5 -5
- package/dist/api/token/client.d.ts.map +1 -0
- package/dist/api/token/{client.mjs → client.js} +3 -3
- package/dist/api/token/client.js.map +1 -0
- package/dist/api/token/{index.d.cts → index.d.ts} +3 -3
- package/dist/api/token/index.d.ts.map +1 -0
- package/dist/api/token/index.js +5 -0
- package/dist/api/token/index.js.map +1 -0
- package/dist/api/token/{types.d.cts → types.d.ts} +1 -1
- package/dist/api/token/types.d.ts.map +1 -0
- package/dist/api/token/{types.mjs → types.js} +1 -1
- package/dist/api/token/types.js.map +1 -0
- package/dist/api/tokens/{client.d.mts → client.d.ts} +5 -5
- package/dist/api/tokens/client.d.ts.map +1 -0
- package/dist/api/tokens/{client.mjs → client.js} +3 -3
- package/dist/api/tokens/client.js.map +1 -0
- package/dist/api/tokens/{index.d.cts → index.d.ts} +3 -3
- package/dist/api/tokens/index.d.ts.map +1 -0
- package/dist/api/tokens/index.js +5 -0
- package/dist/api/tokens/index.js.map +1 -0
- package/dist/api/tokens/{types.d.cts → types.d.ts} +1 -1
- package/dist/api/tokens/types.d.ts.map +1 -0
- package/dist/api/tokens/{types.mjs → types.js} +1 -1
- package/dist/api/tokens/types.js.map +1 -0
- package/dist/{index.d.mts → index.d.ts} +12 -12
- package/dist/index.d.ts.map +1 -0
- package/dist/{index.mjs → index.js} +6 -6
- package/dist/index.js.map +1 -0
- package/dist/logger.d.ts +4 -0
- package/dist/logger.d.ts.map +1 -0
- package/dist/logger.js +4 -0
- package/dist/logger.js.map +1 -0
- package/dist/{types.d.cts → types.d.ts} +1 -1
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/ws/{AccountActivityService.d.cts → AccountActivityService.d.ts} +10 -10
- package/dist/ws/AccountActivityService.d.ts.map +1 -0
- package/dist/ws/AccountActivityService.js +472 -0
- package/dist/ws/AccountActivityService.js.map +1 -0
- package/dist/ws/{BackendWebSocketService-method-action-types.d.cts → BackendWebSocketService-method-action-types.d.ts} +2 -2
- package/dist/ws/BackendWebSocketService-method-action-types.d.ts.map +1 -0
- package/dist/ws/{BackendWebSocketService-method-action-types.mjs → BackendWebSocketService-method-action-types.js} +1 -1
- package/dist/ws/BackendWebSocketService-method-action-types.js.map +1 -0
- package/dist/ws/{BackendWebSocketService.d.cts → BackendWebSocketService.d.ts} +7 -7
- package/dist/ws/BackendWebSocketService.d.ts.map +1 -0
- package/dist/ws/BackendWebSocketService.js +1191 -0
- package/dist/ws/BackendWebSocketService.js.map +1 -0
- package/dist/ws/ohlcv/{OHLCVService-method-action-types.d.cts → OHLCVService-method-action-types.d.ts} +2 -2
- package/dist/ws/ohlcv/OHLCVService-method-action-types.d.ts.map +1 -0
- package/dist/ws/ohlcv/{OHLCVService-method-action-types.mjs → OHLCVService-method-action-types.js} +1 -1
- package/dist/ws/ohlcv/OHLCVService-method-action-types.js.map +1 -0
- package/dist/ws/ohlcv/{OHLCVService.d.cts → OHLCVService.d.ts} +9 -9
- package/dist/ws/ohlcv/OHLCVService.d.ts.map +1 -0
- package/dist/ws/ohlcv/OHLCVService.js +471 -0
- package/dist/ws/ohlcv/OHLCVService.js.map +1 -0
- package/dist/ws/ohlcv/{index.d.cts → index.d.ts} +5 -5
- package/dist/ws/ohlcv/index.d.ts.map +1 -0
- package/dist/ws/ohlcv/index.js +3 -0
- package/dist/ws/ohlcv/index.js.map +1 -0
- package/dist/ws/ohlcv/{types.d.cts → types.d.ts} +1 -1
- package/dist/ws/ohlcv/types.d.ts.map +1 -0
- package/dist/ws/ohlcv/{types.mjs → types.js} +1 -1
- package/dist/ws/ohlcv/types.js.map +1 -0
- package/package.json +13 -17
- package/dist/ApiPlatformClientService-method-action-types.cjs +0 -7
- package/dist/ApiPlatformClientService-method-action-types.cjs.map +0 -1
- package/dist/ApiPlatformClientService-method-action-types.d.cts +0 -21
- package/dist/ApiPlatformClientService-method-action-types.d.cts.map +0 -1
- package/dist/ApiPlatformClientService-method-action-types.d.mts.map +0 -1
- package/dist/ApiPlatformClientService-method-action-types.mjs.map +0 -1
- package/dist/ApiPlatformClientService.cjs +0 -82
- package/dist/ApiPlatformClientService.cjs.map +0 -1
- package/dist/ApiPlatformClientService.d.cts.map +0 -1
- package/dist/ApiPlatformClientService.d.mts +0 -86
- package/dist/ApiPlatformClientService.d.mts.map +0 -1
- package/dist/ApiPlatformClientService.mjs.map +0 -1
- package/dist/api/ApiPlatformClient.cjs +0 -177
- package/dist/api/ApiPlatformClient.d.cts.map +0 -1
- package/dist/api/ApiPlatformClient.d.mts +0 -127
- package/dist/api/ApiPlatformClient.d.mts.map +0 -1
- package/dist/api/ApiPlatformClient.mjs.map +0 -1
- package/dist/api/accounts/client.cjs +0 -850
- package/dist/api/accounts/client.cjs.map +0 -1
- package/dist/api/accounts/client.d.cts.map +0 -1
- package/dist/api/accounts/client.d.mts +0 -500
- package/dist/api/accounts/client.d.mts.map +0 -1
- package/dist/api/accounts/client.mjs.map +0 -1
- package/dist/api/accounts/index.cjs +0 -11
- package/dist/api/accounts/index.cjs.map +0 -1
- package/dist/api/accounts/index.d.cts +0 -7
- package/dist/api/accounts/index.d.cts.map +0 -1
- package/dist/api/accounts/index.d.mts.map +0 -1
- package/dist/api/accounts/index.mjs +0 -6
- package/dist/api/accounts/index.mjs.map +0 -1
- package/dist/api/accounts/types.cjs +0 -22
- package/dist/api/accounts/types.cjs.map +0 -1
- package/dist/api/accounts/types.d.cts.map +0 -1
- package/dist/api/accounts/types.d.mts +0 -286
- package/dist/api/accounts/types.d.mts.map +0 -1
- package/dist/api/accounts/types.mjs.map +0 -1
- package/dist/api/base-client.cjs +0 -151
- package/dist/api/base-client.cjs.map +0 -1
- package/dist/api/base-client.d.cts.map +0 -1
- package/dist/api/base-client.d.mts +0 -54
- package/dist/api/base-client.d.mts.map +0 -1
- package/dist/api/base-client.mjs.map +0 -1
- package/dist/api/index.cjs +0 -37
- package/dist/api/index.cjs.map +0 -1
- package/dist/api/index.d.cts.map +0 -1
- package/dist/api/index.d.mts +0 -18
- package/dist/api/index.d.mts.map +0 -1
- package/dist/api/index.mjs +0 -18
- package/dist/api/index.mjs.map +0 -1
- package/dist/api/prices/client.cjs +0 -779
- package/dist/api/prices/client.cjs.map +0 -1
- package/dist/api/prices/client.d.cts +0 -447
- package/dist/api/prices/client.d.cts.map +0 -1
- package/dist/api/prices/client.d.mts.map +0 -1
- package/dist/api/prices/client.mjs.map +0 -1
- package/dist/api/prices/index.cjs +0 -9
- package/dist/api/prices/index.cjs.map +0 -1
- package/dist/api/prices/index.d.cts +0 -6
- package/dist/api/prices/index.d.cts.map +0 -1
- package/dist/api/prices/index.d.mts.map +0 -1
- package/dist/api/prices/index.mjs +0 -5
- package/dist/api/prices/index.mjs.map +0 -1
- package/dist/api/prices/types.cjs +0 -7
- package/dist/api/prices/types.cjs.map +0 -1
- package/dist/api/prices/types.d.cts.map +0 -1
- package/dist/api/prices/types.d.mts +0 -61
- package/dist/api/prices/types.d.mts.map +0 -1
- package/dist/api/prices/types.mjs.map +0 -1
- package/dist/api/shared-types.cjs +0 -110
- package/dist/api/shared-types.cjs.map +0 -1
- package/dist/api/shared-types.d.cts.map +0 -1
- package/dist/api/shared-types.d.mts +0 -151
- package/dist/api/shared-types.d.mts.map +0 -1
- package/dist/api/shared-types.mjs.map +0 -1
- package/dist/api/test-utils.cjs +0 -70
- package/dist/api/test-utils.cjs.map +0 -1
- package/dist/api/test-utils.d.cts.map +0 -1
- package/dist/api/test-utils.d.mts +0 -30
- package/dist/api/test-utils.d.mts.map +0 -1
- package/dist/api/test-utils.mjs.map +0 -1
- package/dist/api/token/client.cjs +0 -500
- package/dist/api/token/client.cjs.map +0 -1
- package/dist/api/token/client.d.cts +0 -362
- package/dist/api/token/client.d.cts.map +0 -1
- package/dist/api/token/client.d.mts.map +0 -1
- package/dist/api/token/client.mjs.map +0 -1
- package/dist/api/token/index.cjs +0 -9
- package/dist/api/token/index.cjs.map +0 -1
- package/dist/api/token/index.d.cts.map +0 -1
- package/dist/api/token/index.d.mts +0 -6
- package/dist/api/token/index.d.mts.map +0 -1
- package/dist/api/token/index.mjs +0 -5
- package/dist/api/token/index.mjs.map +0 -1
- package/dist/api/token/types.cjs +0 -7
- package/dist/api/token/types.cjs.map +0 -1
- package/dist/api/token/types.d.cts.map +0 -1
- package/dist/api/token/types.d.mts +0 -124
- package/dist/api/token/types.d.mts.map +0 -1
- package/dist/api/token/types.mjs.map +0 -1
- package/dist/api/tokens/client.cjs +0 -132
- package/dist/api/tokens/client.cjs.map +0 -1
- package/dist/api/tokens/client.d.cts +0 -69
- package/dist/api/tokens/client.d.cts.map +0 -1
- package/dist/api/tokens/client.d.mts.map +0 -1
- package/dist/api/tokens/client.mjs.map +0 -1
- package/dist/api/tokens/index.cjs +0 -9
- package/dist/api/tokens/index.cjs.map +0 -1
- package/dist/api/tokens/index.d.cts.map +0 -1
- package/dist/api/tokens/index.d.mts +0 -6
- package/dist/api/tokens/index.d.mts.map +0 -1
- package/dist/api/tokens/index.mjs +0 -5
- package/dist/api/tokens/index.mjs.map +0 -1
- package/dist/api/tokens/types.cjs +0 -7
- package/dist/api/tokens/types.cjs.map +0 -1
- package/dist/api/tokens/types.d.cts.map +0 -1
- package/dist/api/tokens/types.d.mts +0 -87
- package/dist/api/tokens/types.d.mts.map +0 -1
- package/dist/api/tokens/types.mjs.map +0 -1
- package/dist/index.cjs +0 -55
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -12
- package/dist/index.d.cts.map +0 -1
- package/dist/index.d.mts.map +0 -1
- package/dist/index.mjs.map +0 -1
- package/dist/logger.cjs +0 -7
- package/dist/logger.cjs.map +0 -1
- package/dist/logger.d.cts +0 -5
- package/dist/logger.d.cts.map +0 -1
- package/dist/logger.d.mts +0 -5
- package/dist/logger.d.mts.map +0 -1
- package/dist/logger.mjs +0 -4
- package/dist/logger.mjs.map +0 -1
- package/dist/types.cjs +0 -3
- package/dist/types.cjs.map +0 -1
- package/dist/types.d.cts.map +0 -1
- package/dist/types.d.mts +0 -73
- package/dist/types.d.mts.map +0 -1
- package/dist/types.mjs +0 -2
- package/dist/types.mjs.map +0 -1
- package/dist/ws/AccountActivityService.cjs +0 -437
- package/dist/ws/AccountActivityService.cjs.map +0 -1
- package/dist/ws/AccountActivityService.d.cts.map +0 -1
- package/dist/ws/AccountActivityService.d.mts +0 -136
- package/dist/ws/AccountActivityService.d.mts.map +0 -1
- package/dist/ws/AccountActivityService.mjs +0 -433
- package/dist/ws/AccountActivityService.mjs.map +0 -1
- package/dist/ws/BackendWebSocketService-method-action-types.cjs +0 -7
- package/dist/ws/BackendWebSocketService-method-action-types.cjs.map +0 -1
- package/dist/ws/BackendWebSocketService-method-action-types.d.cts.map +0 -1
- package/dist/ws/BackendWebSocketService-method-action-types.d.mts +0 -252
- package/dist/ws/BackendWebSocketService-method-action-types.d.mts.map +0 -1
- package/dist/ws/BackendWebSocketService-method-action-types.mjs.map +0 -1
- package/dist/ws/BackendWebSocketService.cjs +0 -1062
- package/dist/ws/BackendWebSocketService.cjs.map +0 -1
- package/dist/ws/BackendWebSocketService.d.cts.map +0 -1
- package/dist/ws/BackendWebSocketService.d.mts +0 -406
- package/dist/ws/BackendWebSocketService.d.mts.map +0 -1
- package/dist/ws/BackendWebSocketService.mjs +0 -1057
- package/dist/ws/BackendWebSocketService.mjs.map +0 -1
- package/dist/ws/ohlcv/OHLCVService-method-action-types.cjs +0 -7
- package/dist/ws/ohlcv/OHLCVService-method-action-types.cjs.map +0 -1
- package/dist/ws/ohlcv/OHLCVService-method-action-types.d.cts.map +0 -1
- package/dist/ws/ohlcv/OHLCVService-method-action-types.d.mts +0 -35
- package/dist/ws/ohlcv/OHLCVService-method-action-types.d.mts.map +0 -1
- package/dist/ws/ohlcv/OHLCVService-method-action-types.mjs.map +0 -1
- package/dist/ws/ohlcv/OHLCVService.cjs +0 -471
- package/dist/ws/ohlcv/OHLCVService.cjs.map +0 -1
- package/dist/ws/ohlcv/OHLCVService.d.cts.map +0 -1
- package/dist/ws/ohlcv/OHLCVService.d.mts +0 -111
- package/dist/ws/ohlcv/OHLCVService.d.mts.map +0 -1
- package/dist/ws/ohlcv/OHLCVService.mjs +0 -467
- package/dist/ws/ohlcv/OHLCVService.mjs.map +0 -1
- package/dist/ws/ohlcv/index.cjs +0 -9
- package/dist/ws/ohlcv/index.cjs.map +0 -1
- package/dist/ws/ohlcv/index.d.cts.map +0 -1
- package/dist/ws/ohlcv/index.d.mts +0 -5
- package/dist/ws/ohlcv/index.d.mts.map +0 -1
- package/dist/ws/ohlcv/index.mjs +0 -3
- package/dist/ws/ohlcv/index.mjs.map +0 -1
- package/dist/ws/ohlcv/types.cjs +0 -6
- package/dist/ws/ohlcv/types.cjs.map +0 -1
- package/dist/ws/ohlcv/types.d.cts.map +0 -1
- package/dist/ws/ohlcv/types.d.mts +0 -32
- package/dist/ws/ohlcv/types.d.mts.map +0 -1
- package/dist/ws/ohlcv/types.mjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
### Changed
|
|
11
|
+
|
|
12
|
+
- **BREAKING:** Bump minimum Node.js version to 22 ([#9168](https://github.com/MetaMask/core/pull/9168))
|
|
13
|
+
- Bump `@metamask/remote-feature-flag-controller` from `^6.0.0` to `^6.1.0` ([#9980](https://github.com/MetaMask/core/pull/9980))
|
|
14
|
+
|
|
10
15
|
## [9.0.0]
|
|
11
16
|
|
|
12
17
|
### Changed
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* This file is auto generated.
|
|
3
3
|
* Do not edit manually.
|
|
4
4
|
*/
|
|
5
|
-
import type { ApiPlatformClientService } from
|
|
5
|
+
import type { ApiPlatformClientService } from './ApiPlatformClientService.js';
|
|
6
6
|
/**
|
|
7
7
|
* Returns the shared ApiPlatformClient instance.
|
|
8
8
|
*
|
|
@@ -18,4 +18,4 @@ export type ApiPlatformClientServiceGetApiPlatformClientAction = {
|
|
|
18
18
|
* Union of all ApiPlatformClientService action types.
|
|
19
19
|
*/
|
|
20
20
|
export type ApiPlatformClientServiceMethodActions = ApiPlatformClientServiceGetApiPlatformClientAction;
|
|
21
|
-
//# sourceMappingURL=ApiPlatformClientService-method-action-types.d.
|
|
21
|
+
//# sourceMappingURL=ApiPlatformClientService-method-action-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ApiPlatformClientService-method-action-types.d.ts","sourceRoot":"","sources":["../src/ApiPlatformClientService-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAE9E;;;;;;GAMG;AACH,MAAM,MAAM,kDAAkD,GAAG;IAC/D,IAAI,EAAE,+CAA+C,CAAC;IACtD,OAAO,EAAE,wBAAwB,CAAC,sBAAsB,CAAC,CAAC;CAC3D,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,qCAAqC,GAC/C,kDAAkD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ApiPlatformClientService-method-action-types.js","sourceRoot":"","sources":["../src/ApiPlatformClientService-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/**\n * This file is auto generated.\n * Do not edit manually.\n */\n\nimport type { ApiPlatformClientService } from './ApiPlatformClientService.js';\n\n/**\n * Returns the shared ApiPlatformClient instance.\n *\n * Use this via the messenger: `messenger.call('ApiPlatformClientService:getApiPlatformClient')`.\n *\n * @returns The ApiPlatformClient instance (accounts, prices, token, tokens).\n */\nexport type ApiPlatformClientServiceGetApiPlatformClientAction = {\n type: `ApiPlatformClientService:getApiPlatformClient`;\n handler: ApiPlatformClientService['getApiPlatformClient'];\n};\n\n/**\n * Union of all ApiPlatformClientService action types.\n */\nexport type ApiPlatformClientServiceMethodActions =\n ApiPlatformClientServiceGetApiPlatformClientAction;\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { Messenger } from
|
|
2
|
-
import { ApiPlatformClient } from
|
|
3
|
-
import type { ApiPlatformClientOptions } from
|
|
4
|
-
import type { ApiPlatformClientServiceMethodActions } from
|
|
1
|
+
import type { Messenger } from '@metamask/messenger';
|
|
2
|
+
import { ApiPlatformClient } from './api/index.js';
|
|
3
|
+
import type { ApiPlatformClientOptions } from './api/index.js';
|
|
4
|
+
import type { ApiPlatformClientServiceMethodActions } from './ApiPlatformClientService-method-action-types.js';
|
|
5
5
|
/**
|
|
6
6
|
* The name of the {@link ApiPlatformClientService}, used to namespace the
|
|
7
7
|
* service's actions and events.
|
|
@@ -83,4 +83,4 @@ export declare class ApiPlatformClientService {
|
|
|
83
83
|
getApiPlatformClient(): ApiPlatformClient;
|
|
84
84
|
}
|
|
85
85
|
export {};
|
|
86
|
-
//# sourceMappingURL=ApiPlatformClientService.d.
|
|
86
|
+
//# sourceMappingURL=ApiPlatformClientService.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ApiPlatformClientService.d.ts","sourceRoot":"","sources":["../src/ApiPlatformClientService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAC/D,OAAO,KAAK,EAAE,qCAAqC,EAAE,MAAM,mDAAmD,CAAC;AAI/G;;;GAGG;AACH,eAAO,MAAM,4BAA4B,6BAA6B,CAAC;AAMvE;;GAEG;AACH,MAAM,MAAM,+BAA+B,GACzC,qCAAqC,CAAC;AAExC;;GAEG;AACH,KAAK,cAAc,GAAG,KAAK,CAAC;AAE5B;;GAEG;AACH,MAAM,MAAM,8BAA8B,GAAG,KAAK,CAAC;AAEnD;;GAEG;AACH,KAAK,aAAa,GAAG,KAAK,CAAC;AAE3B;;;GAGG;AACH,MAAM,MAAM,iCAAiC,GAAG,SAAS,CACvD,OAAO,4BAA4B,EACnC,+BAA+B,GAAG,cAAc,EAChD,8BAA8B,GAAG,aAAa,CAC/C,CAAC;AAIF;;GAEG;AACH,MAAM,MAAM,+BAA+B,GAAG;IAC5C,6CAA6C;IAC7C,SAAS,EAAE,iCAAiC,CAAC;CAC9C,GAAG,wBAAwB,CAAC;AAI7B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,qBAAa,wBAAwB;;IACnC,QAAQ,CAAC,IAAI,EAAE,OAAO,4BAA4B,CAAC;IAMnD,YAAY,EACV,SAAS,EACT,GAAG,aAAa,EACjB,EAAE,+BAA+B,EASjC;IAED;;;;;;OAMG;IACH,oBAAoB,IAAI,iBAAiB,CAExC;CACF"}
|
|
@@ -1,16 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
3
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
4
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
5
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
6
|
-
};
|
|
7
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
8
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
9
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
10
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
|
-
};
|
|
12
|
-
var _ApiPlatformClientService_messenger, _ApiPlatformClientService_client;
|
|
13
|
-
import { ApiPlatformClient } from "./api/index.mjs";
|
|
1
|
+
import { ApiPlatformClient } from './api/index.js';
|
|
14
2
|
// === GENERAL ===
|
|
15
3
|
/**
|
|
16
4
|
* The name of the {@link ApiPlatformClientService}, used to namespace the
|
|
@@ -55,13 +43,14 @@ const MESSENGER_EXPOSED_METHODS = ['getApiPlatformClient'];
|
|
|
55
43
|
* ```
|
|
56
44
|
*/
|
|
57
45
|
export class ApiPlatformClientService {
|
|
46
|
+
name;
|
|
47
|
+
#messenger;
|
|
48
|
+
#client;
|
|
58
49
|
constructor({ messenger, ...clientOptions }) {
|
|
59
|
-
_ApiPlatformClientService_messenger.set(this, void 0);
|
|
60
|
-
_ApiPlatformClientService_client.set(this, void 0);
|
|
61
50
|
this.name = apiPlatformClientServiceName;
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
51
|
+
this.#messenger = messenger;
|
|
52
|
+
this.#client = new ApiPlatformClient(clientOptions);
|
|
53
|
+
this.#messenger.registerMethodActionHandlers(this, MESSENGER_EXPOSED_METHODS);
|
|
65
54
|
}
|
|
66
55
|
/**
|
|
67
56
|
* Returns the shared ApiPlatformClient instance.
|
|
@@ -71,8 +60,7 @@ export class ApiPlatformClientService {
|
|
|
71
60
|
* @returns The ApiPlatformClient instance (accounts, prices, token, tokens).
|
|
72
61
|
*/
|
|
73
62
|
getApiPlatformClient() {
|
|
74
|
-
return
|
|
63
|
+
return this.#client;
|
|
75
64
|
}
|
|
76
65
|
}
|
|
77
|
-
|
|
78
|
-
//# sourceMappingURL=ApiPlatformClientService.mjs.map
|
|
66
|
+
//# sourceMappingURL=ApiPlatformClientService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ApiPlatformClientService.js","sourceRoot":"","sources":["../src/ApiPlatformClientService.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAInD,kBAAkB;AAElB;;;GAGG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,0BAA0B,CAAC;AAEvE,oBAAoB;AAEpB,MAAM,yBAAyB,GAAG,CAAC,sBAAsB,CAAU,CAAC;AA2CpE,6BAA6B;AAE7B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,MAAM,OAAO,wBAAwB;IAC1B,IAAI,CAAsC;IAE1C,UAAU,CAAoC;IAE9C,OAAO,CAAoB;IAEpC,YAAY,EACV,SAAS,EACT,GAAG,aAAa,EACgB;QAChC,IAAI,CAAC,IAAI,GAAG,4BAA4B,CAAC;QACzC,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC5B,IAAI,CAAC,OAAO,GAAG,IAAI,iBAAiB,CAAC,aAAa,CAAC,CAAC;QAEpD,IAAI,CAAC,UAAU,CAAC,4BAA4B,CAC1C,IAAI,EACJ,yBAAyB,CAC1B,CAAC;IACJ,CAAC;IAED;;;;;;OAMG;IACH,oBAAoB;QAClB,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;CACF","sourcesContent":["import type { Messenger } from '@metamask/messenger';\n\nimport { ApiPlatformClient } from './api/index.js';\nimport type { ApiPlatformClientOptions } from './api/index.js';\nimport type { ApiPlatformClientServiceMethodActions } from './ApiPlatformClientService-method-action-types.js';\n\n// === GENERAL ===\n\n/**\n * The name of the {@link ApiPlatformClientService}, used to namespace the\n * service's actions and events.\n */\nexport const apiPlatformClientServiceName = 'ApiPlatformClientService';\n\n// === MESSENGER ===\n\nconst MESSENGER_EXPOSED_METHODS = ['getApiPlatformClient'] as const;\n\n/**\n * Actions that {@link ApiPlatformClientService} exposes to other consumers.\n */\nexport type ApiPlatformClientServiceActions =\n ApiPlatformClientServiceMethodActions;\n\n/**\n * Actions from other messengers that {@link ApiPlatformClientServiceMessenger} calls.\n */\ntype AllowedActions = never;\n\n/**\n * Events that {@link ApiPlatformClientService} exposes to other consumers.\n */\nexport type ApiPlatformClientServiceEvents = never;\n\n/**\n * Events from other messengers that {@link ApiPlatformClientService} subscribes to.\n */\ntype AllowedEvents = never;\n\n/**\n * The messenger which is restricted to actions and events accessed by\n * {@link ApiPlatformClientService}.\n */\nexport type ApiPlatformClientServiceMessenger = Messenger<\n typeof apiPlatformClientServiceName,\n ApiPlatformClientServiceActions | AllowedActions,\n ApiPlatformClientServiceEvents | AllowedEvents\n>;\n\n// === SERVICE OPTIONS ===\n\n/**\n * Options for constructing {@link ApiPlatformClientService}.\n */\nexport type ApiPlatformClientServiceOptions = {\n /** The messenger suited for this service. */\n messenger: ApiPlatformClientServiceMessenger;\n} & ApiPlatformClientOptions;\n\n// === SERVICE DEFINITION ===\n\n/**\n * Service that provides access to {@link ApiPlatformClient} via the messenger.\n *\n * Consumers obtain the client by calling the `ApiPlatformClientService:getApiPlatformClient`\n * action, then use it for accounts, prices, token, and tokens API calls.\n *\n * @example\n *\n * ```ts\n * import { Messenger } from '@metamask/messenger';\n * import {\n * ApiPlatformClientService,\n * type ApiPlatformClientServiceActions,\n * type ApiPlatformClientServiceEvents,\n * } from '@metamask/core-backend';\n *\n * const rootMessenger = new Messenger<'Root', ApiPlatformClientServiceActions, ApiPlatformClientServiceEvents>({ namespace: 'Root' });\n * const serviceMessenger = new Messenger<\n * 'ApiPlatformClientService',\n * ApiPlatformClientServiceActions,\n * ApiPlatformClientServiceEvents,\n * typeof rootMessenger\n * >({ namespace: 'ApiPlatformClientService', parent: rootMessenger });\n *\n * new ApiPlatformClientService({\n * messenger: serviceMessenger,\n * clientProduct: 'metamask-extension',\n * getBearerToken: async () => token,\n * });\n *\n * const client = rootMessenger.call('ApiPlatformClientService:getApiPlatformClient');\n * const balances = await client.accounts.fetchV5MultiAccountBalances(accountIds);\n * ```\n */\nexport class ApiPlatformClientService {\n readonly name: typeof apiPlatformClientServiceName;\n\n readonly #messenger: ApiPlatformClientServiceMessenger;\n\n readonly #client: ApiPlatformClient;\n\n constructor({\n messenger,\n ...clientOptions\n }: ApiPlatformClientServiceOptions) {\n this.name = apiPlatformClientServiceName;\n this.#messenger = messenger;\n this.#client = new ApiPlatformClient(clientOptions);\n\n this.#messenger.registerMethodActionHandlers(\n this,\n MESSENGER_EXPOSED_METHODS,\n );\n }\n\n /**\n * Returns the shared ApiPlatformClient instance.\n *\n * Use this via the messenger: `messenger.call('ApiPlatformClientService:getApiPlatformClient')`.\n *\n * @returns The ApiPlatformClient instance (accounts, prices, token, tokens).\n */\n getApiPlatformClient(): ApiPlatformClient {\n return this.#client;\n }\n}\n"]}
|
|
@@ -33,13 +33,13 @@
|
|
|
33
33
|
* await client.prices.invalidatePrices(); // Domain-specific via sub-client
|
|
34
34
|
* ```
|
|
35
35
|
*/
|
|
36
|
-
import { QueryClient } from
|
|
37
|
-
import type { QueryKey } from
|
|
38
|
-
import { AccountsApiClient } from
|
|
39
|
-
import { PricesApiClient } from
|
|
40
|
-
import type { ApiPlatformClientOptions } from
|
|
41
|
-
import { TokenApiClient } from
|
|
42
|
-
import { TokensApiClient } from
|
|
36
|
+
import { QueryClient } from '@tanstack/query-core';
|
|
37
|
+
import type { QueryKey } from '@tanstack/query-core';
|
|
38
|
+
import { AccountsApiClient } from './accounts/index.js';
|
|
39
|
+
import { PricesApiClient } from './prices/index.js';
|
|
40
|
+
import type { ApiPlatformClientOptions } from './shared-types.js';
|
|
41
|
+
import { TokenApiClient } from './token/index.js';
|
|
42
|
+
import { TokensApiClient } from './tokens/index.js';
|
|
43
43
|
/**
|
|
44
44
|
* MetaMask API Platform Client with TanStack Query caching.
|
|
45
45
|
* Provides cached access to all MetaMask backend APIs through a unified interface.
|
|
@@ -124,4 +124,4 @@ export declare class ApiPlatformClient {
|
|
|
124
124
|
* @returns A new ApiPlatformClient instance.
|
|
125
125
|
*/
|
|
126
126
|
export declare function createApiPlatformClient(options: ApiPlatformClientOptions): ApiPlatformClient;
|
|
127
|
-
//# sourceMappingURL=ApiPlatformClient.d.
|
|
127
|
+
//# sourceMappingURL=ApiPlatformClient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ApiPlatformClient.d.ts","sourceRoot":"","sources":["../../src/api/ApiPlatformClient.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAGrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAOpD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAMpD;;;;;;;;;GASG;AACH,qBAAa,iBAAiB;;IAC5B;;;OAGG;IACH,QAAQ,CAAC,QAAQ,EAAE,iBAAiB,CAAC;IAErC;;;OAGG;IACH,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAC;IAEjC;;;OAGG;IACH,QAAQ,CAAC,KAAK,EAAE,cAAc,CAAC;IAE/B;;;OAGG;IACH,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAC;IAOjC,YAAY,OAAO,EAAE,wBAAwB,EA2B5C;IAMD;;;;OAIG;IACH,IAAI,WAAW,IAAI,WAAW,CAE7B;IAED;;;;;OAKG;IACH,aAAa,CAAC,UAAU,EAAE,QAAQ,EAAE,QAAQ,GAAG,UAAU,GAAG,SAAS,CAEpE;IAED;;;;;OAKG;IACH,aAAa,CAAC,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,GAAG,IAAI,CAEpE;IAED;;;;;OAKG;IACH,UAAU,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAEtC;IAED;;OAEG;IACH,KAAK,IAAI,IAAI,CAEZ;IAED;;OAEG;IACG,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC,CAEnC;IAED;;;;;;OAMG;IACG,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC,CAIzC;CACF;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,wBAAwB,GAChC,iBAAiB,CAEnB"}
|
|
@@ -33,26 +33,14 @@
|
|
|
33
33
|
* await client.prices.invalidatePrices(); // Domain-specific via sub-client
|
|
34
34
|
* ```
|
|
35
35
|
*/
|
|
36
|
-
|
|
37
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
38
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
39
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
40
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
41
|
-
};
|
|
42
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
43
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
44
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
45
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
46
|
-
};
|
|
47
|
-
var _ApiPlatformClient_sharedQueryClient;
|
|
48
|
-
import { QueryClient } from "@tanstack/query-core";
|
|
36
|
+
import { QueryClient } from '@tanstack/query-core';
|
|
49
37
|
// Import API clients from subfolders
|
|
50
|
-
import { AccountsApiClient } from
|
|
51
|
-
import { authQueryKeys } from
|
|
52
|
-
import { PricesApiClient } from
|
|
53
|
-
import { STALE_TIMES, GC_TIMES, shouldRetry, calculateRetryDelay } from
|
|
54
|
-
import { TokenApiClient } from
|
|
55
|
-
import { TokensApiClient } from
|
|
38
|
+
import { AccountsApiClient } from './accounts/index.js';
|
|
39
|
+
import { authQueryKeys } from './base-client.js';
|
|
40
|
+
import { PricesApiClient } from './prices/index.js';
|
|
41
|
+
import { STALE_TIMES, GC_TIMES, shouldRetry, calculateRetryDelay, } from './shared-types.js';
|
|
42
|
+
import { TokenApiClient } from './token/index.js';
|
|
43
|
+
import { TokensApiClient } from './tokens/index.js';
|
|
56
44
|
// ============================================================================
|
|
57
45
|
// UNIFIED API CLIENT
|
|
58
46
|
// ============================================================================
|
|
@@ -67,29 +55,50 @@ import { TokensApiClient } from "./tokens/index.mjs";
|
|
|
67
55
|
* - `client.tokens` - Tokens API (bulk asset operations, supported networks)
|
|
68
56
|
*/
|
|
69
57
|
export class ApiPlatformClient {
|
|
58
|
+
/**
|
|
59
|
+
* Accounts API client.
|
|
60
|
+
* Provides methods for balances, transactions, relationships, NFTs, and token discovery.
|
|
61
|
+
*/
|
|
62
|
+
accounts;
|
|
63
|
+
/**
|
|
64
|
+
* Prices API client.
|
|
65
|
+
* Provides methods for spot prices, exchange rates, and historical prices.
|
|
66
|
+
*/
|
|
67
|
+
prices;
|
|
68
|
+
/**
|
|
69
|
+
* Token API client.
|
|
70
|
+
* Provides methods for token metadata, networks, trending tokens, and top assets.
|
|
71
|
+
*/
|
|
72
|
+
token;
|
|
73
|
+
/**
|
|
74
|
+
* Tokens API client.
|
|
75
|
+
* Provides methods for bulk asset operations and supported networks.
|
|
76
|
+
*/
|
|
77
|
+
tokens;
|
|
78
|
+
/**
|
|
79
|
+
* Shared QueryClient instance used by all sub-clients.
|
|
80
|
+
*/
|
|
81
|
+
#sharedQueryClient;
|
|
70
82
|
constructor(options) {
|
|
71
|
-
/**
|
|
72
|
-
* Shared QueryClient instance used by all sub-clients.
|
|
73
|
-
*/
|
|
74
|
-
_ApiPlatformClient_sharedQueryClient.set(this, void 0);
|
|
75
83
|
// Create or use provided QueryClient - shared by all sub-clients
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
84
|
+
this.#sharedQueryClient =
|
|
85
|
+
options.queryClient ??
|
|
86
|
+
new QueryClient({
|
|
87
|
+
defaultOptions: {
|
|
88
|
+
queries: {
|
|
89
|
+
staleTime: STALE_TIMES.DEFAULT,
|
|
90
|
+
gcTime: GC_TIMES.DEFAULT,
|
|
91
|
+
retry: shouldRetry,
|
|
92
|
+
retryDelay: calculateRetryDelay,
|
|
93
|
+
refetchOnWindowFocus: false,
|
|
94
|
+
networkMode: 'always',
|
|
95
|
+
},
|
|
86
96
|
},
|
|
87
|
-
}
|
|
88
|
-
}), "f");
|
|
97
|
+
});
|
|
89
98
|
// Pass the shared QueryClient to all sub-clients
|
|
90
99
|
const sharedOptions = {
|
|
91
100
|
...options,
|
|
92
|
-
queryClient:
|
|
101
|
+
queryClient: this.#sharedQueryClient,
|
|
93
102
|
};
|
|
94
103
|
this.accounts = new AccountsApiClient(sharedOptions);
|
|
95
104
|
this.prices = new PricesApiClient(sharedOptions);
|
|
@@ -105,7 +114,7 @@ export class ApiPlatformClient {
|
|
|
105
114
|
* @returns The underlying QueryClient instance.
|
|
106
115
|
*/
|
|
107
116
|
get queryClient() {
|
|
108
|
-
return
|
|
117
|
+
return this.#sharedQueryClient;
|
|
109
118
|
}
|
|
110
119
|
/**
|
|
111
120
|
* Get cached data for a query key.
|
|
@@ -114,7 +123,7 @@ export class ApiPlatformClient {
|
|
|
114
123
|
* @returns The cached data or undefined.
|
|
115
124
|
*/
|
|
116
125
|
getCachedData(queryKey) {
|
|
117
|
-
return
|
|
126
|
+
return this.#sharedQueryClient.getQueryData(queryKey);
|
|
118
127
|
}
|
|
119
128
|
/**
|
|
120
129
|
* Set cached data for a query key.
|
|
@@ -123,7 +132,7 @@ export class ApiPlatformClient {
|
|
|
123
132
|
* @param data - The data to cache.
|
|
124
133
|
*/
|
|
125
134
|
setCachedData(queryKey, data) {
|
|
126
|
-
|
|
135
|
+
this.#sharedQueryClient.setQueryData(queryKey, data);
|
|
127
136
|
}
|
|
128
137
|
/**
|
|
129
138
|
* Check if a query is currently fetching.
|
|
@@ -132,19 +141,19 @@ export class ApiPlatformClient {
|
|
|
132
141
|
* @returns True if the query is currently fetching.
|
|
133
142
|
*/
|
|
134
143
|
isFetching(queryKey) {
|
|
135
|
-
return
|
|
144
|
+
return this.#sharedQueryClient.isFetching({ queryKey }) > 0;
|
|
136
145
|
}
|
|
137
146
|
/**
|
|
138
147
|
* Clear all cached data across all sub-clients.
|
|
139
148
|
*/
|
|
140
149
|
clear() {
|
|
141
|
-
|
|
150
|
+
this.#sharedQueryClient.clear();
|
|
142
151
|
}
|
|
143
152
|
/**
|
|
144
153
|
* Invalidate all queries across all sub-clients.
|
|
145
154
|
*/
|
|
146
155
|
async invalidateAll() {
|
|
147
|
-
await
|
|
156
|
+
await this.#sharedQueryClient.invalidateQueries();
|
|
148
157
|
}
|
|
149
158
|
/**
|
|
150
159
|
* Invalidate the cached auth token.
|
|
@@ -154,12 +163,11 @@ export class ApiPlatformClient {
|
|
|
154
163
|
* the cached value, ensuring the next request fetches a fresh token immediately.
|
|
155
164
|
*/
|
|
156
165
|
async invalidateAuthToken() {
|
|
157
|
-
await
|
|
166
|
+
await this.#sharedQueryClient.resetQueries({
|
|
158
167
|
queryKey: authQueryKeys.bearerToken(),
|
|
159
168
|
});
|
|
160
169
|
}
|
|
161
170
|
}
|
|
162
|
-
_ApiPlatformClient_sharedQueryClient = new WeakMap();
|
|
163
171
|
/**
|
|
164
172
|
* Factory function to create an ApiPlatformClient.
|
|
165
173
|
*
|
|
@@ -169,4 +177,4 @@ _ApiPlatformClient_sharedQueryClient = new WeakMap();
|
|
|
169
177
|
export function createApiPlatformClient(options) {
|
|
170
178
|
return new ApiPlatformClient(options);
|
|
171
179
|
}
|
|
172
|
-
//# sourceMappingURL=ApiPlatformClient.
|
|
180
|
+
//# sourceMappingURL=ApiPlatformClient.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApiPlatformClient.
|
|
1
|
+
{"version":3,"file":"ApiPlatformClient.js","sourceRoot":"","sources":["../../src/api/ApiPlatformClient.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAGnD,qCAAqC;AACrC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EACL,WAAW,EACX,QAAQ,EACR,WAAW,EACX,mBAAmB,GACpB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,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,OAAO,IAAI,CAAC,kBAAkB,CAAC,YAAY,CAAa,QAAQ,CAAC,CAAC;IACpE,CAAC;IAED;;;;;OAKG;IACH,aAAa,CAAa,QAAkB,EAAE,IAAgB;QAC5D,IAAI,CAAC,kBAAkB,CAAC,YAAY,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;IACvD,CAAC;IAED;;;;;OAKG;IACH,UAAU,CAAC,QAAkB;QAC3B,OAAO,IAAI,CAAC,kBAAkB,CAAC,UAAU,CAAC,EAAE,QAAQ,EAAE,CAAC,GAAG,CAAC,CAAC;IAC9D,CAAC;IAED;;OAEG;IACH,KAAK;QACH,IAAI,CAAC,kBAAkB,CAAC,KAAK,EAAE,CAAC;IAClC,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,aAAa;QACjB,MAAM,IAAI,CAAC,kBAAkB,CAAC,iBAAiB,EAAE,CAAC;IACpD,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,mBAAmB;QACvB,MAAM,IAAI,CAAC,kBAAkB,CAAC,YAAY,CAAC;YACzC,QAAQ,EAAE,aAAa,CAAC,WAAW,EAAE;SACtC,CAAC,CAAC;IACL,CAAC;CACF;AAED;;;;;GAKG;AACH,MAAM,UAAU,uBAAuB,CACrC,OAAiC;IAEjC,OAAO,IAAI,iBAAiB,CAAC,OAAO,CAAC,CAAC;AACxC,CAAC","sourcesContent":["/**\n * ApiPlatformClient - MetaMask API Platform Client\n *\n * A comprehensive API client that uses @tanstack/query-core directly for:\n * - Automatic request deduplication\n * - Intelligent caching\n * - Automatic retries with exponential backoff\n *\n * Provides unified access to all MetaMask backend APIs:\n * - Accounts API (accounts.api.cx.metamask.io)\n * - Price API (price.api.cx.metamask.io)\n * - Token API (token.api.cx.metamask.io)\n * - Tokens API (tokens.api.cx.metamask.io)\n *\n * @example\n * ```typescript\n * const client = new ApiPlatformClient({\n * clientProduct: 'metamask-extension',\n * getBearerToken: async () => token,\n * });\n *\n * // Access API methods through sub-clients\n * const networks = await client.accounts.fetchV2SupportedNetworks();\n * const balances = await client.accounts.fetchV5MultiAccountBalances(accountIds);\n * const prices = await client.prices.fetchV3SpotPrices(assetIds);\n * const tokenList = await client.token.fetchTokenList(1);\n * const assets = await client.tokens.fetchV3Assets(assetIds);\n *\n * // Cache management\n * await client.invalidateAll(); // Invalidate all caches\n * await client.invalidateAuthToken(); // Invalidate auth token\n * await client.accounts.invalidateBalances(); // Domain-specific via sub-client\n * await client.prices.invalidatePrices(); // Domain-specific via sub-client\n * ```\n */\n\nimport { QueryClient } from '@tanstack/query-core';\nimport type { QueryKey } from '@tanstack/query-core';\n\n// Import API clients from subfolders\nimport { AccountsApiClient } from './accounts/index.js';\nimport { authQueryKeys } from './base-client.js';\nimport { PricesApiClient } from './prices/index.js';\nimport {\n STALE_TIMES,\n GC_TIMES,\n shouldRetry,\n calculateRetryDelay,\n} from './shared-types.js';\nimport type { ApiPlatformClientOptions } from './shared-types.js';\nimport { TokenApiClient } from './token/index.js';\nimport { TokensApiClient } from './tokens/index.js';\n\n// ============================================================================\n// UNIFIED API CLIENT\n// ============================================================================\n\n/**\n * MetaMask API Platform Client with TanStack Query caching.\n * Provides cached access to all MetaMask backend APIs through a unified interface.\n *\n * Access API methods through the sub-clients:\n * - `client.accounts` - Accounts API (balances, transactions, NFTs, etc.)\n * - `client.prices` - Prices API (spot prices, exchange rates, historical prices)\n * - `client.token` - Token API (token metadata, trending, top gainers)\n * - `client.tokens` - Tokens API (bulk asset operations, supported networks)\n */\nexport class ApiPlatformClient {\n /**\n * Accounts API client.\n * Provides methods for balances, transactions, relationships, NFTs, and token discovery.\n */\n readonly accounts: AccountsApiClient;\n\n /**\n * Prices API client.\n * Provides methods for spot prices, exchange rates, and historical prices.\n */\n readonly prices: PricesApiClient;\n\n /**\n * Token API client.\n * Provides methods for token metadata, networks, trending tokens, and top assets.\n */\n readonly token: TokenApiClient;\n\n /**\n * Tokens API client.\n * Provides methods for bulk asset operations and supported networks.\n */\n readonly tokens: TokensApiClient;\n\n /**\n * Shared QueryClient instance used by all sub-clients.\n */\n readonly #sharedQueryClient: QueryClient;\n\n constructor(options: ApiPlatformClientOptions) {\n // Create or use provided QueryClient - shared by all sub-clients\n this.#sharedQueryClient =\n options.queryClient ??\n new QueryClient({\n defaultOptions: {\n queries: {\n staleTime: STALE_TIMES.DEFAULT,\n gcTime: GC_TIMES.DEFAULT,\n retry: shouldRetry,\n retryDelay: calculateRetryDelay,\n refetchOnWindowFocus: false,\n networkMode: 'always',\n },\n },\n });\n\n // Pass the shared QueryClient to all sub-clients\n const sharedOptions: ApiPlatformClientOptions = {\n ...options,\n queryClient: this.#sharedQueryClient,\n };\n\n this.accounts = new AccountsApiClient(sharedOptions);\n this.prices = new PricesApiClient(sharedOptions);\n this.token = new TokenApiClient(sharedOptions);\n this.tokens = new TokensApiClient(sharedOptions);\n }\n\n // ==========================================================================\n // CACHE MANAGEMENT (operates on shared QueryClient)\n // ==========================================================================\n\n /**\n * Get the underlying QueryClient (for advanced usage).\n *\n * @returns The underlying QueryClient instance.\n */\n get queryClient(): QueryClient {\n return this.#sharedQueryClient;\n }\n\n /**\n * Get cached data for a query key.\n *\n * @param queryKey - The query key to look up.\n * @returns The cached data or undefined.\n */\n getCachedData<CachedData>(queryKey: QueryKey): CachedData | undefined {\n return this.#sharedQueryClient.getQueryData<CachedData>(queryKey);\n }\n\n /**\n * Set cached data for a query key.\n *\n * @param queryKey - The query key to set data for.\n * @param data - The data to cache.\n */\n setCachedData<CachedData>(queryKey: QueryKey, data: CachedData): void {\n this.#sharedQueryClient.setQueryData(queryKey, data);\n }\n\n /**\n * Check if a query is currently fetching.\n *\n * @param queryKey - The query key to check.\n * @returns True if the query is currently fetching.\n */\n isFetching(queryKey: QueryKey): boolean {\n return this.#sharedQueryClient.isFetching({ queryKey }) > 0;\n }\n\n /**\n * Clear all cached data across all sub-clients.\n */\n clear(): void {\n this.#sharedQueryClient.clear();\n }\n\n /**\n * Invalidate all queries across all sub-clients.\n */\n async invalidateAll(): Promise<void> {\n await this.#sharedQueryClient.invalidateQueries();\n }\n\n /**\n * Invalidate the cached auth token.\n * Call this when the user logs out or the token expires.\n *\n * Uses resetQueries() instead of invalidateQueries() to completely remove\n * the cached value, ensuring the next request fetches a fresh token immediately.\n */\n async invalidateAuthToken(): Promise<void> {\n await this.#sharedQueryClient.resetQueries({\n queryKey: authQueryKeys.bearerToken(),\n });\n }\n}\n\n/**\n * Factory function to create an ApiPlatformClient.\n *\n * @param options - Configuration options for the client.\n * @returns A new ApiPlatformClient instance.\n */\nexport function createApiPlatformClient(\n options: ApiPlatformClientOptions,\n): ApiPlatformClient {\n return new ApiPlatformClient(options);\n}\n"]}
|
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
* - NFTs
|
|
11
11
|
* - Token discovery
|
|
12
12
|
*/
|
|
13
|
-
import type { FetchInfiniteQueryOptions, FetchQueryOptions } from
|
|
14
|
-
import { BaseApiClient } from
|
|
15
|
-
import type { FetchOptions } from
|
|
16
|
-
import type { V1SupportedNetworksResponse, V2SupportedNetworksResponse, V2ActiveNetworksResponse, V2BalancesResponse, V4BalancesResponse, V5BalancesResponse, V6BalancesResponse, V6VsCurrency, V1TransactionByHashResponse, V1AccountTransactionsResponse, V4MultiAccountTransactionsResponse, V1AccountRelationshipResult, V2NftsResponse, V2TokensResponse } from
|
|
13
|
+
import type { FetchInfiniteQueryOptions, FetchQueryOptions } from '@tanstack/query-core';
|
|
14
|
+
import { BaseApiClient } from '../base-client.js';
|
|
15
|
+
import type { FetchOptions } from '../shared-types.js';
|
|
16
|
+
import type { V1SupportedNetworksResponse, V2SupportedNetworksResponse, V2ActiveNetworksResponse, V2BalancesResponse, V4BalancesResponse, V5BalancesResponse, V6BalancesResponse, V6VsCurrency, V1TransactionByHashResponse, V1AccountTransactionsResponse, V4MultiAccountTransactionsResponse, V1AccountRelationshipResult, V2NftsResponse, V2TokensResponse } from './types.js';
|
|
17
17
|
/**
|
|
18
18
|
* Accounts API Client.
|
|
19
19
|
* Provides methods for interacting with the Accounts API.
|
|
@@ -497,4 +497,4 @@ export declare class AccountsApiClient extends BaseApiClient {
|
|
|
497
497
|
networks?: number[];
|
|
498
498
|
}, options?: FetchOptions): Promise<V2TokensResponse>;
|
|
499
499
|
}
|
|
500
|
-
//# sourceMappingURL=client.d.
|
|
500
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/api/accounts/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EACV,yBAAyB,EACzB,iBAAiB,EAElB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,aAAa,EAId,MAAM,mBAAmB,CAAC;AAE3B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,EACV,2BAA2B,EAC3B,2BAA2B,EAC3B,wBAAwB,EACxB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,YAAY,EACZ,2BAA2B,EAC3B,6BAA6B,EAC7B,kCAAkC,EAClC,2BAA2B,EAC3B,cAAc,EACd,gBAAgB,EACjB,MAAM,YAAY,CAAC;AAEpB;;;GAGG;AACH,qBAAa,iBAAkB,SAAQ,aAAa;IAKlD;;OAEG;IACG,kBAAkB,IAAI,OAAO,CAAC,IAAI,CAAC,CAIxC;IAED;;OAEG;IACG,kBAAkB,IAAI,OAAO,CAAC,IAAI,CAAC,CAIxC;IAMD;;;;;OAKG;IACH,kCAAkC,CAChC,OAAO,CAAC,EAAE,YAAY,GACrB,iBAAiB,CAAC,2BAA2B,CAAC,CAahD;IAED;;;;;OAKG;IACG,wBAAwB,CAC5B,OAAO,CAAC,EAAE,YAAY,GACrB,OAAO,CAAC,2BAA2B,CAAC,CAItC;IAED;;;;;OAKG;IACH,kCAAkC,CAChC,OAAO,CAAC,EAAE,YAAY,GACrB,iBAAiB,CAAC,2BAA2B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;;;;;OASG;IACG,kBAAkB,CACtB,OAAO,EAAE,MAAM,EACf,YAAY,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,EACvD,OAAO,CAAC,EAAE,YAAY,GACrB,OAAO,CAAC,cAAc,CAAC,CAOzB;IAMD;;;;;;;;OAQG;IACH,8BAA8B,CAC5B,OAAO,EAAE,MAAM,EACf,YAAY,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,EACtC,OAAO,CAAC,EAAE,YAAY,GACrB,iBAAiB,CAAC,gBAAgB,CAAC,CAiCrC;IAED;;;;;;;;OAQG;IACG,oBAAoB,CACxB,OAAO,EAAE,MAAM,EACf,YAAY,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,EACtC,OAAO,CAAC,EAAE,YAAY,GACrB,OAAO,CAAC,gBAAgB,CAAC,CAO3B;CACF"}
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
* - NFTs
|
|
11
11
|
* - Token discovery
|
|
12
12
|
*/
|
|
13
|
-
import { BaseApiClient, API_URLS, STALE_TIMES, GC_TIMES } from
|
|
14
|
-
import { getQueryOptionsOverrides } from
|
|
13
|
+
import { BaseApiClient, API_URLS, STALE_TIMES, GC_TIMES, } from '../base-client.js';
|
|
14
|
+
import { getQueryOptionsOverrides } from '../shared-types.js';
|
|
15
15
|
/**
|
|
16
16
|
* Accounts API Client.
|
|
17
17
|
* Provides methods for interacting with the Accounts API.
|
|
@@ -843,4 +843,4 @@ export class AccountsApiClient extends BaseApiClient {
|
|
|
843
843
|
return this.queryClient.fetchQuery(this.getV2AccountTokensQueryOptions(address, queryOptions, options));
|
|
844
844
|
}
|
|
845
845
|
}
|
|
846
|
-
//# sourceMappingURL=client.
|
|
846
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{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QG;IACH,KAAK,CAAC,oBAAoB,CACxB,OAAe,EACf,YAAsC,EACtC,OAAsB;QAEtB,IAAI,OAAO,KAAK,EAAE,EAAE,CAAC;YACnB,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC;QACtB,CAAC;QACD,OAAO,IAAI,CAAC,WAAW,CAAC,UAAU,CAChC,IAAI,CAAC,8BAA8B,CAAC,OAAO,EAAE,YAAY,EAAE,OAAO,CAAC,CACpE,CAAC;IACJ,CAAC;CACF","sourcesContent":["/**\n * Accounts API Client - accounts.api.cx.metamask.io\n *\n * Handles all account-related API calls including:\n * - Supported networks\n * - Active networks\n * - Balances (v2, v4, v5)\n * - Transactions\n * - Relationships\n * - NFTs\n * - Token discovery\n */\n\nimport type {\n FetchInfiniteQueryOptions,\n FetchQueryOptions,\n QueryFunctionContext,\n} from '@tanstack/query-core';\n\nimport {\n BaseApiClient,\n API_URLS,\n STALE_TIMES,\n GC_TIMES,\n} from '../base-client.js';\nimport { getQueryOptionsOverrides } from '../shared-types.js';\nimport type { FetchOptions } from '../shared-types.js';\nimport type {\n V1SupportedNetworksResponse,\n V2SupportedNetworksResponse,\n V2ActiveNetworksResponse,\n V2BalancesResponse,\n V4BalancesResponse,\n V5BalancesResponse,\n V6BalancesResponse,\n V6VsCurrency,\n V1TransactionByHashResponse,\n V1AccountTransactionsResponse,\n V4MultiAccountTransactionsResponse,\n V1AccountRelationshipResult,\n V2NftsResponse,\n V2TokensResponse,\n} from './types.js';\n\n/**\n * Accounts API Client.\n * Provides methods for interacting with the Accounts API.\n */\nexport class AccountsApiClient extends BaseApiClient {\n // ==========================================================================\n // CACHE MANAGEMENT\n // ==========================================================================\n\n /**\n * Invalidate all balance queries.\n */\n async invalidateBalances(): Promise<void> {\n await this.queryClient.invalidateQueries({\n queryKey: ['accounts', 'balances'],\n });\n }\n\n /**\n * Invalidate all account queries.\n */\n async invalidateAccounts(): Promise<void> {\n await this.queryClient.invalidateQueries({\n queryKey: ['accounts'],\n });\n }\n\n // ==========================================================================\n // SUPPORTED NETWORKS\n // ==========================================================================\n\n /**\n * Returns the TanStack Query options object for v1 supported networks.\n *\n * @param options - Fetch options including cache settings.\n * @returns TanStack Query options for use with useQuery, useSuspenseQuery, etc.\n */\n getV1SupportedNetworksQueryOptions(\n options?: FetchOptions,\n ): FetchQueryOptions<V1SupportedNetworksResponse> {\n return {\n queryKey: ['accounts', 'v1SupportedNetworks'],\n queryFn: ({ signal }: QueryFunctionContext) =>\n this.fetch<V1SupportedNetworksResponse>(\n API_URLS.ACCOUNTS,\n '/v1/supportedNetworks',\n { signal },\n ),\n ...getQueryOptionsOverrides(options),\n staleTime: options?.staleTime ?? STALE_TIMES.SUPPORTED_NETWORKS,\n gcTime: options?.gcTime ?? GC_TIMES.EXTENDED,\n };\n }\n\n /**\n * Get list of supported networks (v1 endpoint).\n *\n * @param options - Fetch options including cache settings.\n * @returns The list of supported networks.\n */\n async fetchV1SupportedNetworks(\n options?: FetchOptions,\n ): Promise<V1SupportedNetworksResponse> {\n return this.queryClient.fetchQuery(\n this.getV1SupportedNetworksQueryOptions(options),\n );\n }\n\n /**\n * Returns the TanStack Query options object for v2 supported networks.\n *\n * @param options - Fetch options including cache settings.\n * @returns TanStack Query options for use with useQuery, useSuspenseQuery, etc.\n */\n getV2SupportedNetworksQueryOptions(\n options?: FetchOptions,\n ): FetchQueryOptions<V2SupportedNetworksResponse> {\n return {\n queryKey: ['accounts', 'v2SupportedNetworks'],\n queryFn: ({ signal }: QueryFunctionContext) =>\n this.fetch<V2SupportedNetworksResponse>(\n API_URLS.ACCOUNTS,\n '/v2/supportedNetworks',\n { signal },\n ),\n ...getQueryOptionsOverrides(options),\n staleTime: options?.staleTime ?? STALE_TIMES.SUPPORTED_NETWORKS,\n gcTime: options?.gcTime ?? GC_TIMES.EXTENDED,\n };\n }\n\n /**\n * Get list of supported networks (v2 endpoint).\n *\n * @param options - Fetch options including cache settings.\n * @returns The list of supported networks.\n */\n async fetchV2SupportedNetworks(\n options?: FetchOptions,\n ): Promise<V2SupportedNetworksResponse> {\n return this.queryClient.fetchQuery(\n this.getV2SupportedNetworksQueryOptions(options),\n );\n }\n\n // ==========================================================================\n // ACTIVE NETWORKS\n // ==========================================================================\n\n /**\n * Returns the TanStack Query options object for v2 active networks.\n *\n * @param accountIds - Array of CAIP-10 account IDs.\n * @param queryOptions - Query filter options.\n * @param queryOptions.filterMMListTokens - Whether to filter MM list tokens.\n * @param queryOptions.networks - Networks to filter by.\n * @param options - Fetch options including cache settings.\n * @returns TanStack Query options for use with useQuery, useSuspenseQuery, etc.\n */\n getV2ActiveNetworksQueryOptions(\n accountIds: string[],\n queryOptions?: { filterMMListTokens?: boolean; networks?: string[] },\n options?: FetchOptions,\n ): FetchQueryOptions<V2ActiveNetworksResponse> {\n return {\n queryKey: [\n 'accounts',\n 'v2ActiveNetworks',\n {\n accountIds: [...accountIds].sort(),\n options: queryOptions && {\n ...queryOptions,\n networks:\n queryOptions.networks && [...queryOptions.networks].sort(),\n },\n },\n ],\n queryFn: async ({\n signal,\n }: QueryFunctionContext): Promise<V2ActiveNetworksResponse> => {\n if (accountIds.length === 0) {\n return { activeNetworks: [] };\n }\n return this.fetch<V2ActiveNetworksResponse>(\n API_URLS.ACCOUNTS,\n '/v2/activeNetworks',\n {\n signal,\n params: {\n accountIds,\n filterMMListTokens: queryOptions?.filterMMListTokens,\n networks: queryOptions?.networks,\n },\n },\n );\n },\n ...getQueryOptionsOverrides(options),\n staleTime: options?.staleTime ?? STALE_TIMES.NETWORKS,\n gcTime: options?.gcTime ?? GC_TIMES.DEFAULT,\n };\n }\n\n /**\n * Get active networks by CAIP-10 account IDs (v2 endpoint).\n *\n * @param accountIds - Array of CAIP-10 account IDs.\n * @param queryOptions - Query filter options.\n * @param queryOptions.filterMMListTokens - Whether to filter MM list tokens.\n * @param queryOptions.networks - Networks to filter by.\n * @param options - Fetch options including cache settings.\n * @returns The active networks response.\n */\n async fetchV2ActiveNetworks(\n accountIds: string[],\n queryOptions?: { filterMMListTokens?: boolean; networks?: string[] },\n options?: FetchOptions,\n ): Promise<V2ActiveNetworksResponse> {\n if (accountIds.length === 0) {\n return { activeNetworks: [] };\n }\n return this.queryClient.fetchQuery(\n this.getV2ActiveNetworksQueryOptions(accountIds, queryOptions, options),\n );\n }\n\n // ==========================================================================\n // BALANCES\n // ==========================================================================\n\n /**\n * Returns the TanStack Query options object for v2 balances.\n *\n * @param address - The account address.\n * @param queryOptions - Query filter options.\n * @param queryOptions.networks - Networks to filter by.\n * @param queryOptions.filterSupportedTokens - Whether to filter supported tokens.\n * @param queryOptions.includeTokenAddresses - Token addresses to include.\n * @param queryOptions.includeStakedAssets - Whether to include staked assets.\n * @param options - Fetch options including cache settings.\n * @returns TanStack Query options for use with useQuery, useSuspenseQuery, etc.\n */\n getV2BalancesQueryOptions(\n address: string,\n queryOptions?: {\n networks?: number[];\n filterSupportedTokens?: boolean;\n includeTokenAddresses?: string[];\n includeStakedAssets?: boolean;\n },\n options?: FetchOptions,\n ): FetchQueryOptions<V2BalancesResponse> {\n return {\n queryKey: [\n 'accounts',\n 'balances',\n 'v2',\n {\n address,\n options: queryOptions && {\n ...queryOptions,\n networks:\n queryOptions.networks && [...queryOptions.networks].sort(),\n includeTokenAddresses:\n queryOptions.includeTokenAddresses &&\n [...queryOptions.includeTokenAddresses].sort(),\n },\n },\n ],\n queryFn: async ({\n signal,\n }: QueryFunctionContext): Promise<V2BalancesResponse> => {\n if (address === '') {\n return { count: 0, balances: [], unprocessedNetworks: [] };\n }\n return this.fetch<V2BalancesResponse>(\n API_URLS.ACCOUNTS,\n `/v2/accounts/${address}/balances`,\n {\n signal,\n params: {\n networks: queryOptions?.networks,\n filterSupportedTokens: queryOptions?.filterSupportedTokens,\n includeTokenAddresses: queryOptions?.includeTokenAddresses,\n includeStakedAssets: queryOptions?.includeStakedAssets,\n },\n },\n );\n },\n ...getQueryOptionsOverrides(options),\n staleTime: options?.staleTime ?? STALE_TIMES.BALANCES,\n gcTime: options?.gcTime ?? GC_TIMES.DEFAULT,\n };\n }\n\n /**\n * Get account balances for a single address (v2 endpoint).\n *\n * @param address - The account address.\n * @param queryOptions - Query filter options.\n * @param queryOptions.networks - Networks to filter by.\n * @param queryOptions.filterSupportedTokens - Whether to filter supported tokens.\n * @param queryOptions.includeTokenAddresses - Token addresses to include.\n * @param queryOptions.includeStakedAssets - Whether to include staked assets.\n * @param options - Fetch options including cache settings.\n * @returns The account balances response.\n */\n async fetchV2Balances(\n address: string,\n queryOptions?: {\n networks?: number[];\n filterSupportedTokens?: boolean;\n includeTokenAddresses?: string[];\n includeStakedAssets?: boolean;\n },\n options?: FetchOptions,\n ): Promise<V2BalancesResponse> {\n if (address === '') {\n return { count: 0, balances: [], unprocessedNetworks: [] };\n }\n return this.queryClient.fetchQuery(\n this.getV2BalancesQueryOptions(address, queryOptions, options),\n );\n }\n\n /**\n * Returns the TanStack Query options object for v4 multi-account balances.\n *\n * @param accountAddresses - Array of account addresses.\n * @param queryOptions - Query filter options.\n * @param queryOptions.networks - Networks to filter by.\n * @param options - Fetch options including cache settings.\n * @returns TanStack Query options for use with useQuery, useSuspenseQuery, etc.\n */\n getV4MultiAccountBalancesQueryOptions(\n accountAddresses: string[],\n queryOptions?: { networks?: number[] },\n options?: FetchOptions,\n ): FetchQueryOptions<V4BalancesResponse> {\n return {\n queryKey: [\n 'accounts',\n 'balances',\n 'v4',\n {\n accountAddresses: [...accountAddresses].sort(),\n options: queryOptions && {\n ...queryOptions,\n networks:\n queryOptions.networks && [...queryOptions.networks].sort(),\n },\n },\n ],\n queryFn: async ({\n signal,\n }: QueryFunctionContext): Promise<V4BalancesResponse> => {\n if (accountAddresses.length === 0) {\n return { count: 0, balances: [], unprocessedNetworks: [] };\n }\n return this.fetch<V4BalancesResponse>(\n API_URLS.ACCOUNTS,\n '/v4/multiaccount/balances',\n {\n signal,\n params: {\n accountAddresses,\n networks: queryOptions?.networks,\n },\n },\n );\n },\n ...getQueryOptionsOverrides(options),\n staleTime: options?.staleTime ?? STALE_TIMES.BALANCES,\n gcTime: options?.gcTime ?? GC_TIMES.DEFAULT,\n };\n }\n\n /**\n * Get balances for multiple accounts (v4 endpoint).\n *\n * @param accountAddresses - Array of account addresses.\n * @param queryOptions - Query filter options.\n * @param queryOptions.networks - Networks to filter by.\n * @param options - Fetch options including cache settings.\n * @returns The multi-account balances response.\n */\n async fetchV4MultiAccountBalances(\n accountAddresses: string[],\n queryOptions?: { networks?: number[] },\n options?: FetchOptions,\n ): Promise<V4BalancesResponse> {\n if (accountAddresses.length === 0) {\n return { count: 0, balances: [], unprocessedNetworks: [] };\n }\n return this.queryClient.fetchQuery(\n this.getV4MultiAccountBalancesQueryOptions(\n accountAddresses,\n queryOptions,\n options,\n ),\n );\n }\n\n /**\n * Returns the TanStack Query options object for v5 multi-account balances.\n *\n * @param accountIds - Array of CAIP-10 account IDs.\n * @param queryOptions - Query filter options.\n * @param queryOptions.filterMMListTokens - Whether to filter MM list tokens.\n * @param queryOptions.networks - Networks to filter by.\n * @param queryOptions.includeStakedAssets - Whether to include staked assets.\n * @param options - Fetch options including cache settings.\n * @returns TanStack Query options for use with useQuery, useSuspenseQuery, etc.\n */\n getV5MultiAccountBalancesQueryOptions(\n accountIds: string[],\n queryOptions?: {\n filterMMListTokens?: boolean;\n networks?: string[];\n includeStakedAssets?: boolean;\n },\n options?: FetchOptions,\n ): FetchQueryOptions<V5BalancesResponse> {\n return {\n queryKey: [\n 'accounts',\n 'balances',\n 'v5',\n {\n accountIds: [...accountIds].sort(),\n options: queryOptions && {\n ...queryOptions,\n networks:\n queryOptions.networks && [...queryOptions.networks].sort(),\n },\n },\n ],\n queryFn: async ({\n signal,\n }: QueryFunctionContext): Promise<V5BalancesResponse> => {\n if (accountIds.length === 0) {\n return { count: 0, unprocessedNetworks: [], balances: [] };\n }\n return this.fetch<V5BalancesResponse>(\n API_URLS.ACCOUNTS,\n '/v5/multiaccount/balances',\n {\n signal,\n params: {\n accountIds,\n networks: queryOptions?.networks,\n filterMMListTokens: queryOptions?.filterMMListTokens,\n includeStakedAssets: queryOptions?.includeStakedAssets,\n },\n },\n );\n },\n ...getQueryOptionsOverrides(options),\n staleTime: options?.staleTime ?? STALE_TIMES.BALANCES,\n gcTime: options?.gcTime ?? GC_TIMES.DEFAULT,\n };\n }\n\n /**\n * Get balances for multiple accounts using CAIP-10 IDs (v5 endpoint).\n *\n * @param accountIds - Array of CAIP-10 account IDs.\n * @param queryOptions - Query filter options.\n * @param queryOptions.filterMMListTokens - Whether to filter MM list tokens.\n * @param queryOptions.networks - Networks to filter by.\n * @param queryOptions.includeStakedAssets - Whether to include staked assets.\n * @param options - Fetch options including cache settings.\n * @returns The multi-account balances response.\n */\n async fetchV5MultiAccountBalances(\n accountIds: string[],\n queryOptions?: {\n filterMMListTokens?: boolean;\n networks?: string[];\n includeStakedAssets?: boolean;\n },\n options?: FetchOptions,\n ): Promise<V5BalancesResponse> {\n if (accountIds.length === 0) {\n return { count: 0, unprocessedNetworks: [], balances: [] };\n }\n return this.queryClient.fetchQuery(\n this.getV5MultiAccountBalancesQueryOptions(\n accountIds,\n queryOptions,\n options,\n ),\n );\n }\n\n /**\n * Returns the TanStack Query options object for v6 multi-account balances.\n * The v6 endpoint returns token balances and, optionally, DeFi positions and\n * spot prices.\n *\n * @param accountIds - Array of CAIP-10 account IDs.\n * @param queryOptions - Query filter options.\n * @param queryOptions.networks - Comma-separated CAIP-2 chain IDs to filter by.\n * @param queryOptions.filterSupportedTokens - Whether to filter the assets to only tokens existing in the Token API.\n * @param queryOptions.startTimestamp - Start timestamp (epoch) from which to return results.\n * @param queryOptions.endTimestamp - End timestamp (epoch) for which to return results.\n * @param queryOptions.includeLabels - Whether to include asset metadata labels in the response.\n * @param queryOptions.includeCanonicalHead - Whether to include the canonical head asset ID in the response.\n * @param queryOptions.includeDeFiBalances - Whether to include DeFi positions (token balances are always returned).\n * @param queryOptions.forceFetchDeFiPositions - Whether to fetch DeFi positions for all accounts, skipping the cached non-DeFi-user check.\n * @param queryOptions.includePrices - Whether to include spot prices for each token and DeFi position asset.\n * @param queryOptions.vsCurrency - Quote currency for spot prices when `includePrices` is true (default `usd`).\n * @param queryOptions.includeAssetIds - ERC-20 CAIP-19 asset IDs to confirm detection for; undetected IDs are returned in `unprocessedIncludeAssetIds`.\n * @param queryOptions.excludeAssetIds - ERC-20 CAIP-19 asset IDs to exclude from balance results.\n * @param options - Fetch options including cache settings.\n * @returns TanStack Query options for use with useQuery, useSuspenseQuery, etc.\n */\n getV6MultiAccountBalancesQueryOptions(\n accountIds: string[],\n queryOptions?: {\n networks?: string[];\n filterSupportedTokens?: boolean;\n startTimestamp?: number;\n endTimestamp?: number;\n includeLabels?: boolean;\n includeCanonicalHead?: boolean;\n includeDeFiBalances?: boolean;\n forceFetchDeFiPositions?: boolean;\n includePrices?: boolean;\n vsCurrency?: V6VsCurrency;\n includeAssetIds?: string[];\n excludeAssetIds?: string[];\n },\n options?: FetchOptions,\n ): FetchQueryOptions<V6BalancesResponse> {\n return {\n queryKey: [\n 'accounts',\n 'balances',\n 'v6',\n {\n accountIds: [...accountIds].sort(),\n options: queryOptions && {\n ...queryOptions,\n networks:\n queryOptions.networks && [...queryOptions.networks].sort(),\n includeAssetIds:\n queryOptions.includeAssetIds &&\n [...queryOptions.includeAssetIds].sort(),\n excludeAssetIds:\n queryOptions.excludeAssetIds &&\n [...queryOptions.excludeAssetIds].sort(),\n },\n },\n ],\n queryFn: async ({\n signal,\n }: QueryFunctionContext): Promise<V6BalancesResponse> => {\n if (accountIds.length === 0) {\n return {\n unprocessedNetworks: [],\n unprocessedIncludeAssetIds: [],\n balances: [],\n };\n }\n return this.fetch<V6BalancesResponse>(\n API_URLS.ACCOUNTS,\n '/v6/multiaccount/balances',\n {\n signal,\n params: {\n accountIds,\n networks: queryOptions?.networks,\n filterSupportedTokens: queryOptions?.filterSupportedTokens,\n startTimestamp: queryOptions?.startTimestamp,\n endTimestamp: queryOptions?.endTimestamp,\n includeLabels: queryOptions?.includeLabels,\n includeCanonicalHead: queryOptions?.includeCanonicalHead,\n includeDeFiBalances: queryOptions?.includeDeFiBalances,\n forceFetchDeFiPositions: queryOptions?.forceFetchDeFiPositions,\n includePrices: queryOptions?.includePrices,\n vsCurrency: queryOptions?.vsCurrency,\n includeAssetIds: queryOptions?.includeAssetIds,\n excludeAssetIds: queryOptions?.excludeAssetIds,\n },\n },\n );\n },\n ...getQueryOptionsOverrides(options),\n staleTime: options?.staleTime ?? STALE_TIMES.BALANCES,\n gcTime: options?.gcTime ?? GC_TIMES.DEFAULT,\n };\n }\n\n /**\n * Get balances and DeFi positions for multiple accounts using CAIP-10 IDs\n * (v6 endpoint).\n *\n * @param accountIds - Array of CAIP-10 account IDs.\n * @param queryOptions - Query filter options.\n * @param queryOptions.networks - Comma-separated CAIP-2 chain IDs to filter by.\n * @param queryOptions.filterSupportedTokens - Whether to filter the assets to only tokens existing in the Token API.\n * @param queryOptions.startTimestamp - Start timestamp (epoch) from which to return results.\n * @param queryOptions.endTimestamp - End timestamp (epoch) for which to return results.\n * @param queryOptions.includeLabels - Whether to include asset metadata labels in the response.\n * @param queryOptions.includeCanonicalHead - Whether to include the canonical head asset ID in the response.\n * @param queryOptions.includeDeFiBalances - Whether to include DeFi positions (token balances are always returned).\n * @param queryOptions.forceFetchDeFiPositions - Whether to fetch DeFi positions for all accounts, skipping the cached non-DeFi-user check.\n * @param queryOptions.includePrices - Whether to include spot prices for each token and DeFi position asset.\n * @param queryOptions.vsCurrency - Quote currency for spot prices when `includePrices` is true (default `usd`).\n * @param queryOptions.includeAssetIds - ERC-20 CAIP-19 asset IDs to confirm detection for; undetected IDs are returned in `unprocessedIncludeAssetIds`.\n * @param queryOptions.excludeAssetIds - ERC-20 CAIP-19 asset IDs to exclude from balance results.\n * @param options - Fetch options including cache settings.\n * @returns The multi-account balances and DeFi positions response.\n */\n async fetchV6MultiAccountBalances(\n accountIds: string[],\n queryOptions?: {\n networks?: string[];\n filterSupportedTokens?: boolean;\n startTimestamp?: number;\n endTimestamp?: number;\n includeLabels?: boolean;\n includeCanonicalHead?: boolean;\n includeDeFiBalances?: boolean;\n forceFetchDeFiPositions?: boolean;\n includePrices?: boolean;\n vsCurrency?: V6VsCurrency;\n includeAssetIds?: string[];\n excludeAssetIds?: string[];\n },\n options?: FetchOptions,\n ): Promise<V6BalancesResponse> {\n if (accountIds.length === 0) {\n return {\n unprocessedNetworks: [],\n unprocessedIncludeAssetIds: [],\n balances: [],\n };\n }\n return this.queryClient.fetchQuery(\n this.getV6MultiAccountBalancesQueryOptions(\n accountIds,\n queryOptions,\n options,\n ),\n );\n }\n\n // ==========================================================================\n // TRANSACTIONS\n // ==========================================================================\n\n /**\n * Returns the TanStack Query options object for v1 transaction by hash.\n *\n * @param chainId - The chain ID.\n * @param txHash - The transaction hash.\n * @param queryOptions - Query filter options.\n * @param queryOptions.includeLogs - Whether to include logs.\n * @param queryOptions.includeValueTransfers - Whether to include value transfers.\n * @param queryOptions.includeTxMetadata - Whether to include transaction metadata.\n * @param queryOptions.lang - Language for metadata.\n * @param options - Fetch options including cache settings.\n * @returns TanStack Query options for use with useQuery, useSuspenseQuery, etc.\n */\n getV1TransactionByHashQueryOptions(\n chainId: number,\n txHash: string,\n queryOptions?: {\n includeLogs?: boolean;\n includeValueTransfers?: boolean;\n includeTxMetadata?: boolean;\n lang?: string;\n },\n options?: FetchOptions,\n ): FetchQueryOptions<V1TransactionByHashResponse> {\n return {\n queryKey: [\n 'accounts',\n 'transactions',\n 'v1ByHash',\n { chainId, txHash, options: queryOptions },\n ],\n queryFn: ({ signal }: QueryFunctionContext) =>\n this.fetch<V1TransactionByHashResponse>(\n API_URLS.ACCOUNTS,\n `/v1/networks/${chainId}/transactions/${txHash}`,\n {\n signal,\n params: {\n includeLogs: queryOptions?.includeLogs,\n includeValueTransfers: queryOptions?.includeValueTransfers,\n includeTxMetadata: queryOptions?.includeTxMetadata,\n lang: queryOptions?.lang,\n },\n },\n ),\n ...getQueryOptionsOverrides(options),\n staleTime: options?.staleTime ?? STALE_TIMES.TRANSACTIONS,\n gcTime: options?.gcTime ?? GC_TIMES.DEFAULT,\n };\n }\n\n /**\n * Get a specific transaction by hash (v1 endpoint).\n *\n * @param chainId - The chain ID.\n * @param txHash - The transaction hash.\n * @param queryOptions - Query filter options.\n * @param queryOptions.includeLogs - Whether to include logs.\n * @param queryOptions.includeValueTransfers - Whether to include value transfers.\n * @param queryOptions.includeTxMetadata - Whether to include transaction metadata.\n * @param queryOptions.lang - Language for metadata.\n * @param options - Fetch options including cache settings.\n * @returns The transaction details.\n */\n async fetchV1TransactionByHash(\n chainId: number,\n txHash: string,\n queryOptions?: {\n includeLogs?: boolean;\n includeValueTransfers?: boolean;\n includeTxMetadata?: boolean;\n lang?: string;\n },\n options?: FetchOptions,\n ): Promise<V1TransactionByHashResponse> {\n return this.queryClient.fetchQuery(\n this.getV1TransactionByHashQueryOptions(\n chainId,\n txHash,\n queryOptions,\n options,\n ),\n );\n }\n\n /**\n * Returns the TanStack Query options object for v1 account transactions.\n *\n * @param address - The account address.\n * @param queryOptions - Query filter options.\n * @param queryOptions.chainIds - Chain IDs to filter by.\n * @param queryOptions.cursor - Pagination cursor.\n * @param queryOptions.startTimestamp - Start timestamp filter.\n * @param queryOptions.endTimestamp - End timestamp filter.\n * @param queryOptions.sortDirection - Sort direction (ASC/DESC).\n * @param options - Fetch options including cache settings.\n * @returns TanStack Query options for use with useQuery, useInfiniteQuery, useSuspenseQuery, etc.\n */\n getV1AccountTransactionsQueryOptions(\n address: string,\n queryOptions?: {\n chainIds?: string[];\n cursor?: string;\n startTimestamp?: number;\n endTimestamp?: number;\n sortDirection?: 'ASC' | 'DESC';\n },\n options?: FetchOptions,\n ): FetchQueryOptions<V1AccountTransactionsResponse> {\n return {\n queryKey: [\n 'accounts',\n 'transactions',\n 'v1Account',\n {\n address,\n options: queryOptions && {\n ...queryOptions,\n chainIds:\n queryOptions.chainIds && [...queryOptions.chainIds].sort(),\n },\n },\n ],\n queryFn: async ({\n signal,\n }: QueryFunctionContext): Promise<V1AccountTransactionsResponse> => {\n if (address === '') {\n return { data: [], pageInfo: { count: 0, hasNextPage: false } };\n }\n return this.fetch<V1AccountTransactionsResponse>(\n API_URLS.ACCOUNTS,\n `/v1/accounts/${address}/transactions`,\n {\n signal,\n params: {\n networks: queryOptions?.chainIds,\n cursor: queryOptions?.cursor,\n startTimestamp: queryOptions?.startTimestamp,\n endTimestamp: queryOptions?.endTimestamp,\n sortDirection: queryOptions?.sortDirection,\n },\n },\n );\n },\n ...getQueryOptionsOverrides(options),\n staleTime: options?.staleTime ?? STALE_TIMES.TRANSACTIONS,\n gcTime: options?.gcTime ?? GC_TIMES.DEFAULT,\n };\n }\n\n /**\n * Get account transactions (v1 endpoint).\n *\n * @param address - The account address.\n * @param queryOptions - Query filter options.\n * @param queryOptions.chainIds - Chain IDs to filter by.\n * @param queryOptions.cursor - Pagination cursor.\n * @param queryOptions.startTimestamp - Start timestamp filter.\n * @param queryOptions.endTimestamp - End timestamp filter.\n * @param queryOptions.sortDirection - Sort direction (ASC/DESC).\n * @param options - Fetch options including cache settings.\n * @returns The account transactions response.\n */\n async fetchV1AccountTransactions(\n address: string,\n queryOptions?: {\n chainIds?: string[];\n cursor?: string;\n startTimestamp?: number;\n endTimestamp?: number;\n sortDirection?: 'ASC' | 'DESC';\n },\n options?: FetchOptions,\n ): Promise<V1AccountTransactionsResponse> {\n if (address === '') {\n return { data: [], pageInfo: { count: 0, hasNextPage: false } };\n }\n return this.queryClient.fetchQuery(\n this.getV1AccountTransactionsQueryOptions(address, queryOptions, options),\n );\n }\n\n /**\n * Returns the TanStack Query options object for v4 multi-account transactions.\n * Use this with `queryClient.fetchQuery()`, `useQuery()`, `useInfiniteQuery()`,\n * `useSuspenseQuery()`, etc. for flexibility across query permutations.\n *\n * @param accountAddresses - Array of CAIP-10 account addresses.\n * @param queryOptions - Query filter options.\n * @param queryOptions.networks - Comma-separated CAIP-2 network IDs.\n * @param queryOptions.startTimestamp - Start timestamp (epoch) from which to return results.\n * @param queryOptions.endTimestamp - End timestamp (epoch) for which to return results.\n * @param queryOptions.cursor - Pagination cursor (deprecated, use after).\n * @param queryOptions.limit - Maximum number of transactions to request (default 50).\n * @param queryOptions.after - JWT containing the endCursor for the query.\n * @param queryOptions.before - JWT containing the startCursor for the query.\n * @param queryOptions.sortDirection - Sort direction (ASC/DESC).\n * @param queryOptions.includeLogs - Whether to include logs.\n * @param queryOptions.includeTxMetadata - Whether to include transaction metadata.\n * @param queryOptions.maxLogsPerTx - Maximum number of logs per transaction.\n * @param queryOptions.lang - Language for transaction category (default \"en\").\n * @param options - Fetch options including cache settings.\n * @returns Query options object compatible with fetchQuery/useQuery/useInfiniteQuery.\n */\n getV4MultiAccountTransactionsQueryOptions(\n accountAddresses: string[],\n queryOptions?: {\n networks?: string[];\n startTimestamp?: number;\n endTimestamp?: number;\n cursor?: string;\n limit?: number;\n after?: string;\n before?: string;\n sortDirection?: 'ASC' | 'DESC';\n includeLogs?: boolean;\n includeTxMetadata?: boolean;\n maxLogsPerTx?: number;\n lang?: string;\n },\n options?: FetchOptions,\n ): FetchQueryOptions<V4MultiAccountTransactionsResponse> {\n return {\n queryKey: [\n 'accounts',\n 'transactions',\n 'v4MultiAccount',\n {\n accountAddresses: [...accountAddresses].sort(),\n options: queryOptions && {\n ...queryOptions,\n networks:\n queryOptions.networks && [...queryOptions.networks].sort(),\n },\n },\n ],\n queryFn: ({ signal }: QueryFunctionContext) =>\n this.fetch<V4MultiAccountTransactionsResponse>(\n API_URLS.ACCOUNTS,\n '/v4/multiaccount/transactions',\n {\n signal,\n params: {\n accountAddresses,\n networks: queryOptions?.networks,\n startTimestamp: queryOptions?.startTimestamp,\n endTimestamp: queryOptions?.endTimestamp,\n cursor: queryOptions?.cursor,\n limit: queryOptions?.limit,\n after: queryOptions?.after,\n before: queryOptions?.before,\n sortDirection: queryOptions?.sortDirection,\n includeLogs: queryOptions?.includeLogs,\n includeTxMetadata: queryOptions?.includeTxMetadata,\n maxLogsPerTx: queryOptions?.maxLogsPerTx,\n lang: queryOptions?.lang,\n },\n },\n ),\n ...getQueryOptionsOverrides(options),\n staleTime: options?.staleTime ?? STALE_TIMES.TRANSACTIONS,\n gcTime: options?.gcTime ?? GC_TIMES.DEFAULT,\n };\n }\n\n /**\n * Returns TanStack Query options for v4 multi-account transactions,\n * designed for use with `useInfiniteQuery`.\n *\n * @param params - API endpoint parameters (excluding pagination cursors).\n * @param params.accountAddresses - Array of CAIP-10 account addresses.\n * @param params.networks - CAIP-2 network IDs to filter by.\n * @param params.startTimestamp - Start timestamp (epoch).\n * @param params.endTimestamp - End timestamp (epoch).\n * @param params.limit - Max transactions per page (default 50).\n * @param params.sortDirection - Sort direction (ASC/DESC).\n * @param params.includeLogs - Whether to include logs.\n * @param params.includeTxMetadata - Whether to include transaction metadata.\n * @param params.maxLogsPerTx - Max logs per transaction.\n * @param params.lang - Language for transaction category (default \"en\").\n * @param options - Fetch options including cache settings.\n * @returns Options object compatible with `useInfiniteQuery`.\n */\n getV4MultiAccountTransactionsInfiniteQueryOptions(\n params: {\n accountAddresses: string[];\n networks?: string[];\n startTimestamp?: number;\n endTimestamp?: number;\n limit?: number;\n sortDirection?: 'ASC' | 'DESC';\n includeLogs?: boolean;\n includeTxMetadata?: boolean;\n maxLogsPerTx?: number;\n lang?: string;\n },\n options?: FetchOptions,\n ): FetchInfiniteQueryOptions<\n V4MultiAccountTransactionsResponse,\n Error,\n V4MultiAccountTransactionsResponse,\n readonly unknown[],\n string | undefined\n > {\n return {\n queryKey: [\n 'accounts',\n 'transactions',\n 'v4MultiAccount',\n {\n accountAddresses: [...params.accountAddresses].sort(),\n networks: params.networks && [...params.networks].sort(),\n startTimestamp: params.startTimestamp,\n endTimestamp: params.endTimestamp,\n limit: params.limit,\n sortDirection: params.sortDirection,\n includeLogs: params.includeLogs,\n includeTxMetadata: params.includeTxMetadata,\n maxLogsPerTx: params.maxLogsPerTx,\n lang: params.lang,\n },\n ] as const,\n queryFn: ({\n pageParam,\n signal,\n }: {\n pageParam?: string;\n signal?: AbortSignal;\n }) =>\n this.fetch<V4MultiAccountTransactionsResponse>(\n API_URLS.ACCOUNTS,\n '/v4/multiaccount/transactions',\n {\n signal,\n params: {\n accountAddresses: params.accountAddresses,\n networks: params.networks,\n startTimestamp: params.startTimestamp,\n endTimestamp: params.endTimestamp,\n cursor: pageParam,\n limit: params.limit,\n sortDirection: params.sortDirection,\n includeLogs: params.includeLogs,\n includeTxMetadata: params.includeTxMetadata,\n maxLogsPerTx: params.maxLogsPerTx,\n lang: params.lang,\n },\n },\n ),\n getNextPageParam: ({ pageInfo }: V4MultiAccountTransactionsResponse) =>\n pageInfo.hasNextPage ? pageInfo.endCursor : undefined,\n initialPageParam: options?.initialPageParam,\n ...getQueryOptionsOverrides(options),\n staleTime: options?.staleTime ?? STALE_TIMES.TRANSACTIONS,\n gcTime: options?.gcTime ?? GC_TIMES.DEFAULT,\n };\n }\n\n /**\n * Get multi-account transactions (v4 endpoint).\n *\n * @param accountAddresses - Array of CAIP-10 account addresses.\n * @param queryOptions - Query filter options.\n * @param queryOptions.networks - Comma-separated CAIP-2 network IDs.\n * @param queryOptions.startTimestamp - Start timestamp (epoch) from which to return results.\n * @param queryOptions.endTimestamp - End timestamp (epoch) for which to return results.\n * @param queryOptions.cursor - Pagination cursor (deprecated, use after).\n * @param queryOptions.limit - Maximum number of transactions to request (default 50).\n * @param queryOptions.after - JWT containing the endCursor for the query.\n * @param queryOptions.before - JWT containing the startCursor for the query.\n * @param queryOptions.sortDirection - Sort direction (ASC/DESC).\n * @param queryOptions.includeLogs - Whether to include logs.\n * @param queryOptions.includeTxMetadata - Whether to include transaction metadata.\n * @param queryOptions.maxLogsPerTx - Maximum number of logs per transaction.\n * @param queryOptions.lang - Language for transaction category (default \"en\").\n * @param options - Fetch options including cache settings.\n * @returns The multi-account transactions response.\n */\n async fetchV4MultiAccountTransactions(\n accountAddresses: string[],\n queryOptions?: {\n networks?: string[];\n startTimestamp?: number;\n endTimestamp?: number;\n cursor?: string;\n limit?: number;\n after?: string;\n before?: string;\n sortDirection?: 'ASC' | 'DESC';\n includeLogs?: boolean;\n includeTxMetadata?: boolean;\n maxLogsPerTx?: number;\n lang?: string;\n },\n options?: FetchOptions,\n ): Promise<V4MultiAccountTransactionsResponse> {\n return this.queryClient.fetchQuery(\n this.getV4MultiAccountTransactionsQueryOptions(\n accountAddresses,\n queryOptions,\n options,\n ),\n );\n }\n\n // ==========================================================================\n // RELATIONSHIPS\n // ==========================================================================\n\n /**\n * Returns the TanStack Query options object for v1 account relationship.\n *\n * @param chainId - The chain ID.\n * @param from - The from address.\n * @param to - The to address.\n * @param options - Fetch options including cache settings.\n * @returns TanStack Query options for use with useQuery, useSuspenseQuery, etc.\n */\n getV1AccountRelationshipQueryOptions(\n chainId: number,\n from: string,\n to: string,\n options?: FetchOptions,\n ): FetchQueryOptions<V1AccountRelationshipResult> {\n return {\n queryKey: ['accounts', 'v1Relationship', chainId, from, to],\n queryFn: async ({\n signal,\n }: QueryFunctionContext): Promise<V1AccountRelationshipResult> =>\n this.fetch<V1AccountRelationshipResult>(\n API_URLS.ACCOUNTS,\n `/v1/networks/${chainId}/accounts/${from}/relationships/${to}`,\n { signal },\n ),\n ...getQueryOptionsOverrides(options),\n staleTime: options?.staleTime ?? STALE_TIMES.DEFAULT,\n gcTime: options?.gcTime ?? GC_TIMES.DEFAULT,\n };\n }\n\n /**\n * Get account address relationship (v1 endpoint).\n *\n * @param chainId - The chain ID.\n * @param from - The from address.\n * @param to - The to address.\n * @param options - Fetch options including cache settings.\n * @returns The account relationship result.\n */\n async fetchV1AccountRelationship(\n chainId: number,\n from: string,\n to: string,\n options?: FetchOptions,\n ): Promise<V1AccountRelationshipResult> {\n return this.queryClient.fetchQuery(\n this.getV1AccountRelationshipQueryOptions(chainId, from, to, options),\n );\n }\n\n // ==========================================================================\n // NFTs\n // ==========================================================================\n\n /**\n * Returns the TanStack Query options object for v2 account NFTs.\n *\n * @param address - The account address.\n * @param queryOptions - Query filter options.\n * @param queryOptions.networks - Networks to filter by.\n * @param queryOptions.cursor - Pagination cursor.\n * @param options - Fetch options including cache settings.\n * @returns TanStack Query options for use with useQuery, useSuspenseQuery, etc.\n */\n getV2AccountNftsQueryOptions(\n address: string,\n queryOptions?: { networks?: number[]; cursor?: string },\n options?: FetchOptions,\n ): FetchQueryOptions<V2NftsResponse> {\n return {\n queryKey: [\n 'accounts',\n 'v2Nfts',\n {\n address,\n options: queryOptions && {\n ...queryOptions,\n networks:\n queryOptions.networks && [...queryOptions.networks].sort(),\n },\n },\n ],\n queryFn: async ({\n signal,\n }: QueryFunctionContext): Promise<V2NftsResponse> => {\n if (address === '') {\n return { data: [], pageInfo: { count: 0, hasNextPage: false } };\n }\n return this.fetch<V2NftsResponse>(\n API_URLS.ACCOUNTS,\n `/v2/accounts/${address}/nfts`,\n {\n signal,\n params: {\n networks: queryOptions?.networks,\n cursor: queryOptions?.cursor,\n },\n },\n );\n },\n ...getQueryOptionsOverrides(options),\n staleTime: options?.staleTime ?? STALE_TIMES.DEFAULT,\n gcTime: options?.gcTime ?? GC_TIMES.DEFAULT,\n };\n }\n\n /**\n * Get NFTs owned by an account (v2 endpoint).\n *\n * @param address - The account address.\n * @param queryOptions - Query filter options.\n * @param queryOptions.networks - Networks to filter by.\n * @param queryOptions.cursor - Pagination cursor.\n * @param options - Fetch options including cache settings.\n * @returns The NFTs response.\n */\n async fetchV2AccountNfts(\n address: string,\n queryOptions?: { networks?: number[]; cursor?: string },\n options?: FetchOptions,\n ): Promise<V2NftsResponse> {\n if (address === '') {\n return { data: [], pageInfo: { count: 0, hasNextPage: false } };\n }\n return this.queryClient.fetchQuery(\n this.getV2AccountNftsQueryOptions(address, queryOptions, options),\n );\n }\n\n // ==========================================================================\n // TOKEN DISCOVERY\n // ==========================================================================\n\n /**\n * Returns the TanStack Query options object for v2 account tokens.\n *\n * @param address - The account address.\n * @param queryOptions - Query filter options.\n * @param queryOptions.networks - Networks to filter by.\n * @param options - Fetch options including cache settings.\n * @returns TanStack Query options for use with useQuery, useSuspenseQuery, etc.\n */\n getV2AccountTokensQueryOptions(\n address: string,\n queryOptions?: { networks?: number[] },\n options?: FetchOptions,\n ): FetchQueryOptions<V2TokensResponse> {\n return {\n queryKey: [\n 'accounts',\n 'v2Tokens',\n {\n address,\n options: queryOptions && {\n ...queryOptions,\n networks:\n queryOptions.networks && [...queryOptions.networks].sort(),\n },\n },\n ],\n queryFn: async ({\n signal,\n }: QueryFunctionContext): Promise<V2TokensResponse> => {\n if (address === '') {\n return { data: [] };\n }\n return this.fetch<V2TokensResponse>(\n API_URLS.ACCOUNTS,\n `/v2/accounts/${address}/tokens`,\n {\n signal,\n params: { networks: queryOptions?.networks },\n },\n );\n },\n ...getQueryOptionsOverrides(options),\n staleTime: options?.staleTime ?? STALE_TIMES.DEFAULT,\n gcTime: options?.gcTime ?? GC_TIMES.DEFAULT,\n };\n }\n\n /**\n * Get ERC20 tokens detected for an account (v2 endpoint).\n *\n * @param address - The account address.\n * @param queryOptions - Query filter options.\n * @param queryOptions.networks - Networks to filter by.\n * @param options - Fetch options including cache settings.\n * @returns The tokens response.\n */\n async fetchV2AccountTokens(\n address: string,\n queryOptions?: { networks?: number[] },\n options?: FetchOptions,\n ): Promise<V2TokensResponse> {\n if (address === '') {\n return { data: [] };\n }\n return this.queryClient.fetchQuery(\n this.getV2AccountTokensQueryOptions(address, queryOptions, options),\n );\n }\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Accounts API barrel export.
|
|
3
3
|
*/
|
|
4
|
-
export { AccountsApiClient } from
|
|
5
|
-
export { V6_DEFI_POSITION_TYPES } from
|
|
6
|
-
export type { V5BalanceItem, V5BalancesResponse, V2BalanceItem, V2BalancesResponse, V4BalancesResponse, V6VsCurrency, V6DeFiPositionType, V6BalanceMetadata, V6TokenMetadata, V6BalanceItem, V6BalancesResponse, V1SupportedNetworksResponse, V2SupportedNetworksResponse, V2ActiveNetworksResponse, V1TransactionByHashResponse, V1AccountTransactionsResponse, V4MultiAccountTransactionsResponse, ValueTransfer, V1AccountRelationshipResult, NftItem, V2NftsResponse, TokenDiscoveryItem, V2TokensResponse, } from
|
|
7
|
-
//# sourceMappingURL=index.d.
|
|
4
|
+
export { AccountsApiClient } from './client.js';
|
|
5
|
+
export { V6_DEFI_POSITION_TYPES } from './types.js';
|
|
6
|
+
export type { V5BalanceItem, V5BalancesResponse, V2BalanceItem, V2BalancesResponse, V4BalancesResponse, V6VsCurrency, V6DeFiPositionType, V6BalanceMetadata, V6TokenMetadata, V6BalanceItem, V6BalancesResponse, V1SupportedNetworksResponse, V2SupportedNetworksResponse, V2ActiveNetworksResponse, V1TransactionByHashResponse, V1AccountTransactionsResponse, V4MultiAccountTransactionsResponse, ValueTransfer, V1AccountRelationshipResult, NftItem, V2NftsResponse, TokenDiscoveryItem, V2TokensResponse, } from './types.js';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|