@metamask-previews/core-backend 5.0.0-preview-fa81dffb → 5.0.0-preview-903db2da
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 +9 -0
- package/README.md +252 -1
- package/dist/api/ApiPlatformClient.cjs +173 -0
- package/dist/api/ApiPlatformClient.cjs.map +1 -0
- package/dist/api/ApiPlatformClient.d.cts +124 -0
- package/dist/api/ApiPlatformClient.d.cts.map +1 -0
- package/dist/api/ApiPlatformClient.d.mts +124 -0
- package/dist/api/ApiPlatformClient.d.mts.map +1 -0
- package/dist/api/ApiPlatformClient.mjs +168 -0
- package/dist/api/ApiPlatformClient.mjs.map +1 -0
- package/dist/api/accounts/client.cjs +492 -0
- package/dist/api/accounts/client.cjs.map +1 -0
- package/dist/api/accounts/client.d.cts +213 -0
- package/dist/api/accounts/client.d.cts.map +1 -0
- package/dist/api/accounts/client.d.mts +213 -0
- package/dist/api/accounts/client.d.mts.map +1 -0
- package/dist/api/accounts/client.mjs +488 -0
- package/dist/api/accounts/client.mjs.map +1 -0
- package/dist/api/accounts/index.cjs +9 -0
- package/dist/api/accounts/index.cjs.map +1 -0
- package/dist/api/accounts/index.d.cts +6 -0
- package/dist/api/accounts/index.d.cts.map +1 -0
- package/dist/api/accounts/index.d.mts +6 -0
- package/dist/api/accounts/index.d.mts.map +1 -0
- package/dist/api/accounts/index.mjs +5 -0
- package/dist/api/accounts/index.mjs.map +1 -0
- package/dist/api/accounts/types.cjs +7 -0
- package/dist/api/accounts/types.cjs.map +1 -0
- package/dist/api/accounts/types.d.cts +195 -0
- package/dist/api/accounts/types.d.cts.map +1 -0
- package/dist/api/accounts/types.d.mts +195 -0
- package/dist/api/accounts/types.d.mts.map +1 -0
- package/dist/api/accounts/types.mjs +6 -0
- package/dist/api/accounts/types.mjs.map +1 -0
- package/dist/api/base-client.cjs +121 -0
- package/dist/api/base-client.cjs.map +1 -0
- package/dist/api/base-client.d.cts +43 -0
- package/dist/api/base-client.d.cts.map +1 -0
- package/dist/api/base-client.d.mts +43 -0
- package/dist/api/base-client.d.mts.map +1 -0
- package/dist/api/base-client.mjs +115 -0
- package/dist/api/base-client.mjs.map +1 -0
- package/dist/api/index.cjs +35 -0
- package/dist/api/index.cjs.map +1 -0
- package/dist/api/index.d.cts +18 -0
- package/dist/api/index.d.cts.map +1 -0
- package/dist/api/index.d.mts +18 -0
- package/dist/api/index.d.mts.map +1 -0
- package/dist/api/index.mjs +18 -0
- package/dist/api/index.mjs.map +1 -0
- package/dist/api/prices/client.cjs +521 -0
- package/dist/api/prices/client.cjs.map +1 -0
- package/dist/api/prices/client.d.cts +235 -0
- package/dist/api/prices/client.d.cts.map +1 -0
- package/dist/api/prices/client.d.mts +235 -0
- package/dist/api/prices/client.d.mts.map +1 -0
- package/dist/api/prices/client.mjs +517 -0
- package/dist/api/prices/client.mjs.map +1 -0
- package/dist/api/prices/index.cjs +9 -0
- package/dist/api/prices/index.cjs.map +1 -0
- package/dist/api/prices/index.d.cts +6 -0
- package/dist/api/prices/index.d.cts.map +1 -0
- package/dist/api/prices/index.d.mts +6 -0
- package/dist/api/prices/index.d.mts.map +1 -0
- package/dist/api/prices/index.mjs +5 -0
- package/dist/api/prices/index.mjs.map +1 -0
- package/dist/api/prices/types.cjs +7 -0
- package/dist/api/prices/types.cjs.map +1 -0
- package/dist/api/prices/types.d.cts +61 -0
- package/dist/api/prices/types.d.cts.map +1 -0
- package/dist/api/prices/types.d.mts +61 -0
- package/dist/api/prices/types.d.mts.map +1 -0
- package/dist/api/prices/types.mjs +6 -0
- package/dist/api/prices/types.mjs.map +1 -0
- package/dist/api/shared-types.cjs +99 -0
- package/dist/api/shared-types.cjs.map +1 -0
- package/dist/api/shared-types.d.cts +134 -0
- package/dist/api/shared-types.d.cts.map +1 -0
- package/dist/api/shared-types.d.mts +134 -0
- package/dist/api/shared-types.d.mts.map +1 -0
- package/dist/api/shared-types.mjs +93 -0
- package/dist/api/shared-types.mjs.map +1 -0
- package/dist/api/test-utils.cjs +70 -0
- package/dist/api/test-utils.cjs.map +1 -0
- package/dist/api/test-utils.d.cts +30 -0
- package/dist/api/test-utils.d.cts.map +1 -0
- package/dist/api/test-utils.d.mts +30 -0
- package/dist/api/test-utils.d.mts.map +1 -0
- package/dist/api/test-utils.mjs +64 -0
- package/dist/api/test-utils.mjs.map +1 -0
- package/dist/api/token/client.cjs +342 -0
- package/dist/api/token/client.cjs.map +1 -0
- package/dist/api/token/client.d.cts +193 -0
- package/dist/api/token/client.d.cts.map +1 -0
- package/dist/api/token/client.d.mts +193 -0
- package/dist/api/token/client.d.mts.map +1 -0
- package/dist/api/token/client.mjs +338 -0
- package/dist/api/token/client.mjs.map +1 -0
- package/dist/api/token/index.cjs +9 -0
- package/dist/api/token/index.cjs.map +1 -0
- package/dist/api/token/index.d.cts +6 -0
- package/dist/api/token/index.d.cts.map +1 -0
- package/dist/api/token/index.d.mts +6 -0
- package/dist/api/token/index.d.mts.map +1 -0
- package/dist/api/token/index.mjs +5 -0
- package/dist/api/token/index.mjs.map +1 -0
- package/dist/api/token/types.cjs +7 -0
- package/dist/api/token/types.cjs.map +1 -0
- package/dist/api/token/types.d.cts +75 -0
- package/dist/api/token/types.d.cts.map +1 -0
- package/dist/api/token/types.d.mts +75 -0
- package/dist/api/token/types.d.mts.map +1 -0
- package/dist/api/token/types.mjs +6 -0
- package/dist/api/token/types.mjs.map +1 -0
- package/dist/api/tokens/client.cjs +83 -0
- package/dist/api/tokens/client.cjs.map +1 -0
- package/dist/api/tokens/client.d.cts +44 -0
- package/dist/api/tokens/client.d.cts.map +1 -0
- package/dist/api/tokens/client.d.mts +44 -0
- package/dist/api/tokens/client.d.mts.map +1 -0
- package/dist/api/tokens/client.mjs +79 -0
- package/dist/api/tokens/client.mjs.map +1 -0
- package/dist/api/tokens/index.cjs +9 -0
- package/dist/api/tokens/index.cjs.map +1 -0
- package/dist/api/tokens/index.d.cts +6 -0
- package/dist/api/tokens/index.d.cts.map +1 -0
- package/dist/api/tokens/index.d.mts +6 -0
- package/dist/api/tokens/index.d.mts.map +1 -0
- package/dist/api/tokens/index.mjs +5 -0
- package/dist/api/tokens/index.mjs.map +1 -0
- package/dist/api/tokens/types.cjs +7 -0
- package/dist/api/tokens/types.cjs.map +1 -0
- package/dist/api/tokens/types.d.cts +28 -0
- package/dist/api/tokens/types.d.cts.map +1 -0
- package/dist/api/tokens/types.d.mts +28 -0
- package/dist/api/tokens/types.d.mts.map +1 -0
- package/dist/api/tokens/types.mjs +6 -0
- package/dist/api/tokens/types.mjs.map +1 -0
- package/dist/index.cjs +33 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -7
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +6 -7
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +21 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -1
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Tokens API Client - tokens.api.cx.metamask.io
|
|
4
|
+
*
|
|
5
|
+
* Handles bulk token operations including:
|
|
6
|
+
* - Supported networks (v1, v2)
|
|
7
|
+
* - V3 Assets
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.TokensApiClient = void 0;
|
|
11
|
+
const base_client_1 = require("../base-client.cjs");
|
|
12
|
+
/**
|
|
13
|
+
* Tokens API Client.
|
|
14
|
+
* Provides methods for interacting with the Tokens API.
|
|
15
|
+
*/
|
|
16
|
+
class TokensApiClient extends base_client_1.BaseApiClient {
|
|
17
|
+
// ==========================================================================
|
|
18
|
+
// CACHE MANAGEMENT
|
|
19
|
+
// ==========================================================================
|
|
20
|
+
/**
|
|
21
|
+
* Invalidate all token queries.
|
|
22
|
+
*/
|
|
23
|
+
async invalidateTokens() {
|
|
24
|
+
await this.queryClient.invalidateQueries({
|
|
25
|
+
queryKey: ['tokens'],
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
// ==========================================================================
|
|
29
|
+
// SUPPORTED NETWORKS
|
|
30
|
+
// ==========================================================================
|
|
31
|
+
/**
|
|
32
|
+
* Get token supported networks (v1 endpoint).
|
|
33
|
+
*
|
|
34
|
+
* @param options - Fetch options including cache settings.
|
|
35
|
+
* @returns The supported networks response.
|
|
36
|
+
*/
|
|
37
|
+
async fetchTokenV1SupportedNetworks(options) {
|
|
38
|
+
return this.queryClient.fetchQuery({
|
|
39
|
+
queryKey: ['tokens', 'v1SupportedNetworks'],
|
|
40
|
+
queryFn: ({ signal }) => this.fetch(base_client_1.API_URLS.TOKENS, '/v1/supportedNetworks', { signal }),
|
|
41
|
+
staleTime: options?.staleTime ?? base_client_1.STALE_TIMES.SUPPORTED_NETWORKS,
|
|
42
|
+
gcTime: options?.gcTime ?? base_client_1.GC_TIMES.EXTENDED,
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Get token supported networks (v2 endpoint).
|
|
47
|
+
* Returns both fullSupport and partialSupport networks.
|
|
48
|
+
*
|
|
49
|
+
* @param options - Fetch options including cache settings.
|
|
50
|
+
* @returns The supported networks response.
|
|
51
|
+
*/
|
|
52
|
+
async fetchTokenV2SupportedNetworks(options) {
|
|
53
|
+
return this.queryClient.fetchQuery({
|
|
54
|
+
queryKey: ['tokens', 'v2SupportedNetworks'],
|
|
55
|
+
queryFn: ({ signal }) => this.fetch(base_client_1.API_URLS.TOKENS, '/v2/supportedNetworks', { signal }),
|
|
56
|
+
staleTime: options?.staleTime ?? base_client_1.STALE_TIMES.SUPPORTED_NETWORKS,
|
|
57
|
+
gcTime: options?.gcTime ?? base_client_1.GC_TIMES.EXTENDED,
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
// ==========================================================================
|
|
61
|
+
// V3 ASSETS
|
|
62
|
+
// ==========================================================================
|
|
63
|
+
/**
|
|
64
|
+
* Fetch assets by IDs (v3) with caching.
|
|
65
|
+
*
|
|
66
|
+
* @param assetIds - Array of CAIP-19 asset IDs.
|
|
67
|
+
* @param options - Fetch options including cache settings.
|
|
68
|
+
* @returns Array of asset responses.
|
|
69
|
+
*/
|
|
70
|
+
async fetchV3Assets(assetIds, options) {
|
|
71
|
+
return this.queryClient.fetchQuery({
|
|
72
|
+
queryKey: ['tokens', 'v3Assets', { assetIds: [...assetIds].sort() }],
|
|
73
|
+
queryFn: ({ signal }) => this.fetch(base_client_1.API_URLS.TOKENS, '/v3/assets', {
|
|
74
|
+
signal,
|
|
75
|
+
params: { assetIds },
|
|
76
|
+
}),
|
|
77
|
+
staleTime: options?.staleTime ?? base_client_1.STALE_TIMES.TOKEN_METADATA,
|
|
78
|
+
gcTime: options?.gcTime ?? base_client_1.GC_TIMES.EXTENDED,
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
exports.TokensApiClient = TokensApiClient;
|
|
83
|
+
//# sourceMappingURL=client.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.cjs","sourceRoot":"","sources":["../../../src/api/tokens/client.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AASH,oDAAgF;AAGhF;;;GAGG;AACH,MAAa,eAAgB,SAAQ,2BAAa;IAChD,6EAA6E;IAC7E,mBAAmB;IACnB,6EAA6E;IAE7E;;OAEG;IACH,KAAK,CAAC,gBAAgB;QACpB,MAAM,IAAI,CAAC,WAAW,CAAC,iBAAiB,CAAC;YACvC,QAAQ,EAAE,CAAC,QAAQ,CAAC;SACrB,CAAC,CAAC;IACL,CAAC;IAED,6EAA6E;IAC7E,qBAAqB;IACrB,6EAA6E;IAE7E;;;;;OAKG;IACH,KAAK,CAAC,6BAA6B,CACjC,OAAsB;QAEtB,OAAO,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC;YACjC,QAAQ,EAAE,CAAC,QAAQ,EAAE,qBAAqB,CAAC;YAC3C,OAAO,EAAE,CAAC,EAAE,MAAM,EAAwB,EAAE,EAAE,CAC5C,IAAI,CAAC,KAAK,CACR,sBAAQ,CAAC,MAAM,EACf,uBAAuB,EACvB,EAAE,MAAM,EAAE,CACX;YACH,SAAS,EAAE,OAAO,EAAE,SAAS,IAAI,yBAAW,CAAC,kBAAkB;YAC/D,MAAM,EAAE,OAAO,EAAE,MAAM,IAAI,sBAAQ,CAAC,QAAQ;SAC7C,CAAC,CAAC;IACL,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,6BAA6B,CACjC,OAAsB;QAEtB,OAAO,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC;YACjC,QAAQ,EAAE,CAAC,QAAQ,EAAE,qBAAqB,CAAC;YAC3C,OAAO,EAAE,CAAC,EAAE,MAAM,EAAwB,EAAE,EAAE,CAC5C,IAAI,CAAC,KAAK,CACR,sBAAQ,CAAC,MAAM,EACf,uBAAuB,EACvB,EAAE,MAAM,EAAE,CACX;YACH,SAAS,EAAE,OAAO,EAAE,SAAS,IAAI,yBAAW,CAAC,kBAAkB;YAC/D,MAAM,EAAE,OAAO,EAAE,MAAM,IAAI,sBAAQ,CAAC,QAAQ;SAC7C,CAAC,CAAC;IACL,CAAC;IAED,6EAA6E;IAC7E,YAAY;IACZ,6EAA6E;IAE7E;;;;;;OAMG;IACH,KAAK,CAAC,aAAa,CACjB,QAAkB,EAClB,OAAsB;QAEtB,OAAO,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC;YACjC,QAAQ,EAAE,CAAC,QAAQ,EAAE,UAAU,EAAE,EAAE,QAAQ,EAAE,CAAC,GAAG,QAAQ,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC;YACpE,OAAO,EAAE,CAAC,EAAE,MAAM,EAAwB,EAAE,EAAE,CAC5C,IAAI,CAAC,KAAK,CAAoB,sBAAQ,CAAC,MAAM,EAAE,YAAY,EAAE;gBAC3D,MAAM;gBACN,MAAM,EAAE,EAAE,QAAQ,EAAE;aACrB,CAAC;YACJ,SAAS,EAAE,OAAO,EAAE,SAAS,IAAI,yBAAW,CAAC,cAAc;YAC3D,MAAM,EAAE,OAAO,EAAE,MAAM,IAAI,sBAAQ,CAAC,QAAQ;SAC7C,CAAC,CAAC;IACL,CAAC;CACF;AAzFD,0CAyFC","sourcesContent":["/**\n * Tokens API Client - tokens.api.cx.metamask.io\n *\n * Handles bulk token operations including:\n * - Supported networks (v1, v2)\n * - V3 Assets\n */\n\nimport type { QueryFunctionContext } from '@tanstack/query-core';\n\nimport type {\n V1TokenSupportedNetworksResponse,\n V2TokenSupportedNetworksResponse,\n V3AssetResponse,\n} from './types';\nimport { BaseApiClient, API_URLS, STALE_TIMES, GC_TIMES } from '../base-client';\nimport type { FetchOptions } from '../shared-types';\n\n/**\n * Tokens API Client.\n * Provides methods for interacting with the Tokens API.\n */\nexport class TokensApiClient extends BaseApiClient {\n // ==========================================================================\n // CACHE MANAGEMENT\n // ==========================================================================\n\n /**\n * Invalidate all token queries.\n */\n async invalidateTokens(): Promise<void> {\n await this.queryClient.invalidateQueries({\n queryKey: ['tokens'],\n });\n }\n\n // ==========================================================================\n // SUPPORTED NETWORKS\n // ==========================================================================\n\n /**\n * Get token supported networks (v1 endpoint).\n *\n * @param options - Fetch options including cache settings.\n * @returns The supported networks response.\n */\n async fetchTokenV1SupportedNetworks(\n options?: FetchOptions,\n ): Promise<V1TokenSupportedNetworksResponse> {\n return this.queryClient.fetchQuery({\n queryKey: ['tokens', 'v1SupportedNetworks'],\n queryFn: ({ signal }: QueryFunctionContext) =>\n this.fetch<V1TokenSupportedNetworksResponse>(\n API_URLS.TOKENS,\n '/v1/supportedNetworks',\n { signal },\n ),\n staleTime: options?.staleTime ?? STALE_TIMES.SUPPORTED_NETWORKS,\n gcTime: options?.gcTime ?? GC_TIMES.EXTENDED,\n });\n }\n\n /**\n * Get token supported networks (v2 endpoint).\n * Returns both fullSupport and partialSupport networks.\n *\n * @param options - Fetch options including cache settings.\n * @returns The supported networks response.\n */\n async fetchTokenV2SupportedNetworks(\n options?: FetchOptions,\n ): Promise<V2TokenSupportedNetworksResponse> {\n return this.queryClient.fetchQuery({\n queryKey: ['tokens', 'v2SupportedNetworks'],\n queryFn: ({ signal }: QueryFunctionContext) =>\n this.fetch<V2TokenSupportedNetworksResponse>(\n API_URLS.TOKENS,\n '/v2/supportedNetworks',\n { signal },\n ),\n staleTime: options?.staleTime ?? STALE_TIMES.SUPPORTED_NETWORKS,\n gcTime: options?.gcTime ?? GC_TIMES.EXTENDED,\n });\n }\n\n // ==========================================================================\n // V3 ASSETS\n // ==========================================================================\n\n /**\n * Fetch assets by IDs (v3) with caching.\n *\n * @param assetIds - Array of CAIP-19 asset IDs.\n * @param options - Fetch options including cache settings.\n * @returns Array of asset responses.\n */\n async fetchV3Assets(\n assetIds: string[],\n options?: FetchOptions,\n ): Promise<V3AssetResponse[]> {\n return this.queryClient.fetchQuery({\n queryKey: ['tokens', 'v3Assets', { assetIds: [...assetIds].sort() }],\n queryFn: ({ signal }: QueryFunctionContext) =>\n this.fetch<V3AssetResponse[]>(API_URLS.TOKENS, '/v3/assets', {\n signal,\n params: { assetIds },\n }),\n staleTime: options?.staleTime ?? STALE_TIMES.TOKEN_METADATA,\n gcTime: options?.gcTime ?? GC_TIMES.EXTENDED,\n });\n }\n}\n"]}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tokens API Client - tokens.api.cx.metamask.io
|
|
3
|
+
*
|
|
4
|
+
* Handles bulk token operations including:
|
|
5
|
+
* - Supported networks (v1, v2)
|
|
6
|
+
* - V3 Assets
|
|
7
|
+
*/
|
|
8
|
+
import type { V1TokenSupportedNetworksResponse, V2TokenSupportedNetworksResponse, V3AssetResponse } from "./types.cjs";
|
|
9
|
+
import { BaseApiClient } from "../base-client.cjs";
|
|
10
|
+
import type { FetchOptions } from "../shared-types.cjs";
|
|
11
|
+
/**
|
|
12
|
+
* Tokens API Client.
|
|
13
|
+
* Provides methods for interacting with the Tokens API.
|
|
14
|
+
*/
|
|
15
|
+
export declare class TokensApiClient extends BaseApiClient {
|
|
16
|
+
/**
|
|
17
|
+
* Invalidate all token queries.
|
|
18
|
+
*/
|
|
19
|
+
invalidateTokens(): Promise<void>;
|
|
20
|
+
/**
|
|
21
|
+
* Get token supported networks (v1 endpoint).
|
|
22
|
+
*
|
|
23
|
+
* @param options - Fetch options including cache settings.
|
|
24
|
+
* @returns The supported networks response.
|
|
25
|
+
*/
|
|
26
|
+
fetchTokenV1SupportedNetworks(options?: FetchOptions): Promise<V1TokenSupportedNetworksResponse>;
|
|
27
|
+
/**
|
|
28
|
+
* Get token supported networks (v2 endpoint).
|
|
29
|
+
* Returns both fullSupport and partialSupport networks.
|
|
30
|
+
*
|
|
31
|
+
* @param options - Fetch options including cache settings.
|
|
32
|
+
* @returns The supported networks response.
|
|
33
|
+
*/
|
|
34
|
+
fetchTokenV2SupportedNetworks(options?: FetchOptions): Promise<V2TokenSupportedNetworksResponse>;
|
|
35
|
+
/**
|
|
36
|
+
* Fetch assets by IDs (v3) with caching.
|
|
37
|
+
*
|
|
38
|
+
* @param assetIds - Array of CAIP-19 asset IDs.
|
|
39
|
+
* @param options - Fetch options including cache settings.
|
|
40
|
+
* @returns Array of asset responses.
|
|
41
|
+
*/
|
|
42
|
+
fetchV3Assets(assetIds: string[], options?: FetchOptions): Promise<V3AssetResponse[]>;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=client.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.cts","sourceRoot":"","sources":["../../../src/api/tokens/client.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,KAAK,EACV,gCAAgC,EAChC,gCAAgC,EAChC,eAAe,EAChB,oBAAgB;AACjB,OAAO,EAAE,aAAa,EAAmC,2BAAuB;AAChF,OAAO,KAAK,EAAE,YAAY,EAAE,4BAAwB;AAEpD;;;GAGG;AACH,qBAAa,eAAgB,SAAQ,aAAa;IAKhD;;OAEG;IACG,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC;IAUvC;;;;;OAKG;IACG,6BAA6B,CACjC,OAAO,CAAC,EAAE,YAAY,GACrB,OAAO,CAAC,gCAAgC,CAAC;IAc5C;;;;;;OAMG;IACG,6BAA6B,CACjC,OAAO,CAAC,EAAE,YAAY,GACrB,OAAO,CAAC,gCAAgC,CAAC;IAkB5C;;;;;;OAMG;IACG,aAAa,CACjB,QAAQ,EAAE,MAAM,EAAE,EAClB,OAAO,CAAC,EAAE,YAAY,GACrB,OAAO,CAAC,eAAe,EAAE,CAAC;CAY9B"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tokens API Client - tokens.api.cx.metamask.io
|
|
3
|
+
*
|
|
4
|
+
* Handles bulk token operations including:
|
|
5
|
+
* - Supported networks (v1, v2)
|
|
6
|
+
* - V3 Assets
|
|
7
|
+
*/
|
|
8
|
+
import type { V1TokenSupportedNetworksResponse, V2TokenSupportedNetworksResponse, V3AssetResponse } from "./types.mjs";
|
|
9
|
+
import { BaseApiClient } from "../base-client.mjs";
|
|
10
|
+
import type { FetchOptions } from "../shared-types.mjs";
|
|
11
|
+
/**
|
|
12
|
+
* Tokens API Client.
|
|
13
|
+
* Provides methods for interacting with the Tokens API.
|
|
14
|
+
*/
|
|
15
|
+
export declare class TokensApiClient extends BaseApiClient {
|
|
16
|
+
/**
|
|
17
|
+
* Invalidate all token queries.
|
|
18
|
+
*/
|
|
19
|
+
invalidateTokens(): Promise<void>;
|
|
20
|
+
/**
|
|
21
|
+
* Get token supported networks (v1 endpoint).
|
|
22
|
+
*
|
|
23
|
+
* @param options - Fetch options including cache settings.
|
|
24
|
+
* @returns The supported networks response.
|
|
25
|
+
*/
|
|
26
|
+
fetchTokenV1SupportedNetworks(options?: FetchOptions): Promise<V1TokenSupportedNetworksResponse>;
|
|
27
|
+
/**
|
|
28
|
+
* Get token supported networks (v2 endpoint).
|
|
29
|
+
* Returns both fullSupport and partialSupport networks.
|
|
30
|
+
*
|
|
31
|
+
* @param options - Fetch options including cache settings.
|
|
32
|
+
* @returns The supported networks response.
|
|
33
|
+
*/
|
|
34
|
+
fetchTokenV2SupportedNetworks(options?: FetchOptions): Promise<V2TokenSupportedNetworksResponse>;
|
|
35
|
+
/**
|
|
36
|
+
* Fetch assets by IDs (v3) with caching.
|
|
37
|
+
*
|
|
38
|
+
* @param assetIds - Array of CAIP-19 asset IDs.
|
|
39
|
+
* @param options - Fetch options including cache settings.
|
|
40
|
+
* @returns Array of asset responses.
|
|
41
|
+
*/
|
|
42
|
+
fetchV3Assets(assetIds: string[], options?: FetchOptions): Promise<V3AssetResponse[]>;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=client.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.mts","sourceRoot":"","sources":["../../../src/api/tokens/client.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,KAAK,EACV,gCAAgC,EAChC,gCAAgC,EAChC,eAAe,EAChB,oBAAgB;AACjB,OAAO,EAAE,aAAa,EAAmC,2BAAuB;AAChF,OAAO,KAAK,EAAE,YAAY,EAAE,4BAAwB;AAEpD;;;GAGG;AACH,qBAAa,eAAgB,SAAQ,aAAa;IAKhD;;OAEG;IACG,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC;IAUvC;;;;;OAKG;IACG,6BAA6B,CACjC,OAAO,CAAC,EAAE,YAAY,GACrB,OAAO,CAAC,gCAAgC,CAAC;IAc5C;;;;;;OAMG;IACG,6BAA6B,CACjC,OAAO,CAAC,EAAE,YAAY,GACrB,OAAO,CAAC,gCAAgC,CAAC;IAkB5C;;;;;;OAMG;IACG,aAAa,CACjB,QAAQ,EAAE,MAAM,EAAE,EAClB,OAAO,CAAC,EAAE,YAAY,GACrB,OAAO,CAAC,eAAe,EAAE,CAAC;CAY9B"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tokens API Client - tokens.api.cx.metamask.io
|
|
3
|
+
*
|
|
4
|
+
* Handles bulk token operations including:
|
|
5
|
+
* - Supported networks (v1, v2)
|
|
6
|
+
* - V3 Assets
|
|
7
|
+
*/
|
|
8
|
+
import { BaseApiClient, API_URLS, STALE_TIMES, GC_TIMES } from "../base-client.mjs";
|
|
9
|
+
/**
|
|
10
|
+
* Tokens API Client.
|
|
11
|
+
* Provides methods for interacting with the Tokens API.
|
|
12
|
+
*/
|
|
13
|
+
export class TokensApiClient extends BaseApiClient {
|
|
14
|
+
// ==========================================================================
|
|
15
|
+
// CACHE MANAGEMENT
|
|
16
|
+
// ==========================================================================
|
|
17
|
+
/**
|
|
18
|
+
* Invalidate all token queries.
|
|
19
|
+
*/
|
|
20
|
+
async invalidateTokens() {
|
|
21
|
+
await this.queryClient.invalidateQueries({
|
|
22
|
+
queryKey: ['tokens'],
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
// ==========================================================================
|
|
26
|
+
// SUPPORTED NETWORKS
|
|
27
|
+
// ==========================================================================
|
|
28
|
+
/**
|
|
29
|
+
* Get token supported networks (v1 endpoint).
|
|
30
|
+
*
|
|
31
|
+
* @param options - Fetch options including cache settings.
|
|
32
|
+
* @returns The supported networks response.
|
|
33
|
+
*/
|
|
34
|
+
async fetchTokenV1SupportedNetworks(options) {
|
|
35
|
+
return this.queryClient.fetchQuery({
|
|
36
|
+
queryKey: ['tokens', 'v1SupportedNetworks'],
|
|
37
|
+
queryFn: ({ signal }) => this.fetch(API_URLS.TOKENS, '/v1/supportedNetworks', { signal }),
|
|
38
|
+
staleTime: options?.staleTime ?? STALE_TIMES.SUPPORTED_NETWORKS,
|
|
39
|
+
gcTime: options?.gcTime ?? GC_TIMES.EXTENDED,
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Get token supported networks (v2 endpoint).
|
|
44
|
+
* Returns both fullSupport and partialSupport networks.
|
|
45
|
+
*
|
|
46
|
+
* @param options - Fetch options including cache settings.
|
|
47
|
+
* @returns The supported networks response.
|
|
48
|
+
*/
|
|
49
|
+
async fetchTokenV2SupportedNetworks(options) {
|
|
50
|
+
return this.queryClient.fetchQuery({
|
|
51
|
+
queryKey: ['tokens', 'v2SupportedNetworks'],
|
|
52
|
+
queryFn: ({ signal }) => this.fetch(API_URLS.TOKENS, '/v2/supportedNetworks', { signal }),
|
|
53
|
+
staleTime: options?.staleTime ?? STALE_TIMES.SUPPORTED_NETWORKS,
|
|
54
|
+
gcTime: options?.gcTime ?? GC_TIMES.EXTENDED,
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
// ==========================================================================
|
|
58
|
+
// V3 ASSETS
|
|
59
|
+
// ==========================================================================
|
|
60
|
+
/**
|
|
61
|
+
* Fetch assets by IDs (v3) with caching.
|
|
62
|
+
*
|
|
63
|
+
* @param assetIds - Array of CAIP-19 asset IDs.
|
|
64
|
+
* @param options - Fetch options including cache settings.
|
|
65
|
+
* @returns Array of asset responses.
|
|
66
|
+
*/
|
|
67
|
+
async fetchV3Assets(assetIds, options) {
|
|
68
|
+
return this.queryClient.fetchQuery({
|
|
69
|
+
queryKey: ['tokens', 'v3Assets', { assetIds: [...assetIds].sort() }],
|
|
70
|
+
queryFn: ({ signal }) => this.fetch(API_URLS.TOKENS, '/v3/assets', {
|
|
71
|
+
signal,
|
|
72
|
+
params: { assetIds },
|
|
73
|
+
}),
|
|
74
|
+
staleTime: options?.staleTime ?? STALE_TIMES.TOKEN_METADATA,
|
|
75
|
+
gcTime: options?.gcTime ?? GC_TIMES.EXTENDED,
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=client.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.mjs","sourceRoot":"","sources":["../../../src/api/tokens/client.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AASH,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE,2BAAuB;AAGhF;;;GAGG;AACH,MAAM,OAAO,eAAgB,SAAQ,aAAa;IAChD,6EAA6E;IAC7E,mBAAmB;IACnB,6EAA6E;IAE7E;;OAEG;IACH,KAAK,CAAC,gBAAgB;QACpB,MAAM,IAAI,CAAC,WAAW,CAAC,iBAAiB,CAAC;YACvC,QAAQ,EAAE,CAAC,QAAQ,CAAC;SACrB,CAAC,CAAC;IACL,CAAC;IAED,6EAA6E;IAC7E,qBAAqB;IACrB,6EAA6E;IAE7E;;;;;OAKG;IACH,KAAK,CAAC,6BAA6B,CACjC,OAAsB;QAEtB,OAAO,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC;YACjC,QAAQ,EAAE,CAAC,QAAQ,EAAE,qBAAqB,CAAC;YAC3C,OAAO,EAAE,CAAC,EAAE,MAAM,EAAwB,EAAE,EAAE,CAC5C,IAAI,CAAC,KAAK,CACR,QAAQ,CAAC,MAAM,EACf,uBAAuB,EACvB,EAAE,MAAM,EAAE,CACX;YACH,SAAS,EAAE,OAAO,EAAE,SAAS,IAAI,WAAW,CAAC,kBAAkB;YAC/D,MAAM,EAAE,OAAO,EAAE,MAAM,IAAI,QAAQ,CAAC,QAAQ;SAC7C,CAAC,CAAC;IACL,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,6BAA6B,CACjC,OAAsB;QAEtB,OAAO,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC;YACjC,QAAQ,EAAE,CAAC,QAAQ,EAAE,qBAAqB,CAAC;YAC3C,OAAO,EAAE,CAAC,EAAE,MAAM,EAAwB,EAAE,EAAE,CAC5C,IAAI,CAAC,KAAK,CACR,QAAQ,CAAC,MAAM,EACf,uBAAuB,EACvB,EAAE,MAAM,EAAE,CACX;YACH,SAAS,EAAE,OAAO,EAAE,SAAS,IAAI,WAAW,CAAC,kBAAkB;YAC/D,MAAM,EAAE,OAAO,EAAE,MAAM,IAAI,QAAQ,CAAC,QAAQ;SAC7C,CAAC,CAAC;IACL,CAAC;IAED,6EAA6E;IAC7E,YAAY;IACZ,6EAA6E;IAE7E;;;;;;OAMG;IACH,KAAK,CAAC,aAAa,CACjB,QAAkB,EAClB,OAAsB;QAEtB,OAAO,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC;YACjC,QAAQ,EAAE,CAAC,QAAQ,EAAE,UAAU,EAAE,EAAE,QAAQ,EAAE,CAAC,GAAG,QAAQ,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC;YACpE,OAAO,EAAE,CAAC,EAAE,MAAM,EAAwB,EAAE,EAAE,CAC5C,IAAI,CAAC,KAAK,CAAoB,QAAQ,CAAC,MAAM,EAAE,YAAY,EAAE;gBAC3D,MAAM;gBACN,MAAM,EAAE,EAAE,QAAQ,EAAE;aACrB,CAAC;YACJ,SAAS,EAAE,OAAO,EAAE,SAAS,IAAI,WAAW,CAAC,cAAc;YAC3D,MAAM,EAAE,OAAO,EAAE,MAAM,IAAI,QAAQ,CAAC,QAAQ;SAC7C,CAAC,CAAC;IACL,CAAC;CACF","sourcesContent":["/**\n * Tokens API Client - tokens.api.cx.metamask.io\n *\n * Handles bulk token operations including:\n * - Supported networks (v1, v2)\n * - V3 Assets\n */\n\nimport type { QueryFunctionContext } from '@tanstack/query-core';\n\nimport type {\n V1TokenSupportedNetworksResponse,\n V2TokenSupportedNetworksResponse,\n V3AssetResponse,\n} from './types';\nimport { BaseApiClient, API_URLS, STALE_TIMES, GC_TIMES } from '../base-client';\nimport type { FetchOptions } from '../shared-types';\n\n/**\n * Tokens API Client.\n * Provides methods for interacting with the Tokens API.\n */\nexport class TokensApiClient extends BaseApiClient {\n // ==========================================================================\n // CACHE MANAGEMENT\n // ==========================================================================\n\n /**\n * Invalidate all token queries.\n */\n async invalidateTokens(): Promise<void> {\n await this.queryClient.invalidateQueries({\n queryKey: ['tokens'],\n });\n }\n\n // ==========================================================================\n // SUPPORTED NETWORKS\n // ==========================================================================\n\n /**\n * Get token supported networks (v1 endpoint).\n *\n * @param options - Fetch options including cache settings.\n * @returns The supported networks response.\n */\n async fetchTokenV1SupportedNetworks(\n options?: FetchOptions,\n ): Promise<V1TokenSupportedNetworksResponse> {\n return this.queryClient.fetchQuery({\n queryKey: ['tokens', 'v1SupportedNetworks'],\n queryFn: ({ signal }: QueryFunctionContext) =>\n this.fetch<V1TokenSupportedNetworksResponse>(\n API_URLS.TOKENS,\n '/v1/supportedNetworks',\n { signal },\n ),\n staleTime: options?.staleTime ?? STALE_TIMES.SUPPORTED_NETWORKS,\n gcTime: options?.gcTime ?? GC_TIMES.EXTENDED,\n });\n }\n\n /**\n * Get token supported networks (v2 endpoint).\n * Returns both fullSupport and partialSupport networks.\n *\n * @param options - Fetch options including cache settings.\n * @returns The supported networks response.\n */\n async fetchTokenV2SupportedNetworks(\n options?: FetchOptions,\n ): Promise<V2TokenSupportedNetworksResponse> {\n return this.queryClient.fetchQuery({\n queryKey: ['tokens', 'v2SupportedNetworks'],\n queryFn: ({ signal }: QueryFunctionContext) =>\n this.fetch<V2TokenSupportedNetworksResponse>(\n API_URLS.TOKENS,\n '/v2/supportedNetworks',\n { signal },\n ),\n staleTime: options?.staleTime ?? STALE_TIMES.SUPPORTED_NETWORKS,\n gcTime: options?.gcTime ?? GC_TIMES.EXTENDED,\n });\n }\n\n // ==========================================================================\n // V3 ASSETS\n // ==========================================================================\n\n /**\n * Fetch assets by IDs (v3) with caching.\n *\n * @param assetIds - Array of CAIP-19 asset IDs.\n * @param options - Fetch options including cache settings.\n * @returns Array of asset responses.\n */\n async fetchV3Assets(\n assetIds: string[],\n options?: FetchOptions,\n ): Promise<V3AssetResponse[]> {\n return this.queryClient.fetchQuery({\n queryKey: ['tokens', 'v3Assets', { assetIds: [...assetIds].sort() }],\n queryFn: ({ signal }: QueryFunctionContext) =>\n this.fetch<V3AssetResponse[]>(API_URLS.TOKENS, '/v3/assets', {\n signal,\n params: { assetIds },\n }),\n staleTime: options?.staleTime ?? STALE_TIMES.TOKEN_METADATA,\n gcTime: options?.gcTime ?? GC_TIMES.EXTENDED,\n });\n }\n}\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Tokens API barrel export.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.TokensApiClient = void 0;
|
|
7
|
+
var client_1 = require("./client.cjs");
|
|
8
|
+
Object.defineProperty(exports, "TokensApiClient", { enumerable: true, get: function () { return client_1.TokensApiClient; } });
|
|
9
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/api/tokens/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,uCAA2C;AAAlC,yGAAA,eAAe,OAAA","sourcesContent":["/**\n * Tokens API barrel export.\n */\n\nexport { TokensApiClient } from './client';\nexport type {\n V1TokenSupportedNetworksResponse,\n V2TokenSupportedNetworksResponse,\n V3AssetResponse,\n} from './types';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/api/tokens/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,eAAe,EAAE,qBAAiB;AAC3C,YAAY,EACV,gCAAgC,EAChC,gCAAgC,EAChC,eAAe,GAChB,oBAAgB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/api/tokens/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,eAAe,EAAE,qBAAiB;AAC3C,YAAY,EACV,gCAAgC,EAChC,gCAAgC,EAChC,eAAe,GAChB,oBAAgB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/api/tokens/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,eAAe,EAAE,qBAAiB","sourcesContent":["/**\n * Tokens API barrel export.\n */\n\nexport { TokensApiClient } from './client';\nexport type {\n V1TokenSupportedNetworksResponse,\n V2TokenSupportedNetworksResponse,\n V3AssetResponse,\n} from './types';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.cjs","sourceRoot":"","sources":["../../../src/api/tokens/types.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/**\n * Tokens API types for the API Platform Client.\n * API: tokens.api.cx.metamask.io\n */\n\n// ============================================================================\n// SUPPORTED NETWORKS TYPES\n// ============================================================================\n\n/** Token supported networks response (v1) */\nexport type V1TokenSupportedNetworksResponse = {\n fullSupport: string[];\n};\n\n/** Token supported networks response (v2) - includes partial support */\nexport type V2TokenSupportedNetworksResponse = {\n fullSupport: string[];\n partialSupport: string[];\n};\n\n// ============================================================================\n// ASSET TYPES\n// ============================================================================\n\n/** Asset by CAIP-19 ID response */\nexport type V3AssetResponse = {\n assetId: string;\n name: string;\n symbol: string;\n decimals: number;\n address: string;\n chainId: number | string;\n iconUrl?: string;\n iconUrlThumbnail?: string;\n coingeckoId?: string;\n occurrences?: number;\n aggregators?: string[];\n};\n"]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tokens API types for the API Platform Client.
|
|
3
|
+
* API: tokens.api.cx.metamask.io
|
|
4
|
+
*/
|
|
5
|
+
/** Token supported networks response (v1) */
|
|
6
|
+
export type V1TokenSupportedNetworksResponse = {
|
|
7
|
+
fullSupport: string[];
|
|
8
|
+
};
|
|
9
|
+
/** Token supported networks response (v2) - includes partial support */
|
|
10
|
+
export type V2TokenSupportedNetworksResponse = {
|
|
11
|
+
fullSupport: string[];
|
|
12
|
+
partialSupport: string[];
|
|
13
|
+
};
|
|
14
|
+
/** Asset by CAIP-19 ID response */
|
|
15
|
+
export type V3AssetResponse = {
|
|
16
|
+
assetId: string;
|
|
17
|
+
name: string;
|
|
18
|
+
symbol: string;
|
|
19
|
+
decimals: number;
|
|
20
|
+
address: string;
|
|
21
|
+
chainId: number | string;
|
|
22
|
+
iconUrl?: string;
|
|
23
|
+
iconUrlThumbnail?: string;
|
|
24
|
+
coingeckoId?: string;
|
|
25
|
+
occurrences?: number;
|
|
26
|
+
aggregators?: string[];
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=types.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.cts","sourceRoot":"","sources":["../../../src/api/tokens/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,6CAA6C;AAC7C,MAAM,MAAM,gCAAgC,GAAG;IAC7C,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB,CAAC;AAEF,wEAAwE;AACxE,MAAM,MAAM,gCAAgC,GAAG;IAC7C,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,cAAc,EAAE,MAAM,EAAE,CAAC;CAC1B,CAAC;AAMF,mCAAmC;AACnC,MAAM,MAAM,eAAe,GAAG;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tokens API types for the API Platform Client.
|
|
3
|
+
* API: tokens.api.cx.metamask.io
|
|
4
|
+
*/
|
|
5
|
+
/** Token supported networks response (v1) */
|
|
6
|
+
export type V1TokenSupportedNetworksResponse = {
|
|
7
|
+
fullSupport: string[];
|
|
8
|
+
};
|
|
9
|
+
/** Token supported networks response (v2) - includes partial support */
|
|
10
|
+
export type V2TokenSupportedNetworksResponse = {
|
|
11
|
+
fullSupport: string[];
|
|
12
|
+
partialSupport: string[];
|
|
13
|
+
};
|
|
14
|
+
/** Asset by CAIP-19 ID response */
|
|
15
|
+
export type V3AssetResponse = {
|
|
16
|
+
assetId: string;
|
|
17
|
+
name: string;
|
|
18
|
+
symbol: string;
|
|
19
|
+
decimals: number;
|
|
20
|
+
address: string;
|
|
21
|
+
chainId: number | string;
|
|
22
|
+
iconUrl?: string;
|
|
23
|
+
iconUrlThumbnail?: string;
|
|
24
|
+
coingeckoId?: string;
|
|
25
|
+
occurrences?: number;
|
|
26
|
+
aggregators?: string[];
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=types.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.mts","sourceRoot":"","sources":["../../../src/api/tokens/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,6CAA6C;AAC7C,MAAM,MAAM,gCAAgC,GAAG;IAC7C,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB,CAAC;AAEF,wEAAwE;AACxE,MAAM,MAAM,gCAAgC,GAAG;IAC7C,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,cAAc,EAAE,MAAM,EAAE,CAAC;CAC1B,CAAC;AAMF,mCAAmC;AACnC,MAAM,MAAM,eAAe,GAAG;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.mjs","sourceRoot":"","sources":["../../../src/api/tokens/types.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/**\n * Tokens API types for the API Platform Client.\n * API: tokens.api.cx.metamask.io\n */\n\n// ============================================================================\n// SUPPORTED NETWORKS TYPES\n// ============================================================================\n\n/** Token supported networks response (v1) */\nexport type V1TokenSupportedNetworksResponse = {\n fullSupport: string[];\n};\n\n/** Token supported networks response (v2) - includes partial support */\nexport type V2TokenSupportedNetworksResponse = {\n fullSupport: string[];\n partialSupport: string[];\n};\n\n// ============================================================================\n// ASSET TYPES\n// ============================================================================\n\n/** Asset by CAIP-19 ID response */\nexport type V3AssetResponse = {\n assetId: string;\n name: string;\n symbol: string;\n decimals: number;\n address: string;\n chainId: number | string;\n iconUrl?: string;\n iconUrlThumbnail?: string;\n coingeckoId?: string;\n occurrences?: number;\n aggregators?: string[];\n};\n"]}
|
package/dist/index.cjs
CHANGED
|
@@ -1,11 +1,40 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
* @file Backend platform services for MetaMask.
|
|
4
|
-
*/
|
|
2
|
+
// Core Backend Package Exports
|
|
5
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.AccountActivityService = exports.BackendWebSocketService = void 0;
|
|
4
|
+
exports.HttpError = exports.shouldRetry = exports.calculateRetryDelay = exports.GC_TIMES = exports.STALE_TIMES = exports.API_URLS = exports.TokensApiClient = exports.TokenApiClient = exports.PricesApiClient = exports.AccountsApiClient = exports.createApiPlatformClient = exports.ApiPlatformClient = exports.ACCOUNT_ACTIVITY_SERVICE_ALLOWED_EVENTS = exports.ACCOUNT_ACTIVITY_SERVICE_ALLOWED_ACTIONS = exports.AccountActivityService = exports.WebSocketEventType = exports.WebSocketState = exports.getCloseReason = exports.BackendWebSocketService = void 0;
|
|
5
|
+
// ============================================================================
|
|
6
|
+
// BACKEND WEBSOCKET SERVICE
|
|
7
|
+
// ============================================================================
|
|
7
8
|
var BackendWebSocketService_1 = require("./BackendWebSocketService.cjs");
|
|
8
9
|
Object.defineProperty(exports, "BackendWebSocketService", { enumerable: true, get: function () { return BackendWebSocketService_1.BackendWebSocketService; } });
|
|
10
|
+
Object.defineProperty(exports, "getCloseReason", { enumerable: true, get: function () { return BackendWebSocketService_1.getCloseReason; } });
|
|
11
|
+
Object.defineProperty(exports, "WebSocketState", { enumerable: true, get: function () { return BackendWebSocketService_1.WebSocketState; } });
|
|
12
|
+
Object.defineProperty(exports, "WebSocketEventType", { enumerable: true, get: function () { return BackendWebSocketService_1.WebSocketEventType; } });
|
|
13
|
+
// ============================================================================
|
|
14
|
+
// ACCOUNT ACTIVITY SERVICE
|
|
15
|
+
// ============================================================================
|
|
9
16
|
var AccountActivityService_1 = require("./AccountActivityService.cjs");
|
|
10
17
|
Object.defineProperty(exports, "AccountActivityService", { enumerable: true, get: function () { return AccountActivityService_1.AccountActivityService; } });
|
|
18
|
+
Object.defineProperty(exports, "ACCOUNT_ACTIVITY_SERVICE_ALLOWED_ACTIONS", { enumerable: true, get: function () { return AccountActivityService_1.ACCOUNT_ACTIVITY_SERVICE_ALLOWED_ACTIONS; } });
|
|
19
|
+
Object.defineProperty(exports, "ACCOUNT_ACTIVITY_SERVICE_ALLOWED_EVENTS", { enumerable: true, get: function () { return AccountActivityService_1.ACCOUNT_ACTIVITY_SERVICE_ALLOWED_EVENTS; } });
|
|
20
|
+
// ============================================================================
|
|
21
|
+
// API PLATFORM CLIENT
|
|
22
|
+
// ============================================================================
|
|
23
|
+
var api_1 = require("./api/index.cjs");
|
|
24
|
+
Object.defineProperty(exports, "ApiPlatformClient", { enumerable: true, get: function () { return api_1.ApiPlatformClient; } });
|
|
25
|
+
Object.defineProperty(exports, "createApiPlatformClient", { enumerable: true, get: function () { return api_1.createApiPlatformClient; } });
|
|
26
|
+
// Individual API clients
|
|
27
|
+
Object.defineProperty(exports, "AccountsApiClient", { enumerable: true, get: function () { return api_1.AccountsApiClient; } });
|
|
28
|
+
Object.defineProperty(exports, "PricesApiClient", { enumerable: true, get: function () { return api_1.PricesApiClient; } });
|
|
29
|
+
Object.defineProperty(exports, "TokenApiClient", { enumerable: true, get: function () { return api_1.TokenApiClient; } });
|
|
30
|
+
Object.defineProperty(exports, "TokensApiClient", { enumerable: true, get: function () { return api_1.TokensApiClient; } });
|
|
31
|
+
// Constants
|
|
32
|
+
Object.defineProperty(exports, "API_URLS", { enumerable: true, get: function () { return api_1.API_URLS; } });
|
|
33
|
+
Object.defineProperty(exports, "STALE_TIMES", { enumerable: true, get: function () { return api_1.STALE_TIMES; } });
|
|
34
|
+
Object.defineProperty(exports, "GC_TIMES", { enumerable: true, get: function () { return api_1.GC_TIMES; } });
|
|
35
|
+
// Helpers
|
|
36
|
+
Object.defineProperty(exports, "calculateRetryDelay", { enumerable: true, get: function () { return api_1.calculateRetryDelay; } });
|
|
37
|
+
Object.defineProperty(exports, "shouldRetry", { enumerable: true, get: function () { return api_1.shouldRetry; } });
|
|
38
|
+
// Errors
|
|
39
|
+
Object.defineProperty(exports, "HttpError", { enumerable: true, get: function () { return api_1.HttpError; } });
|
|
11
40
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,+BAA+B;;;AAE/B,+EAA+E;AAC/E,4BAA4B;AAC5B,+EAA+E;AAE/E,yEAKmC;AAJjC,kIAAA,uBAAuB,OAAA;AACvB,yHAAA,cAAc,OAAA;AACd,yHAAA,cAAc,OAAA;AACd,6HAAA,kBAAkB,OAAA;AAkBpB,+EAA+E;AAC/E,2BAA2B;AAC3B,+EAA+E;AAE/E,uEAIkC;AAHhC,gIAAA,sBAAsB,OAAA;AACtB,kJAAA,wCAAwC,OAAA;AACxC,iJAAA,uCAAuC,OAAA;AA+BzC,+EAA+E;AAC/E,sBAAsB;AACtB,+EAA+E;AAE/E,uCAiBe;AAhBb,wGAAA,iBAAiB,OAAA;AACjB,8GAAA,uBAAuB,OAAA;AACvB,yBAAyB;AACzB,wGAAA,iBAAiB,OAAA;AACjB,sGAAA,eAAe,OAAA;AACf,qGAAA,cAAc,OAAA;AACd,sGAAA,eAAe,OAAA;AACf,YAAY;AACZ,+FAAA,QAAQ,OAAA;AACR,kGAAA,WAAW,OAAA;AACX,+FAAA,QAAQ,OAAA;AACR,UAAU;AACV,0GAAA,mBAAmB,OAAA;AACnB,kGAAA,WAAW,OAAA;AACX,SAAS;AACT,gGAAA,SAAS,OAAA","sourcesContent":["// Core Backend Package Exports\n\n// ============================================================================\n// BACKEND WEBSOCKET SERVICE\n// ============================================================================\n\nexport {\n BackendWebSocketService,\n getCloseReason,\n WebSocketState,\n WebSocketEventType,\n} from './BackendWebSocketService';\n\nexport type {\n BackendWebSocketServiceOptions,\n ClientRequestMessage,\n ServerResponseMessage,\n ServerNotificationMessage,\n WebSocketMessage,\n ChannelCallback,\n WebSocketSubscription,\n WebSocketConnectionInfo,\n BackendWebSocketServiceActions,\n BackendWebSocketServiceConnectionStateChangedEvent,\n BackendWebSocketServiceEvents,\n BackendWebSocketServiceMessenger,\n} from './BackendWebSocketService';\n\n// ============================================================================\n// ACCOUNT ACTIVITY SERVICE\n// ============================================================================\n\nexport {\n AccountActivityService,\n ACCOUNT_ACTIVITY_SERVICE_ALLOWED_ACTIONS,\n ACCOUNT_ACTIVITY_SERVICE_ALLOWED_EVENTS,\n} from './AccountActivityService';\n\nexport type {\n SystemNotificationData,\n SubscriptionOptions,\n AccountActivityServiceOptions,\n AccountActivityServiceActions,\n AllowedActions as AccountActivityServiceAllowedActions,\n AccountActivityServiceTransactionUpdatedEvent,\n AccountActivityServiceBalanceUpdatedEvent,\n AccountActivityServiceSubscriptionErrorEvent,\n AccountActivityServiceStatusChangedEvent,\n AccountActivityServiceEvents,\n AllowedEvents as AccountActivityServiceAllowedEvents,\n AccountActivityServiceMessenger,\n} from './AccountActivityService';\n\n// ============================================================================\n// SHARED TYPES\n// ============================================================================\n\nexport type {\n Transaction,\n Asset,\n Balance,\n Transfer,\n BalanceUpdate,\n AccountActivityMessage,\n} from './types';\n\n// ============================================================================\n// API PLATFORM CLIENT\n// ============================================================================\n\nexport {\n ApiPlatformClient,\n createApiPlatformClient,\n // Individual API clients\n AccountsApiClient,\n PricesApiClient,\n TokenApiClient,\n TokensApiClient,\n // Constants\n API_URLS,\n STALE_TIMES,\n GC_TIMES,\n // Helpers\n calculateRetryDelay,\n shouldRetry,\n // Errors\n HttpError,\n} from './api';\n\n// ============================================================================\n// API PLATFORM CLIENT TYPES\n// ============================================================================\n\nexport type {\n // Client options\n ApiPlatformClientOptions,\n FetchOptions,\n // Shared types\n PageInfo,\n SupportedCurrency,\n MarketDataDetails,\n // Accounts API types\n V5BalanceItem,\n V5BalancesResponse,\n V2BalanceItem,\n V2BalancesResponse,\n V4BalancesResponse,\n V1SupportedNetworksResponse,\n V2SupportedNetworksResponse,\n V2ActiveNetworksResponse,\n V1TransactionByHashResponse,\n V1AccountTransactionsResponse,\n V4MultiAccountTransactionsResponse,\n ValueTransfer,\n V1AccountRelationshipResult,\n NftItem,\n V2NftsResponse,\n TokenDiscoveryItem,\n V2TokensResponse,\n // Prices API types\n V3SpotPricesResponse,\n CoinGeckoSpotPrice,\n ExchangeRateInfo,\n V1ExchangeRatesResponse,\n PriceSupportedNetworksResponse,\n V1HistoricalPricesResponse,\n V3HistoricalPricesResponse,\n // Token API types\n TokenMetadata,\n V1TokenDescriptionResponse,\n NetworkInfo,\n TopAsset,\n TrendingSortBy,\n TrendingToken,\n TopGainersSortOption,\n TrendingSortOption,\n V1SuggestedOccurrenceFloorsResponse,\n // Tokens API types\n V1TokenSupportedNetworksResponse,\n V2TokenSupportedNetworksResponse,\n V3AssetResponse,\n} from './api';\n"]}
|
package/dist/index.d.cts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
export { BackendWebSocketService, getCloseReason, WebSocketState, WebSocketEventType, } from "./BackendWebSocketService.cjs";
|
|
2
|
+
export type { BackendWebSocketServiceOptions, ClientRequestMessage, ServerResponseMessage, ServerNotificationMessage, WebSocketMessage, ChannelCallback, WebSocketSubscription, WebSocketConnectionInfo, BackendWebSocketServiceActions, BackendWebSocketServiceConnectionStateChangedEvent, BackendWebSocketServiceEvents, BackendWebSocketServiceMessenger, } from "./BackendWebSocketService.cjs";
|
|
3
|
+
export { AccountActivityService, ACCOUNT_ACTIVITY_SERVICE_ALLOWED_ACTIONS, ACCOUNT_ACTIVITY_SERVICE_ALLOWED_EVENTS, } from "./AccountActivityService.cjs";
|
|
4
|
+
export type { SystemNotificationData, SubscriptionOptions, AccountActivityServiceOptions, AccountActivityServiceActions, AllowedActions as AccountActivityServiceAllowedActions, AccountActivityServiceTransactionUpdatedEvent, AccountActivityServiceBalanceUpdatedEvent, AccountActivityServiceSubscriptionErrorEvent, AccountActivityServiceStatusChangedEvent, AccountActivityServiceEvents, AllowedEvents as AccountActivityServiceAllowedEvents, AccountActivityServiceMessenger, } from "./AccountActivityService.cjs";
|
|
4
5
|
export type { Transaction, Asset, Balance, Transfer, BalanceUpdate, AccountActivityMessage, } from "./types.cjs";
|
|
5
|
-
export
|
|
6
|
-
export {
|
|
7
|
-
export type { SubscriptionOptions, AccountActivityServiceOptions, AccountActivityServiceActions, AccountActivityServiceTransactionUpdatedEvent, AccountActivityServiceBalanceUpdatedEvent, AccountActivityServiceSubscriptionErrorEvent, AccountActivityServiceStatusChangedEvent, AccountActivityServiceEvents, AccountActivityServiceMessenger, } from "./AccountActivityService.cjs";
|
|
8
|
-
export { AccountActivityService } from "./AccountActivityService.cjs";
|
|
6
|
+
export { ApiPlatformClient, createApiPlatformClient, AccountsApiClient, PricesApiClient, TokenApiClient, TokensApiClient, API_URLS, STALE_TIMES, GC_TIMES, calculateRetryDelay, shouldRetry, HttpError, } from "./api/index.cjs";
|
|
7
|
+
export type { ApiPlatformClientOptions, FetchOptions, PageInfo, SupportedCurrency, MarketDataDetails, V5BalanceItem, V5BalancesResponse, V2BalanceItem, V2BalancesResponse, V4BalancesResponse, V1SupportedNetworksResponse, V2SupportedNetworksResponse, V2ActiveNetworksResponse, V1TransactionByHashResponse, V1AccountTransactionsResponse, V4MultiAccountTransactionsResponse, ValueTransfer, V1AccountRelationshipResult, NftItem, V2NftsResponse, TokenDiscoveryItem, V2TokensResponse, V3SpotPricesResponse, CoinGeckoSpotPrice, ExchangeRateInfo, V1ExchangeRatesResponse, PriceSupportedNetworksResponse, V1HistoricalPricesResponse, V3HistoricalPricesResponse, TokenMetadata, V1TokenDescriptionResponse, NetworkInfo, TopAsset, TrendingSortBy, TrendingToken, TopGainersSortOption, TrendingSortOption, V1SuggestedOccurrenceFloorsResponse, V1TokenSupportedNetworksResponse, V2TokenSupportedNetworksResponse, V3AssetResponse, } from "./api/index.cjs";
|
|
9
8
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,uBAAuB,EACvB,cAAc,EACd,cAAc,EACd,kBAAkB,GACnB,sCAAkC;AAEnC,YAAY,EACV,8BAA8B,EAC9B,oBAAoB,EACpB,qBAAqB,EACrB,yBAAyB,EACzB,gBAAgB,EAChB,eAAe,EACf,qBAAqB,EACrB,uBAAuB,EACvB,8BAA8B,EAC9B,kDAAkD,EAClD,6BAA6B,EAC7B,gCAAgC,GACjC,sCAAkC;AAMnC,OAAO,EACL,sBAAsB,EACtB,wCAAwC,EACxC,uCAAuC,GACxC,qCAAiC;AAElC,YAAY,EACV,sBAAsB,EACtB,mBAAmB,EACnB,6BAA6B,EAC7B,6BAA6B,EAC7B,cAAc,IAAI,oCAAoC,EACtD,6CAA6C,EAC7C,yCAAyC,EACzC,4CAA4C,EAC5C,wCAAwC,EACxC,4BAA4B,EAC5B,aAAa,IAAI,mCAAmC,EACpD,+BAA+B,GAChC,qCAAiC;AAMlC,YAAY,EACV,WAAW,EACX,KAAK,EACL,OAAO,EACP,QAAQ,EACR,aAAa,EACb,sBAAsB,GACvB,oBAAgB;AAMjB,OAAO,EACL,iBAAiB,EACjB,uBAAuB,EAEvB,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,eAAe,EAEf,QAAQ,EACR,WAAW,EACX,QAAQ,EAER,mBAAmB,EACnB,WAAW,EAEX,SAAS,GACV,wBAAc;AAMf,YAAY,EAEV,wBAAwB,EACxB,YAAY,EAEZ,QAAQ,EACR,iBAAiB,EACjB,iBAAiB,EAEjB,aAAa,EACb,kBAAkB,EAClB,aAAa,EACb,kBAAkB,EAClB,kBAAkB,EAClB,2BAA2B,EAC3B,2BAA2B,EAC3B,wBAAwB,EACxB,2BAA2B,EAC3B,6BAA6B,EAC7B,kCAAkC,EAClC,aAAa,EACb,2BAA2B,EAC3B,OAAO,EACP,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAEhB,oBAAoB,EACpB,kBAAkB,EAClB,gBAAgB,EAChB,uBAAuB,EACvB,8BAA8B,EAC9B,0BAA0B,EAC1B,0BAA0B,EAE1B,aAAa,EACb,0BAA0B,EAC1B,WAAW,EACX,QAAQ,EACR,cAAc,EACd,aAAa,EACb,oBAAoB,EACpB,kBAAkB,EAClB,mCAAmC,EAEnC,gCAAgC,EAChC,gCAAgC,EAChC,eAAe,GAChB,wBAAc"}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
export { BackendWebSocketService, getCloseReason, WebSocketState, WebSocketEventType, } from "./BackendWebSocketService.mjs";
|
|
2
|
+
export type { BackendWebSocketServiceOptions, ClientRequestMessage, ServerResponseMessage, ServerNotificationMessage, WebSocketMessage, ChannelCallback, WebSocketSubscription, WebSocketConnectionInfo, BackendWebSocketServiceActions, BackendWebSocketServiceConnectionStateChangedEvent, BackendWebSocketServiceEvents, BackendWebSocketServiceMessenger, } from "./BackendWebSocketService.mjs";
|
|
3
|
+
export { AccountActivityService, ACCOUNT_ACTIVITY_SERVICE_ALLOWED_ACTIONS, ACCOUNT_ACTIVITY_SERVICE_ALLOWED_EVENTS, } from "./AccountActivityService.mjs";
|
|
4
|
+
export type { SystemNotificationData, SubscriptionOptions, AccountActivityServiceOptions, AccountActivityServiceActions, AllowedActions as AccountActivityServiceAllowedActions, AccountActivityServiceTransactionUpdatedEvent, AccountActivityServiceBalanceUpdatedEvent, AccountActivityServiceSubscriptionErrorEvent, AccountActivityServiceStatusChangedEvent, AccountActivityServiceEvents, AllowedEvents as AccountActivityServiceAllowedEvents, AccountActivityServiceMessenger, } from "./AccountActivityService.mjs";
|
|
4
5
|
export type { Transaction, Asset, Balance, Transfer, BalanceUpdate, AccountActivityMessage, } from "./types.mjs";
|
|
5
|
-
export
|
|
6
|
-
export {
|
|
7
|
-
export type { SubscriptionOptions, AccountActivityServiceOptions, AccountActivityServiceActions, AccountActivityServiceTransactionUpdatedEvent, AccountActivityServiceBalanceUpdatedEvent, AccountActivityServiceSubscriptionErrorEvent, AccountActivityServiceStatusChangedEvent, AccountActivityServiceEvents, AccountActivityServiceMessenger, } from "./AccountActivityService.mjs";
|
|
8
|
-
export { AccountActivityService } from "./AccountActivityService.mjs";
|
|
6
|
+
export { ApiPlatformClient, createApiPlatformClient, AccountsApiClient, PricesApiClient, TokenApiClient, TokensApiClient, API_URLS, STALE_TIMES, GC_TIMES, calculateRetryDelay, shouldRetry, HttpError, } from "./api/index.mjs";
|
|
7
|
+
export type { ApiPlatformClientOptions, FetchOptions, PageInfo, SupportedCurrency, MarketDataDetails, V5BalanceItem, V5BalancesResponse, V2BalanceItem, V2BalancesResponse, V4BalancesResponse, V1SupportedNetworksResponse, V2SupportedNetworksResponse, V2ActiveNetworksResponse, V1TransactionByHashResponse, V1AccountTransactionsResponse, V4MultiAccountTransactionsResponse, ValueTransfer, V1AccountRelationshipResult, NftItem, V2NftsResponse, TokenDiscoveryItem, V2TokensResponse, V3SpotPricesResponse, CoinGeckoSpotPrice, ExchangeRateInfo, V1ExchangeRatesResponse, PriceSupportedNetworksResponse, V1HistoricalPricesResponse, V3HistoricalPricesResponse, TokenMetadata, V1TokenDescriptionResponse, NetworkInfo, TopAsset, TrendingSortBy, TrendingToken, TopGainersSortOption, TrendingSortOption, V1SuggestedOccurrenceFloorsResponse, V1TokenSupportedNetworksResponse, V2TokenSupportedNetworksResponse, V3AssetResponse, } from "./api/index.mjs";
|
|
9
8
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,uBAAuB,EACvB,cAAc,EACd,cAAc,EACd,kBAAkB,GACnB,sCAAkC;AAEnC,YAAY,EACV,8BAA8B,EAC9B,oBAAoB,EACpB,qBAAqB,EACrB,yBAAyB,EACzB,gBAAgB,EAChB,eAAe,EACf,qBAAqB,EACrB,uBAAuB,EACvB,8BAA8B,EAC9B,kDAAkD,EAClD,6BAA6B,EAC7B,gCAAgC,GACjC,sCAAkC;AAMnC,OAAO,EACL,sBAAsB,EACtB,wCAAwC,EACxC,uCAAuC,GACxC,qCAAiC;AAElC,YAAY,EACV,sBAAsB,EACtB,mBAAmB,EACnB,6BAA6B,EAC7B,6BAA6B,EAC7B,cAAc,IAAI,oCAAoC,EACtD,6CAA6C,EAC7C,yCAAyC,EACzC,4CAA4C,EAC5C,wCAAwC,EACxC,4BAA4B,EAC5B,aAAa,IAAI,mCAAmC,EACpD,+BAA+B,GAChC,qCAAiC;AAMlC,YAAY,EACV,WAAW,EACX,KAAK,EACL,OAAO,EACP,QAAQ,EACR,aAAa,EACb,sBAAsB,GACvB,oBAAgB;AAMjB,OAAO,EACL,iBAAiB,EACjB,uBAAuB,EAEvB,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,eAAe,EAEf,QAAQ,EACR,WAAW,EACX,QAAQ,EAER,mBAAmB,EACnB,WAAW,EAEX,SAAS,GACV,wBAAc;AAMf,YAAY,EAEV,wBAAwB,EACxB,YAAY,EAEZ,QAAQ,EACR,iBAAiB,EACjB,iBAAiB,EAEjB,aAAa,EACb,kBAAkB,EAClB,aAAa,EACb,kBAAkB,EAClB,kBAAkB,EAClB,2BAA2B,EAC3B,2BAA2B,EAC3B,wBAAwB,EACxB,2BAA2B,EAC3B,6BAA6B,EAC7B,kCAAkC,EAClC,aAAa,EACb,2BAA2B,EAC3B,OAAO,EACP,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAEhB,oBAAoB,EACpB,kBAAkB,EAClB,gBAAgB,EAChB,uBAAuB,EACvB,8BAA8B,EAC9B,0BAA0B,EAC1B,0BAA0B,EAE1B,aAAa,EACb,0BAA0B,EAC1B,WAAW,EACX,QAAQ,EACR,cAAc,EACd,aAAa,EACb,oBAAoB,EACpB,kBAAkB,EAClB,mCAAmC,EAEnC,gCAAgC,EAChC,gCAAgC,EAChC,eAAe,GAChB,wBAAc"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export {
|
|
1
|
+
// Core Backend Package Exports
|
|
2
|
+
// ============================================================================
|
|
3
|
+
// BACKEND WEBSOCKET SERVICE
|
|
4
|
+
// ============================================================================
|
|
5
|
+
export { BackendWebSocketService, getCloseReason, WebSocketState, WebSocketEventType } from "./BackendWebSocketService.mjs";
|
|
6
|
+
// ============================================================================
|
|
7
|
+
// ACCOUNT ACTIVITY SERVICE
|
|
8
|
+
// ============================================================================
|
|
9
|
+
export { AccountActivityService, ACCOUNT_ACTIVITY_SERVICE_ALLOWED_ACTIONS, ACCOUNT_ACTIVITY_SERVICE_ALLOWED_EVENTS } from "./AccountActivityService.mjs";
|
|
10
|
+
// ============================================================================
|
|
11
|
+
// API PLATFORM CLIENT
|
|
12
|
+
// ============================================================================
|
|
13
|
+
export { ApiPlatformClient, createApiPlatformClient,
|
|
14
|
+
// Individual API clients
|
|
15
|
+
AccountsApiClient, PricesApiClient, TokenApiClient, TokensApiClient,
|
|
16
|
+
// Constants
|
|
17
|
+
API_URLS, STALE_TIMES, GC_TIMES,
|
|
18
|
+
// Helpers
|
|
19
|
+
calculateRetryDelay, shouldRetry,
|
|
20
|
+
// Errors
|
|
21
|
+
HttpError } from "./api/index.mjs";
|
|
6
22
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAE/B,+EAA+E;AAC/E,4BAA4B;AAC5B,+EAA+E;AAE/E,OAAO,EACL,uBAAuB,EACvB,cAAc,EACd,cAAc,EACd,kBAAkB,EACnB,sCAAkC;AAiBnC,+EAA+E;AAC/E,2BAA2B;AAC3B,+EAA+E;AAE/E,OAAO,EACL,sBAAsB,EACtB,wCAAwC,EACxC,uCAAuC,EACxC,qCAAiC;AA8BlC,+EAA+E;AAC/E,sBAAsB;AACtB,+EAA+E;AAE/E,OAAO,EACL,iBAAiB,EACjB,uBAAuB;AACvB,yBAAyB;AACzB,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,eAAe;AACf,YAAY;AACZ,QAAQ,EACR,WAAW,EACX,QAAQ;AACR,UAAU;AACV,mBAAmB,EACnB,WAAW;AACX,SAAS;AACT,SAAS,EACV,wBAAc","sourcesContent":["// Core Backend Package Exports\n\n// ============================================================================\n// BACKEND WEBSOCKET SERVICE\n// ============================================================================\n\nexport {\n BackendWebSocketService,\n getCloseReason,\n WebSocketState,\n WebSocketEventType,\n} from './BackendWebSocketService';\n\nexport type {\n BackendWebSocketServiceOptions,\n ClientRequestMessage,\n ServerResponseMessage,\n ServerNotificationMessage,\n WebSocketMessage,\n ChannelCallback,\n WebSocketSubscription,\n WebSocketConnectionInfo,\n BackendWebSocketServiceActions,\n BackendWebSocketServiceConnectionStateChangedEvent,\n BackendWebSocketServiceEvents,\n BackendWebSocketServiceMessenger,\n} from './BackendWebSocketService';\n\n// ============================================================================\n// ACCOUNT ACTIVITY SERVICE\n// ============================================================================\n\nexport {\n AccountActivityService,\n ACCOUNT_ACTIVITY_SERVICE_ALLOWED_ACTIONS,\n ACCOUNT_ACTIVITY_SERVICE_ALLOWED_EVENTS,\n} from './AccountActivityService';\n\nexport type {\n SystemNotificationData,\n SubscriptionOptions,\n AccountActivityServiceOptions,\n AccountActivityServiceActions,\n AllowedActions as AccountActivityServiceAllowedActions,\n AccountActivityServiceTransactionUpdatedEvent,\n AccountActivityServiceBalanceUpdatedEvent,\n AccountActivityServiceSubscriptionErrorEvent,\n AccountActivityServiceStatusChangedEvent,\n AccountActivityServiceEvents,\n AllowedEvents as AccountActivityServiceAllowedEvents,\n AccountActivityServiceMessenger,\n} from './AccountActivityService';\n\n// ============================================================================\n// SHARED TYPES\n// ============================================================================\n\nexport type {\n Transaction,\n Asset,\n Balance,\n Transfer,\n BalanceUpdate,\n AccountActivityMessage,\n} from './types';\n\n// ============================================================================\n// API PLATFORM CLIENT\n// ============================================================================\n\nexport {\n ApiPlatformClient,\n createApiPlatformClient,\n // Individual API clients\n AccountsApiClient,\n PricesApiClient,\n TokenApiClient,\n TokensApiClient,\n // Constants\n API_URLS,\n STALE_TIMES,\n GC_TIMES,\n // Helpers\n calculateRetryDelay,\n shouldRetry,\n // Errors\n HttpError,\n} from './api';\n\n// ============================================================================\n// API PLATFORM CLIENT TYPES\n// ============================================================================\n\nexport type {\n // Client options\n ApiPlatformClientOptions,\n FetchOptions,\n // Shared types\n PageInfo,\n SupportedCurrency,\n MarketDataDetails,\n // Accounts API types\n V5BalanceItem,\n V5BalancesResponse,\n V2BalanceItem,\n V2BalancesResponse,\n V4BalancesResponse,\n V1SupportedNetworksResponse,\n V2SupportedNetworksResponse,\n V2ActiveNetworksResponse,\n V1TransactionByHashResponse,\n V1AccountTransactionsResponse,\n V4MultiAccountTransactionsResponse,\n ValueTransfer,\n V1AccountRelationshipResult,\n NftItem,\n V2NftsResponse,\n TokenDiscoveryItem,\n V2TokensResponse,\n // Prices API types\n V3SpotPricesResponse,\n CoinGeckoSpotPrice,\n ExchangeRateInfo,\n V1ExchangeRatesResponse,\n PriceSupportedNetworksResponse,\n V1HistoricalPricesResponse,\n V3HistoricalPricesResponse,\n // Token API types\n TokenMetadata,\n V1TokenDescriptionResponse,\n NetworkInfo,\n TopAsset,\n TrendingSortBy,\n TrendingToken,\n TopGainersSortOption,\n TrendingSortOption,\n V1SuggestedOccurrenceFloorsResponse,\n // Tokens API types\n V1TokenSupportedNetworksResponse,\n V2TokenSupportedNetworksResponse,\n V3AssetResponse,\n} from './api';\n"]}
|