@talismn/balances 0.0.0-pr2043-20250618091117 → 0.0.0-pr2043-20250619015240

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@talismn/balances",
3
- "version": "0.0.0-pr2043-20250618091117",
3
+ "version": "0.0.0-pr2043-20250619015240",
4
4
  "author": "Talisman",
5
5
  "homepage": "https://talisman.xyz",
6
6
  "license": "GPL-3.0-or-later",
@@ -28,18 +28,20 @@
28
28
  "bignumber.js": "^9.1.2",
29
29
  "dexie": "^4.0.9",
30
30
  "lodash": "4.17.21",
31
+ "p-queue": "^8.1.0",
31
32
  "pako": "^2.1.0",
32
33
  "polkadot-api": "1.13.1",
33
34
  "rxjs": "^7.8.1",
34
35
  "scale-ts": "^1.6.1",
35
36
  "viem": "^2.27.3",
36
- "@talismn/chain-connector": "0.0.0-pr2043-20250618091117",
37
- "@talismn/chain-connector-evm": "0.0.0-pr2043-20250618091117",
38
- "@talismn/sapi": "0.0.0-pr2043-20250618091117",
37
+ "zod": "^3.25.62",
38
+ "@talismn/chain-connector": "0.0.0-pr2043-20250619015240",
39
+ "@talismn/chaindata-provider": "0.0.0-pr2043-20250619015240",
40
+ "@talismn/chain-connector-evm": "0.0.0-pr2043-20250619015240",
41
+ "@talismn/sapi": "0.0.0-pr2043-20250619015240",
39
42
  "@talismn/scale": "0.1.2",
40
- "@talismn/token-rates": "0.0.0-pr2043-20250618091117",
41
- "@talismn/util": "0.4.2",
42
- "@talismn/chaindata-provider": "0.0.0-pr2043-20250618091117"
43
+ "@talismn/token-rates": "0.0.0-pr2043-20250619015240",
44
+ "@talismn/util": "0.4.2"
43
45
  },
44
46
  "devDependencies": {
45
47
  "@polkadot/api-contract": "16.1.2",
@@ -1,43 +0,0 @@
1
- import { ChaindataProvider, ChainId, DotNetwork } from "@talismn/chaindata-provider";
2
- import { ChainConnectors } from "./BalanceModule";
3
- import { AnyBalanceModule } from "./modules/util";
4
- import { MiniMetadata, MiniMetadataStatus } from "./types";
5
- /**
6
- * A substrate dapp needs access to a set of types when it wants to communicate with a blockchain node.
7
- *
8
- * These types are used to encode requests & decode responses via the SCALE codec.
9
- * Each chain generally has its own set of types.
10
- *
11
- * Substrate provides a construct to retrieve these types from a blockchain node.
12
- * The chain metadata.
13
- *
14
- * The metadata includes the types required for any communication with the chain,
15
- * including lots of methods which are not relevant to balance fetching.
16
- *
17
- * As such, the metadata can clock in at around 1-2MB per chain, which is a lot of storage
18
- * for browser-based dapps which want to connect to lots of chains.
19
- *
20
- * By utilizing the wonderful [scale-ts](https://github.com/unstoppablejs/unstoppablejs/tree/main/packages/scale-ts#readme) library,
21
- * we can trim the chain metadata down so that it only includes the types we need for balance fetching.
22
- *
23
- * Each balance module has a function to do just that, `BalanceModule::fetchSubstrateChainMeta`.
24
- *
25
- * But, we only want to run this operation when necessary.
26
- *
27
- * The purpose of this class, `MiniMetadataUpdater`, is to maintain a local cache of
28
- * trimmed-down metadatas, which we'll refer to as `MiniMetadatas`.
29
- */
30
- export declare class MiniMetadataUpdater {
31
- #private;
32
- constructor(chainConnectors: ChainConnectors, chaindataProvider: ChaindataProvider, balanceModules: Array<AnyBalanceModule>);
33
- /** Subscribe to the metadata for a chain */
34
- subscribe(chainId: ChainId): import("rxjs").Observable<MiniMetadata>;
35
- update(chainIds: ChainId[]): Promise<void>;
36
- statuses(chains: Array<Pick<DotNetwork, "id" | "specName" | "specVersion">>): Promise<{
37
- wantedIdsByChain: Map<string, string[]>;
38
- statusesByChain: Map<string, MiniMetadataStatus>;
39
- }>;
40
- hydrateFromChaindata(): Promise<boolean>;
41
- hydrateCustomChains(): Promise<void>;
42
- private updateSubstrateChains;
43
- }
@@ -1,8 +0,0 @@
1
- import { EvmTokenFetcher, MiniMetadataUpdater } from "@talismn/balances";
2
- import { ChaindataProvider } from "@talismn/chaindata-provider";
3
- /** Pulls the latest chaindata from https://github.com/TalismanSociety/chaindata */
4
- export declare const hydrateChaindataAndMiniMetadata: (chaindataProvider: ChaindataProvider, miniMetadataUpdater: MiniMetadataUpdater) => Promise<void>;
5
- /** Builds any missing miniMetadatas (e.g. for the user's custom substrate chains) */
6
- export declare const updateCustomMiniMetadata: (chaindataProvider: ChaindataProvider, miniMetadataUpdater: MiniMetadataUpdater) => Promise<void>;
7
- /** Fetches any missing Evm Tokens */
8
- export declare const updateEvmTokens: (chaindataProvider: ChaindataProvider, evmTokenFetcher: EvmTokenFetcher) => Promise<void>;
@@ -1 +0,0 @@
1
- export * from "./hydrateChaindata";