@ledgerhq/cryptoassets 13.33.0-nightly.20251120023735 → 13.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +22 -24
- package/lib/abandonseed.d.ts.map +1 -1
- package/lib/abandonseed.js +0 -3
- package/lib/abandonseed.js.map +1 -1
- package/lib/cal-client/state-manager/api.d.ts +0 -2906
- package/lib/cal-client/state-manager/api.d.ts.map +1 -1
- package/lib/cal-client/state-manager/api.js +3 -3
- package/lib/cal-client/state-manager/api.js.map +1 -1
- package/lib/cal-client/state-manager/types.d.ts +1 -1
- package/lib/currencies.d.ts.map +1 -1
- package/lib/currencies.js +0 -63
- package/lib/currencies.js.map +1 -1
- package/lib-es/abandonseed.d.ts.map +1 -1
- package/lib-es/abandonseed.js +0 -3
- package/lib-es/abandonseed.js.map +1 -1
- package/lib-es/cal-client/state-manager/api.d.ts +0 -2906
- package/lib-es/cal-client/state-manager/api.d.ts.map +1 -1
- package/lib-es/cal-client/state-manager/api.js +2 -2
- package/lib-es/cal-client/state-manager/api.js.map +1 -1
- package/lib-es/cal-client/state-manager/types.d.ts +1 -1
- package/lib-es/currencies.d.ts.map +1 -1
- package/lib-es/currencies.js +0 -63
- package/lib-es/currencies.js.map +1 -1
- package/package.json +3 -3
- package/src/abandonseed.ts +0 -3
- package/src/cal-client/MIGRATION_GUIDE.md +8 -3
- package/src/cal-client/README.md +3 -1
- package/src/cal-client/state-manager/api.ts +1 -2
- package/src/cal-client/state-manager/types.ts +1 -1
- package/src/currencies.ts +0 -63
|
@@ -13,7 +13,7 @@ const { data, isLoading, isSuccess, isError, loadNext, error, refetch } = useTok
|
|
|
13
13
|
networkFamily?: string, // Filter by network families (e.g., "ethereum", "polygon")
|
|
14
14
|
output?: string[], // Specify output fields (e.g., ["id", "name", "ticker", "units", "delisted"])
|
|
15
15
|
limit?: number, // Maximum number of assets to return
|
|
16
|
-
pageSize?: number, // Number of items per page (default:
|
|
16
|
+
pageSize?: number, // Number of items per page (default: 100, options: 10, 100, 1000)
|
|
17
17
|
ref?: string, // CAL reference (default: "branch:main", can be tag or commit)
|
|
18
18
|
isStaging?: boolean, // Use staging or production environment
|
|
19
19
|
});
|
|
@@ -63,7 +63,9 @@ function TokenList() {
|
|
|
63
63
|
import { useTokensData } from "@ledgerhq/cryptoassets/cal-client/hooks/useTokensData";
|
|
64
64
|
|
|
65
65
|
function TokenList() {
|
|
66
|
-
const { data, isLoading, loadNext } = useTokensData({
|
|
66
|
+
const { data, isLoading, loadNext } = useTokensData({
|
|
67
|
+
pageSize: 100, // Optional: default is 100
|
|
68
|
+
});
|
|
67
69
|
|
|
68
70
|
if (isLoading) return <div>Loading...</div>;
|
|
69
71
|
|
|
@@ -157,7 +159,9 @@ import { useTokensData } from "@ledgerhq/cryptoassets/cal-client/hooks/useTokens
|
|
|
157
159
|
import { useMemo } from "react";
|
|
158
160
|
|
|
159
161
|
function SearchableTokens({ searchQuery }) {
|
|
160
|
-
const { data, isLoading, loadNext } = useTokensData({
|
|
162
|
+
const { data, isLoading, loadNext } = useTokensData({
|
|
163
|
+
pageSize: 100,
|
|
164
|
+
});
|
|
161
165
|
|
|
162
166
|
const filteredTokens = useMemo(() => {
|
|
163
167
|
if (!data?.tokens) return [];
|
|
@@ -195,6 +199,7 @@ function TokenDropdown() {
|
|
|
195
199
|
const { data, isLoading } = useTokensData({
|
|
196
200
|
output: ["id", "name", "ticker"], // Only fetch what you need
|
|
197
201
|
networkFamily: "ethereum",
|
|
202
|
+
pageSize: 100,
|
|
198
203
|
});
|
|
199
204
|
|
|
200
205
|
if (isLoading) return <select disabled>Loading...</select>;
|
package/src/cal-client/README.md
CHANGED
|
@@ -17,6 +17,7 @@ import { useTokensData } from "@ledgerhq/cryptoassets/cal-client/hooks/useTokens
|
|
|
17
17
|
const TokensList = () => {
|
|
18
18
|
const { data, isLoading, error, loadNext, isSuccess } = useTokensData({
|
|
19
19
|
networkFamily: ["ethereum", "polygon"],
|
|
20
|
+
pageSize: 100,
|
|
20
21
|
isStaging: false,
|
|
21
22
|
});
|
|
22
23
|
|
|
@@ -73,6 +74,7 @@ const InfiniteTokensList = () => {
|
|
|
73
74
|
refetch
|
|
74
75
|
} = useTokensData({
|
|
75
76
|
networkFamily: "ethereum",
|
|
77
|
+
pageSize: 100,
|
|
76
78
|
output: ["id", "name", "ticker", "contract_address"],
|
|
77
79
|
});
|
|
78
80
|
|
|
@@ -117,7 +119,7 @@ const { data: hash } = cryptoAssetsApi.useGetTokensSyncHashQuery("ethereum");
|
|
|
117
119
|
- `useTokensData(params)` - Fetch paginated tokens data with infinite scroll support
|
|
118
120
|
- **Parameters:**
|
|
119
121
|
- `networkFamily?: string` - Filter by network families (e.g., "ethereum", "polygon")
|
|
120
|
-
- `pageSize?: number` - Number of items per page (default:
|
|
122
|
+
- `pageSize?: number` - Number of items per page (default: 100, options: 10, 100, 1000)
|
|
121
123
|
- `isStaging?: boolean` - Use staging environment
|
|
122
124
|
- `output?: string[]` - Specify output fields (default: all fields)
|
|
123
125
|
- **Returns:**
|
|
@@ -197,7 +197,7 @@ export const cryptoAssetsApi = createApi({
|
|
|
197
197
|
|
|
198
198
|
getTokensData: build.infiniteQuery<TokensDataWithPagination, GetTokensDataParams, PageParam>({
|
|
199
199
|
query: ({ pageParam, queryArg = {} }) => {
|
|
200
|
-
const { isStaging = false, output, networkFamily, pageSize =
|
|
200
|
+
const { isStaging = false, output, networkFamily, pageSize = 100, limit, ref } = queryArg;
|
|
201
201
|
|
|
202
202
|
const params = {
|
|
203
203
|
output: output?.join(",") || TOKEN_OUTPUT_FIELDS.join(","),
|
|
@@ -239,7 +239,6 @@ export const {
|
|
|
239
239
|
useFindTokenByIdQuery,
|
|
240
240
|
useFindTokenByAddressInCurrencyQuery,
|
|
241
241
|
useGetTokensSyncHashQuery,
|
|
242
|
-
endpoints,
|
|
243
242
|
} = cryptoAssetsApi;
|
|
244
243
|
|
|
245
244
|
export type CryptoAssetsApi = typeof cryptoAssetsApi;
|
|
@@ -9,7 +9,7 @@ export enum TokensDataTags {
|
|
|
9
9
|
*
|
|
10
10
|
* @param networkFamily - Filter by network families (e.g., "ethereum", "polygon")
|
|
11
11
|
* @param isStaging - Use staging or production environment
|
|
12
|
-
* @param pageSize - Number of items per page (default:
|
|
12
|
+
* @param pageSize - Number of items per page (default: 100, options: 10, 100, 1000)
|
|
13
13
|
* @param output - Specify output fields (default: all fields, values: id, name, ticker, units, delisted)
|
|
14
14
|
* @param limit - Maximum number of assets to return
|
|
15
15
|
* @param ref - Reference to the source of the data Default: "branch:main" Examples:
|
package/src/currencies.ts
CHANGED
|
@@ -4840,69 +4840,6 @@ export const cryptocurrenciesById: Record<CryptoCurrencyId, CryptoCurrency> = {
|
|
|
4840
4840
|
},
|
|
4841
4841
|
],
|
|
4842
4842
|
},
|
|
4843
|
-
monad_testnet: {
|
|
4844
|
-
type: "CryptoCurrency",
|
|
4845
|
-
id: "monad_testnet",
|
|
4846
|
-
coinType: CoinType.ETH,
|
|
4847
|
-
name: "Monad Testnet",
|
|
4848
|
-
managerAppName: "Ethereum",
|
|
4849
|
-
ticker: "MON",
|
|
4850
|
-
scheme: "monad_testnet",
|
|
4851
|
-
color: "#836EF9",
|
|
4852
|
-
family: "evm",
|
|
4853
|
-
units: ethereumUnits("MON", "MON"),
|
|
4854
|
-
ethereumLikeInfo: {
|
|
4855
|
-
chainId: 10143,
|
|
4856
|
-
},
|
|
4857
|
-
explorerViews: [
|
|
4858
|
-
{
|
|
4859
|
-
tx: "https://testnet.monadexplorer.com/tx/$hash",
|
|
4860
|
-
address: "https://testnet.monadexplorer.com/address/$address",
|
|
4861
|
-
},
|
|
4862
|
-
],
|
|
4863
|
-
},
|
|
4864
|
-
somnia: {
|
|
4865
|
-
type: "CryptoCurrency",
|
|
4866
|
-
id: "somnia",
|
|
4867
|
-
coinType: CoinType.ETH,
|
|
4868
|
-
name: "Somnia",
|
|
4869
|
-
managerAppName: "Ethereum",
|
|
4870
|
-
ticker: "SOMI",
|
|
4871
|
-
scheme: "somnia",
|
|
4872
|
-
color: "#6F0191",
|
|
4873
|
-
family: "evm",
|
|
4874
|
-
units: ethereumUnits("SOMI", "SOMI"),
|
|
4875
|
-
ethereumLikeInfo: {
|
|
4876
|
-
chainId: 5031,
|
|
4877
|
-
},
|
|
4878
|
-
explorerViews: [
|
|
4879
|
-
{
|
|
4880
|
-
tx: "https://explorer.somnia.network/tx/$hash",
|
|
4881
|
-
address: "https://explorer.somnia.network/address/$address",
|
|
4882
|
-
},
|
|
4883
|
-
],
|
|
4884
|
-
},
|
|
4885
|
-
zero_gravity: {
|
|
4886
|
-
type: "CryptoCurrency",
|
|
4887
|
-
id: "zero_gravity",
|
|
4888
|
-
coinType: CoinType.ETH,
|
|
4889
|
-
name: "0G",
|
|
4890
|
-
managerAppName: "Ethereum",
|
|
4891
|
-
ticker: "0G",
|
|
4892
|
-
scheme: "zero_gravity",
|
|
4893
|
-
color: "#9200E1",
|
|
4894
|
-
family: "evm",
|
|
4895
|
-
units: ethereumUnits("0G", "0G"),
|
|
4896
|
-
ethereumLikeInfo: {
|
|
4897
|
-
chainId: 16661,
|
|
4898
|
-
},
|
|
4899
|
-
explorerViews: [
|
|
4900
|
-
{
|
|
4901
|
-
tx: "https://chainscan.0g.ai/tx/$hash",
|
|
4902
|
-
address: "https://chainscan.0g.ai/address/$address",
|
|
4903
|
-
},
|
|
4904
|
-
],
|
|
4905
|
-
},
|
|
4906
4843
|
};
|
|
4907
4844
|
|
|
4908
4845
|
const cryptocurrenciesByScheme: Record<string, CryptoCurrency> = {};
|