@talismn/balances-react 0.0.0-pr2111-20250724004118 → 0.0.0-pr2112-20250724042947
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/dist/declarations/src/atoms/chaindata.d.ts +91 -150
- package/dist/declarations/src/hooks/useChaindata.d.ts +181 -3
- package/dist/talismn-balances-react.cjs.dev.js +33 -24
- package/dist/talismn-balances-react.cjs.prod.js +33 -24
- package/dist/talismn-balances-react.esm.js +34 -21
- package/package.json +5 -5
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { NetworkList, TokenList } from "@talismn/chaindata-provider";
|
|
2
1
|
export declare const chaindataAtom: import("jotai").Atom<{
|
|
3
2
|
networks: ({
|
|
4
3
|
id: string;
|
|
@@ -474,154 +473,6 @@ export declare const chaindataAtom: import("jotai").Atom<{
|
|
|
474
473
|
mirrorOf?: string | undefined;
|
|
475
474
|
})[];
|
|
476
475
|
}>>;
|
|
477
|
-
export declare const networksAtom: import("jotai").Atom<Promise<({
|
|
478
|
-
id: string;
|
|
479
|
-
name: string;
|
|
480
|
-
nativeTokenId: string;
|
|
481
|
-
nativeCurrency: {
|
|
482
|
-
decimals: number;
|
|
483
|
-
symbol: string;
|
|
484
|
-
name: string;
|
|
485
|
-
coingeckoId?: string | undefined;
|
|
486
|
-
mirrorOf?: string | undefined;
|
|
487
|
-
logo?: string | undefined;
|
|
488
|
-
};
|
|
489
|
-
blockExplorerUrls: string[];
|
|
490
|
-
genesisHash: `0x${string}`;
|
|
491
|
-
platform: "polkadot";
|
|
492
|
-
chainName: string;
|
|
493
|
-
specName: string;
|
|
494
|
-
specVersion: number;
|
|
495
|
-
account: "secp256k1" | "*25519";
|
|
496
|
-
prefix: number;
|
|
497
|
-
rpcs: string[];
|
|
498
|
-
topology: {
|
|
499
|
-
type: "standalone";
|
|
500
|
-
} | {
|
|
501
|
-
type: "relay";
|
|
502
|
-
} | {
|
|
503
|
-
type: "parachain";
|
|
504
|
-
relayId: string;
|
|
505
|
-
paraId: number;
|
|
506
|
-
};
|
|
507
|
-
isTestnet?: boolean | undefined;
|
|
508
|
-
isDefault?: boolean | undefined;
|
|
509
|
-
forceScan?: boolean | undefined;
|
|
510
|
-
logo?: string | undefined;
|
|
511
|
-
themeColor?: string | undefined;
|
|
512
|
-
chainspecQrUrl?: string | undefined;
|
|
513
|
-
latestMetadataQrUrl?: string | undefined;
|
|
514
|
-
oldPrefix?: number | undefined;
|
|
515
|
-
registryTypes?: any;
|
|
516
|
-
signedExtensions?: any;
|
|
517
|
-
hasCheckMetadataHash?: boolean | undefined;
|
|
518
|
-
hasExtrinsicSignatureTypePrefix?: boolean | undefined;
|
|
519
|
-
isUnknownFeeToken?: boolean | undefined;
|
|
520
|
-
balancesConfig?: {
|
|
521
|
-
"substrate-native"?: {
|
|
522
|
-
disable?: boolean | undefined;
|
|
523
|
-
} | undefined;
|
|
524
|
-
"substrate-assets"?: undefined;
|
|
525
|
-
"substrate-psp22"?: undefined;
|
|
526
|
-
"substrate-tokens"?: {
|
|
527
|
-
palletId?: string | undefined;
|
|
528
|
-
} | undefined;
|
|
529
|
-
"substrate-foreignassets"?: undefined;
|
|
530
|
-
"substrate-hydration"?: undefined;
|
|
531
|
-
} | undefined;
|
|
532
|
-
} | {
|
|
533
|
-
id: string;
|
|
534
|
-
name: string;
|
|
535
|
-
nativeTokenId: string;
|
|
536
|
-
nativeCurrency: {
|
|
537
|
-
decimals: number;
|
|
538
|
-
symbol: string;
|
|
539
|
-
name: string;
|
|
540
|
-
coingeckoId?: string | undefined;
|
|
541
|
-
mirrorOf?: string | undefined;
|
|
542
|
-
logo?: string | undefined;
|
|
543
|
-
};
|
|
544
|
-
blockExplorerUrls: string[];
|
|
545
|
-
platform: "ethereum";
|
|
546
|
-
rpcs: string[];
|
|
547
|
-
isTestnet?: boolean | undefined;
|
|
548
|
-
isDefault?: boolean | undefined;
|
|
549
|
-
forceScan?: boolean | undefined;
|
|
550
|
-
logo?: string | undefined;
|
|
551
|
-
themeColor?: string | undefined;
|
|
552
|
-
substrateChainId?: string | undefined;
|
|
553
|
-
preserveGasEstimate?: boolean | undefined;
|
|
554
|
-
feeType?: "legacy" | "eip-1559" | undefined;
|
|
555
|
-
l2FeeType?: {
|
|
556
|
-
type: "op-stack";
|
|
557
|
-
} | {
|
|
558
|
-
type: "scroll";
|
|
559
|
-
l1GasPriceOracle: `0x${string}`;
|
|
560
|
-
} | undefined;
|
|
561
|
-
contracts?: Partial<Record<"Erc20Aggregator" | "Multicall3", `0x${string}`>> | undefined;
|
|
562
|
-
balancesConfig?: {
|
|
563
|
-
"evm-native"?: undefined;
|
|
564
|
-
"evm-erc20"?: undefined;
|
|
565
|
-
"evm-uniswapv2"?: undefined;
|
|
566
|
-
} | undefined;
|
|
567
|
-
})[]>>;
|
|
568
|
-
export declare const networksByIdAtom: import("jotai").Atom<Promise<NetworkList>>;
|
|
569
|
-
export declare const dotNetworksByGenesisHashAtom: import("jotai").Atom<Promise<Record<string, {
|
|
570
|
-
id: string;
|
|
571
|
-
name: string;
|
|
572
|
-
nativeTokenId: string;
|
|
573
|
-
nativeCurrency: {
|
|
574
|
-
decimals: number;
|
|
575
|
-
symbol: string;
|
|
576
|
-
name: string;
|
|
577
|
-
coingeckoId?: string | undefined;
|
|
578
|
-
mirrorOf?: string | undefined;
|
|
579
|
-
logo?: string | undefined;
|
|
580
|
-
};
|
|
581
|
-
blockExplorerUrls: string[];
|
|
582
|
-
genesisHash: `0x${string}`;
|
|
583
|
-
platform: "polkadot";
|
|
584
|
-
chainName: string;
|
|
585
|
-
specName: string;
|
|
586
|
-
specVersion: number;
|
|
587
|
-
account: "secp256k1" | "*25519";
|
|
588
|
-
prefix: number;
|
|
589
|
-
rpcs: string[];
|
|
590
|
-
topology: {
|
|
591
|
-
type: "standalone";
|
|
592
|
-
} | {
|
|
593
|
-
type: "relay";
|
|
594
|
-
} | {
|
|
595
|
-
type: "parachain";
|
|
596
|
-
relayId: string;
|
|
597
|
-
paraId: number;
|
|
598
|
-
};
|
|
599
|
-
isTestnet?: boolean | undefined;
|
|
600
|
-
isDefault?: boolean | undefined;
|
|
601
|
-
forceScan?: boolean | undefined;
|
|
602
|
-
logo?: string | undefined;
|
|
603
|
-
themeColor?: string | undefined;
|
|
604
|
-
chainspecQrUrl?: string | undefined;
|
|
605
|
-
latestMetadataQrUrl?: string | undefined;
|
|
606
|
-
oldPrefix?: number | undefined;
|
|
607
|
-
registryTypes?: any;
|
|
608
|
-
signedExtensions?: any;
|
|
609
|
-
hasCheckMetadataHash?: boolean | undefined;
|
|
610
|
-
hasExtrinsicSignatureTypePrefix?: boolean | undefined;
|
|
611
|
-
isUnknownFeeToken?: boolean | undefined;
|
|
612
|
-
balancesConfig?: {
|
|
613
|
-
"substrate-native"?: {
|
|
614
|
-
disable?: boolean | undefined;
|
|
615
|
-
} | undefined;
|
|
616
|
-
"substrate-assets"?: undefined;
|
|
617
|
-
"substrate-psp22"?: undefined;
|
|
618
|
-
"substrate-tokens"?: {
|
|
619
|
-
palletId?: string | undefined;
|
|
620
|
-
} | undefined;
|
|
621
|
-
"substrate-foreignassets"?: undefined;
|
|
622
|
-
"substrate-hydration"?: undefined;
|
|
623
|
-
} | undefined;
|
|
624
|
-
}>>>;
|
|
625
476
|
export declare const tokensAtom: import("jotai").Atom<Promise<({
|
|
626
477
|
id: string;
|
|
627
478
|
networkId: string;
|
|
@@ -767,4 +618,94 @@ export declare const tokensAtom: import("jotai").Atom<Promise<({
|
|
|
767
618
|
noDiscovery?: boolean | undefined;
|
|
768
619
|
mirrorOf?: string | undefined;
|
|
769
620
|
})[]>>;
|
|
770
|
-
export declare const
|
|
621
|
+
export declare const networksAtom: import("jotai").Atom<Promise<({
|
|
622
|
+
id: string;
|
|
623
|
+
name: string;
|
|
624
|
+
nativeTokenId: string;
|
|
625
|
+
nativeCurrency: {
|
|
626
|
+
decimals: number;
|
|
627
|
+
symbol: string;
|
|
628
|
+
name: string;
|
|
629
|
+
coingeckoId?: string | undefined;
|
|
630
|
+
mirrorOf?: string | undefined;
|
|
631
|
+
logo?: string | undefined;
|
|
632
|
+
};
|
|
633
|
+
blockExplorerUrls: string[];
|
|
634
|
+
genesisHash: `0x${string}`;
|
|
635
|
+
platform: "polkadot";
|
|
636
|
+
chainName: string;
|
|
637
|
+
specName: string;
|
|
638
|
+
specVersion: number;
|
|
639
|
+
account: "secp256k1" | "*25519";
|
|
640
|
+
prefix: number;
|
|
641
|
+
rpcs: string[];
|
|
642
|
+
topology: {
|
|
643
|
+
type: "standalone";
|
|
644
|
+
} | {
|
|
645
|
+
type: "relay";
|
|
646
|
+
} | {
|
|
647
|
+
type: "parachain";
|
|
648
|
+
relayId: string;
|
|
649
|
+
paraId: number;
|
|
650
|
+
};
|
|
651
|
+
isTestnet?: boolean | undefined;
|
|
652
|
+
isDefault?: boolean | undefined;
|
|
653
|
+
forceScan?: boolean | undefined;
|
|
654
|
+
logo?: string | undefined;
|
|
655
|
+
themeColor?: string | undefined;
|
|
656
|
+
chainspecQrUrl?: string | undefined;
|
|
657
|
+
latestMetadataQrUrl?: string | undefined;
|
|
658
|
+
oldPrefix?: number | undefined;
|
|
659
|
+
registryTypes?: any;
|
|
660
|
+
signedExtensions?: any;
|
|
661
|
+
hasCheckMetadataHash?: boolean | undefined;
|
|
662
|
+
hasExtrinsicSignatureTypePrefix?: boolean | undefined;
|
|
663
|
+
isUnknownFeeToken?: boolean | undefined;
|
|
664
|
+
balancesConfig?: {
|
|
665
|
+
"substrate-native"?: {
|
|
666
|
+
disable?: boolean | undefined;
|
|
667
|
+
} | undefined;
|
|
668
|
+
"substrate-assets"?: undefined;
|
|
669
|
+
"substrate-psp22"?: undefined;
|
|
670
|
+
"substrate-tokens"?: {
|
|
671
|
+
palletId?: string | undefined;
|
|
672
|
+
} | undefined;
|
|
673
|
+
"substrate-foreignassets"?: undefined;
|
|
674
|
+
"substrate-hydration"?: undefined;
|
|
675
|
+
} | undefined;
|
|
676
|
+
} | {
|
|
677
|
+
id: string;
|
|
678
|
+
name: string;
|
|
679
|
+
nativeTokenId: string;
|
|
680
|
+
nativeCurrency: {
|
|
681
|
+
decimals: number;
|
|
682
|
+
symbol: string;
|
|
683
|
+
name: string;
|
|
684
|
+
coingeckoId?: string | undefined;
|
|
685
|
+
mirrorOf?: string | undefined;
|
|
686
|
+
logo?: string | undefined;
|
|
687
|
+
};
|
|
688
|
+
blockExplorerUrls: string[];
|
|
689
|
+
platform: "ethereum";
|
|
690
|
+
rpcs: string[];
|
|
691
|
+
isTestnet?: boolean | undefined;
|
|
692
|
+
isDefault?: boolean | undefined;
|
|
693
|
+
forceScan?: boolean | undefined;
|
|
694
|
+
logo?: string | undefined;
|
|
695
|
+
themeColor?: string | undefined;
|
|
696
|
+
substrateChainId?: string | undefined;
|
|
697
|
+
preserveGasEstimate?: boolean | undefined;
|
|
698
|
+
feeType?: "legacy" | "eip-1559" | undefined;
|
|
699
|
+
l2FeeType?: {
|
|
700
|
+
type: "op-stack";
|
|
701
|
+
} | {
|
|
702
|
+
type: "scroll";
|
|
703
|
+
l1GasPriceOracle: `0x${string}`;
|
|
704
|
+
} | undefined;
|
|
705
|
+
contracts?: Partial<Record<"Erc20Aggregator" | "Multicall3", `0x${string}`>> | undefined;
|
|
706
|
+
balancesConfig?: {
|
|
707
|
+
"evm-native"?: undefined;
|
|
708
|
+
"evm-erc20"?: undefined;
|
|
709
|
+
"evm-uniswapv2"?: undefined;
|
|
710
|
+
} | undefined;
|
|
711
|
+
})[]>>;
|
|
@@ -329,8 +329,7 @@ export declare const useNetworks: () => ({
|
|
|
329
329
|
"evm-uniswapv2"?: undefined;
|
|
330
330
|
} | undefined;
|
|
331
331
|
})[];
|
|
332
|
-
export declare const useNetworksById: () => import("
|
|
333
|
-
export declare const useDotNetworksByGenesisHash: () => Record<string, {
|
|
332
|
+
export declare const useNetworksById: () => import("lodash").Dictionary<{
|
|
334
333
|
id: string;
|
|
335
334
|
name: string;
|
|
336
335
|
nativeTokenId: string;
|
|
@@ -385,6 +384,41 @@ export declare const useDotNetworksByGenesisHash: () => Record<string, {
|
|
|
385
384
|
"substrate-foreignassets"?: undefined;
|
|
386
385
|
"substrate-hydration"?: undefined;
|
|
387
386
|
} | undefined;
|
|
387
|
+
} | {
|
|
388
|
+
id: string;
|
|
389
|
+
name: string;
|
|
390
|
+
nativeTokenId: string;
|
|
391
|
+
nativeCurrency: {
|
|
392
|
+
decimals: number;
|
|
393
|
+
symbol: string;
|
|
394
|
+
name: string;
|
|
395
|
+
coingeckoId?: string | undefined;
|
|
396
|
+
mirrorOf?: string | undefined;
|
|
397
|
+
logo?: string | undefined;
|
|
398
|
+
};
|
|
399
|
+
blockExplorerUrls: string[];
|
|
400
|
+
platform: "ethereum";
|
|
401
|
+
rpcs: string[];
|
|
402
|
+
isTestnet?: boolean | undefined;
|
|
403
|
+
isDefault?: boolean | undefined;
|
|
404
|
+
forceScan?: boolean | undefined;
|
|
405
|
+
logo?: string | undefined;
|
|
406
|
+
themeColor?: string | undefined;
|
|
407
|
+
substrateChainId?: string | undefined;
|
|
408
|
+
preserveGasEstimate?: boolean | undefined;
|
|
409
|
+
feeType?: "legacy" | "eip-1559" | undefined;
|
|
410
|
+
l2FeeType?: {
|
|
411
|
+
type: "op-stack";
|
|
412
|
+
} | {
|
|
413
|
+
type: "scroll";
|
|
414
|
+
l1GasPriceOracle: `0x${string}`;
|
|
415
|
+
} | undefined;
|
|
416
|
+
contracts?: Partial<Record<"Erc20Aggregator" | "Multicall3", `0x${string}`>> | undefined;
|
|
417
|
+
balancesConfig?: {
|
|
418
|
+
"evm-native"?: undefined;
|
|
419
|
+
"evm-erc20"?: undefined;
|
|
420
|
+
"evm-uniswapv2"?: undefined;
|
|
421
|
+
} | undefined;
|
|
388
422
|
}>;
|
|
389
423
|
export declare const useNetwork: (networkId?: NetworkId) => {
|
|
390
424
|
id: string;
|
|
@@ -622,7 +656,151 @@ export declare const useTokens: () => ({
|
|
|
622
656
|
noDiscovery?: boolean | undefined;
|
|
623
657
|
mirrorOf?: string | undefined;
|
|
624
658
|
})[];
|
|
625
|
-
export declare const useTokensById: () => import("
|
|
659
|
+
export declare const useTokensById: () => import("lodash").Dictionary<{
|
|
660
|
+
id: string;
|
|
661
|
+
networkId: string;
|
|
662
|
+
decimals: number;
|
|
663
|
+
symbol: string;
|
|
664
|
+
type: "evm-erc20";
|
|
665
|
+
platform: "ethereum";
|
|
666
|
+
contractAddress: `0x${string}`;
|
|
667
|
+
isDefault?: boolean | undefined;
|
|
668
|
+
name?: string | undefined;
|
|
669
|
+
logo?: string | undefined;
|
|
670
|
+
coingeckoId?: string | undefined;
|
|
671
|
+
noDiscovery?: boolean | undefined;
|
|
672
|
+
mirrorOf?: string | undefined;
|
|
673
|
+
} | {
|
|
674
|
+
id: string;
|
|
675
|
+
networkId: string;
|
|
676
|
+
decimals: number;
|
|
677
|
+
symbol: string;
|
|
678
|
+
type: "evm-native";
|
|
679
|
+
platform: "ethereum";
|
|
680
|
+
isDefault?: boolean | undefined;
|
|
681
|
+
name?: string | undefined;
|
|
682
|
+
logo?: string | undefined;
|
|
683
|
+
coingeckoId?: string | undefined;
|
|
684
|
+
noDiscovery?: boolean | undefined;
|
|
685
|
+
mirrorOf?: string | undefined;
|
|
686
|
+
} | {
|
|
687
|
+
id: string;
|
|
688
|
+
networkId: string;
|
|
689
|
+
decimals: number;
|
|
690
|
+
symbol: string;
|
|
691
|
+
type: "evm-uniswapv2";
|
|
692
|
+
platform: "ethereum";
|
|
693
|
+
contractAddress: `0x${string}`;
|
|
694
|
+
symbol0: string;
|
|
695
|
+
symbol1: string;
|
|
696
|
+
decimals0: number;
|
|
697
|
+
decimals1: number;
|
|
698
|
+
tokenAddress0: `0x${string}`;
|
|
699
|
+
tokenAddress1: `0x${string}`;
|
|
700
|
+
isDefault?: boolean | undefined;
|
|
701
|
+
name?: string | undefined;
|
|
702
|
+
logo?: string | undefined;
|
|
703
|
+
coingeckoId?: string | undefined;
|
|
704
|
+
noDiscovery?: boolean | undefined;
|
|
705
|
+
mirrorOf?: string | undefined;
|
|
706
|
+
isCustom?: boolean | undefined;
|
|
707
|
+
coingeckoId0?: string | undefined;
|
|
708
|
+
coingeckoId1?: string | undefined;
|
|
709
|
+
} | {
|
|
710
|
+
id: string;
|
|
711
|
+
networkId: string;
|
|
712
|
+
decimals: number;
|
|
713
|
+
symbol: string;
|
|
714
|
+
type: "substrate-assets";
|
|
715
|
+
platform: "polkadot";
|
|
716
|
+
assetId: string;
|
|
717
|
+
isSufficient: boolean;
|
|
718
|
+
existentialDeposit: string;
|
|
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
|
+
isFrozen?: boolean | undefined;
|
|
726
|
+
} | {
|
|
727
|
+
id: string;
|
|
728
|
+
networkId: string;
|
|
729
|
+
decimals: number;
|
|
730
|
+
symbol: string;
|
|
731
|
+
type: "substrate-foreignassets";
|
|
732
|
+
platform: "polkadot";
|
|
733
|
+
onChainId: string;
|
|
734
|
+
isSufficient: boolean;
|
|
735
|
+
existentialDeposit: string;
|
|
736
|
+
isDefault?: boolean | undefined;
|
|
737
|
+
name?: string | undefined;
|
|
738
|
+
logo?: string | undefined;
|
|
739
|
+
coingeckoId?: string | undefined;
|
|
740
|
+
noDiscovery?: boolean | undefined;
|
|
741
|
+
mirrorOf?: string | undefined;
|
|
742
|
+
isFrozen?: boolean | undefined;
|
|
743
|
+
} | {
|
|
744
|
+
id: string;
|
|
745
|
+
networkId: string;
|
|
746
|
+
decimals: number;
|
|
747
|
+
symbol: string;
|
|
748
|
+
type: "substrate-native";
|
|
749
|
+
platform: "polkadot";
|
|
750
|
+
existentialDeposit: string;
|
|
751
|
+
isDefault?: boolean | undefined;
|
|
752
|
+
name?: string | undefined;
|
|
753
|
+
logo?: string | undefined;
|
|
754
|
+
coingeckoId?: string | undefined;
|
|
755
|
+
noDiscovery?: boolean | undefined;
|
|
756
|
+
mirrorOf?: string | undefined;
|
|
757
|
+
} | {
|
|
758
|
+
id: string;
|
|
759
|
+
networkId: string;
|
|
760
|
+
decimals: number;
|
|
761
|
+
symbol: string;
|
|
762
|
+
type: "substrate-psp22";
|
|
763
|
+
platform: "polkadot";
|
|
764
|
+
contractAddress: string;
|
|
765
|
+
isDefault?: boolean | undefined;
|
|
766
|
+
name?: string | undefined;
|
|
767
|
+
logo?: string | undefined;
|
|
768
|
+
coingeckoId?: string | undefined;
|
|
769
|
+
noDiscovery?: boolean | undefined;
|
|
770
|
+
mirrorOf?: string | undefined;
|
|
771
|
+
} | {
|
|
772
|
+
id: string;
|
|
773
|
+
networkId: string;
|
|
774
|
+
decimals: number;
|
|
775
|
+
symbol: string;
|
|
776
|
+
type: "substrate-tokens";
|
|
777
|
+
platform: "polkadot";
|
|
778
|
+
onChainId: string | number;
|
|
779
|
+
existentialDeposit: string;
|
|
780
|
+
isDefault?: boolean | undefined;
|
|
781
|
+
name?: string | undefined;
|
|
782
|
+
logo?: string | undefined;
|
|
783
|
+
coingeckoId?: string | undefined;
|
|
784
|
+
noDiscovery?: boolean | undefined;
|
|
785
|
+
mirrorOf?: string | undefined;
|
|
786
|
+
} | {
|
|
787
|
+
id: string;
|
|
788
|
+
networkId: string;
|
|
789
|
+
decimals: number;
|
|
790
|
+
symbol: string;
|
|
791
|
+
type: "substrate-hydration";
|
|
792
|
+
platform: "polkadot";
|
|
793
|
+
onChainId: number;
|
|
794
|
+
assetType: "Token" | "Erc20" | "External";
|
|
795
|
+
isSufficient: boolean;
|
|
796
|
+
existentialDeposit: string;
|
|
797
|
+
isDefault?: boolean | undefined;
|
|
798
|
+
name?: string | undefined;
|
|
799
|
+
logo?: string | undefined;
|
|
800
|
+
coingeckoId?: string | undefined;
|
|
801
|
+
noDiscovery?: boolean | undefined;
|
|
802
|
+
mirrorOf?: string | undefined;
|
|
803
|
+
}>;
|
|
626
804
|
export declare const useToken: (tokenId?: TokenId) => {
|
|
627
805
|
id: string;
|
|
628
806
|
networkId: string;
|
|
@@ -64,23 +64,21 @@ const filteredChaindataAtom = jotai.atom(async get => {
|
|
|
64
64
|
const enableTestnets = get(enableTestnetsAtom);
|
|
65
65
|
const chaindata = await get(chaindataAtom);
|
|
66
66
|
const networks = chaindata.networks.filter(n => (enabledNetworkIds?.includes(n.id) || n.isDefault) && (enableTestnets || !n.isTestnet));
|
|
67
|
-
const
|
|
68
|
-
const
|
|
69
|
-
const tokens = chaindata.tokens.filter(token => (enabledTokenIds?.includes(token.id) || token.isDefault) && networksById[token.networkId]);
|
|
70
|
-
const tokensById = lodashEs.keyBy(tokens, t => t.id);
|
|
67
|
+
const networkById = lodashEs.keyBy(networks, n => n.id);
|
|
68
|
+
const tokens = chaindata.tokens.filter(token => (enabledTokenIds?.includes(token.id) || token.isDefault) && networkById[token.networkId]);
|
|
71
69
|
return {
|
|
72
70
|
networks,
|
|
73
|
-
|
|
74
|
-
dotNetworksByGenesisHash,
|
|
75
|
-
tokens,
|
|
76
|
-
tokensById
|
|
71
|
+
tokens
|
|
77
72
|
};
|
|
78
73
|
});
|
|
79
|
-
const
|
|
80
|
-
const
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
const
|
|
74
|
+
const tokensAtom = jotai.atom(async get => {
|
|
75
|
+
const chaindata = await get(filteredChaindataAtom);
|
|
76
|
+
return chaindata.tokens;
|
|
77
|
+
});
|
|
78
|
+
const networksAtom = jotai.atom(async get => {
|
|
79
|
+
const chaindata = await get(filteredChaindataAtom);
|
|
80
|
+
return chaindata.networks;
|
|
81
|
+
});
|
|
84
82
|
|
|
85
83
|
var packageJson = {
|
|
86
84
|
name: "@talismn/balances-react"};
|
|
@@ -253,13 +251,28 @@ const useChainConnectors = () => jotai.useAtomValue(chainConnectorsAtom);
|
|
|
253
251
|
|
|
254
252
|
const useChaindataProvider = () => jotai.useAtomValue(chaindataProviderAtom);
|
|
255
253
|
const useChaindata = () => jotai.useAtomValue(chaindataAtom);
|
|
256
|
-
const useNetworks = () =>
|
|
257
|
-
const useNetworksById = () =>
|
|
258
|
-
const
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
254
|
+
const useNetworks = () => useChaindata().networks;
|
|
255
|
+
const useNetworksById = () => {
|
|
256
|
+
const {
|
|
257
|
+
networks
|
|
258
|
+
} = useChaindata();
|
|
259
|
+
return react.useMemo(() => lodashEs.keyBy(networks, n => n.id), [networks]);
|
|
260
|
+
};
|
|
261
|
+
const useNetwork = networkId => {
|
|
262
|
+
const networksById = useNetworksById();
|
|
263
|
+
return networksById[networkId ?? ""] ?? null;
|
|
264
|
+
};
|
|
265
|
+
const useTokens = () => useChaindata().tokens;
|
|
266
|
+
const useTokensById = () => {
|
|
267
|
+
const {
|
|
268
|
+
tokens
|
|
269
|
+
} = useChaindata();
|
|
270
|
+
return react.useMemo(() => lodashEs.keyBy(tokens, t => t.id), [tokens]);
|
|
271
|
+
};
|
|
272
|
+
const useToken = tokenId => {
|
|
273
|
+
const tokensById = useTokensById();
|
|
274
|
+
return tokensById[tokenId ?? ""] ?? null;
|
|
275
|
+
};
|
|
263
276
|
|
|
264
277
|
const useTokenRates = () => jotai.useAtomValue(tokenRatesAtom);
|
|
265
278
|
const useTokenRate = tokenId => useTokenRates()[tokenId ?? ""] ?? undefined;
|
|
@@ -328,22 +341,18 @@ exports.chaindataAtom = chaindataAtom;
|
|
|
328
341
|
exports.chaindataProviderAtom = chaindataProviderAtom;
|
|
329
342
|
exports.coinsApiConfigAtom = coinsApiConfigAtom;
|
|
330
343
|
exports.cryptoWaitReadyAtom = cryptoWaitReadyAtom;
|
|
331
|
-
exports.dotNetworksByGenesisHashAtom = dotNetworksByGenesisHashAtom;
|
|
332
344
|
exports.enableTestnetsAtom = enableTestnetsAtom;
|
|
333
345
|
exports.enabledChainsAtom = enabledChainsAtom;
|
|
334
346
|
exports.enabledTokensAtom = enabledTokensAtom;
|
|
335
347
|
exports.getStaleChains = getStaleChains;
|
|
336
348
|
exports.networksAtom = networksAtom;
|
|
337
|
-
exports.networksByIdAtom = networksByIdAtom;
|
|
338
349
|
exports.tokenRatesAtom = tokenRatesAtom;
|
|
339
350
|
exports.tokensAtom = tokensAtom;
|
|
340
|
-
exports.tokensByIdAtom = tokensByIdAtom;
|
|
341
351
|
exports.useBalances = useBalances;
|
|
342
352
|
exports.useBalancesStatus = useBalancesStatus;
|
|
343
353
|
exports.useChainConnectors = useChainConnectors;
|
|
344
354
|
exports.useChaindata = useChaindata;
|
|
345
355
|
exports.useChaindataProvider = useChaindataProvider;
|
|
346
|
-
exports.useDotNetworksByGenesisHash = useDotNetworksByGenesisHash;
|
|
347
356
|
exports.useNetwork = useNetwork;
|
|
348
357
|
exports.useNetworks = useNetworks;
|
|
349
358
|
exports.useNetworksById = useNetworksById;
|
|
@@ -64,23 +64,21 @@ const filteredChaindataAtom = jotai.atom(async get => {
|
|
|
64
64
|
const enableTestnets = get(enableTestnetsAtom);
|
|
65
65
|
const chaindata = await get(chaindataAtom);
|
|
66
66
|
const networks = chaindata.networks.filter(n => (enabledNetworkIds?.includes(n.id) || n.isDefault) && (enableTestnets || !n.isTestnet));
|
|
67
|
-
const
|
|
68
|
-
const
|
|
69
|
-
const tokens = chaindata.tokens.filter(token => (enabledTokenIds?.includes(token.id) || token.isDefault) && networksById[token.networkId]);
|
|
70
|
-
const tokensById = lodashEs.keyBy(tokens, t => t.id);
|
|
67
|
+
const networkById = lodashEs.keyBy(networks, n => n.id);
|
|
68
|
+
const tokens = chaindata.tokens.filter(token => (enabledTokenIds?.includes(token.id) || token.isDefault) && networkById[token.networkId]);
|
|
71
69
|
return {
|
|
72
70
|
networks,
|
|
73
|
-
|
|
74
|
-
dotNetworksByGenesisHash,
|
|
75
|
-
tokens,
|
|
76
|
-
tokensById
|
|
71
|
+
tokens
|
|
77
72
|
};
|
|
78
73
|
});
|
|
79
|
-
const
|
|
80
|
-
const
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
const
|
|
74
|
+
const tokensAtom = jotai.atom(async get => {
|
|
75
|
+
const chaindata = await get(filteredChaindataAtom);
|
|
76
|
+
return chaindata.tokens;
|
|
77
|
+
});
|
|
78
|
+
const networksAtom = jotai.atom(async get => {
|
|
79
|
+
const chaindata = await get(filteredChaindataAtom);
|
|
80
|
+
return chaindata.networks;
|
|
81
|
+
});
|
|
84
82
|
|
|
85
83
|
var packageJson = {
|
|
86
84
|
name: "@talismn/balances-react"};
|
|
@@ -253,13 +251,28 @@ const useChainConnectors = () => jotai.useAtomValue(chainConnectorsAtom);
|
|
|
253
251
|
|
|
254
252
|
const useChaindataProvider = () => jotai.useAtomValue(chaindataProviderAtom);
|
|
255
253
|
const useChaindata = () => jotai.useAtomValue(chaindataAtom);
|
|
256
|
-
const useNetworks = () =>
|
|
257
|
-
const useNetworksById = () =>
|
|
258
|
-
const
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
254
|
+
const useNetworks = () => useChaindata().networks;
|
|
255
|
+
const useNetworksById = () => {
|
|
256
|
+
const {
|
|
257
|
+
networks
|
|
258
|
+
} = useChaindata();
|
|
259
|
+
return react.useMemo(() => lodashEs.keyBy(networks, n => n.id), [networks]);
|
|
260
|
+
};
|
|
261
|
+
const useNetwork = networkId => {
|
|
262
|
+
const networksById = useNetworksById();
|
|
263
|
+
return networksById[networkId ?? ""] ?? null;
|
|
264
|
+
};
|
|
265
|
+
const useTokens = () => useChaindata().tokens;
|
|
266
|
+
const useTokensById = () => {
|
|
267
|
+
const {
|
|
268
|
+
tokens
|
|
269
|
+
} = useChaindata();
|
|
270
|
+
return react.useMemo(() => lodashEs.keyBy(tokens, t => t.id), [tokens]);
|
|
271
|
+
};
|
|
272
|
+
const useToken = tokenId => {
|
|
273
|
+
const tokensById = useTokensById();
|
|
274
|
+
return tokensById[tokenId ?? ""] ?? null;
|
|
275
|
+
};
|
|
263
276
|
|
|
264
277
|
const useTokenRates = () => jotai.useAtomValue(tokenRatesAtom);
|
|
265
278
|
const useTokenRate = tokenId => useTokenRates()[tokenId ?? ""] ?? undefined;
|
|
@@ -328,22 +341,18 @@ exports.chaindataAtom = chaindataAtom;
|
|
|
328
341
|
exports.chaindataProviderAtom = chaindataProviderAtom;
|
|
329
342
|
exports.coinsApiConfigAtom = coinsApiConfigAtom;
|
|
330
343
|
exports.cryptoWaitReadyAtom = cryptoWaitReadyAtom;
|
|
331
|
-
exports.dotNetworksByGenesisHashAtom = dotNetworksByGenesisHashAtom;
|
|
332
344
|
exports.enableTestnetsAtom = enableTestnetsAtom;
|
|
333
345
|
exports.enabledChainsAtom = enabledChainsAtom;
|
|
334
346
|
exports.enabledTokensAtom = enabledTokensAtom;
|
|
335
347
|
exports.getStaleChains = getStaleChains;
|
|
336
348
|
exports.networksAtom = networksAtom;
|
|
337
|
-
exports.networksByIdAtom = networksByIdAtom;
|
|
338
349
|
exports.tokenRatesAtom = tokenRatesAtom;
|
|
339
350
|
exports.tokensAtom = tokensAtom;
|
|
340
|
-
exports.tokensByIdAtom = tokensByIdAtom;
|
|
341
351
|
exports.useBalances = useBalances;
|
|
342
352
|
exports.useBalancesStatus = useBalancesStatus;
|
|
343
353
|
exports.useChainConnectors = useChainConnectors;
|
|
344
354
|
exports.useChaindata = useChaindata;
|
|
345
355
|
exports.useChaindataProvider = useChaindataProvider;
|
|
346
|
-
exports.useDotNetworksByGenesisHash = useDotNetworksByGenesisHash;
|
|
347
356
|
exports.useNetwork = useNetwork;
|
|
348
357
|
exports.useNetworks = useNetworks;
|
|
349
358
|
exports.useNetworksById = useNetworksById;
|
|
@@ -59,23 +59,21 @@ const filteredChaindataAtom = atom(async get => {
|
|
|
59
59
|
const enableTestnets = get(enableTestnetsAtom);
|
|
60
60
|
const chaindata = await get(chaindataAtom);
|
|
61
61
|
const networks = chaindata.networks.filter(n => (enabledNetworkIds?.includes(n.id) || n.isDefault) && (enableTestnets || !n.isTestnet));
|
|
62
|
-
const
|
|
63
|
-
const
|
|
64
|
-
const tokens = chaindata.tokens.filter(token => (enabledTokenIds?.includes(token.id) || token.isDefault) && networksById[token.networkId]);
|
|
65
|
-
const tokensById = keyBy(tokens, t => t.id);
|
|
62
|
+
const networkById = keyBy(networks, n => n.id);
|
|
63
|
+
const tokens = chaindata.tokens.filter(token => (enabledTokenIds?.includes(token.id) || token.isDefault) && networkById[token.networkId]);
|
|
66
64
|
return {
|
|
67
65
|
networks,
|
|
68
|
-
|
|
69
|
-
dotNetworksByGenesisHash,
|
|
70
|
-
tokens,
|
|
71
|
-
tokensById
|
|
66
|
+
tokens
|
|
72
67
|
};
|
|
73
68
|
});
|
|
74
|
-
const
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
const
|
|
69
|
+
const tokensAtom = atom(async get => {
|
|
70
|
+
const chaindata = await get(filteredChaindataAtom);
|
|
71
|
+
return chaindata.tokens;
|
|
72
|
+
});
|
|
73
|
+
const networksAtom = atom(async get => {
|
|
74
|
+
const chaindata = await get(filteredChaindataAtom);
|
|
75
|
+
return chaindata.networks;
|
|
76
|
+
});
|
|
79
77
|
|
|
80
78
|
var packageJson = {
|
|
81
79
|
name: "@talismn/balances-react"};
|
|
@@ -248,13 +246,28 @@ const useChainConnectors = () => useAtomValue(chainConnectorsAtom);
|
|
|
248
246
|
|
|
249
247
|
const useChaindataProvider = () => useAtomValue(chaindataProviderAtom);
|
|
250
248
|
const useChaindata = () => useAtomValue(chaindataAtom);
|
|
251
|
-
const useNetworks = () =>
|
|
252
|
-
const useNetworksById = () =>
|
|
253
|
-
const
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
249
|
+
const useNetworks = () => useChaindata().networks;
|
|
250
|
+
const useNetworksById = () => {
|
|
251
|
+
const {
|
|
252
|
+
networks
|
|
253
|
+
} = useChaindata();
|
|
254
|
+
return useMemo(() => keyBy(networks, n => n.id), [networks]);
|
|
255
|
+
};
|
|
256
|
+
const useNetwork = networkId => {
|
|
257
|
+
const networksById = useNetworksById();
|
|
258
|
+
return networksById[networkId ?? ""] ?? null;
|
|
259
|
+
};
|
|
260
|
+
const useTokens = () => useChaindata().tokens;
|
|
261
|
+
const useTokensById = () => {
|
|
262
|
+
const {
|
|
263
|
+
tokens
|
|
264
|
+
} = useChaindata();
|
|
265
|
+
return useMemo(() => keyBy(tokens, t => t.id), [tokens]);
|
|
266
|
+
};
|
|
267
|
+
const useToken = tokenId => {
|
|
268
|
+
const tokensById = useTokensById();
|
|
269
|
+
return tokensById[tokenId ?? ""] ?? null;
|
|
270
|
+
};
|
|
258
271
|
|
|
259
272
|
const useTokenRates = () => useAtomValue(tokenRatesAtom);
|
|
260
273
|
const useTokenRate = tokenId => useTokenRates()[tokenId ?? ""] ?? undefined;
|
|
@@ -291,4 +304,4 @@ const BalancesProvider = ({
|
|
|
291
304
|
});
|
|
292
305
|
};
|
|
293
306
|
|
|
294
|
-
export { BalancesProvider, allAddressesAtom, balancesAtom, chainConnectorsAtom, chaindataAtom, chaindataProviderAtom, coinsApiConfigAtom, cryptoWaitReadyAtom,
|
|
307
|
+
export { BalancesProvider, allAddressesAtom, balancesAtom, chainConnectorsAtom, chaindataAtom, chaindataProviderAtom, coinsApiConfigAtom, cryptoWaitReadyAtom, enableTestnetsAtom, enabledChainsAtom, enabledTokensAtom, getStaleChains, networksAtom, tokenRatesAtom, tokensAtom, useBalances, useBalancesStatus, useChainConnectors, useChaindata, useChaindataProvider, useNetwork, useNetworks, useNetworksById, useSetBalancesAddresses, useToken, useTokenRate, useTokenRates, useTokens, useTokensById };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@talismn/balances-react",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-pr2112-20250724042947",
|
|
4
4
|
"author": "Talisman",
|
|
5
5
|
"homepage": "https://talisman.xyz",
|
|
6
6
|
"license": "GPL-3.0-or-later",
|
|
@@ -30,12 +30,12 @@
|
|
|
30
30
|
"lodash-es": "4.17.21",
|
|
31
31
|
"react-use": "^17.5.1",
|
|
32
32
|
"rxjs": "^7.8.1",
|
|
33
|
-
"@talismn/balances": "0.0.0-
|
|
34
|
-
"@talismn/
|
|
33
|
+
"@talismn/balances": "0.0.0-pr2112-20250724042947",
|
|
34
|
+
"@talismn/chaindata-provider": "1.0.0",
|
|
35
35
|
"@talismn/chain-connector-evm": "1.0.0",
|
|
36
|
-
"@talismn/
|
|
36
|
+
"@talismn/chain-connector": "1.0.0",
|
|
37
37
|
"@talismn/connection-meta": "0.2.18",
|
|
38
|
-
"@talismn/
|
|
38
|
+
"@talismn/scale": "0.2.0",
|
|
39
39
|
"@talismn/token-rates": "3.0.0",
|
|
40
40
|
"@talismn/util": "0.5.0"
|
|
41
41
|
},
|