@talismn/chaindata-provider 2.3.2 → 2.4.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/README.md CHANGED
@@ -5,6 +5,8 @@ Networks and tokens for the Talisman wallet.
5
5
  - `ChaindataProvider` fetches networks and tokens from the [chaindata](https://github.com/TalismanSociety/chaindata) repository (`CHAINDATA_PUB_FOLDER` in `src/constants.ts`) and supports custom networks and tokens.
6
6
  - Data is kept in memory. To persist it, pass `persistedStorage` and subscribe to changes.
7
7
  - To replace the default chaindata file, pass `chaindata$`: an object or an observable of objects in the `ChaindataFile` format. To download a file from a URL, pass `getRemoteChaindata$(url)`. The jsdelivr fallback and the bundled `initChaindata.json` apply only to the default file.
8
+ - The default file is fetched from jsdelivr, at the same repository and ref, when raw.githubusercontent.com is unreachable or answers with a 5xx, a 429 rate limit or a 403. A 404, invalid JSON or a file that fails validation is retried with backoff on the same origin.
9
+ - Networks in a `ChaindataFile` (fetched, persisted, bundled or passed as `chaindata$`) keep only their `https://` and `wss://` RPCs. Custom networks accept `http://` and `ws://` RPCs, for local nodes.
8
10
  - The provider subscribes to `chaindata$` only while it has subscribers. Pass a replaying observable (a `BehaviorSubject`, or `shareReplay(1)` without `refCount`), else values emitted while nothing is subscribed are lost. A failed observable is resubscribed with backoff, so only a cold observable can recover.
9
11
  - The objects that `getRemoteChaindata$` emits are shared and already validated. Treat them as immutable: to filter them, return new objects.
10
12
  - `persistedStorage` seeds the data whichever source is used. Clear it when you switch sources.
package/dist/index.d.mts CHANGED
@@ -1,7 +1,6 @@
1
1
  import z, { z as z$1 } from "zod/v4";
2
2
  import { Dexie } from "dexie";
3
3
  import { Observable, ReplaySubject } from "rxjs";
4
- //#region src/chaindata/miniMetadata.d.ts
5
4
  export declare const AnyMiniMetadataSchema: z.ZodObject<{
6
5
  id: z.ZodString;
7
6
  source: z.ZodString;
@@ -12,8 +11,6 @@ export declare const AnyMiniMetadataSchema: z.ZodObject<{
12
11
  extra: z.ZodNullable<z.ZodAny>;
13
12
  }, z.core.$strict>;
14
13
  export type AnyMiniMetadata = z.infer<typeof AnyMiniMetadataSchema>;
15
- //#endregion
16
- //#region src/chaindata/networks/DotNetwork.d.ts
17
14
  export declare const DotNetworkBalancesConfigSchema: z.ZodObject<{
18
15
  "substrate-native": z.ZodOptional<z.ZodObject<{
19
16
  disable: z.ZodOptional<z.ZodBoolean>;
@@ -101,8 +98,6 @@ export declare const DotNetworkSchema: z.ZodObject<{
101
98
  export type DotNetwork = z.infer<typeof DotNetworkSchema>;
102
99
  export type DotNetworkId = DotNetwork["id"];
103
100
  export type DotNetworkList = Record<DotNetworkId, DotNetwork>;
104
- //#endregion
105
- //#region src/chaindata/networks/EthNetwork.d.ts
106
101
  export declare const EthNetworkBalancesConfigSchema: z.ZodObject<{
107
102
  "evm-native": z.ZodOptional<z.ZodObject<{}, z.core.$strict>>;
108
103
  "evm-erc20": z.ZodOptional<z.ZodObject<{}, z.core.$strict>>;
@@ -154,8 +149,6 @@ export declare const EthNetworkSchema: z.ZodObject<{
154
149
  export type EthNetwork = z.infer<typeof EthNetworkSchema>;
155
150
  export type EthNetworkId = EthNetwork["id"];
156
151
  export type EthNetworkList = Record<EthNetworkId, EthNetwork>;
157
- //#endregion
158
- //#region src/chaindata/networks/Network.d.ts
159
152
  export declare const NetworkSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
160
153
  id: z.ZodString;
161
154
  isTestnet: z.ZodOptional<z.ZodBoolean>;
@@ -288,8 +281,6 @@ export type Network = z.infer<typeof NetworkSchema>;
288
281
  export type NetworkId = Network["id"];
289
282
  export type NetworkPlatform = Network["platform"];
290
283
  export type NetworkList = Record<NetworkId, Network>;
291
- //#endregion
292
- //#region src/chaindata/networks/NetworkBase.d.ts
293
284
  export declare const NetworkBaseSchema: z$1.ZodObject<{
294
285
  id: z$1.ZodString;
295
286
  isTestnet: z$1.ZodOptional<z$1.ZodBoolean>;
@@ -310,8 +301,6 @@ export declare const NetworkBaseSchema: z$1.ZodObject<{
310
301
  blockExplorerUrls: z$1.ZodDefault<z$1.ZodArray<z$1.ZodURL>>;
311
302
  }, z$1.core.$strict>;
312
303
  export type NetworkBase = z$1.infer<typeof NetworkBaseSchema>;
313
- //#endregion
314
- //#region src/chaindata/networks/SolNetwork.d.ts
315
304
  export declare const SolNetworkBalancesConfigSchema: z.ZodObject<{
316
305
  "sol-native": z.ZodOptional<z.ZodObject<{}, z.core.$strict>>;
317
306
  "sol-spl": z.ZodOptional<z.ZodObject<{}, z.core.$strict>>;
@@ -348,20 +337,12 @@ export declare const SolNetworkSchema: z.ZodObject<{
348
337
  export type SolNetwork = z.infer<typeof SolNetworkSchema>;
349
338
  export type SolNetworkId = SolNetwork["id"];
350
339
  export type SolNetworkList = Record<SolNetworkId, SolNetwork>;
351
- //#endregion
352
- //#region src/chaindata/shared/EthereumAddress.d.ts
353
340
  export declare const EthereumAddressSchema: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
354
341
  export type EthereumAddress = z.infer<typeof EthereumAddressSchema>;
355
- //#endregion
356
- //#region src/chaindata/shared/HexString.d.ts
357
342
  export declare const HexStringSchema: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
358
343
  export type HexString = z.infer<typeof HexStringSchema>;
359
- //#endregion
360
- //#region src/chaindata/shared/SolanaAddress.d.ts
361
344
  export declare const SolanaAddressSchema: z.ZodString;
362
345
  export type SolanaAddress = z.infer<typeof SolanaAddressSchema>;
363
- //#endregion
364
- //#region src/chaindata/tokens/EvmNativeToken.d.ts
365
346
  declare const TOKEN_TYPE$12 = "evm-native";
366
347
  export declare const EvmNativeTokenSchema: z.ZodObject<{
367
348
  id: z.ZodString;
@@ -386,8 +367,6 @@ export type EvmNativeTokenIdSpecs = {
386
367
  };
387
368
  export declare const evmNativeTokenId: (networkId: NetworkId) => string;
388
369
  export declare const parseEvmNativeTokenId: (tokenId: TokenId) => EvmNativeTokenIdSpecs;
389
- //#endregion
390
- //#region src/chaindata/tokens/EvmUniswapV2Token.d.ts
391
370
  declare const TOKEN_TYPE$11 = "evm-uniswapv2";
392
371
  export declare const EvmUniswapV2TokenSchema: z.ZodObject<{
393
372
  id: z.ZodString;
@@ -423,8 +402,6 @@ export type EvmUniswapV2TokenIdSpecs = {
423
402
  };
424
403
  export declare const evmUniswapV2TokenId: (networkId: NetworkId, contractAddress: EvmUniswapV2Token["contractAddress"]) => string;
425
404
  export declare const parseEvmUniswapV2TokenId: (tokenId: TokenId) => EvmUniswapV2TokenIdSpecs;
426
- //#endregion
427
- //#region src/chaindata/tokens/SolNativeToken.d.ts
428
405
  declare const TOKEN_TYPE$10 = "sol-native";
429
406
  export declare const SolNativeTokenSchema: z.ZodObject<{
430
407
  id: z.ZodString;
@@ -449,8 +426,6 @@ export type SolNativeTokenIdSpecs = {
449
426
  };
450
427
  export declare const solNativeTokenId: (networkId: SolNetworkId) => string;
451
428
  export declare const parseSolNativeTokenId: (tokenId: TokenId) => SolNativeTokenIdSpecs;
452
- //#endregion
453
- //#region src/chaindata/tokens/SolSplToken.d.ts
454
429
  declare const TOKEN_TYPE$9 = "sol-spl";
455
430
  export declare const SolSplTokenSchema: z.ZodObject<{
456
431
  id: z.ZodString;
@@ -477,8 +452,6 @@ export type SolSplTokenIdSpecs = {
477
452
  };
478
453
  export declare const solSplTokenId: (networkId: string, mintAddress: string) => string;
479
454
  export declare const parseSolSplTokenId: (tokenId: TokenId) => SolSplTokenIdSpecs;
480
- //#endregion
481
- //#region src/chaindata/tokens/SolToken2022Token.d.ts
482
455
  declare const TOKEN_TYPE$8 = "sol-token2022";
483
456
  export declare const SolToken2022TokenSchema: z.ZodObject<{
484
457
  id: z.ZodString;
@@ -506,8 +479,6 @@ export type SolToken2022TokenIdSpecs = {
506
479
  };
507
480
  export declare const solToken2022TokenId: (networkId: string, mintAddress: string) => string;
508
481
  export declare const parseSolToken2022TokenId: (tokenId: TokenId) => SolToken2022TokenIdSpecs;
509
- //#endregion
510
- //#region src/chaindata/tokens/SubstrateAssetsToken.d.ts
511
482
  declare const TOKEN_TYPE$7 = "substrate-assets";
512
483
  export declare const SubAssetsTokenSchema: z.ZodObject<{
513
484
  id: z.ZodString;
@@ -537,8 +508,6 @@ export type SubAssetTokenIdSpecs = {
537
508
  };
538
509
  export declare const subAssetTokenId: (networkId: NetworkId, assetId: string) => string;
539
510
  export declare const parseSubAssetTokenId: (tokenId: TokenId) => SubAssetTokenIdSpecs;
540
- //#endregion
541
- //#region src/chaindata/tokens/SubstrateDTaoToken.d.ts
542
511
  declare const TOKEN_TYPE$6 = "substrate-dtao";
543
512
  export declare const SubDTaoTokenSchema: z.ZodObject<{
544
513
  id: z.ZodString;
@@ -569,8 +538,6 @@ export type SubDTaoTokenIdSpecs = {
569
538
  };
570
539
  export declare const subDTaoTokenId: (networkId: NetworkId, subnetId: number, hotkey?: string) => string;
571
540
  export declare const parseSubDTaoTokenId: (tokenId: TokenId) => SubDTaoTokenIdSpecs;
572
- //#endregion
573
- //#region src/chaindata/tokens/SubstrateForeignAssetsToken.d.ts
574
541
  export declare const TOKEN_TYPE = "substrate-foreignassets";
575
542
  export declare const SubForeignAssetsTokenSchema: z.ZodObject<{
576
543
  id: z.ZodString;
@@ -600,8 +567,6 @@ export type ForeignAssetsTokenIdSpecs = {
600
567
  };
601
568
  export declare const subForeignAssetTokenId: (networkId: NetworkId, onChainId: string) => string;
602
569
  export declare const parseSubForeignAssetTokenId: (tokenId: TokenId) => ForeignAssetsTokenIdSpecs;
603
- //#endregion
604
- //#region src/chaindata/tokens/SubstrateHydrationToken.d.ts
605
570
  declare const TOKEN_TYPE$5 = "substrate-hydration";
606
571
  export declare const SubHydrationTokenSchema: z.ZodObject<{
607
572
  id: z.ZodString;
@@ -635,8 +600,6 @@ export type SubHydrationTokenIdSpecs = {
635
600
  };
636
601
  export declare const subHydrationTokenId: (networkId: NetworkId, onChainId: number) => string;
637
602
  export declare const parseSubHydrationTokenId: (tokenId: string) => SubHydrationTokenIdSpecs;
638
- //#endregion
639
- //#region src/chaindata/tokens/SubstrateNativeToken.d.ts
640
603
  declare const TOKEN_TYPE$4 = "substrate-native";
641
604
  export declare const SubNativeTokenSchema: z.ZodObject<{
642
605
  id: z.ZodString;
@@ -664,8 +627,6 @@ export type SubNativeTokenIdSpecs = {
664
627
  };
665
628
  export declare const subNativeTokenId: (networkId: NetworkId) => string;
666
629
  export declare const parseSubNativeTokenId: (tokenId: TokenId) => SubNativeTokenIdSpecs;
667
- //#endregion
668
- //#region src/chaindata/tokens/SubstratePsp22Token.d.ts
669
630
  declare const TOKEN_TYPE$3 = "substrate-psp22";
670
631
  export declare const SubPsp22TokenSchema: z.ZodObject<{
671
632
  id: z.ZodString;
@@ -692,8 +653,6 @@ export type SubPsp22TokenIdSpecs = {
692
653
  };
693
654
  export declare const subPsp22TokenId: (networkId: NetworkId, contractAddress: string) => string;
694
655
  export declare const parseSubPsp22TokenId: (tokenId: TokenId) => SubPsp22TokenIdSpecs;
695
- //#endregion
696
- //#region src/chaindata/tokens/SubstrateTokensToken.d.ts
697
656
  declare const TOKEN_TYPE$2 = "substrate-tokens";
698
657
  export declare const SubTokensTokenSchema: z.ZodObject<{
699
658
  id: z.ZodString;
@@ -723,8 +682,6 @@ export type SubTokensTokenIdSpecs = {
723
682
  };
724
683
  export declare const subTokensTokenId: (networkId: NetworkId, onChainId: string | number) => string;
725
684
  export declare const parseSubTokensTokenId: (tokenId: string) => SubTokensTokenIdSpecs;
726
- //#endregion
727
- //#region src/chaindata/tokens/Token.d.ts
728
685
  /**
729
686
  * The `Token` sum type, which is a union of all of the possible `TokenTypes`.
730
687
  */
@@ -1164,6 +1121,23 @@ export declare const TokenSchema: z.ZodPipe<z.ZodDiscriminatedUnion<[z.ZodObject
1164
1121
  mintAddress: z.ZodString;
1165
1122
  isTransferable: z.ZodOptional<z.ZodBoolean>;
1166
1123
  }, z.core.$strict>], "type">, z.ZodTransform<{
1124
+ id: string;
1125
+ networkId: string;
1126
+ isDefault?: boolean | undefined;
1127
+ decimals: number;
1128
+ symbol: string;
1129
+ name?: string | undefined;
1130
+ logo?: string | undefined;
1131
+ coingeckoId?: string | undefined;
1132
+ noDiscovery?: boolean | undefined;
1133
+ mirrorOf?: string | undefined;
1134
+ type: "substrate-hydration";
1135
+ platform: "polkadot";
1136
+ onChainId: number;
1137
+ assetType: "Erc20" | "External" | "Token";
1138
+ isSufficient: boolean;
1139
+ existentialDeposit: string;
1140
+ } | {
1167
1141
  id: string;
1168
1142
  networkId: string;
1169
1143
  isDefault?: boolean | undefined;
@@ -1318,12 +1292,8 @@ export declare const TokenSchema: z.ZodPipe<z.ZodDiscriminatedUnion<[z.ZodObject
1318
1292
  coingeckoId?: string | undefined;
1319
1293
  noDiscovery?: boolean | undefined;
1320
1294
  mirrorOf?: string | undefined;
1321
- type: "substrate-hydration";
1322
- platform: "polkadot";
1323
- onChainId: number;
1324
- assetType: "Erc20" | "External" | "Token";
1325
- isSufficient: boolean;
1326
- existentialDeposit: string;
1295
+ type: "sol-native";
1296
+ platform: "solana";
1327
1297
  } | {
1328
1298
  id: string;
1329
1299
  networkId: string;
@@ -1335,8 +1305,9 @@ export declare const TokenSchema: z.ZodPipe<z.ZodDiscriminatedUnion<[z.ZodObject
1335
1305
  coingeckoId?: string | undefined;
1336
1306
  noDiscovery?: boolean | undefined;
1337
1307
  mirrorOf?: string | undefined;
1338
- type: "sol-native";
1308
+ type: "sol-spl";
1339
1309
  platform: "solana";
1310
+ mintAddress: string;
1340
1311
  } | {
1341
1312
  id: string;
1342
1313
  networkId: string;
@@ -1348,10 +1319,11 @@ export declare const TokenSchema: z.ZodPipe<z.ZodDiscriminatedUnion<[z.ZodObject
1348
1319
  coingeckoId?: string | undefined;
1349
1320
  noDiscovery?: boolean | undefined;
1350
1321
  mirrorOf?: string | undefined;
1351
- type: "sol-spl";
1322
+ type: "sol-token2022";
1352
1323
  platform: "solana";
1353
1324
  mintAddress: string;
1354
- } | {
1325
+ isTransferable?: boolean | undefined;
1326
+ }, {
1355
1327
  id: string;
1356
1328
  networkId: string;
1357
1329
  isDefault?: boolean | undefined;
@@ -1362,11 +1334,13 @@ export declare const TokenSchema: z.ZodPipe<z.ZodDiscriminatedUnion<[z.ZodObject
1362
1334
  coingeckoId?: string | undefined;
1363
1335
  noDiscovery?: boolean | undefined;
1364
1336
  mirrorOf?: string | undefined;
1365
- type: "sol-token2022";
1366
- platform: "solana";
1367
- mintAddress: string;
1368
- isTransferable?: boolean | undefined;
1369
- }, {
1337
+ type: "substrate-hydration";
1338
+ platform: "polkadot";
1339
+ onChainId: number;
1340
+ assetType: "Erc20" | "External" | "Token";
1341
+ isSufficient: boolean;
1342
+ existentialDeposit: string;
1343
+ } | {
1370
1344
  id: string;
1371
1345
  networkId: string;
1372
1346
  isDefault?: boolean | undefined;
@@ -1510,23 +1484,6 @@ export declare const TokenSchema: z.ZodPipe<z.ZodDiscriminatedUnion<[z.ZodObject
1510
1484
  platform: "polkadot";
1511
1485
  onChainId: string | number;
1512
1486
  existentialDeposit: string;
1513
- } | {
1514
- id: string;
1515
- networkId: string;
1516
- isDefault?: boolean | undefined;
1517
- decimals: number;
1518
- symbol: string;
1519
- name?: string | undefined;
1520
- logo?: string | undefined;
1521
- coingeckoId?: string | undefined;
1522
- noDiscovery?: boolean | undefined;
1523
- mirrorOf?: string | undefined;
1524
- type: "substrate-hydration";
1525
- platform: "polkadot";
1526
- onChainId: number;
1527
- assetType: "Erc20" | "External" | "Token";
1528
- isSufficient: boolean;
1529
- existentialDeposit: string;
1530
1487
  } | {
1531
1488
  id: string;
1532
1489
  networkId: string;
@@ -1570,8 +1527,6 @@ export declare const TokenSchema: z.ZodPipe<z.ZodDiscriminatedUnion<[z.ZodObject
1570
1527
  mintAddress: string;
1571
1528
  isTransferable?: boolean | undefined;
1572
1529
  }>>;
1573
- //#endregion
1574
- //#region src/chaindata/tokens/EvmErc20Token.d.ts
1575
1530
  declare const TOKEN_TYPE$1 = "evm-erc20";
1576
1531
  export declare const EvmErc20TokenSchema: z.ZodObject<{
1577
1532
  id: z.ZodString;
@@ -1598,8 +1553,6 @@ export type EvmErc20TokenIdSpecs = {
1598
1553
  };
1599
1554
  export declare const evmErc20TokenId: (networkId: string, contractAddress: `0x${string}`) => string;
1600
1555
  export declare const parseEvmErc20TokenId: (tokenId: TokenId) => EvmErc20TokenIdSpecs;
1601
- //#endregion
1602
- //#region src/chaindata/tokens/TokenBase.d.ts
1603
1556
  export declare const TokenBaseSchema: z.ZodObject<{
1604
1557
  id: z.ZodString;
1605
1558
  networkId: z.ZodString;
@@ -1613,8 +1566,6 @@ export declare const TokenBaseSchema: z.ZodObject<{
1613
1566
  mirrorOf: z.ZodOptional<z.ZodString>;
1614
1567
  }, z.core.$strict>;
1615
1568
  export type TokenBase = z.infer<typeof TokenBaseSchema>;
1616
- //#endregion
1617
- //#region src/chaindata/utils.d.ts
1618
1569
  export type NetworkOfPlatform<P extends NetworkPlatform> = Extract<Network, {
1619
1570
  platform: P;
1620
1571
  }>;
@@ -1771,10 +1722,10 @@ export declare const isTokenNeedExistentialDeposit: (token: Token) => token is {
1771
1722
  coingeckoId?: string | undefined;
1772
1723
  noDiscovery?: boolean | undefined;
1773
1724
  mirrorOf?: string | undefined;
1774
- type: "substrate-assets";
1725
+ type: "substrate-hydration";
1775
1726
  platform: "polkadot";
1776
- assetId: string;
1777
- isFrozen?: boolean | undefined;
1727
+ onChainId: number;
1728
+ assetType: "Erc20" | "External" | "Token";
1778
1729
  isSufficient: boolean;
1779
1730
  existentialDeposit: string;
1780
1731
  } | {
@@ -1788,9 +1739,9 @@ export declare const isTokenNeedExistentialDeposit: (token: Token) => token is {
1788
1739
  coingeckoId?: string | undefined;
1789
1740
  noDiscovery?: boolean | undefined;
1790
1741
  mirrorOf?: string | undefined;
1791
- type: "substrate-foreignassets";
1742
+ type: "substrate-assets";
1792
1743
  platform: "polkadot";
1793
- onChainId: string;
1744
+ assetId: string;
1794
1745
  isFrozen?: boolean | undefined;
1795
1746
  isSufficient: boolean;
1796
1747
  existentialDeposit: string;
@@ -1805,8 +1756,11 @@ export declare const isTokenNeedExistentialDeposit: (token: Token) => token is {
1805
1756
  coingeckoId?: string | undefined;
1806
1757
  noDiscovery?: boolean | undefined;
1807
1758
  mirrorOf?: string | undefined;
1808
- type: "substrate-native";
1759
+ type: "substrate-foreignassets";
1809
1760
  platform: "polkadot";
1761
+ onChainId: string;
1762
+ isFrozen?: boolean | undefined;
1763
+ isSufficient: boolean;
1810
1764
  existentialDeposit: string;
1811
1765
  } | {
1812
1766
  id: string;
@@ -1819,9 +1773,8 @@ export declare const isTokenNeedExistentialDeposit: (token: Token) => token is {
1819
1773
  coingeckoId?: string | undefined;
1820
1774
  noDiscovery?: boolean | undefined;
1821
1775
  mirrorOf?: string | undefined;
1822
- type: "substrate-tokens";
1776
+ type: "substrate-native";
1823
1777
  platform: "polkadot";
1824
- onChainId: string | number;
1825
1778
  existentialDeposit: string;
1826
1779
  } | {
1827
1780
  id: string;
@@ -1834,11 +1787,9 @@ export declare const isTokenNeedExistentialDeposit: (token: Token) => token is {
1834
1787
  coingeckoId?: string | undefined;
1835
1788
  noDiscovery?: boolean | undefined;
1836
1789
  mirrorOf?: string | undefined;
1837
- type: "substrate-hydration";
1790
+ type: "substrate-tokens";
1838
1791
  platform: "polkadot";
1839
- onChainId: number;
1840
- assetType: "Erc20" | "External" | "Token";
1841
- isSufficient: boolean;
1792
+ onChainId: string | number;
1842
1793
  existentialDeposit: string;
1843
1794
  };
1844
1795
  export declare const isTokenOfType: <T extends TokenType>(token: Token | null | undefined, type: T) => token is TokenOfType<T>;
@@ -2060,12 +2011,8 @@ export type NativeToken<P extends NetworkPlatform = NetworkPlatform> = Extract<T
2060
2011
  }>;
2061
2012
  export declare const isNativeTokenType: <P extends NetworkPlatform = NetworkPlatform>(type: TokenType, platform?: P) => type is NativeTokenType<P>;
2062
2013
  export declare const isNativeToken: <P extends NetworkPlatform = NetworkPlatform>(token: Token, platform?: P) => token is NativeToken<P>;
2063
- //#endregion
2064
- //#region src/constants.d.ts
2065
2014
  export declare const MINIMETADATA_VERSION: string;
2066
2015
  export declare const DEFAULT_CHAINDATA_URL = "https://raw.githubusercontent.com/TalismanSociety/chaindata/main/pub/v15/chaindata.min.json";
2067
- //#endregion
2068
- //#region src/getBlockExplorerUrls.d.ts
2069
2016
  export type BlockExplorerQuery = {
2070
2017
  type: "address";
2071
2018
  address: string;
@@ -2089,13 +2036,9 @@ export type BlockExplorerQuery = {
2089
2036
  export declare const getBlockExplorerUrls: (network: Network, query: BlockExplorerQuery) => string[];
2090
2037
  export declare const getBlockExplorerUrl: (network: Network | null | undefined, query: BlockExplorerQuery) => string | null;
2091
2038
  export declare const getBlockExplorerLabel: (blockExplorerUrl: string) => string;
2092
- //#endregion
2093
- //#region src/isAccountPlatformCompatibleWithNetwork.d.ts
2094
2039
  /** mirrors AccountPlatform from @talismn/crypto, which this package does not depend on */
2095
2040
  type AccountPlatform = "ethereum" | "polkadot" | "bitcoin" | "solana";
2096
2041
  export declare const isAccountPlatformCompatibleWithNetwork: (network: Network, platform: AccountPlatform) => boolean;
2097
- //#endregion
2098
- //#region src/legacy/EvmNetwork.d.ts
2099
2042
  /** @deprecated */
2100
2043
  export type LegacyEvmNetworkId = string;
2101
2044
  /** @deprecated */
@@ -2157,8 +2100,6 @@ type BalancesMetadataLegacy$1 = {
2157
2100
  moduleType: string;
2158
2101
  metadata: unknown;
2159
2102
  };
2160
- //#endregion
2161
- //#region src/legacy/Chain.d.ts
2162
2103
  /** @deprecated use NetworkId */
2163
2104
  export type LegacyChainId = string;
2164
2105
  /** @deprecated use DotNetwork */
@@ -2247,8 +2188,6 @@ type BalancesMetadataLegacy = {
2247
2188
  moduleType: string;
2248
2189
  metadata: unknown;
2249
2190
  };
2250
- //#endregion
2251
- //#region src/legacy/TalismanChaindataDatabase.d.ts
2252
2191
  declare class TalismanChaindataDatabase extends Dexie {
2253
2192
  chains: Dexie.Table<LegacyChain | LegacyCustomChain, LegacyChainId>;
2254
2193
  evmNetworks: Dexie.Table<LegacyEvmNetwork | LegacyCustomEvmNetwork, LegacyEvmNetworkId>;
@@ -2257,8 +2196,6 @@ declare class TalismanChaindataDatabase extends Dexie {
2257
2196
  }
2258
2197
  /** @deprecated */
2259
2198
  export declare const getChaindataDbV3: () => TalismanChaindataDatabase;
2260
- //#endregion
2261
- //#region src/state/schema.d.ts
2262
2199
  export declare const ChaindataFileSchema: z.ZodObject<{
2263
2200
  networks: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
2264
2201
  id: z.ZodString;
@@ -2596,6 +2533,19 @@ export declare const ChaindataFileSchema: z.ZodObject<{
2596
2533
  mintAddress: z.ZodString;
2597
2534
  isTransferable: z.ZodOptional<z.ZodBoolean>;
2598
2535
  }, z.core.$strict>], "type">, z.ZodTransform<{
2536
+ id: string;
2537
+ networkId: string;
2538
+ isDefault?: boolean | undefined;
2539
+ decimals: number;
2540
+ symbol: string;
2541
+ name?: string | undefined;
2542
+ logo?: string | undefined;
2543
+ coingeckoId?: string | undefined;
2544
+ noDiscovery?: boolean | undefined;
2545
+ mirrorOf?: string | undefined;
2546
+ type: "sol-native";
2547
+ platform: "solana";
2548
+ } | {
2599
2549
  id: string;
2600
2550
  networkId: string;
2601
2551
  isDefault?: boolean | undefined;
@@ -2767,8 +2717,9 @@ export declare const ChaindataFileSchema: z.ZodObject<{
2767
2717
  coingeckoId?: string | undefined;
2768
2718
  noDiscovery?: boolean | undefined;
2769
2719
  mirrorOf?: string | undefined;
2770
- type: "sol-native";
2720
+ type: "sol-spl";
2771
2721
  platform: "solana";
2722
+ mintAddress: string;
2772
2723
  } | {
2773
2724
  id: string;
2774
2725
  networkId: string;
@@ -2780,10 +2731,11 @@ export declare const ChaindataFileSchema: z.ZodObject<{
2780
2731
  coingeckoId?: string | undefined;
2781
2732
  noDiscovery?: boolean | undefined;
2782
2733
  mirrorOf?: string | undefined;
2783
- type: "sol-spl";
2734
+ type: "sol-token2022";
2784
2735
  platform: "solana";
2785
2736
  mintAddress: string;
2786
- } | {
2737
+ isTransferable?: boolean | undefined;
2738
+ }, {
2787
2739
  id: string;
2788
2740
  networkId: string;
2789
2741
  isDefault?: boolean | undefined;
@@ -2794,11 +2746,9 @@ export declare const ChaindataFileSchema: z.ZodObject<{
2794
2746
  coingeckoId?: string | undefined;
2795
2747
  noDiscovery?: boolean | undefined;
2796
2748
  mirrorOf?: string | undefined;
2797
- type: "sol-token2022";
2749
+ type: "sol-native";
2798
2750
  platform: "solana";
2799
- mintAddress: string;
2800
- isTransferable?: boolean | undefined;
2801
- }, {
2751
+ } | {
2802
2752
  id: string;
2803
2753
  networkId: string;
2804
2754
  isDefault?: boolean | undefined;
@@ -2959,19 +2909,6 @@ export declare const ChaindataFileSchema: z.ZodObject<{
2959
2909
  assetType: "Erc20" | "External" | "Token";
2960
2910
  isSufficient: boolean;
2961
2911
  existentialDeposit: string;
2962
- } | {
2963
- id: string;
2964
- networkId: string;
2965
- isDefault?: boolean | undefined;
2966
- decimals: number;
2967
- symbol: string;
2968
- name?: string | undefined;
2969
- logo?: string | undefined;
2970
- coingeckoId?: string | undefined;
2971
- noDiscovery?: boolean | undefined;
2972
- mirrorOf?: string | undefined;
2973
- type: "sol-native";
2974
- platform: "solana";
2975
2912
  } | {
2976
2913
  id: string;
2977
2914
  networkId: string;
@@ -3351,6 +3288,19 @@ export declare const CustomChaindataSchema: z.ZodObject<{
3351
3288
  mintAddress: z.ZodString;
3352
3289
  isTransferable: z.ZodOptional<z.ZodBoolean>;
3353
3290
  }, z.core.$strict>], "type">, z.ZodTransform<{
3291
+ id: string;
3292
+ networkId: string;
3293
+ isDefault?: boolean | undefined;
3294
+ decimals: number;
3295
+ symbol: string;
3296
+ name?: string | undefined;
3297
+ logo?: string | undefined;
3298
+ coingeckoId?: string | undefined;
3299
+ noDiscovery?: boolean | undefined;
3300
+ mirrorOf?: string | undefined;
3301
+ type: "sol-native";
3302
+ platform: "solana";
3303
+ } | {
3354
3304
  id: string;
3355
3305
  networkId: string;
3356
3306
  isDefault?: boolean | undefined;
@@ -3522,8 +3472,9 @@ export declare const CustomChaindataSchema: z.ZodObject<{
3522
3472
  coingeckoId?: string | undefined;
3523
3473
  noDiscovery?: boolean | undefined;
3524
3474
  mirrorOf?: string | undefined;
3525
- type: "sol-native";
3475
+ type: "sol-spl";
3526
3476
  platform: "solana";
3477
+ mintAddress: string;
3527
3478
  } | {
3528
3479
  id: string;
3529
3480
  networkId: string;
@@ -3535,10 +3486,11 @@ export declare const CustomChaindataSchema: z.ZodObject<{
3535
3486
  coingeckoId?: string | undefined;
3536
3487
  noDiscovery?: boolean | undefined;
3537
3488
  mirrorOf?: string | undefined;
3538
- type: "sol-spl";
3489
+ type: "sol-token2022";
3539
3490
  platform: "solana";
3540
3491
  mintAddress: string;
3541
- } | {
3492
+ isTransferable?: boolean | undefined;
3493
+ }, {
3542
3494
  id: string;
3543
3495
  networkId: string;
3544
3496
  isDefault?: boolean | undefined;
@@ -3549,11 +3501,9 @@ export declare const CustomChaindataSchema: z.ZodObject<{
3549
3501
  coingeckoId?: string | undefined;
3550
3502
  noDiscovery?: boolean | undefined;
3551
3503
  mirrorOf?: string | undefined;
3552
- type: "sol-token2022";
3504
+ type: "sol-native";
3553
3505
  platform: "solana";
3554
- mintAddress: string;
3555
- isTransferable?: boolean | undefined;
3556
- }, {
3506
+ } | {
3557
3507
  id: string;
3558
3508
  networkId: string;
3559
3509
  isDefault?: boolean | undefined;
@@ -3714,19 +3664,6 @@ export declare const CustomChaindataSchema: z.ZodObject<{
3714
3664
  assetType: "Erc20" | "External" | "Token";
3715
3665
  isSufficient: boolean;
3716
3666
  existentialDeposit: string;
3717
- } | {
3718
- id: string;
3719
- networkId: string;
3720
- isDefault?: boolean | undefined;
3721
- decimals: number;
3722
- symbol: string;
3723
- name?: string | undefined;
3724
- logo?: string | undefined;
3725
- coingeckoId?: string | undefined;
3726
- noDiscovery?: boolean | undefined;
3727
- mirrorOf?: string | undefined;
3728
- type: "sol-native";
3729
- platform: "solana";
3730
3667
  } | {
3731
3668
  id: string;
3732
3669
  networkId: string;
@@ -3759,8 +3696,6 @@ export declare const CustomChaindataSchema: z.ZodObject<{
3759
3696
  }>>>;
3760
3697
  }, z.core.$strict>;
3761
3698
  type CustomChaindata = z.infer<typeof CustomChaindataSchema>;
3762
- //#endregion
3763
- //#region src/provider/ChaindataProviderInterface.d.ts
3764
3699
  export interface IChaindataNetworkProvider {
3765
3700
  networks$: Observable<Network[]>;
3766
3701
  getNetworks$<P extends NetworkPlatform | undefined, R = P extends NetworkPlatform ? NetworkOfPlatform<P> : Network>(platform?: P): Observable<R[]>;
@@ -3788,8 +3723,6 @@ export interface IChaindataTokenProvider {
3788
3723
  getTokenById<T extends TokenType | undefined, R extends T extends TokenType ? TokenOfType<T> : Token>(tokenId: TokenId, type?: T): Promise<R | null>;
3789
3724
  }
3790
3725
  export interface IChaindataProvider extends IChaindataNetworkProvider, IChaindataTokenProvider {}
3791
- //#endregion
3792
- //#region src/provider/ChaindataProvider.d.ts
3793
3726
  /**
3794
3727
  * This type will be used for in-memory storage of chaindata.
3795
3728
  *
@@ -4420,8 +4353,6 @@ export declare class ChaindataProvider implements IChaindataProvider {
4420
4353
  } | undefined;
4421
4354
  }>;
4422
4355
  }
4423
- //#endregion
4424
- //#region src/state/combinedChaindata.d.ts
4425
4356
  export declare const isNetworkCustom: (network: Network) => boolean;
4426
4357
  export declare const isNetworkKnown: (network: Network) => boolean;
4427
4358
  export declare const isTokenCustom: (token: Token) => boolean;
@@ -4429,8 +4360,6 @@ export declare const isTokenKnown: (token: Token) => boolean;
4429
4360
  export declare const isTokenTestnet: (token: Token) => boolean;
4430
4361
  export declare const getCleanNetwork: (network: Network) => Network;
4431
4362
  export declare const getCleanToken: (token: Token) => Token;
4432
- //#endregion
4433
- //#region src/state/remoteChaindata.d.ts
4434
4363
  /**
4435
4364
  * Downloads the chaindata file at `url` and refreshes it every 5 minutes. Equivalent spellings
4436
4365
  * of a url share one observable. Throws if `url` is not a valid url.
@@ -4775,8 +4704,6 @@ export declare const getRemoteChaindata$: (url: string) => Observable<{
4775
4704
  extra: any;
4776
4705
  }[];
4777
4706
  }>;
4778
- //#endregion
4779
- //#region src/util.d.ts
4780
4707
  type KNOWN_TOKEN_ID = "uniswap";
4781
4708
  export declare const getGithubTokenLogoUrl: (tokenId: KNOWN_TOKEN_ID) => string;
4782
4709
  /**
@@ -4786,6 +4713,5 @@ export declare const getGithubTokenLogoUrl: (tokenId: KNOWN_TOKEN_ID) => string;
4786
4713
  */
4787
4714
  export declare const getGithubTokenLogoUrlByCoingeckoId: (coingeckoId: string) => string;
4788
4715
  export declare const getGithubBittensorHotkeyAssetUrl: (fileName: string) => string;
4789
- //#endregion
4790
4716
  export type { Chaindata, ChaindataFile, CustomChaindata };
4791
4717
  //# sourceMappingURL=index.d.mts.map