@talismn/balances-react 0.0.0-pr2109-20250718011908 → 0.0.0-pr2111-20250723030956
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.
|
@@ -473,6 +473,188 @@ export declare const chaindataAtom: import("jotai").Atom<{
|
|
|
473
473
|
mirrorOf?: string | undefined;
|
|
474
474
|
})[];
|
|
475
475
|
}>>;
|
|
476
|
+
export declare const networksAtom: import("jotai").Atom<Promise<({
|
|
477
|
+
id: string;
|
|
478
|
+
name: string;
|
|
479
|
+
nativeTokenId: string;
|
|
480
|
+
nativeCurrency: {
|
|
481
|
+
decimals: number;
|
|
482
|
+
symbol: string;
|
|
483
|
+
name: string;
|
|
484
|
+
coingeckoId?: string | undefined;
|
|
485
|
+
mirrorOf?: string | undefined;
|
|
486
|
+
logo?: string | undefined;
|
|
487
|
+
};
|
|
488
|
+
blockExplorerUrls: string[];
|
|
489
|
+
genesisHash: `0x${string}`;
|
|
490
|
+
platform: "polkadot";
|
|
491
|
+
chainName: string;
|
|
492
|
+
specName: string;
|
|
493
|
+
specVersion: number;
|
|
494
|
+
account: "secp256k1" | "*25519";
|
|
495
|
+
prefix: number;
|
|
496
|
+
rpcs: string[];
|
|
497
|
+
topology: {
|
|
498
|
+
type: "standalone";
|
|
499
|
+
} | {
|
|
500
|
+
type: "relay";
|
|
501
|
+
} | {
|
|
502
|
+
type: "parachain";
|
|
503
|
+
relayId: string;
|
|
504
|
+
paraId: number;
|
|
505
|
+
};
|
|
506
|
+
isTestnet?: boolean | undefined;
|
|
507
|
+
isDefault?: boolean | undefined;
|
|
508
|
+
forceScan?: boolean | undefined;
|
|
509
|
+
logo?: string | undefined;
|
|
510
|
+
themeColor?: string | undefined;
|
|
511
|
+
chainspecQrUrl?: string | undefined;
|
|
512
|
+
latestMetadataQrUrl?: string | undefined;
|
|
513
|
+
oldPrefix?: number | undefined;
|
|
514
|
+
registryTypes?: any;
|
|
515
|
+
signedExtensions?: any;
|
|
516
|
+
hasCheckMetadataHash?: boolean | undefined;
|
|
517
|
+
hasExtrinsicSignatureTypePrefix?: boolean | undefined;
|
|
518
|
+
isUnknownFeeToken?: boolean | undefined;
|
|
519
|
+
balancesConfig?: {
|
|
520
|
+
"substrate-native"?: {
|
|
521
|
+
disable?: boolean | undefined;
|
|
522
|
+
} | undefined;
|
|
523
|
+
"substrate-assets"?: undefined;
|
|
524
|
+
"substrate-psp22"?: undefined;
|
|
525
|
+
"substrate-tokens"?: {
|
|
526
|
+
palletId?: string | undefined;
|
|
527
|
+
} | undefined;
|
|
528
|
+
"substrate-foreignassets"?: undefined;
|
|
529
|
+
"substrate-hydration"?: undefined;
|
|
530
|
+
} | undefined;
|
|
531
|
+
} | {
|
|
532
|
+
id: string;
|
|
533
|
+
name: string;
|
|
534
|
+
nativeTokenId: string;
|
|
535
|
+
nativeCurrency: {
|
|
536
|
+
decimals: number;
|
|
537
|
+
symbol: string;
|
|
538
|
+
name: string;
|
|
539
|
+
coingeckoId?: string | undefined;
|
|
540
|
+
mirrorOf?: string | undefined;
|
|
541
|
+
logo?: string | undefined;
|
|
542
|
+
};
|
|
543
|
+
blockExplorerUrls: string[];
|
|
544
|
+
platform: "ethereum";
|
|
545
|
+
rpcs: string[];
|
|
546
|
+
isTestnet?: boolean | undefined;
|
|
547
|
+
isDefault?: boolean | undefined;
|
|
548
|
+
forceScan?: boolean | undefined;
|
|
549
|
+
logo?: string | undefined;
|
|
550
|
+
themeColor?: string | undefined;
|
|
551
|
+
substrateChainId?: string | undefined;
|
|
552
|
+
preserveGasEstimate?: boolean | undefined;
|
|
553
|
+
feeType?: "legacy" | "eip-1559" | undefined;
|
|
554
|
+
l2FeeType?: {
|
|
555
|
+
type: "op-stack";
|
|
556
|
+
} | {
|
|
557
|
+
type: "scroll";
|
|
558
|
+
l1GasPriceOracle: `0x${string}`;
|
|
559
|
+
} | undefined;
|
|
560
|
+
contracts?: Partial<Record<"Erc20Aggregator" | "Multicall3", `0x${string}`>> | undefined;
|
|
561
|
+
balancesConfig?: {
|
|
562
|
+
"evm-native"?: undefined;
|
|
563
|
+
"evm-erc20"?: undefined;
|
|
564
|
+
"evm-uniswapv2"?: undefined;
|
|
565
|
+
} | undefined;
|
|
566
|
+
})[]>>;
|
|
567
|
+
export declare const networksByIdAtom: import("jotai").Atom<Promise<import("lodash").Dictionary<{
|
|
568
|
+
id: string;
|
|
569
|
+
name: string;
|
|
570
|
+
nativeTokenId: string;
|
|
571
|
+
nativeCurrency: {
|
|
572
|
+
decimals: number;
|
|
573
|
+
symbol: string;
|
|
574
|
+
name: string;
|
|
575
|
+
coingeckoId?: string | undefined;
|
|
576
|
+
mirrorOf?: string | undefined;
|
|
577
|
+
logo?: string | undefined;
|
|
578
|
+
};
|
|
579
|
+
blockExplorerUrls: string[];
|
|
580
|
+
genesisHash: `0x${string}`;
|
|
581
|
+
platform: "polkadot";
|
|
582
|
+
chainName: string;
|
|
583
|
+
specName: string;
|
|
584
|
+
specVersion: number;
|
|
585
|
+
account: "secp256k1" | "*25519";
|
|
586
|
+
prefix: number;
|
|
587
|
+
rpcs: string[];
|
|
588
|
+
topology: {
|
|
589
|
+
type: "standalone";
|
|
590
|
+
} | {
|
|
591
|
+
type: "relay";
|
|
592
|
+
} | {
|
|
593
|
+
type: "parachain";
|
|
594
|
+
relayId: string;
|
|
595
|
+
paraId: number;
|
|
596
|
+
};
|
|
597
|
+
isTestnet?: boolean | undefined;
|
|
598
|
+
isDefault?: boolean | undefined;
|
|
599
|
+
forceScan?: boolean | undefined;
|
|
600
|
+
logo?: string | undefined;
|
|
601
|
+
themeColor?: string | undefined;
|
|
602
|
+
chainspecQrUrl?: string | undefined;
|
|
603
|
+
latestMetadataQrUrl?: string | undefined;
|
|
604
|
+
oldPrefix?: number | undefined;
|
|
605
|
+
registryTypes?: any;
|
|
606
|
+
signedExtensions?: any;
|
|
607
|
+
hasCheckMetadataHash?: boolean | undefined;
|
|
608
|
+
hasExtrinsicSignatureTypePrefix?: boolean | undefined;
|
|
609
|
+
isUnknownFeeToken?: boolean | undefined;
|
|
610
|
+
balancesConfig?: {
|
|
611
|
+
"substrate-native"?: {
|
|
612
|
+
disable?: boolean | undefined;
|
|
613
|
+
} | undefined;
|
|
614
|
+
"substrate-assets"?: undefined;
|
|
615
|
+
"substrate-psp22"?: undefined;
|
|
616
|
+
"substrate-tokens"?: {
|
|
617
|
+
palletId?: string | undefined;
|
|
618
|
+
} | undefined;
|
|
619
|
+
"substrate-foreignassets"?: undefined;
|
|
620
|
+
"substrate-hydration"?: undefined;
|
|
621
|
+
} | undefined;
|
|
622
|
+
} | {
|
|
623
|
+
id: string;
|
|
624
|
+
name: string;
|
|
625
|
+
nativeTokenId: string;
|
|
626
|
+
nativeCurrency: {
|
|
627
|
+
decimals: number;
|
|
628
|
+
symbol: string;
|
|
629
|
+
name: string;
|
|
630
|
+
coingeckoId?: string | undefined;
|
|
631
|
+
mirrorOf?: string | undefined;
|
|
632
|
+
logo?: string | undefined;
|
|
633
|
+
};
|
|
634
|
+
blockExplorerUrls: string[];
|
|
635
|
+
platform: "ethereum";
|
|
636
|
+
rpcs: string[];
|
|
637
|
+
isTestnet?: boolean | undefined;
|
|
638
|
+
isDefault?: boolean | undefined;
|
|
639
|
+
forceScan?: boolean | undefined;
|
|
640
|
+
logo?: string | undefined;
|
|
641
|
+
themeColor?: string | undefined;
|
|
642
|
+
substrateChainId?: string | undefined;
|
|
643
|
+
preserveGasEstimate?: boolean | undefined;
|
|
644
|
+
feeType?: "legacy" | "eip-1559" | undefined;
|
|
645
|
+
l2FeeType?: {
|
|
646
|
+
type: "op-stack";
|
|
647
|
+
} | {
|
|
648
|
+
type: "scroll";
|
|
649
|
+
l1GasPriceOracle: `0x${string}`;
|
|
650
|
+
} | undefined;
|
|
651
|
+
contracts?: Partial<Record<"Erc20Aggregator" | "Multicall3", `0x${string}`>> | undefined;
|
|
652
|
+
balancesConfig?: {
|
|
653
|
+
"evm-native"?: undefined;
|
|
654
|
+
"evm-erc20"?: undefined;
|
|
655
|
+
"evm-uniswapv2"?: undefined;
|
|
656
|
+
} | undefined;
|
|
657
|
+
}>>>;
|
|
476
658
|
export declare const tokensAtom: import("jotai").Atom<Promise<({
|
|
477
659
|
id: string;
|
|
478
660
|
networkId: string;
|
|
@@ -618,94 +800,148 @@ export declare const tokensAtom: import("jotai").Atom<Promise<({
|
|
|
618
800
|
noDiscovery?: boolean | undefined;
|
|
619
801
|
mirrorOf?: string | undefined;
|
|
620
802
|
})[]>>;
|
|
621
|
-
export declare const
|
|
803
|
+
export declare const tokensByIdAtom: import("jotai").Atom<Promise<import("lodash").Dictionary<{
|
|
622
804
|
id: string;
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
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;
|
|
805
|
+
networkId: string;
|
|
806
|
+
decimals: number;
|
|
807
|
+
symbol: string;
|
|
808
|
+
type: "evm-erc20";
|
|
809
|
+
platform: "ethereum";
|
|
810
|
+
contractAddress: `0x${string}`;
|
|
652
811
|
isDefault?: boolean | undefined;
|
|
653
|
-
|
|
812
|
+
name?: string | undefined;
|
|
654
813
|
logo?: string | undefined;
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
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;
|
|
814
|
+
coingeckoId?: string | undefined;
|
|
815
|
+
noDiscovery?: boolean | undefined;
|
|
816
|
+
mirrorOf?: string | undefined;
|
|
676
817
|
} | {
|
|
677
818
|
id: string;
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
symbol: string;
|
|
683
|
-
name: string;
|
|
684
|
-
coingeckoId?: string | undefined;
|
|
685
|
-
mirrorOf?: string | undefined;
|
|
686
|
-
logo?: string | undefined;
|
|
687
|
-
};
|
|
688
|
-
blockExplorerUrls: string[];
|
|
819
|
+
networkId: string;
|
|
820
|
+
decimals: number;
|
|
821
|
+
symbol: string;
|
|
822
|
+
type: "evm-native";
|
|
689
823
|
platform: "ethereum";
|
|
690
|
-
rpcs: string[];
|
|
691
|
-
isTestnet?: boolean | undefined;
|
|
692
824
|
isDefault?: boolean | undefined;
|
|
693
|
-
|
|
825
|
+
name?: string | undefined;
|
|
694
826
|
logo?: string | undefined;
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
}
|
|
711
|
-
}
|
|
827
|
+
coingeckoId?: string | undefined;
|
|
828
|
+
noDiscovery?: boolean | undefined;
|
|
829
|
+
mirrorOf?: string | undefined;
|
|
830
|
+
} | {
|
|
831
|
+
id: string;
|
|
832
|
+
networkId: string;
|
|
833
|
+
decimals: number;
|
|
834
|
+
symbol: string;
|
|
835
|
+
type: "evm-uniswapv2";
|
|
836
|
+
platform: "ethereum";
|
|
837
|
+
contractAddress: `0x${string}`;
|
|
838
|
+
symbol0: string;
|
|
839
|
+
symbol1: string;
|
|
840
|
+
decimals0: number;
|
|
841
|
+
decimals1: number;
|
|
842
|
+
tokenAddress0: `0x${string}`;
|
|
843
|
+
tokenAddress1: `0x${string}`;
|
|
844
|
+
isDefault?: boolean | undefined;
|
|
845
|
+
name?: string | undefined;
|
|
846
|
+
logo?: string | undefined;
|
|
847
|
+
coingeckoId?: string | undefined;
|
|
848
|
+
noDiscovery?: boolean | undefined;
|
|
849
|
+
mirrorOf?: string | undefined;
|
|
850
|
+
isCustom?: boolean | undefined;
|
|
851
|
+
coingeckoId0?: string | undefined;
|
|
852
|
+
coingeckoId1?: string | undefined;
|
|
853
|
+
} | {
|
|
854
|
+
id: string;
|
|
855
|
+
networkId: string;
|
|
856
|
+
decimals: number;
|
|
857
|
+
symbol: string;
|
|
858
|
+
type: "substrate-assets";
|
|
859
|
+
platform: "polkadot";
|
|
860
|
+
assetId: string;
|
|
861
|
+
isSufficient: boolean;
|
|
862
|
+
existentialDeposit: string;
|
|
863
|
+
isDefault?: boolean | undefined;
|
|
864
|
+
name?: string | undefined;
|
|
865
|
+
logo?: string | undefined;
|
|
866
|
+
coingeckoId?: string | undefined;
|
|
867
|
+
noDiscovery?: boolean | undefined;
|
|
868
|
+
mirrorOf?: string | undefined;
|
|
869
|
+
isFrozen?: boolean | undefined;
|
|
870
|
+
} | {
|
|
871
|
+
id: string;
|
|
872
|
+
networkId: string;
|
|
873
|
+
decimals: number;
|
|
874
|
+
symbol: string;
|
|
875
|
+
type: "substrate-foreignassets";
|
|
876
|
+
platform: "polkadot";
|
|
877
|
+
onChainId: string;
|
|
878
|
+
isSufficient: boolean;
|
|
879
|
+
existentialDeposit: string;
|
|
880
|
+
isDefault?: boolean | undefined;
|
|
881
|
+
name?: string | undefined;
|
|
882
|
+
logo?: string | undefined;
|
|
883
|
+
coingeckoId?: string | undefined;
|
|
884
|
+
noDiscovery?: boolean | undefined;
|
|
885
|
+
mirrorOf?: string | undefined;
|
|
886
|
+
isFrozen?: boolean | undefined;
|
|
887
|
+
} | {
|
|
888
|
+
id: string;
|
|
889
|
+
networkId: string;
|
|
890
|
+
decimals: number;
|
|
891
|
+
symbol: string;
|
|
892
|
+
type: "substrate-native";
|
|
893
|
+
platform: "polkadot";
|
|
894
|
+
existentialDeposit: string;
|
|
895
|
+
isDefault?: boolean | undefined;
|
|
896
|
+
name?: string | undefined;
|
|
897
|
+
logo?: string | undefined;
|
|
898
|
+
coingeckoId?: string | undefined;
|
|
899
|
+
noDiscovery?: boolean | undefined;
|
|
900
|
+
mirrorOf?: string | undefined;
|
|
901
|
+
} | {
|
|
902
|
+
id: string;
|
|
903
|
+
networkId: string;
|
|
904
|
+
decimals: number;
|
|
905
|
+
symbol: string;
|
|
906
|
+
type: "substrate-psp22";
|
|
907
|
+
platform: "polkadot";
|
|
908
|
+
contractAddress: string;
|
|
909
|
+
isDefault?: boolean | undefined;
|
|
910
|
+
name?: string | undefined;
|
|
911
|
+
logo?: string | undefined;
|
|
912
|
+
coingeckoId?: string | undefined;
|
|
913
|
+
noDiscovery?: boolean | undefined;
|
|
914
|
+
mirrorOf?: string | undefined;
|
|
915
|
+
} | {
|
|
916
|
+
id: string;
|
|
917
|
+
networkId: string;
|
|
918
|
+
decimals: number;
|
|
919
|
+
symbol: string;
|
|
920
|
+
type: "substrate-tokens";
|
|
921
|
+
platform: "polkadot";
|
|
922
|
+
onChainId: string | number;
|
|
923
|
+
existentialDeposit: string;
|
|
924
|
+
isDefault?: boolean | undefined;
|
|
925
|
+
name?: string | undefined;
|
|
926
|
+
logo?: string | undefined;
|
|
927
|
+
coingeckoId?: string | undefined;
|
|
928
|
+
noDiscovery?: boolean | undefined;
|
|
929
|
+
mirrorOf?: string | undefined;
|
|
930
|
+
} | {
|
|
931
|
+
id: string;
|
|
932
|
+
networkId: string;
|
|
933
|
+
decimals: number;
|
|
934
|
+
symbol: string;
|
|
935
|
+
type: "substrate-hydration";
|
|
936
|
+
platform: "polkadot";
|
|
937
|
+
onChainId: number;
|
|
938
|
+
assetType: "Token" | "Erc20" | "External";
|
|
939
|
+
isSufficient: boolean;
|
|
940
|
+
existentialDeposit: string;
|
|
941
|
+
isDefault?: boolean | undefined;
|
|
942
|
+
name?: string | undefined;
|
|
943
|
+
logo?: string | undefined;
|
|
944
|
+
coingeckoId?: string | undefined;
|
|
945
|
+
noDiscovery?: boolean | undefined;
|
|
946
|
+
mirrorOf?: string | undefined;
|
|
947
|
+
}>>>;
|
|
@@ -64,21 +64,20 @@ 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 tokens = chaindata.tokens.filter(token => (enabledTokenIds?.includes(token.id) || token.isDefault) &&
|
|
67
|
+
const networksById = lodashEs.keyBy(networks, n => n.id);
|
|
68
|
+
const tokens = chaindata.tokens.filter(token => (enabledTokenIds?.includes(token.id) || token.isDefault) && networksById[token.networkId]);
|
|
69
|
+
const tokensById = lodashEs.keyBy(tokens, t => t.id);
|
|
69
70
|
return {
|
|
70
71
|
networks,
|
|
71
|
-
|
|
72
|
+
networksById,
|
|
73
|
+
tokens,
|
|
74
|
+
tokensById
|
|
72
75
|
};
|
|
73
76
|
});
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
const networksAtom = jotai.atom(async get => {
|
|
79
|
-
const chaindata = await get(filteredChaindataAtom);
|
|
80
|
-
return chaindata.networks;
|
|
81
|
-
});
|
|
77
|
+
const networksAtom = jotai.atom(async get => (await get(filteredChaindataAtom)).networks);
|
|
78
|
+
const networksByIdAtom = jotai.atom(async get => (await get(filteredChaindataAtom)).networksById);
|
|
79
|
+
const tokensAtom = jotai.atom(async get => (await get(filteredChaindataAtom)).tokens);
|
|
80
|
+
const tokensByIdAtom = jotai.atom(async get => (await get(filteredChaindataAtom)).tokensById);
|
|
82
81
|
|
|
83
82
|
var packageJson = {
|
|
84
83
|
name: "@talismn/balances-react"};
|
|
@@ -346,8 +345,10 @@ exports.enabledChainsAtom = enabledChainsAtom;
|
|
|
346
345
|
exports.enabledTokensAtom = enabledTokensAtom;
|
|
347
346
|
exports.getStaleChains = getStaleChains;
|
|
348
347
|
exports.networksAtom = networksAtom;
|
|
348
|
+
exports.networksByIdAtom = networksByIdAtom;
|
|
349
349
|
exports.tokenRatesAtom = tokenRatesAtom;
|
|
350
350
|
exports.tokensAtom = tokensAtom;
|
|
351
|
+
exports.tokensByIdAtom = tokensByIdAtom;
|
|
351
352
|
exports.useBalances = useBalances;
|
|
352
353
|
exports.useBalancesStatus = useBalancesStatus;
|
|
353
354
|
exports.useChainConnectors = useChainConnectors;
|
|
@@ -64,21 +64,20 @@ 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 tokens = chaindata.tokens.filter(token => (enabledTokenIds?.includes(token.id) || token.isDefault) &&
|
|
67
|
+
const networksById = lodashEs.keyBy(networks, n => n.id);
|
|
68
|
+
const tokens = chaindata.tokens.filter(token => (enabledTokenIds?.includes(token.id) || token.isDefault) && networksById[token.networkId]);
|
|
69
|
+
const tokensById = lodashEs.keyBy(tokens, t => t.id);
|
|
69
70
|
return {
|
|
70
71
|
networks,
|
|
71
|
-
|
|
72
|
+
networksById,
|
|
73
|
+
tokens,
|
|
74
|
+
tokensById
|
|
72
75
|
};
|
|
73
76
|
});
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
const networksAtom = jotai.atom(async get => {
|
|
79
|
-
const chaindata = await get(filteredChaindataAtom);
|
|
80
|
-
return chaindata.networks;
|
|
81
|
-
});
|
|
77
|
+
const networksAtom = jotai.atom(async get => (await get(filteredChaindataAtom)).networks);
|
|
78
|
+
const networksByIdAtom = jotai.atom(async get => (await get(filteredChaindataAtom)).networksById);
|
|
79
|
+
const tokensAtom = jotai.atom(async get => (await get(filteredChaindataAtom)).tokens);
|
|
80
|
+
const tokensByIdAtom = jotai.atom(async get => (await get(filteredChaindataAtom)).tokensById);
|
|
82
81
|
|
|
83
82
|
var packageJson = {
|
|
84
83
|
name: "@talismn/balances-react"};
|
|
@@ -346,8 +345,10 @@ exports.enabledChainsAtom = enabledChainsAtom;
|
|
|
346
345
|
exports.enabledTokensAtom = enabledTokensAtom;
|
|
347
346
|
exports.getStaleChains = getStaleChains;
|
|
348
347
|
exports.networksAtom = networksAtom;
|
|
348
|
+
exports.networksByIdAtom = networksByIdAtom;
|
|
349
349
|
exports.tokenRatesAtom = tokenRatesAtom;
|
|
350
350
|
exports.tokensAtom = tokensAtom;
|
|
351
|
+
exports.tokensByIdAtom = tokensByIdAtom;
|
|
351
352
|
exports.useBalances = useBalances;
|
|
352
353
|
exports.useBalancesStatus = useBalancesStatus;
|
|
353
354
|
exports.useChainConnectors = useChainConnectors;
|
|
@@ -59,21 +59,20 @@ 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 tokens = chaindata.tokens.filter(token => (enabledTokenIds?.includes(token.id) || token.isDefault) &&
|
|
62
|
+
const networksById = keyBy(networks, n => n.id);
|
|
63
|
+
const tokens = chaindata.tokens.filter(token => (enabledTokenIds?.includes(token.id) || token.isDefault) && networksById[token.networkId]);
|
|
64
|
+
const tokensById = keyBy(tokens, t => t.id);
|
|
64
65
|
return {
|
|
65
66
|
networks,
|
|
66
|
-
|
|
67
|
+
networksById,
|
|
68
|
+
tokens,
|
|
69
|
+
tokensById
|
|
67
70
|
};
|
|
68
71
|
});
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
const networksAtom = atom(async get => {
|
|
74
|
-
const chaindata = await get(filteredChaindataAtom);
|
|
75
|
-
return chaindata.networks;
|
|
76
|
-
});
|
|
72
|
+
const networksAtom = atom(async get => (await get(filteredChaindataAtom)).networks);
|
|
73
|
+
const networksByIdAtom = atom(async get => (await get(filteredChaindataAtom)).networksById);
|
|
74
|
+
const tokensAtom = atom(async get => (await get(filteredChaindataAtom)).tokens);
|
|
75
|
+
const tokensByIdAtom = atom(async get => (await get(filteredChaindataAtom)).tokensById);
|
|
77
76
|
|
|
78
77
|
var packageJson = {
|
|
79
78
|
name: "@talismn/balances-react"};
|
|
@@ -304,4 +303,4 @@ const BalancesProvider = ({
|
|
|
304
303
|
});
|
|
305
304
|
};
|
|
306
305
|
|
|
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 };
|
|
306
|
+
export { BalancesProvider, allAddressesAtom, balancesAtom, chainConnectorsAtom, chaindataAtom, chaindataProviderAtom, coinsApiConfigAtom, cryptoWaitReadyAtom, enableTestnetsAtom, enabledChainsAtom, enabledTokensAtom, getStaleChains, networksAtom, networksByIdAtom, tokenRatesAtom, tokensAtom, tokensByIdAtom, 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-pr2111-20250723030956",
|
|
4
4
|
"author": "Talisman",
|
|
5
5
|
"homepage": "https://talisman.xyz",
|
|
6
6
|
"license": "GPL-3.0-or-later",
|
|
@@ -30,14 +30,14 @@
|
|
|
30
30
|
"lodash-es": "4.17.21",
|
|
31
31
|
"react-use": "^17.5.1",
|
|
32
32
|
"rxjs": "^7.8.1",
|
|
33
|
-
"@talismn/
|
|
34
|
-
"@talismn/
|
|
35
|
-
"@talismn/chaindata-provider": "
|
|
36
|
-
"@talismn/
|
|
37
|
-
"@talismn/
|
|
38
|
-
"@talismn/
|
|
39
|
-
"@talismn/
|
|
40
|
-
"@talismn/
|
|
33
|
+
"@talismn/chain-connector": "1.0.0",
|
|
34
|
+
"@talismn/balances": "0.0.0-pr2111-20250723030956",
|
|
35
|
+
"@talismn/chaindata-provider": "1.0.0",
|
|
36
|
+
"@talismn/connection-meta": "0.2.18",
|
|
37
|
+
"@talismn/scale": "0.2.0",
|
|
38
|
+
"@talismn/chain-connector-evm": "1.0.0",
|
|
39
|
+
"@talismn/token-rates": "3.0.0",
|
|
40
|
+
"@talismn/util": "0.5.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@types/jest": "^29.5.14",
|