@talismn/balances-react 1.3.1 → 1.3.2

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.
@@ -1,6 +1,1003 @@
1
- import { NetworkId, TokenId } from "@talismn/chaindata-provider";
2
- export declare const useChaindataProvider: () => import("@talismn/chaindata-provider").ChaindataProvider;
3
- export declare const useChaindata: () => {
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ReactNode } from 'react';
3
+ import * as _talismn_chaindata_provider from '@talismn/chaindata-provider';
4
+ import { ChaindataProvider, NetworkId, TokenId } from '@talismn/chaindata-provider';
5
+ export { evmErc20TokenId, evmNativeTokenId, subAssetTokenId, subNativeTokenId, subPsp22TokenId, subTokensTokenId } from '@talismn/chaindata-provider';
6
+ import * as jotai from 'jotai';
7
+ import * as _talismn_balances from '@talismn/balances';
8
+ import { Balances, ChainConnectors } from '@talismn/balances';
9
+ import * as _talismn_token_rates from '@talismn/token-rates';
10
+ import { CoinsApiConfig } from '@talismn/token-rates';
11
+ import * as lodash from 'lodash';
12
+
13
+ /** Sets the list of addresses for which token balances will be fetched by the balances subscription */
14
+ declare const allAddressesAtom: jotai.PrimitiveAtom<string[]> & {
15
+ init: string[];
16
+ };
17
+
18
+ declare const balancesAtom: jotai.Atom<Promise<Balances>>;
19
+
20
+ declare const chainConnectorsAtom: jotai.Atom<ChainConnectors>;
21
+
22
+ declare const chaindataAtom: jotai.Atom<{
23
+ networks: ({
24
+ id: string;
25
+ name: string;
26
+ nativeTokenId: string;
27
+ nativeCurrency: {
28
+ decimals: number;
29
+ symbol: string;
30
+ name: string;
31
+ coingeckoId?: string | undefined;
32
+ mirrorOf?: string | undefined;
33
+ logo?: string | undefined;
34
+ };
35
+ blockExplorerUrls: string[];
36
+ genesisHash: `0x${string}`;
37
+ platform: "polkadot";
38
+ chainName: string;
39
+ specName: string;
40
+ specVersion: number;
41
+ account: "secp256k1" | "*25519";
42
+ prefix: number;
43
+ rpcs: string[];
44
+ topology: {
45
+ type: "standalone";
46
+ } | {
47
+ type: "relay";
48
+ } | {
49
+ type: "parachain";
50
+ relayId: string;
51
+ paraId: number;
52
+ };
53
+ isTestnet?: boolean | undefined;
54
+ isDefault?: boolean | undefined;
55
+ forceScan?: boolean | undefined;
56
+ logo?: string | undefined;
57
+ themeColor?: string | undefined;
58
+ chainspecQrUrl?: string | undefined;
59
+ latestMetadataQrUrl?: string | undefined;
60
+ oldPrefix?: number | undefined;
61
+ registryTypes?: any;
62
+ signedExtensions?: any;
63
+ hasCheckMetadataHash?: boolean | undefined;
64
+ hasExtrinsicSignatureTypePrefix?: boolean | undefined;
65
+ isUnknownFeeToken?: boolean | undefined;
66
+ balancesConfig?: {
67
+ "substrate-native"?: {
68
+ disable?: boolean | undefined;
69
+ } | undefined;
70
+ "substrate-assets"?: Record<string, never> | undefined;
71
+ "substrate-psp22"?: Record<string, never> | undefined;
72
+ "substrate-tokens"?: {
73
+ palletId?: string | undefined;
74
+ } | undefined;
75
+ "substrate-foreignassets"?: Record<string, never> | undefined;
76
+ "substrate-hydration"?: Record<string, never> | undefined;
77
+ "substrate-dtao"?: Record<string, never> | undefined;
78
+ } | undefined;
79
+ } | {
80
+ id: string;
81
+ name: string;
82
+ nativeTokenId: string;
83
+ nativeCurrency: {
84
+ decimals: number;
85
+ symbol: string;
86
+ name: string;
87
+ coingeckoId?: string | undefined;
88
+ mirrorOf?: string | undefined;
89
+ logo?: string | undefined;
90
+ };
91
+ blockExplorerUrls: string[];
92
+ platform: "ethereum";
93
+ rpcs: string[];
94
+ isTestnet?: boolean | undefined;
95
+ isDefault?: boolean | undefined;
96
+ forceScan?: boolean | undefined;
97
+ logo?: string | undefined;
98
+ themeColor?: string | undefined;
99
+ substrateChainId?: string | undefined;
100
+ preserveGasEstimate?: boolean | undefined;
101
+ feeType?: "legacy" | "eip-1559" | undefined;
102
+ l2FeeType?: {
103
+ type: "op-stack";
104
+ } | {
105
+ type: "scroll";
106
+ l1GasPriceOracle: `0x${string}`;
107
+ } | undefined;
108
+ contracts?: {
109
+ Erc20Aggregator?: `0x${string}` | undefined;
110
+ Multicall3?: `0x${string}` | undefined;
111
+ } | undefined;
112
+ balancesConfig?: {
113
+ "evm-native"?: Record<string, never> | undefined;
114
+ "evm-erc20"?: Record<string, never> | undefined;
115
+ "evm-uniswapv2"?: Record<string, never> | undefined;
116
+ } | undefined;
117
+ } | {
118
+ id: string;
119
+ name: string;
120
+ nativeTokenId: string;
121
+ nativeCurrency: {
122
+ decimals: number;
123
+ symbol: string;
124
+ name: string;
125
+ coingeckoId?: string | undefined;
126
+ mirrorOf?: string | undefined;
127
+ logo?: string | undefined;
128
+ };
129
+ blockExplorerUrls: string[];
130
+ platform: "solana";
131
+ genesisHash: string;
132
+ rpcs: string[];
133
+ isTestnet?: boolean | undefined;
134
+ isDefault?: boolean | undefined;
135
+ forceScan?: boolean | undefined;
136
+ logo?: string | undefined;
137
+ themeColor?: string | undefined;
138
+ balancesConfig?: {
139
+ "sol-native"?: Record<string, never> | undefined;
140
+ "sol-spl"?: Record<string, never> | undefined;
141
+ } | undefined;
142
+ })[];
143
+ tokens: ({
144
+ id: string;
145
+ networkId: string;
146
+ decimals: number;
147
+ symbol: string;
148
+ type: "evm-erc20";
149
+ platform: "ethereum";
150
+ contractAddress: `0x${string}`;
151
+ isDefault?: boolean | undefined;
152
+ name?: string | undefined;
153
+ logo?: string | undefined;
154
+ coingeckoId?: string | undefined;
155
+ noDiscovery?: boolean | undefined;
156
+ mirrorOf?: string | undefined;
157
+ } | {
158
+ id: string;
159
+ networkId: string;
160
+ decimals: number;
161
+ symbol: string;
162
+ type: "evm-native";
163
+ platform: "ethereum";
164
+ isDefault?: boolean | undefined;
165
+ name?: string | undefined;
166
+ logo?: string | undefined;
167
+ coingeckoId?: string | undefined;
168
+ noDiscovery?: boolean | undefined;
169
+ mirrorOf?: string | undefined;
170
+ } | {
171
+ id: string;
172
+ networkId: string;
173
+ decimals: number;
174
+ symbol: string;
175
+ type: "evm-uniswapv2";
176
+ platform: "ethereum";
177
+ contractAddress: `0x${string}`;
178
+ symbol0: string;
179
+ symbol1: string;
180
+ decimals0: number;
181
+ decimals1: number;
182
+ tokenAddress0: `0x${string}`;
183
+ tokenAddress1: `0x${string}`;
184
+ isDefault?: boolean | undefined;
185
+ name?: string | undefined;
186
+ logo?: string | undefined;
187
+ coingeckoId?: string | undefined;
188
+ noDiscovery?: boolean | undefined;
189
+ mirrorOf?: string | undefined;
190
+ isCustom?: boolean | undefined;
191
+ coingeckoId0?: string | undefined;
192
+ coingeckoId1?: string | undefined;
193
+ } | {
194
+ id: string;
195
+ networkId: string;
196
+ decimals: number;
197
+ symbol: string;
198
+ type: "substrate-assets";
199
+ platform: "polkadot";
200
+ assetId: string;
201
+ isSufficient: boolean;
202
+ existentialDeposit: string;
203
+ isDefault?: boolean | undefined;
204
+ name?: string | undefined;
205
+ logo?: string | undefined;
206
+ coingeckoId?: string | undefined;
207
+ noDiscovery?: boolean | undefined;
208
+ mirrorOf?: string | undefined;
209
+ isFrozen?: boolean | undefined;
210
+ } | {
211
+ id: string;
212
+ networkId: string;
213
+ decimals: number;
214
+ symbol: string;
215
+ type: "substrate-dtao";
216
+ platform: "polkadot";
217
+ netuid: number;
218
+ isTransferable: boolean;
219
+ isDefault?: boolean | undefined;
220
+ name?: string | undefined;
221
+ logo?: string | undefined;
222
+ coingeckoId?: string | undefined;
223
+ noDiscovery?: boolean | undefined;
224
+ mirrorOf?: string | undefined;
225
+ subnetName?: string | undefined;
226
+ hotkey?: string | undefined;
227
+ } | {
228
+ id: string;
229
+ networkId: string;
230
+ decimals: number;
231
+ symbol: string;
232
+ type: "substrate-foreignassets";
233
+ platform: "polkadot";
234
+ onChainId: string;
235
+ isSufficient: boolean;
236
+ existentialDeposit: string;
237
+ isDefault?: boolean | undefined;
238
+ name?: string | undefined;
239
+ logo?: string | undefined;
240
+ coingeckoId?: string | undefined;
241
+ noDiscovery?: boolean | undefined;
242
+ mirrorOf?: string | undefined;
243
+ isFrozen?: boolean | undefined;
244
+ } | {
245
+ id: string;
246
+ networkId: string;
247
+ decimals: number;
248
+ symbol: string;
249
+ type: "substrate-native";
250
+ platform: "polkadot";
251
+ existentialDeposit: string;
252
+ isDefault?: boolean | undefined;
253
+ name?: string | undefined;
254
+ logo?: string | undefined;
255
+ coingeckoId?: string | undefined;
256
+ noDiscovery?: boolean | undefined;
257
+ mirrorOf?: string | undefined;
258
+ } | {
259
+ id: string;
260
+ networkId: string;
261
+ decimals: number;
262
+ symbol: string;
263
+ type: "substrate-psp22";
264
+ platform: "polkadot";
265
+ contractAddress: string;
266
+ isDefault?: boolean | undefined;
267
+ name?: string | undefined;
268
+ logo?: string | undefined;
269
+ coingeckoId?: string | undefined;
270
+ noDiscovery?: boolean | undefined;
271
+ mirrorOf?: string | undefined;
272
+ } | {
273
+ id: string;
274
+ networkId: string;
275
+ decimals: number;
276
+ symbol: string;
277
+ type: "substrate-tokens";
278
+ platform: "polkadot";
279
+ onChainId: string | number;
280
+ existentialDeposit: string;
281
+ isDefault?: boolean | undefined;
282
+ name?: string | undefined;
283
+ logo?: string | undefined;
284
+ coingeckoId?: string | undefined;
285
+ noDiscovery?: boolean | undefined;
286
+ mirrorOf?: string | undefined;
287
+ } | {
288
+ id: string;
289
+ networkId: string;
290
+ decimals: number;
291
+ symbol: string;
292
+ type: "substrate-hydration";
293
+ platform: "polkadot";
294
+ onChainId: number;
295
+ assetType: "Token" | "Erc20" | "External";
296
+ isSufficient: boolean;
297
+ existentialDeposit: string;
298
+ isDefault?: boolean | undefined;
299
+ name?: string | undefined;
300
+ logo?: string | undefined;
301
+ coingeckoId?: string | undefined;
302
+ noDiscovery?: boolean | undefined;
303
+ mirrorOf?: string | undefined;
304
+ } | {
305
+ id: string;
306
+ networkId: string;
307
+ decimals: number;
308
+ symbol: string;
309
+ type: "sol-native";
310
+ platform: "solana";
311
+ isDefault?: boolean | undefined;
312
+ name?: string | undefined;
313
+ logo?: string | undefined;
314
+ coingeckoId?: string | undefined;
315
+ noDiscovery?: boolean | undefined;
316
+ mirrorOf?: string | undefined;
317
+ } | {
318
+ id: string;
319
+ networkId: string;
320
+ decimals: number;
321
+ symbol: string;
322
+ type: "sol-spl";
323
+ platform: "solana";
324
+ mintAddress: string;
325
+ isDefault?: boolean | undefined;
326
+ name?: string | undefined;
327
+ logo?: string | undefined;
328
+ coingeckoId?: string | undefined;
329
+ noDiscovery?: boolean | undefined;
330
+ mirrorOf?: string | undefined;
331
+ })[];
332
+ } | Promise<{
333
+ networks: ({
334
+ id: string;
335
+ name: string;
336
+ nativeTokenId: string;
337
+ nativeCurrency: {
338
+ decimals: number;
339
+ symbol: string;
340
+ name: string;
341
+ coingeckoId?: string | undefined;
342
+ mirrorOf?: string | undefined;
343
+ logo?: string | undefined;
344
+ };
345
+ blockExplorerUrls: string[];
346
+ genesisHash: `0x${string}`;
347
+ platform: "polkadot";
348
+ chainName: string;
349
+ specName: string;
350
+ specVersion: number;
351
+ account: "secp256k1" | "*25519";
352
+ prefix: number;
353
+ rpcs: string[];
354
+ topology: {
355
+ type: "standalone";
356
+ } | {
357
+ type: "relay";
358
+ } | {
359
+ type: "parachain";
360
+ relayId: string;
361
+ paraId: number;
362
+ };
363
+ isTestnet?: boolean | undefined;
364
+ isDefault?: boolean | undefined;
365
+ forceScan?: boolean | undefined;
366
+ logo?: string | undefined;
367
+ themeColor?: string | undefined;
368
+ chainspecQrUrl?: string | undefined;
369
+ latestMetadataQrUrl?: string | undefined;
370
+ oldPrefix?: number | undefined;
371
+ registryTypes?: any;
372
+ signedExtensions?: any;
373
+ hasCheckMetadataHash?: boolean | undefined;
374
+ hasExtrinsicSignatureTypePrefix?: boolean | undefined;
375
+ isUnknownFeeToken?: boolean | undefined;
376
+ balancesConfig?: {
377
+ "substrate-native"?: {
378
+ disable?: boolean | undefined;
379
+ } | undefined;
380
+ "substrate-assets"?: Record<string, never> | undefined;
381
+ "substrate-psp22"?: Record<string, never> | undefined;
382
+ "substrate-tokens"?: {
383
+ palletId?: string | undefined;
384
+ } | undefined;
385
+ "substrate-foreignassets"?: Record<string, never> | undefined;
386
+ "substrate-hydration"?: Record<string, never> | undefined;
387
+ "substrate-dtao"?: Record<string, never> | undefined;
388
+ } | undefined;
389
+ } | {
390
+ id: string;
391
+ name: string;
392
+ nativeTokenId: string;
393
+ nativeCurrency: {
394
+ decimals: number;
395
+ symbol: string;
396
+ name: string;
397
+ coingeckoId?: string | undefined;
398
+ mirrorOf?: string | undefined;
399
+ logo?: string | undefined;
400
+ };
401
+ blockExplorerUrls: string[];
402
+ platform: "ethereum";
403
+ rpcs: string[];
404
+ isTestnet?: boolean | undefined;
405
+ isDefault?: boolean | undefined;
406
+ forceScan?: boolean | undefined;
407
+ logo?: string | undefined;
408
+ themeColor?: string | undefined;
409
+ substrateChainId?: string | undefined;
410
+ preserveGasEstimate?: boolean | undefined;
411
+ feeType?: "legacy" | "eip-1559" | undefined;
412
+ l2FeeType?: {
413
+ type: "op-stack";
414
+ } | {
415
+ type: "scroll";
416
+ l1GasPriceOracle: `0x${string}`;
417
+ } | undefined;
418
+ contracts?: {
419
+ Erc20Aggregator?: `0x${string}` | undefined;
420
+ Multicall3?: `0x${string}` | undefined;
421
+ } | undefined;
422
+ balancesConfig?: {
423
+ "evm-native"?: Record<string, never> | undefined;
424
+ "evm-erc20"?: Record<string, never> | undefined;
425
+ "evm-uniswapv2"?: Record<string, never> | undefined;
426
+ } | undefined;
427
+ } | {
428
+ id: string;
429
+ name: string;
430
+ nativeTokenId: string;
431
+ nativeCurrency: {
432
+ decimals: number;
433
+ symbol: string;
434
+ name: string;
435
+ coingeckoId?: string | undefined;
436
+ mirrorOf?: string | undefined;
437
+ logo?: string | undefined;
438
+ };
439
+ blockExplorerUrls: string[];
440
+ platform: "solana";
441
+ genesisHash: string;
442
+ rpcs: string[];
443
+ isTestnet?: boolean | undefined;
444
+ isDefault?: boolean | undefined;
445
+ forceScan?: boolean | undefined;
446
+ logo?: string | undefined;
447
+ themeColor?: string | undefined;
448
+ balancesConfig?: {
449
+ "sol-native"?: Record<string, never> | undefined;
450
+ "sol-spl"?: Record<string, never> | undefined;
451
+ } | undefined;
452
+ })[];
453
+ tokens: ({
454
+ id: string;
455
+ networkId: string;
456
+ decimals: number;
457
+ symbol: string;
458
+ type: "evm-erc20";
459
+ platform: "ethereum";
460
+ contractAddress: `0x${string}`;
461
+ isDefault?: boolean | undefined;
462
+ name?: string | undefined;
463
+ logo?: string | undefined;
464
+ coingeckoId?: string | undefined;
465
+ noDiscovery?: boolean | undefined;
466
+ mirrorOf?: string | undefined;
467
+ } | {
468
+ id: string;
469
+ networkId: string;
470
+ decimals: number;
471
+ symbol: string;
472
+ type: "evm-native";
473
+ platform: "ethereum";
474
+ isDefault?: boolean | undefined;
475
+ name?: string | undefined;
476
+ logo?: string | undefined;
477
+ coingeckoId?: string | undefined;
478
+ noDiscovery?: boolean | undefined;
479
+ mirrorOf?: string | undefined;
480
+ } | {
481
+ id: string;
482
+ networkId: string;
483
+ decimals: number;
484
+ symbol: string;
485
+ type: "evm-uniswapv2";
486
+ platform: "ethereum";
487
+ contractAddress: `0x${string}`;
488
+ symbol0: string;
489
+ symbol1: string;
490
+ decimals0: number;
491
+ decimals1: number;
492
+ tokenAddress0: `0x${string}`;
493
+ tokenAddress1: `0x${string}`;
494
+ isDefault?: boolean | undefined;
495
+ name?: string | undefined;
496
+ logo?: string | undefined;
497
+ coingeckoId?: string | undefined;
498
+ noDiscovery?: boolean | undefined;
499
+ mirrorOf?: string | undefined;
500
+ isCustom?: boolean | undefined;
501
+ coingeckoId0?: string | undefined;
502
+ coingeckoId1?: string | undefined;
503
+ } | {
504
+ id: string;
505
+ networkId: string;
506
+ decimals: number;
507
+ symbol: string;
508
+ type: "substrate-assets";
509
+ platform: "polkadot";
510
+ assetId: string;
511
+ isSufficient: boolean;
512
+ existentialDeposit: string;
513
+ isDefault?: boolean | undefined;
514
+ name?: string | undefined;
515
+ logo?: string | undefined;
516
+ coingeckoId?: string | undefined;
517
+ noDiscovery?: boolean | undefined;
518
+ mirrorOf?: string | undefined;
519
+ isFrozen?: boolean | undefined;
520
+ } | {
521
+ id: string;
522
+ networkId: string;
523
+ decimals: number;
524
+ symbol: string;
525
+ type: "substrate-dtao";
526
+ platform: "polkadot";
527
+ netuid: number;
528
+ isTransferable: boolean;
529
+ isDefault?: boolean | undefined;
530
+ name?: string | undefined;
531
+ logo?: string | undefined;
532
+ coingeckoId?: string | undefined;
533
+ noDiscovery?: boolean | undefined;
534
+ mirrorOf?: string | undefined;
535
+ subnetName?: string | undefined;
536
+ hotkey?: string | undefined;
537
+ } | {
538
+ id: string;
539
+ networkId: string;
540
+ decimals: number;
541
+ symbol: string;
542
+ type: "substrate-foreignassets";
543
+ platform: "polkadot";
544
+ onChainId: string;
545
+ isSufficient: boolean;
546
+ existentialDeposit: string;
547
+ isDefault?: boolean | undefined;
548
+ name?: string | undefined;
549
+ logo?: string | undefined;
550
+ coingeckoId?: string | undefined;
551
+ noDiscovery?: boolean | undefined;
552
+ mirrorOf?: string | undefined;
553
+ isFrozen?: boolean | undefined;
554
+ } | {
555
+ id: string;
556
+ networkId: string;
557
+ decimals: number;
558
+ symbol: string;
559
+ type: "substrate-native";
560
+ platform: "polkadot";
561
+ existentialDeposit: string;
562
+ isDefault?: boolean | undefined;
563
+ name?: string | undefined;
564
+ logo?: string | undefined;
565
+ coingeckoId?: string | undefined;
566
+ noDiscovery?: boolean | undefined;
567
+ mirrorOf?: string | undefined;
568
+ } | {
569
+ id: string;
570
+ networkId: string;
571
+ decimals: number;
572
+ symbol: string;
573
+ type: "substrate-psp22";
574
+ platform: "polkadot";
575
+ contractAddress: string;
576
+ isDefault?: boolean | undefined;
577
+ name?: string | undefined;
578
+ logo?: string | undefined;
579
+ coingeckoId?: string | undefined;
580
+ noDiscovery?: boolean | undefined;
581
+ mirrorOf?: string | undefined;
582
+ } | {
583
+ id: string;
584
+ networkId: string;
585
+ decimals: number;
586
+ symbol: string;
587
+ type: "substrate-tokens";
588
+ platform: "polkadot";
589
+ onChainId: string | number;
590
+ existentialDeposit: string;
591
+ isDefault?: boolean | undefined;
592
+ name?: string | undefined;
593
+ logo?: string | undefined;
594
+ coingeckoId?: string | undefined;
595
+ noDiscovery?: boolean | undefined;
596
+ mirrorOf?: string | undefined;
597
+ } | {
598
+ id: string;
599
+ networkId: string;
600
+ decimals: number;
601
+ symbol: string;
602
+ type: "substrate-hydration";
603
+ platform: "polkadot";
604
+ onChainId: number;
605
+ assetType: "Token" | "Erc20" | "External";
606
+ isSufficient: boolean;
607
+ existentialDeposit: string;
608
+ isDefault?: boolean | undefined;
609
+ name?: string | undefined;
610
+ logo?: string | undefined;
611
+ coingeckoId?: string | undefined;
612
+ noDiscovery?: boolean | undefined;
613
+ mirrorOf?: string | undefined;
614
+ } | {
615
+ id: string;
616
+ networkId: string;
617
+ decimals: number;
618
+ symbol: string;
619
+ type: "sol-native";
620
+ platform: "solana";
621
+ isDefault?: boolean | undefined;
622
+ name?: string | undefined;
623
+ logo?: string | undefined;
624
+ coingeckoId?: string | undefined;
625
+ noDiscovery?: boolean | undefined;
626
+ mirrorOf?: string | undefined;
627
+ } | {
628
+ id: string;
629
+ networkId: string;
630
+ decimals: number;
631
+ symbol: string;
632
+ type: "sol-spl";
633
+ platform: "solana";
634
+ mintAddress: string;
635
+ isDefault?: boolean | undefined;
636
+ name?: string | undefined;
637
+ logo?: string | undefined;
638
+ coingeckoId?: string | undefined;
639
+ noDiscovery?: boolean | undefined;
640
+ mirrorOf?: string | undefined;
641
+ })[];
642
+ }>>;
643
+ declare const tokensAtom: jotai.Atom<Promise<({
644
+ id: string;
645
+ networkId: string;
646
+ decimals: number;
647
+ symbol: string;
648
+ type: "evm-erc20";
649
+ platform: "ethereum";
650
+ contractAddress: `0x${string}`;
651
+ isDefault?: boolean | undefined;
652
+ name?: string | undefined;
653
+ logo?: string | undefined;
654
+ coingeckoId?: string | undefined;
655
+ noDiscovery?: boolean | undefined;
656
+ mirrorOf?: string | undefined;
657
+ } | {
658
+ id: string;
659
+ networkId: string;
660
+ decimals: number;
661
+ symbol: string;
662
+ type: "evm-native";
663
+ platform: "ethereum";
664
+ isDefault?: boolean | undefined;
665
+ name?: string | undefined;
666
+ logo?: string | undefined;
667
+ coingeckoId?: string | undefined;
668
+ noDiscovery?: boolean | undefined;
669
+ mirrorOf?: string | undefined;
670
+ } | {
671
+ id: string;
672
+ networkId: string;
673
+ decimals: number;
674
+ symbol: string;
675
+ type: "evm-uniswapv2";
676
+ platform: "ethereum";
677
+ contractAddress: `0x${string}`;
678
+ symbol0: string;
679
+ symbol1: string;
680
+ decimals0: number;
681
+ decimals1: number;
682
+ tokenAddress0: `0x${string}`;
683
+ tokenAddress1: `0x${string}`;
684
+ isDefault?: boolean | undefined;
685
+ name?: string | undefined;
686
+ logo?: string | undefined;
687
+ coingeckoId?: string | undefined;
688
+ noDiscovery?: boolean | undefined;
689
+ mirrorOf?: string | undefined;
690
+ isCustom?: boolean | undefined;
691
+ coingeckoId0?: string | undefined;
692
+ coingeckoId1?: string | undefined;
693
+ } | {
694
+ id: string;
695
+ networkId: string;
696
+ decimals: number;
697
+ symbol: string;
698
+ type: "substrate-assets";
699
+ platform: "polkadot";
700
+ assetId: string;
701
+ isSufficient: boolean;
702
+ existentialDeposit: string;
703
+ isDefault?: boolean | undefined;
704
+ name?: string | undefined;
705
+ logo?: string | undefined;
706
+ coingeckoId?: string | undefined;
707
+ noDiscovery?: boolean | undefined;
708
+ mirrorOf?: string | undefined;
709
+ isFrozen?: boolean | undefined;
710
+ } | {
711
+ id: string;
712
+ networkId: string;
713
+ decimals: number;
714
+ symbol: string;
715
+ type: "substrate-dtao";
716
+ platform: "polkadot";
717
+ netuid: number;
718
+ isTransferable: boolean;
719
+ isDefault?: boolean | undefined;
720
+ name?: string | undefined;
721
+ logo?: string | undefined;
722
+ coingeckoId?: string | undefined;
723
+ noDiscovery?: boolean | undefined;
724
+ mirrorOf?: string | undefined;
725
+ subnetName?: string | undefined;
726
+ hotkey?: string | undefined;
727
+ } | {
728
+ id: string;
729
+ networkId: string;
730
+ decimals: number;
731
+ symbol: string;
732
+ type: "substrate-foreignassets";
733
+ platform: "polkadot";
734
+ onChainId: string;
735
+ isSufficient: boolean;
736
+ existentialDeposit: string;
737
+ isDefault?: boolean | undefined;
738
+ name?: string | undefined;
739
+ logo?: string | undefined;
740
+ coingeckoId?: string | undefined;
741
+ noDiscovery?: boolean | undefined;
742
+ mirrorOf?: string | undefined;
743
+ isFrozen?: boolean | undefined;
744
+ } | {
745
+ id: string;
746
+ networkId: string;
747
+ decimals: number;
748
+ symbol: string;
749
+ type: "substrate-native";
750
+ platform: "polkadot";
751
+ existentialDeposit: string;
752
+ isDefault?: boolean | undefined;
753
+ name?: string | undefined;
754
+ logo?: string | undefined;
755
+ coingeckoId?: string | undefined;
756
+ noDiscovery?: boolean | undefined;
757
+ mirrorOf?: string | undefined;
758
+ } | {
759
+ id: string;
760
+ networkId: string;
761
+ decimals: number;
762
+ symbol: string;
763
+ type: "substrate-psp22";
764
+ platform: "polkadot";
765
+ contractAddress: string;
766
+ isDefault?: boolean | undefined;
767
+ name?: string | undefined;
768
+ logo?: string | undefined;
769
+ coingeckoId?: string | undefined;
770
+ noDiscovery?: boolean | undefined;
771
+ mirrorOf?: string | undefined;
772
+ } | {
773
+ id: string;
774
+ networkId: string;
775
+ decimals: number;
776
+ symbol: string;
777
+ type: "substrate-tokens";
778
+ platform: "polkadot";
779
+ onChainId: string | number;
780
+ existentialDeposit: string;
781
+ isDefault?: boolean | undefined;
782
+ name?: string | undefined;
783
+ logo?: string | undefined;
784
+ coingeckoId?: string | undefined;
785
+ noDiscovery?: boolean | undefined;
786
+ mirrorOf?: string | undefined;
787
+ } | {
788
+ id: string;
789
+ networkId: string;
790
+ decimals: number;
791
+ symbol: string;
792
+ type: "substrate-hydration";
793
+ platform: "polkadot";
794
+ onChainId: number;
795
+ assetType: "Token" | "Erc20" | "External";
796
+ isSufficient: boolean;
797
+ existentialDeposit: string;
798
+ isDefault?: boolean | undefined;
799
+ name?: string | undefined;
800
+ logo?: string | undefined;
801
+ coingeckoId?: string | undefined;
802
+ noDiscovery?: boolean | undefined;
803
+ mirrorOf?: string | undefined;
804
+ } | {
805
+ id: string;
806
+ networkId: string;
807
+ decimals: number;
808
+ symbol: string;
809
+ type: "sol-native";
810
+ platform: "solana";
811
+ isDefault?: boolean | undefined;
812
+ name?: string | undefined;
813
+ logo?: string | undefined;
814
+ coingeckoId?: string | undefined;
815
+ noDiscovery?: boolean | undefined;
816
+ mirrorOf?: string | undefined;
817
+ } | {
818
+ id: string;
819
+ networkId: string;
820
+ decimals: number;
821
+ symbol: string;
822
+ type: "sol-spl";
823
+ platform: "solana";
824
+ mintAddress: string;
825
+ isDefault?: boolean | undefined;
826
+ name?: string | undefined;
827
+ logo?: string | undefined;
828
+ coingeckoId?: string | undefined;
829
+ noDiscovery?: boolean | undefined;
830
+ mirrorOf?: string | undefined;
831
+ })[]>>;
832
+ declare const networksAtom: jotai.Atom<Promise<({
833
+ id: string;
834
+ name: string;
835
+ nativeTokenId: string;
836
+ nativeCurrency: {
837
+ decimals: number;
838
+ symbol: string;
839
+ name: string;
840
+ coingeckoId?: string | undefined;
841
+ mirrorOf?: string | undefined;
842
+ logo?: string | undefined;
843
+ };
844
+ blockExplorerUrls: string[];
845
+ genesisHash: `0x${string}`;
846
+ platform: "polkadot";
847
+ chainName: string;
848
+ specName: string;
849
+ specVersion: number;
850
+ account: "secp256k1" | "*25519";
851
+ prefix: number;
852
+ rpcs: string[];
853
+ topology: {
854
+ type: "standalone";
855
+ } | {
856
+ type: "relay";
857
+ } | {
858
+ type: "parachain";
859
+ relayId: string;
860
+ paraId: number;
861
+ };
862
+ isTestnet?: boolean | undefined;
863
+ isDefault?: boolean | undefined;
864
+ forceScan?: boolean | undefined;
865
+ logo?: string | undefined;
866
+ themeColor?: string | undefined;
867
+ chainspecQrUrl?: string | undefined;
868
+ latestMetadataQrUrl?: string | undefined;
869
+ oldPrefix?: number | undefined;
870
+ registryTypes?: any;
871
+ signedExtensions?: any;
872
+ hasCheckMetadataHash?: boolean | undefined;
873
+ hasExtrinsicSignatureTypePrefix?: boolean | undefined;
874
+ isUnknownFeeToken?: boolean | undefined;
875
+ balancesConfig?: {
876
+ "substrate-native"?: {
877
+ disable?: boolean | undefined;
878
+ } | undefined;
879
+ "substrate-assets"?: Record<string, never> | undefined;
880
+ "substrate-psp22"?: Record<string, never> | undefined;
881
+ "substrate-tokens"?: {
882
+ palletId?: string | undefined;
883
+ } | undefined;
884
+ "substrate-foreignassets"?: Record<string, never> | undefined;
885
+ "substrate-hydration"?: Record<string, never> | undefined;
886
+ "substrate-dtao"?: Record<string, never> | undefined;
887
+ } | undefined;
888
+ } | {
889
+ id: string;
890
+ name: string;
891
+ nativeTokenId: string;
892
+ nativeCurrency: {
893
+ decimals: number;
894
+ symbol: string;
895
+ name: string;
896
+ coingeckoId?: string | undefined;
897
+ mirrorOf?: string | undefined;
898
+ logo?: string | undefined;
899
+ };
900
+ blockExplorerUrls: string[];
901
+ platform: "ethereum";
902
+ rpcs: string[];
903
+ isTestnet?: boolean | undefined;
904
+ isDefault?: boolean | undefined;
905
+ forceScan?: boolean | undefined;
906
+ logo?: string | undefined;
907
+ themeColor?: string | undefined;
908
+ substrateChainId?: string | undefined;
909
+ preserveGasEstimate?: boolean | undefined;
910
+ feeType?: "legacy" | "eip-1559" | undefined;
911
+ l2FeeType?: {
912
+ type: "op-stack";
913
+ } | {
914
+ type: "scroll";
915
+ l1GasPriceOracle: `0x${string}`;
916
+ } | undefined;
917
+ contracts?: {
918
+ Erc20Aggregator?: `0x${string}` | undefined;
919
+ Multicall3?: `0x${string}` | undefined;
920
+ } | undefined;
921
+ balancesConfig?: {
922
+ "evm-native"?: Record<string, never> | undefined;
923
+ "evm-erc20"?: Record<string, never> | undefined;
924
+ "evm-uniswapv2"?: Record<string, never> | undefined;
925
+ } | undefined;
926
+ } | {
927
+ id: string;
928
+ name: string;
929
+ nativeTokenId: string;
930
+ nativeCurrency: {
931
+ decimals: number;
932
+ symbol: string;
933
+ name: string;
934
+ coingeckoId?: string | undefined;
935
+ mirrorOf?: string | undefined;
936
+ logo?: string | undefined;
937
+ };
938
+ blockExplorerUrls: string[];
939
+ platform: "solana";
940
+ genesisHash: string;
941
+ rpcs: string[];
942
+ isTestnet?: boolean | undefined;
943
+ isDefault?: boolean | undefined;
944
+ forceScan?: boolean | undefined;
945
+ logo?: string | undefined;
946
+ themeColor?: string | undefined;
947
+ balancesConfig?: {
948
+ "sol-native"?: Record<string, never> | undefined;
949
+ "sol-spl"?: Record<string, never> | undefined;
950
+ } | undefined;
951
+ })[]>>;
952
+
953
+ declare const chaindataProviderAtom: jotai.Atom<ChaindataProvider>;
954
+ declare const useSyncSwapsChaindata: () => [void, never];
955
+
956
+ declare const coinsApiConfigAtom: jotai.WritableAtom<CoinsApiConfig, [Partial<CoinsApiConfig>], void>;
957
+ declare const enableTestnetsAtom: jotai.PrimitiveAtom<boolean> & {
958
+ init: boolean;
959
+ };
960
+ declare const enabledChainsAtom: jotai.PrimitiveAtom<string[] | undefined> & {
961
+ init: string[] | undefined;
962
+ };
963
+ declare const enabledTokensAtom: jotai.PrimitiveAtom<string[] | undefined> & {
964
+ init: string[] | undefined;
965
+ };
966
+
967
+ declare const cryptoWaitReadyAtom: jotai.Atom<Promise<boolean>>;
968
+
969
+ declare const tokenRatesAtom: jotai.Atom<Promise<_talismn_token_rates.TokenRatesList>>;
970
+
971
+ declare const useSetBalancesAddresses: (addresses: string[]) => void;
972
+ /**
973
+ * @name useBalances
974
+ * @description Hook to get the current balances state.
975
+ * @param persistBackend an optional BalancesPersistBackend backend to use for persisting the balances state. By default, indexedDB is used.
976
+ * @returns a Balances object containing the current balances state.
977
+ */
978
+ declare const useBalances: () => Balances;
979
+ type BalancesStatus = {
980
+ status: "live";
981
+ } | {
982
+ status: "fetching";
983
+ } | {
984
+ status: "stale";
985
+ staleChains: string[];
986
+ };
987
+ /**
988
+ * Given a collection of `Balances`, this hook returns a `BalancesStatus` summary for the collection.
989
+ *
990
+ * @param balances The collection of balances to get the status from.
991
+ * @returns An instance of `BalancesStatus` which represents the status of the balances collection.
992
+
993
+ */
994
+ declare const useBalancesStatus: (balances: Balances) => BalancesStatus;
995
+ declare const getStaleChains: (balances: Balances) => string[];
996
+
997
+ declare const useChainConnectors: () => _talismn_balances.ChainConnectors;
998
+
999
+ declare const useChaindataProvider: () => _talismn_chaindata_provider.ChaindataProvider;
1000
+ declare const useChaindata: () => {
4
1001
  networks: ({
5
1002
  id: string;
6
1003
  name: string;
@@ -311,7 +1308,7 @@ export declare const useChaindata: () => {
311
1308
  mirrorOf?: string | undefined;
312
1309
  })[];
313
1310
  };
314
- export declare const useNetworks: () => ({
1311
+ declare const useNetworks: () => ({
315
1312
  id: string;
316
1313
  name: string;
317
1314
  nativeTokenId: string;
@@ -431,7 +1428,7 @@ export declare const useNetworks: () => ({
431
1428
  "sol-spl"?: Record<string, never> | undefined;
432
1429
  } | undefined;
433
1430
  })[];
434
- export declare const useNetworksById: () => import("lodash").Dictionary<{
1431
+ declare const useNetworksById: () => lodash.Dictionary<{
435
1432
  id: string;
436
1433
  name: string;
437
1434
  nativeTokenId: string;
@@ -551,7 +1548,7 @@ export declare const useNetworksById: () => import("lodash").Dictionary<{
551
1548
  "sol-spl"?: Record<string, never> | undefined;
552
1549
  } | undefined;
553
1550
  }>;
554
- export declare const useNetwork: (networkId?: NetworkId) => {
1551
+ declare const useNetwork: (networkId?: NetworkId) => {
555
1552
  id: string;
556
1553
  name: string;
557
1554
  nativeTokenId: string;
@@ -671,7 +1668,7 @@ export declare const useNetwork: (networkId?: NetworkId) => {
671
1668
  "sol-spl"?: Record<string, never> | undefined;
672
1669
  } | undefined;
673
1670
  };
674
- export declare const useTokens: () => ({
1671
+ declare const useTokens: () => ({
675
1672
  id: string;
676
1673
  networkId: string;
677
1674
  decimals: number;
@@ -860,7 +1857,7 @@ export declare const useTokens: () => ({
860
1857
  noDiscovery?: boolean | undefined;
861
1858
  mirrorOf?: string | undefined;
862
1859
  })[];
863
- export declare const useTokensById: () => import("lodash").Dictionary<{
1860
+ declare const useTokensById: () => lodash.Dictionary<{
864
1861
  id: string;
865
1862
  networkId: string;
866
1863
  decimals: number;
@@ -1049,7 +2046,7 @@ export declare const useTokensById: () => import("lodash").Dictionary<{
1049
2046
  noDiscovery?: boolean | undefined;
1050
2047
  mirrorOf?: string | undefined;
1051
2048
  }>;
1052
- export declare const useToken: (tokenId?: TokenId) => {
2049
+ declare const useToken: (tokenId?: TokenId) => {
1053
2050
  id: string;
1054
2051
  networkId: string;
1055
2052
  decimals: number;
@@ -1238,3 +2235,63 @@ export declare const useToken: (tokenId?: TokenId) => {
1238
2235
  noDiscovery?: boolean | undefined;
1239
2236
  mirrorOf?: string | undefined;
1240
2237
  };
2238
+
2239
+ declare const useTokenRates: () => _talismn_token_rates.TokenRatesList;
2240
+ declare const useTokenRate: (tokenId?: TokenId) => _talismn_token_rates.TokenRates;
2241
+
2242
+ type BalancesConfig = {
2243
+ coinsApiUrl?: string;
2244
+ /** Enables balances fetching for tokens on testnet chains. */
2245
+ withTestnets?: boolean;
2246
+ /**
2247
+ * A list of chain genesisHashes to fetch balances for.
2248
+ *
2249
+ * If undefined, balances will be fetched for all chains.
2250
+ *
2251
+ * Only applies to built-in chains, custom chains will always fetch balances.
2252
+ *
2253
+ * NOTE: This is an allowlist to enable the dapp to disable balances for chains it does not care about.
2254
+ * Adding a chain here which is not already supported by the library will not automagically begin to fetch balances.
2255
+ * It will just be ignored.
2256
+ *
2257
+ * In a similar vein, if you add testnets here then make sure you've also set the `useTestnets` prop to `true`.
2258
+ *
2259
+ * @example
2260
+ * enabledChains={[
2261
+ * // polkadot
2262
+ * "0x91b171bb158e2d3848fa23a9f1c25182fb8e20313b2c1eb49219da7a70ce90c3",
2263
+ * // kusama
2264
+ * "0xb0a8d493285c2df73290dfb7e61f870f17b41801197a149ca93654499ea3dafe",
2265
+ * // rococo
2266
+ * "0x6408de7737c59c238890533af25896a2c20608d8b380bb01029acb392781063e",
2267
+ * // westend
2268
+ * "0xe143f23803ac50e8f6f8e62695d1ce9e4e1d68aa36c1cd2cfd15340213f3423e",
2269
+ * ]}
2270
+ */
2271
+ enabledChains?: string[];
2272
+ /**
2273
+ * A list of token ids to fetch balances for.
2274
+ *
2275
+ * If undefined, balances will be fetched for all tokens.
2276
+ *
2277
+ * If `enabledChains` is also defined, both filters will be applied,
2278
+ * such that only the intersection of enabledChains and enabledTokens will be fetched.
2279
+ *
2280
+ * @example
2281
+ * enabledTokens={[
2282
+ * // DOT (polkadot relay chain)
2283
+ * "polkadot-substrate-native",
2284
+ * // USDC (polkadot asset hub)
2285
+ * "polkadot-asset-hub-substrate-assets-1337-usdc",
2286
+ * // ETH (ethereum mainnet)
2287
+ * "1-evm-native",
2288
+ * // GM (gm chain)
2289
+ * "gm-substrate-tokens-gm",
2290
+ * ]}
2291
+ */
2292
+ enabledTokens?: string[];
2293
+ children?: ReactNode;
2294
+ };
2295
+ declare const BalancesProvider: ({ coinsApiUrl, withTestnets, enabledChains, enabledTokens, children, }: BalancesConfig) => react_jsx_runtime.JSX.Element;
2296
+
2297
+ export { type BalancesConfig, BalancesProvider, type BalancesStatus, allAddressesAtom, balancesAtom, chainConnectorsAtom, chaindataAtom, chaindataProviderAtom, coinsApiConfigAtom, cryptoWaitReadyAtom, enableTestnetsAtom, enabledChainsAtom, enabledTokensAtom, getStaleChains, networksAtom, tokenRatesAtom, tokensAtom, useBalances, useBalancesStatus, useChainConnectors, useChaindata, useChaindataProvider, useNetwork, useNetworks, useNetworksById, useSetBalancesAddresses, useSyncSwapsChaindata, useToken, useTokenRate, useTokenRates, useTokens, useTokensById };