@talismn/chaindata-provider 2.0.4 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -1172,10 +1172,10 @@ export declare const TokenSchema: z.ZodPipe<z.ZodDiscriminatedUnion<[z.ZodObject
1172
1172
  coingeckoId?: string | undefined;
1173
1173
  noDiscovery?: boolean | undefined;
1174
1174
  mirrorOf?: string | undefined;
1175
- type: "substrate-assets";
1175
+ type: "substrate-hydration";
1176
1176
  platform: "polkadot";
1177
- assetId: string;
1178
- isFrozen?: boolean | undefined;
1177
+ onChainId: number;
1178
+ assetType: "Erc20" | "External" | "Token";
1179
1179
  isSufficient: boolean;
1180
1180
  existentialDeposit: string;
1181
1181
  } | {
@@ -1228,6 +1228,23 @@ export declare const TokenSchema: z.ZodPipe<z.ZodDiscriminatedUnion<[z.ZodObject
1228
1228
  tokenAddress1: `0x${string}`;
1229
1229
  coingeckoId0?: string | undefined;
1230
1230
  coingeckoId1?: string | undefined;
1231
+ } | {
1232
+ id: string;
1233
+ networkId: string;
1234
+ isDefault?: boolean | undefined;
1235
+ decimals: number;
1236
+ symbol: string;
1237
+ name?: string | undefined;
1238
+ logo?: string | undefined;
1239
+ coingeckoId?: string | undefined;
1240
+ noDiscovery?: boolean | undefined;
1241
+ mirrorOf?: string | undefined;
1242
+ type: "substrate-assets";
1243
+ platform: "polkadot";
1244
+ assetId: string;
1245
+ isFrozen?: boolean | undefined;
1246
+ isSufficient: boolean;
1247
+ existentialDeposit: string;
1231
1248
  } | {
1232
1249
  id: string;
1233
1250
  networkId: string;
@@ -1305,23 +1322,6 @@ export declare const TokenSchema: z.ZodPipe<z.ZodDiscriminatedUnion<[z.ZodObject
1305
1322
  platform: "polkadot";
1306
1323
  onChainId: string | number;
1307
1324
  existentialDeposit: string;
1308
- } | {
1309
- id: string;
1310
- networkId: string;
1311
- isDefault?: boolean | undefined;
1312
- decimals: number;
1313
- symbol: string;
1314
- name?: string | undefined;
1315
- logo?: string | undefined;
1316
- coingeckoId?: string | undefined;
1317
- noDiscovery?: boolean | undefined;
1318
- mirrorOf?: string | undefined;
1319
- type: "substrate-hydration";
1320
- platform: "polkadot";
1321
- onChainId: number;
1322
- assetType: "Erc20" | "External" | "Token";
1323
- isSufficient: boolean;
1324
- existentialDeposit: string;
1325
1325
  } | {
1326
1326
  id: string;
1327
1327
  networkId: string;
@@ -1375,10 +1375,10 @@ export declare const TokenSchema: z.ZodPipe<z.ZodDiscriminatedUnion<[z.ZodObject
1375
1375
  coingeckoId?: string | undefined;
1376
1376
  noDiscovery?: boolean | undefined;
1377
1377
  mirrorOf?: string | undefined;
1378
- type: "substrate-assets";
1378
+ type: "substrate-hydration";
1379
1379
  platform: "polkadot";
1380
- assetId: string;
1381
- isFrozen?: boolean | undefined;
1380
+ onChainId: number;
1381
+ assetType: "Erc20" | "External" | "Token";
1382
1382
  isSufficient: boolean;
1383
1383
  existentialDeposit: string;
1384
1384
  } | {
@@ -1431,6 +1431,23 @@ export declare const TokenSchema: z.ZodPipe<z.ZodDiscriminatedUnion<[z.ZodObject
1431
1431
  tokenAddress1: `0x${string}`;
1432
1432
  coingeckoId0?: string | undefined;
1433
1433
  coingeckoId1?: string | undefined;
1434
+ } | {
1435
+ id: string;
1436
+ networkId: string;
1437
+ isDefault?: boolean | undefined;
1438
+ decimals: number;
1439
+ symbol: string;
1440
+ name?: string | undefined;
1441
+ logo?: string | undefined;
1442
+ coingeckoId?: string | undefined;
1443
+ noDiscovery?: boolean | undefined;
1444
+ mirrorOf?: string | undefined;
1445
+ type: "substrate-assets";
1446
+ platform: "polkadot";
1447
+ assetId: string;
1448
+ isFrozen?: boolean | undefined;
1449
+ isSufficient: boolean;
1450
+ existentialDeposit: string;
1434
1451
  } | {
1435
1452
  id: string;
1436
1453
  networkId: string;
@@ -1508,23 +1525,6 @@ export declare const TokenSchema: z.ZodPipe<z.ZodDiscriminatedUnion<[z.ZodObject
1508
1525
  platform: "polkadot";
1509
1526
  onChainId: string | number;
1510
1527
  existentialDeposit: string;
1511
- } | {
1512
- id: string;
1513
- networkId: string;
1514
- isDefault?: boolean | undefined;
1515
- decimals: number;
1516
- symbol: string;
1517
- name?: string | undefined;
1518
- logo?: string | undefined;
1519
- coingeckoId?: string | undefined;
1520
- noDiscovery?: boolean | undefined;
1521
- mirrorOf?: string | undefined;
1522
- type: "substrate-hydration";
1523
- platform: "polkadot";
1524
- onChainId: number;
1525
- assetType: "Erc20" | "External" | "Token";
1526
- isSufficient: boolean;
1527
- existentialDeposit: string;
1528
1528
  } | {
1529
1529
  id: string;
1530
1530
  networkId: string;
@@ -1768,10 +1768,10 @@ export declare const isTokenNeedExistentialDeposit: (token: Token) => token is {
1768
1768
  coingeckoId?: string | undefined;
1769
1769
  noDiscovery?: boolean | undefined;
1770
1770
  mirrorOf?: string | undefined;
1771
- type: "substrate-assets";
1771
+ type: "substrate-hydration";
1772
1772
  platform: "polkadot";
1773
- assetId: string;
1774
- isFrozen?: boolean | undefined;
1773
+ onChainId: number;
1774
+ assetType: "Erc20" | "External" | "Token";
1775
1775
  isSufficient: boolean;
1776
1776
  existentialDeposit: string;
1777
1777
  } | {
@@ -1785,9 +1785,9 @@ export declare const isTokenNeedExistentialDeposit: (token: Token) => token is {
1785
1785
  coingeckoId?: string | undefined;
1786
1786
  noDiscovery?: boolean | undefined;
1787
1787
  mirrorOf?: string | undefined;
1788
- type: "substrate-foreignassets";
1788
+ type: "substrate-assets";
1789
1789
  platform: "polkadot";
1790
- onChainId: string;
1790
+ assetId: string;
1791
1791
  isFrozen?: boolean | undefined;
1792
1792
  isSufficient: boolean;
1793
1793
  existentialDeposit: string;
@@ -1802,8 +1802,11 @@ export declare const isTokenNeedExistentialDeposit: (token: Token) => token is {
1802
1802
  coingeckoId?: string | undefined;
1803
1803
  noDiscovery?: boolean | undefined;
1804
1804
  mirrorOf?: string | undefined;
1805
- type: "substrate-native";
1805
+ type: "substrate-foreignassets";
1806
1806
  platform: "polkadot";
1807
+ onChainId: string;
1808
+ isFrozen?: boolean | undefined;
1809
+ isSufficient: boolean;
1807
1810
  existentialDeposit: string;
1808
1811
  } | {
1809
1812
  id: string;
@@ -1816,9 +1819,8 @@ export declare const isTokenNeedExistentialDeposit: (token: Token) => token is {
1816
1819
  coingeckoId?: string | undefined;
1817
1820
  noDiscovery?: boolean | undefined;
1818
1821
  mirrorOf?: string | undefined;
1819
- type: "substrate-tokens";
1822
+ type: "substrate-native";
1820
1823
  platform: "polkadot";
1821
- onChainId: string | number;
1822
1824
  existentialDeposit: string;
1823
1825
  } | {
1824
1826
  id: string;
@@ -1831,11 +1833,9 @@ export declare const isTokenNeedExistentialDeposit: (token: Token) => token is {
1831
1833
  coingeckoId?: string | undefined;
1832
1834
  noDiscovery?: boolean | undefined;
1833
1835
  mirrorOf?: string | undefined;
1834
- type: "substrate-hydration";
1836
+ type: "substrate-tokens";
1835
1837
  platform: "polkadot";
1836
- onChainId: number;
1837
- assetType: "Erc20" | "External" | "Token";
1838
- isSufficient: boolean;
1838
+ onChainId: string | number;
1839
1839
  existentialDeposit: string;
1840
1840
  };
1841
1841
  export declare const isTokenOfType: <T extends TokenType>(token: Token | null | undefined, type: T) => token is TokenOfType<T>;
@@ -2060,6 +2060,7 @@ export declare const isNativeToken: <P extends NetworkPlatform = NetworkPlatform
2060
2060
  //#endregion
2061
2061
  //#region src/constants.d.ts
2062
2062
  export declare const MINIMETADATA_VERSION: string;
2063
+ export declare const DEFAULT_CHAINDATA_URL = "https://raw.githubusercontent.com/TalismanSociety/chaindata/main/pub/v14/chaindata.min.json";
2063
2064
  //#endregion
2064
2065
  //#region src/getBlockExplorerUrls.d.ts
2065
2066
  export type BlockExplorerQuery = {
@@ -2083,8 +2084,14 @@ export type BlockExplorerQuery = {
2083
2084
  hash: `0x${string}`;
2084
2085
  };
2085
2086
  export declare const getBlockExplorerUrls: (network: Network, query: BlockExplorerQuery) => string[];
2087
+ export declare const getBlockExplorerUrl: (network: Network | null | undefined, query: BlockExplorerQuery) => string | null;
2086
2088
  export declare const getBlockExplorerLabel: (blockExplorerUrl: string) => string;
2087
2089
  //#endregion
2090
+ //#region src/isAccountPlatformCompatibleWithNetwork.d.ts
2091
+ /** mirrors AccountPlatform from @talismn/crypto, which this package does not depend on */
2092
+ type AccountPlatform = "ethereum" | "polkadot" | "bitcoin" | "solana";
2093
+ export declare const isAccountPlatformCompatibleWithNetwork: (network: Network, platform: AccountPlatform) => boolean;
2094
+ //#endregion
2088
2095
  //#region src/legacy/EvmNetwork.d.ts
2089
2096
  /** @deprecated */
2090
2097
  export type LegacyEvmNetworkId = string;
@@ -2585,6 +2592,23 @@ export declare const ChaindataFileSchema: z.ZodObject<{
2585
2592
  mintAddress: z.ZodString;
2586
2593
  isTransferable: z.ZodOptional<z.ZodBoolean>;
2587
2594
  }, z.core.$strict>], "type">, z.ZodTransform<{
2595
+ id: string;
2596
+ networkId: string;
2597
+ isDefault?: boolean | undefined;
2598
+ decimals: number;
2599
+ symbol: string;
2600
+ name?: string | undefined;
2601
+ logo?: string | undefined;
2602
+ coingeckoId?: string | undefined;
2603
+ noDiscovery?: boolean | undefined;
2604
+ mirrorOf?: string | undefined;
2605
+ type: "substrate-hydration";
2606
+ platform: "polkadot";
2607
+ onChainId: number;
2608
+ assetType: "Erc20" | "External" | "Token";
2609
+ isSufficient: boolean;
2610
+ existentialDeposit: string;
2611
+ } | {
2588
2612
  id: string;
2589
2613
  networkId: string;
2590
2614
  isDefault?: boolean | undefined;
@@ -2739,12 +2763,8 @@ export declare const ChaindataFileSchema: z.ZodObject<{
2739
2763
  coingeckoId?: string | undefined;
2740
2764
  noDiscovery?: boolean | undefined;
2741
2765
  mirrorOf?: string | undefined;
2742
- type: "substrate-hydration";
2743
- platform: "polkadot";
2744
- onChainId: number;
2745
- assetType: "Erc20" | "External" | "Token";
2746
- isSufficient: boolean;
2747
- existentialDeposit: string;
2766
+ type: "sol-native";
2767
+ platform: "solana";
2748
2768
  } | {
2749
2769
  id: string;
2750
2770
  networkId: string;
@@ -2756,8 +2776,9 @@ export declare const ChaindataFileSchema: z.ZodObject<{
2756
2776
  coingeckoId?: string | undefined;
2757
2777
  noDiscovery?: boolean | undefined;
2758
2778
  mirrorOf?: string | undefined;
2759
- type: "sol-native";
2779
+ type: "sol-spl";
2760
2780
  platform: "solana";
2781
+ mintAddress: string;
2761
2782
  } | {
2762
2783
  id: string;
2763
2784
  networkId: string;
@@ -2769,10 +2790,11 @@ export declare const ChaindataFileSchema: z.ZodObject<{
2769
2790
  coingeckoId?: string | undefined;
2770
2791
  noDiscovery?: boolean | undefined;
2771
2792
  mirrorOf?: string | undefined;
2772
- type: "sol-spl";
2793
+ type: "sol-token2022";
2773
2794
  platform: "solana";
2774
2795
  mintAddress: string;
2775
- } | {
2796
+ isTransferable?: boolean | undefined;
2797
+ }, {
2776
2798
  id: string;
2777
2799
  networkId: string;
2778
2800
  isDefault?: boolean | undefined;
@@ -2783,11 +2805,13 @@ export declare const ChaindataFileSchema: z.ZodObject<{
2783
2805
  coingeckoId?: string | undefined;
2784
2806
  noDiscovery?: boolean | undefined;
2785
2807
  mirrorOf?: string | undefined;
2786
- type: "sol-token2022";
2787
- platform: "solana";
2788
- mintAddress: string;
2789
- isTransferable?: boolean | undefined;
2790
- }, {
2808
+ type: "substrate-hydration";
2809
+ platform: "polkadot";
2810
+ onChainId: number;
2811
+ assetType: "Erc20" | "External" | "Token";
2812
+ isSufficient: boolean;
2813
+ existentialDeposit: string;
2814
+ } | {
2791
2815
  id: string;
2792
2816
  networkId: string;
2793
2817
  isDefault?: boolean | undefined;
@@ -2931,23 +2955,6 @@ export declare const ChaindataFileSchema: z.ZodObject<{
2931
2955
  platform: "polkadot";
2932
2956
  onChainId: string | number;
2933
2957
  existentialDeposit: string;
2934
- } | {
2935
- id: string;
2936
- networkId: string;
2937
- isDefault?: boolean | undefined;
2938
- decimals: number;
2939
- symbol: string;
2940
- name?: string | undefined;
2941
- logo?: string | undefined;
2942
- coingeckoId?: string | undefined;
2943
- noDiscovery?: boolean | undefined;
2944
- mirrorOf?: string | undefined;
2945
- type: "substrate-hydration";
2946
- platform: "polkadot";
2947
- onChainId: number;
2948
- assetType: "Erc20" | "External" | "Token";
2949
- isSufficient: boolean;
2950
- existentialDeposit: string;
2951
2958
  } | {
2952
2959
  id: string;
2953
2960
  networkId: string;
@@ -3002,6 +3009,7 @@ export declare const ChaindataFileSchema: z.ZodObject<{
3002
3009
  }, z.core.$strict>>;
3003
3010
  }, z.core.$strip>;
3004
3011
  type Chaindata = z.infer<typeof ChaindataFileSchema>;
3012
+ type ChaindataFile = z.input<typeof ChaindataFileSchema>;
3005
3013
  export declare const CustomChaindataSchema: z.ZodObject<{
3006
3014
  networks: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
3007
3015
  id: z.ZodString;
@@ -3338,6 +3346,23 @@ export declare const CustomChaindataSchema: z.ZodObject<{
3338
3346
  mintAddress: z.ZodString;
3339
3347
  isTransferable: z.ZodOptional<z.ZodBoolean>;
3340
3348
  }, z.core.$strict>], "type">, z.ZodTransform<{
3349
+ id: string;
3350
+ networkId: string;
3351
+ isDefault?: boolean | undefined;
3352
+ decimals: number;
3353
+ symbol: string;
3354
+ name?: string | undefined;
3355
+ logo?: string | undefined;
3356
+ coingeckoId?: string | undefined;
3357
+ noDiscovery?: boolean | undefined;
3358
+ mirrorOf?: string | undefined;
3359
+ type: "substrate-hydration";
3360
+ platform: "polkadot";
3361
+ onChainId: number;
3362
+ assetType: "Erc20" | "External" | "Token";
3363
+ isSufficient: boolean;
3364
+ existentialDeposit: string;
3365
+ } | {
3341
3366
  id: string;
3342
3367
  networkId: string;
3343
3368
  isDefault?: boolean | undefined;
@@ -3492,12 +3517,8 @@ export declare const CustomChaindataSchema: z.ZodObject<{
3492
3517
  coingeckoId?: string | undefined;
3493
3518
  noDiscovery?: boolean | undefined;
3494
3519
  mirrorOf?: string | undefined;
3495
- type: "substrate-hydration";
3496
- platform: "polkadot";
3497
- onChainId: number;
3498
- assetType: "Erc20" | "External" | "Token";
3499
- isSufficient: boolean;
3500
- existentialDeposit: string;
3520
+ type: "sol-native";
3521
+ platform: "solana";
3501
3522
  } | {
3502
3523
  id: string;
3503
3524
  networkId: string;
@@ -3509,8 +3530,9 @@ export declare const CustomChaindataSchema: z.ZodObject<{
3509
3530
  coingeckoId?: string | undefined;
3510
3531
  noDiscovery?: boolean | undefined;
3511
3532
  mirrorOf?: string | undefined;
3512
- type: "sol-native";
3533
+ type: "sol-spl";
3513
3534
  platform: "solana";
3535
+ mintAddress: string;
3514
3536
  } | {
3515
3537
  id: string;
3516
3538
  networkId: string;
@@ -3522,10 +3544,11 @@ export declare const CustomChaindataSchema: z.ZodObject<{
3522
3544
  coingeckoId?: string | undefined;
3523
3545
  noDiscovery?: boolean | undefined;
3524
3546
  mirrorOf?: string | undefined;
3525
- type: "sol-spl";
3547
+ type: "sol-token2022";
3526
3548
  platform: "solana";
3527
3549
  mintAddress: string;
3528
- } | {
3550
+ isTransferable?: boolean | undefined;
3551
+ }, {
3529
3552
  id: string;
3530
3553
  networkId: string;
3531
3554
  isDefault?: boolean | undefined;
@@ -3536,11 +3559,13 @@ export declare const CustomChaindataSchema: z.ZodObject<{
3536
3559
  coingeckoId?: string | undefined;
3537
3560
  noDiscovery?: boolean | undefined;
3538
3561
  mirrorOf?: string | undefined;
3539
- type: "sol-token2022";
3540
- platform: "solana";
3541
- mintAddress: string;
3542
- isTransferable?: boolean | undefined;
3543
- }, {
3562
+ type: "substrate-hydration";
3563
+ platform: "polkadot";
3564
+ onChainId: number;
3565
+ assetType: "Erc20" | "External" | "Token";
3566
+ isSufficient: boolean;
3567
+ existentialDeposit: string;
3568
+ } | {
3544
3569
  id: string;
3545
3570
  networkId: string;
3546
3571
  isDefault?: boolean | undefined;
@@ -3684,23 +3709,6 @@ export declare const CustomChaindataSchema: z.ZodObject<{
3684
3709
  platform: "polkadot";
3685
3710
  onChainId: string | number;
3686
3711
  existentialDeposit: string;
3687
- } | {
3688
- id: string;
3689
- networkId: string;
3690
- isDefault?: boolean | undefined;
3691
- decimals: number;
3692
- symbol: string;
3693
- name?: string | undefined;
3694
- logo?: string | undefined;
3695
- coingeckoId?: string | undefined;
3696
- noDiscovery?: boolean | undefined;
3697
- mirrorOf?: string | undefined;
3698
- type: "substrate-hydration";
3699
- platform: "polkadot";
3700
- onChainId: number;
3701
- assetType: "Erc20" | "External" | "Token";
3702
- isSufficient: boolean;
3703
- existentialDeposit: string;
3704
3712
  } | {
3705
3713
  id: string;
3706
3714
  networkId: string;
@@ -3792,10 +3800,22 @@ export type ChaindataProviderOptions = {
3792
3800
  persistedStorage?: ChaindataStorage | Promise<ChaindataStorage | undefined>;
3793
3801
  customChaindata$?: Observable<CustomChaindata> | CustomChaindata;
3794
3802
  dynamicTokens$?: ReplaySubject<Token[]>;
3803
+ /**
3804
+ * Replaces the default chaindata downloaded from the TalismanSociety/chaindata repository.
3805
+ *
3806
+ * The provider subscribes to `chaindata$` only while the provider itself has subscribers.
3807
+ * Pass a replaying observable (a `BehaviorSubject`, or `shareReplay(1)` without `refCount`),
3808
+ * otherwise values emitted while nothing is subscribed are lost. A failed observable is
3809
+ * resubscribed with backoff, so only a cold observable can recover.
3810
+ *
3811
+ * `persistedStorage` seeds the data whichever source is used: clear it when you switch
3812
+ * sources. Only the provider without `chaindata$` falls back to the bundled chaindata.
3813
+ */
3814
+ chaindata$?: Observable<ChaindataFile> | ChaindataFile;
3795
3815
  };
3796
3816
  export declare class ChaindataProvider implements IChaindataProvider {
3797
3817
  #private;
3798
- constructor({ persistedStorage, customChaindata$, dynamicTokens$ }?: ChaindataProviderOptions);
3818
+ constructor({ persistedStorage, customChaindata$, dynamicTokens$, chaindata$ }?: ChaindataProviderOptions);
3799
3819
  /**
3800
3820
  * Subscribe to this observable and save its contents somewhere persistent.
3801
3821
  *
@@ -3864,23 +3884,6 @@ export declare class ChaindataProvider implements IChaindataProvider {
3864
3884
  * Tokens
3865
3885
  */
3866
3886
  get tokens$(): Observable<({
3867
- id: string;
3868
- networkId: string;
3869
- isDefault?: boolean | undefined;
3870
- decimals: number;
3871
- symbol: string;
3872
- name?: string | undefined;
3873
- logo?: string | undefined;
3874
- coingeckoId?: string | undefined;
3875
- noDiscovery?: boolean | undefined;
3876
- mirrorOf?: string | undefined;
3877
- type: "substrate-assets";
3878
- platform: "polkadot";
3879
- assetId: string;
3880
- isFrozen?: boolean | undefined;
3881
- isSufficient: boolean;
3882
- existentialDeposit: string;
3883
- } | {
3884
3887
  id: string;
3885
3888
  networkId: string;
3886
3889
  isDefault?: boolean | undefined;
@@ -3941,12 +3944,29 @@ export declare class ChaindataProvider implements IChaindataProvider {
3941
3944
  coingeckoId?: string | undefined;
3942
3945
  noDiscovery?: boolean | undefined;
3943
3946
  mirrorOf?: string | undefined;
3944
- type: "substrate-dtao";
3947
+ type: "substrate-assets";
3945
3948
  platform: "polkadot";
3946
- netuid: number;
3947
- subnetName?: string | undefined;
3948
- hotkey?: string | undefined;
3949
- isTransferable: boolean;
3949
+ assetId: string;
3950
+ isFrozen?: boolean | undefined;
3951
+ isSufficient: boolean;
3952
+ existentialDeposit: string;
3953
+ } | {
3954
+ id: string;
3955
+ networkId: string;
3956
+ isDefault?: boolean | undefined;
3957
+ decimals: number;
3958
+ symbol: string;
3959
+ name?: string | undefined;
3960
+ logo?: string | undefined;
3961
+ coingeckoId?: string | undefined;
3962
+ noDiscovery?: boolean | undefined;
3963
+ mirrorOf?: string | undefined;
3964
+ type: "substrate-dtao";
3965
+ platform: "polkadot";
3966
+ netuid: number;
3967
+ subnetName?: string | undefined;
3968
+ hotkey?: string | undefined;
3969
+ isTransferable: boolean;
3950
3970
  } | {
3951
3971
  id: string;
3952
3972
  networkId: string;
@@ -4401,6 +4421,351 @@ export declare const isTokenTestnet: (token: Token) => boolean;
4401
4421
  export declare const getCleanNetwork: (network: Network) => Network;
4402
4422
  export declare const getCleanToken: (token: Token) => Token;
4403
4423
  //#endregion
4424
+ //#region src/state/remoteChaindata.d.ts
4425
+ /**
4426
+ * Downloads the chaindata file at `url` and refreshes it every 5 minutes. Equivalent spellings
4427
+ * of a url share one observable. Throws if `url` is not a valid url.
4428
+ *
4429
+ * Emitted objects are shared and already validated: treat them as immutable, and filter them
4430
+ * by returning new objects.
4431
+ */
4432
+ export declare const getRemoteChaindata$: (url: string) => Observable<{
4433
+ networks: ({
4434
+ id: string;
4435
+ isTestnet?: boolean | undefined;
4436
+ isDefault?: boolean | undefined;
4437
+ forceScan?: boolean | undefined;
4438
+ name: string;
4439
+ logo?: string | undefined;
4440
+ nativeTokenId: string;
4441
+ nativeCurrency: {
4442
+ decimals: number;
4443
+ symbol: string;
4444
+ name: string;
4445
+ coingeckoId?: string | undefined;
4446
+ mirrorOf?: string | undefined;
4447
+ logo?: string | undefined;
4448
+ };
4449
+ themeColor?: string | undefined;
4450
+ blockExplorerUrls: string[];
4451
+ genesisHash: `0x${string}`;
4452
+ platform: "polkadot";
4453
+ chainName: string;
4454
+ specName: string;
4455
+ specVersion: number;
4456
+ account: "*25519" | "secp256k1";
4457
+ chainspecQrUrl?: string | undefined;
4458
+ latestMetadataQrUrl?: string | undefined;
4459
+ prefix: number;
4460
+ oldPrefix?: number | undefined;
4461
+ rpcs: string[];
4462
+ registryTypes?: any;
4463
+ signedExtensions?: any;
4464
+ hasCheckMetadataHash?: boolean | undefined;
4465
+ hasExtrinsicSignatureTypePrefix?: boolean | undefined;
4466
+ isUnknownFeeToken?: boolean | undefined;
4467
+ topology: {
4468
+ type: "standalone";
4469
+ } | {
4470
+ type: "relay";
4471
+ } | {
4472
+ type: "parachain";
4473
+ relayId: string;
4474
+ paraId: number;
4475
+ };
4476
+ balancesConfig?: {
4477
+ "substrate-native"?: {
4478
+ disable?: boolean | undefined;
4479
+ } | undefined;
4480
+ "substrate-assets"?: Record<string, never> | undefined;
4481
+ "substrate-psp22"?: Record<string, never> | undefined;
4482
+ "substrate-tokens"?: {
4483
+ palletId?: string | undefined;
4484
+ } | undefined;
4485
+ "substrate-foreignassets"?: Record<string, never> | undefined;
4486
+ "substrate-hydration"?: Record<string, never> | undefined;
4487
+ "substrate-dtao"?: Record<string, never> | undefined;
4488
+ } | undefined;
4489
+ } | {
4490
+ id: string;
4491
+ isTestnet?: boolean | undefined;
4492
+ isDefault?: boolean | undefined;
4493
+ forceScan?: boolean | undefined;
4494
+ name: string;
4495
+ logo?: string | undefined;
4496
+ nativeTokenId: string;
4497
+ nativeCurrency: {
4498
+ decimals: number;
4499
+ symbol: string;
4500
+ name: string;
4501
+ coingeckoId?: string | undefined;
4502
+ mirrorOf?: string | undefined;
4503
+ logo?: string | undefined;
4504
+ };
4505
+ themeColor?: string | undefined;
4506
+ blockExplorerUrls: string[];
4507
+ platform: "ethereum";
4508
+ substrateChainId?: string | undefined;
4509
+ preserveGasEstimate?: boolean | undefined;
4510
+ rpcs: string[];
4511
+ feeType?: "eip-1559" | "legacy" | undefined;
4512
+ l2FeeType?: {
4513
+ type: "op-stack";
4514
+ } | {
4515
+ type: "scroll";
4516
+ l1GasPriceOracle: `0x${string}`;
4517
+ } | undefined;
4518
+ contracts?: {
4519
+ Erc20Aggregator?: `0x${string}` | undefined;
4520
+ Multicall3?: `0x${string}` | undefined;
4521
+ } | undefined;
4522
+ balancesConfig?: {
4523
+ "evm-native"?: Record<string, never> | undefined;
4524
+ "evm-erc20"?: Record<string, never> | undefined;
4525
+ "evm-uniswapv2"?: Record<string, never> | undefined;
4526
+ } | undefined;
4527
+ } | {
4528
+ id: string;
4529
+ isTestnet?: boolean | undefined;
4530
+ isDefault?: boolean | undefined;
4531
+ forceScan?: boolean | undefined;
4532
+ name: string;
4533
+ logo?: string | undefined;
4534
+ nativeTokenId: string;
4535
+ nativeCurrency: {
4536
+ decimals: number;
4537
+ symbol: string;
4538
+ name: string;
4539
+ coingeckoId?: string | undefined;
4540
+ mirrorOf?: string | undefined;
4541
+ logo?: string | undefined;
4542
+ };
4543
+ themeColor?: string | undefined;
4544
+ blockExplorerUrls: string[];
4545
+ platform: "solana";
4546
+ genesisHash: string;
4547
+ rpcs: string[];
4548
+ balancesConfig?: {
4549
+ "sol-native"?: Record<string, never> | undefined;
4550
+ "sol-spl"?: Record<string, never> | undefined;
4551
+ "sol-token2022"?: Record<string, never> | undefined;
4552
+ } | undefined;
4553
+ })[];
4554
+ tokens: ({
4555
+ id: string;
4556
+ networkId: string;
4557
+ isDefault?: boolean | undefined;
4558
+ decimals: number;
4559
+ symbol: string;
4560
+ name?: string | undefined;
4561
+ logo?: string | undefined;
4562
+ coingeckoId?: string | undefined;
4563
+ noDiscovery?: boolean | undefined;
4564
+ mirrorOf?: string | undefined;
4565
+ type: "evm-erc20";
4566
+ platform: "ethereum";
4567
+ contractAddress: `0x${string}`;
4568
+ } | {
4569
+ id: string;
4570
+ networkId: string;
4571
+ isDefault?: boolean | undefined;
4572
+ decimals: number;
4573
+ symbol: string;
4574
+ name?: string | undefined;
4575
+ logo?: string | undefined;
4576
+ coingeckoId?: string | undefined;
4577
+ noDiscovery?: boolean | undefined;
4578
+ mirrorOf?: string | undefined;
4579
+ type: "evm-native";
4580
+ platform: "ethereum";
4581
+ } | {
4582
+ id: string;
4583
+ networkId: string;
4584
+ isDefault?: boolean | undefined;
4585
+ decimals: number;
4586
+ symbol: string;
4587
+ name?: string | undefined;
4588
+ logo?: string | undefined;
4589
+ coingeckoId?: string | undefined;
4590
+ noDiscovery?: boolean | undefined;
4591
+ mirrorOf?: string | undefined;
4592
+ type: "evm-uniswapv2";
4593
+ platform: "ethereum";
4594
+ contractAddress: `0x${string}`;
4595
+ isCustom?: boolean | undefined;
4596
+ symbol0: string;
4597
+ symbol1: string;
4598
+ decimals0: number;
4599
+ decimals1: number;
4600
+ tokenAddress0: `0x${string}`;
4601
+ tokenAddress1: `0x${string}`;
4602
+ coingeckoId0?: string | undefined;
4603
+ coingeckoId1?: string | undefined;
4604
+ } | {
4605
+ id: string;
4606
+ networkId: string;
4607
+ isDefault?: boolean | undefined;
4608
+ decimals: number;
4609
+ symbol: string;
4610
+ name?: string | undefined;
4611
+ logo?: string | undefined;
4612
+ coingeckoId?: string | undefined;
4613
+ noDiscovery?: boolean | undefined;
4614
+ mirrorOf?: string | undefined;
4615
+ type: "substrate-assets";
4616
+ platform: "polkadot";
4617
+ assetId: string;
4618
+ isFrozen?: boolean | undefined;
4619
+ isSufficient: boolean;
4620
+ existentialDeposit: string;
4621
+ } | {
4622
+ id: string;
4623
+ networkId: string;
4624
+ isDefault?: boolean | undefined;
4625
+ decimals: number;
4626
+ symbol: string;
4627
+ name?: string | undefined;
4628
+ logo?: string | undefined;
4629
+ coingeckoId?: string | undefined;
4630
+ noDiscovery?: boolean | undefined;
4631
+ mirrorOf?: string | undefined;
4632
+ type: "substrate-dtao";
4633
+ platform: "polkadot";
4634
+ netuid: number;
4635
+ subnetName?: string | undefined;
4636
+ hotkey?: string | undefined;
4637
+ isTransferable: boolean;
4638
+ } | {
4639
+ id: string;
4640
+ networkId: string;
4641
+ isDefault?: boolean | undefined;
4642
+ decimals: number;
4643
+ symbol: string;
4644
+ name?: string | undefined;
4645
+ logo?: string | undefined;
4646
+ coingeckoId?: string | undefined;
4647
+ noDiscovery?: boolean | undefined;
4648
+ mirrorOf?: string | undefined;
4649
+ type: "substrate-foreignassets";
4650
+ platform: "polkadot";
4651
+ onChainId: string;
4652
+ isFrozen?: boolean | undefined;
4653
+ isSufficient: boolean;
4654
+ existentialDeposit: string;
4655
+ } | {
4656
+ id: string;
4657
+ networkId: string;
4658
+ isDefault?: boolean | undefined;
4659
+ decimals: number;
4660
+ symbol: string;
4661
+ name?: string | undefined;
4662
+ logo?: string | undefined;
4663
+ coingeckoId?: string | undefined;
4664
+ noDiscovery?: boolean | undefined;
4665
+ mirrorOf?: string | undefined;
4666
+ type: "substrate-native";
4667
+ platform: "polkadot";
4668
+ existentialDeposit: string;
4669
+ } | {
4670
+ id: string;
4671
+ networkId: string;
4672
+ isDefault?: boolean | undefined;
4673
+ decimals: number;
4674
+ symbol: string;
4675
+ name?: string | undefined;
4676
+ logo?: string | undefined;
4677
+ coingeckoId?: string | undefined;
4678
+ noDiscovery?: boolean | undefined;
4679
+ mirrorOf?: string | undefined;
4680
+ type: "substrate-psp22";
4681
+ platform: "polkadot";
4682
+ contractAddress: string;
4683
+ } | {
4684
+ id: string;
4685
+ networkId: string;
4686
+ isDefault?: boolean | undefined;
4687
+ decimals: number;
4688
+ symbol: string;
4689
+ name?: string | undefined;
4690
+ logo?: string | undefined;
4691
+ coingeckoId?: string | undefined;
4692
+ noDiscovery?: boolean | undefined;
4693
+ mirrorOf?: string | undefined;
4694
+ type: "substrate-tokens";
4695
+ platform: "polkadot";
4696
+ onChainId: string | number;
4697
+ existentialDeposit: string;
4698
+ } | {
4699
+ id: string;
4700
+ networkId: string;
4701
+ isDefault?: boolean | undefined;
4702
+ decimals: number;
4703
+ symbol: string;
4704
+ name?: string | undefined;
4705
+ logo?: string | undefined;
4706
+ coingeckoId?: string | undefined;
4707
+ noDiscovery?: boolean | undefined;
4708
+ mirrorOf?: string | undefined;
4709
+ type: "substrate-hydration";
4710
+ platform: "polkadot";
4711
+ onChainId: number;
4712
+ assetType: "Erc20" | "External" | "Token";
4713
+ isSufficient: boolean;
4714
+ existentialDeposit: string;
4715
+ } | {
4716
+ id: string;
4717
+ networkId: string;
4718
+ isDefault?: boolean | undefined;
4719
+ decimals: number;
4720
+ symbol: string;
4721
+ name?: string | undefined;
4722
+ logo?: string | undefined;
4723
+ coingeckoId?: string | undefined;
4724
+ noDiscovery?: boolean | undefined;
4725
+ mirrorOf?: string | undefined;
4726
+ type: "sol-native";
4727
+ platform: "solana";
4728
+ } | {
4729
+ id: string;
4730
+ networkId: string;
4731
+ isDefault?: boolean | undefined;
4732
+ decimals: number;
4733
+ symbol: string;
4734
+ name?: string | undefined;
4735
+ logo?: string | undefined;
4736
+ coingeckoId?: string | undefined;
4737
+ noDiscovery?: boolean | undefined;
4738
+ mirrorOf?: string | undefined;
4739
+ type: "sol-spl";
4740
+ platform: "solana";
4741
+ mintAddress: string;
4742
+ } | {
4743
+ id: string;
4744
+ networkId: string;
4745
+ isDefault?: boolean | undefined;
4746
+ decimals: number;
4747
+ symbol: string;
4748
+ name?: string | undefined;
4749
+ logo?: string | undefined;
4750
+ coingeckoId?: string | undefined;
4751
+ noDiscovery?: boolean | undefined;
4752
+ mirrorOf?: string | undefined;
4753
+ type: "sol-token2022";
4754
+ platform: "solana";
4755
+ mintAddress: string;
4756
+ isTransferable?: boolean | undefined;
4757
+ })[];
4758
+ miniMetadatas: {
4759
+ id: string;
4760
+ source: string;
4761
+ chainId: string;
4762
+ specVersion: number;
4763
+ version: string;
4764
+ data: `0x${string}` | null;
4765
+ extra: any;
4766
+ }[];
4767
+ }>;
4768
+ //#endregion
4404
4769
  //#region src/util.d.ts
4405
4770
  type KNOWN_TOKEN_ID = "uniswap";
4406
4771
  export declare const getGithubTokenLogoUrl: (tokenId: KNOWN_TOKEN_ID) => string;
@@ -4412,5 +4777,5 @@ export declare const getGithubTokenLogoUrl: (tokenId: KNOWN_TOKEN_ID) => string;
4412
4777
  export declare const getGithubTokenLogoUrlByCoingeckoId: (coingeckoId: string) => string;
4413
4778
  export declare const getGithubBittensorHotkeyAssetUrl: (fileName: string) => string;
4414
4779
  //#endregion
4415
- export type { Chaindata, CustomChaindata };
4780
+ export type { Chaindata, ChaindataFile, CustomChaindata };
4416
4781
  //# sourceMappingURL=index.d.mts.map