@talismn/balances 0.0.0-pr2043-20250619151012 → 0.0.0-pr2043-20250619153855

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.
@@ -1,198 +1,4 @@
1
- export declare const defaultBalanceModules: (import("..").NewBalanceModule<"evm-erc20", {
2
- id: string;
3
- decimals: number;
4
- symbol: string;
5
- name: string;
6
- networkId: string;
7
- type: "evm-erc20";
8
- platform: "ethereum";
9
- contractAddress: `0x${string}`;
10
- isDefault?: boolean | undefined;
11
- logo?: string | undefined;
12
- coingeckoId?: string | undefined;
13
- noDiscovery?: boolean | undefined;
14
- mirrorOf?: string | undefined;
15
- isCustom?: boolean | undefined;
16
- } | {
17
- id: string;
18
- decimals: number;
19
- symbol: string;
20
- name: string;
21
- networkId: string;
22
- type: "evm-erc20";
23
- platform: "ethereum";
24
- contractAddress: `0x${string}`;
25
- isCustom: true;
26
- isDefault?: boolean | undefined;
27
- logo?: string | undefined;
28
- coingeckoId?: string | undefined;
29
- noDiscovery?: boolean | undefined;
30
- mirrorOf?: string | undefined;
31
- }, import("..").DefaultChainMeta, import("./EvmErc20Module").EvmErc20ModuleConfig> | import("..").NewBalanceModule<"evm-native", {
32
- id: string;
33
- decimals: number;
34
- symbol: string;
35
- name: string;
36
- networkId: string;
37
- type: "evm-native";
38
- platform: "ethereum";
39
- isDefault?: boolean | undefined;
40
- logo?: string | undefined;
41
- coingeckoId?: string | undefined;
42
- noDiscovery?: boolean | undefined;
43
- mirrorOf?: string | undefined;
44
- } | {
45
- id: string;
46
- decimals: number;
47
- symbol: string;
48
- name: string;
49
- networkId: string;
50
- type: "evm-native";
51
- platform: "ethereum";
52
- isCustom: true;
53
- isDefault?: boolean | undefined;
54
- logo?: string | undefined;
55
- coingeckoId?: string | undefined;
56
- noDiscovery?: boolean | undefined;
57
- mirrorOf?: string | undefined;
58
- }, import("..").DefaultChainMeta, import("@talismn/chaindata-provider").BalancesConfigTokenParams> | import("..").NewBalanceModule<"evm-uniswapv2", {
59
- id: string;
60
- decimals: number;
61
- symbol: string;
62
- name: string;
63
- networkId: string;
64
- type: "evm-uniswapv2";
65
- platform: "ethereum";
66
- contractAddress: `0x${string}`;
67
- symbol0: string;
68
- symbol1: string;
69
- decimals0: number;
70
- decimals1: number;
71
- tokenAddress0: `0x${string}`;
72
- tokenAddress1: `0x${string}`;
73
- isDefault?: boolean | undefined;
74
- logo?: string | undefined;
75
- coingeckoId?: string | undefined;
76
- noDiscovery?: boolean | undefined;
77
- mirrorOf?: string | undefined;
78
- isCustom?: boolean | undefined;
79
- coingeckoId0?: string | undefined;
80
- coingeckoId1?: string | undefined;
81
- } | {
82
- id: string;
83
- decimals: number;
84
- symbol: string;
85
- name: string;
86
- networkId: string;
87
- type: "evm-uniswapv2";
88
- platform: "ethereum";
89
- contractAddress: `0x${string}`;
90
- symbol0: string;
91
- symbol1: string;
92
- decimals0: number;
93
- decimals1: number;
94
- tokenAddress0: `0x${string}`;
95
- tokenAddress1: `0x${string}`;
96
- isCustom: true;
97
- isDefault?: boolean | undefined;
98
- logo?: string | undefined;
99
- coingeckoId?: string | undefined;
100
- noDiscovery?: boolean | undefined;
101
- mirrorOf?: string | undefined;
102
- coingeckoId0?: string | undefined;
103
- coingeckoId1?: string | undefined;
104
- }, import("..").DefaultChainMeta, import("./EvmUniswapV2Module").EvmUniswapV2ModuleConfig> | import("..").NewBalanceModule<"substrate-assets", {
105
- id: string;
106
- decimals: number;
107
- symbol: string;
108
- name: string;
109
- networkId: string;
110
- type: "substrate-assets";
111
- platform: "polkadot";
112
- assetId: string;
113
- existentialDeposit: string;
114
- isDefault?: boolean | undefined;
115
- logo?: string | undefined;
116
- coingeckoId?: string | undefined;
117
- noDiscovery?: boolean | undefined;
118
- mirrorOf?: string | undefined;
119
- isFrozen?: boolean | undefined;
120
- }, import("./SubstrateAssetsModule").SubAssetsChainMeta, import("./SubstrateAssetsModule").SubAssetsModuleConfig, import("./SubstrateAssetsModule").SubAssetsTransferParams> | import("..").NewBalanceModule<"substrate-foreignassets", {
121
- id: string;
122
- decimals: number;
123
- symbol: string;
124
- name: string;
125
- networkId: string;
126
- type: "substrate-foreignassets";
127
- platform: "polkadot";
128
- onChainId: string;
129
- existentialDeposit: string;
130
- isDefault?: boolean | undefined;
131
- logo?: string | undefined;
132
- coingeckoId?: string | undefined;
133
- noDiscovery?: boolean | undefined;
134
- mirrorOf?: string | undefined;
135
- isFrozen?: boolean | undefined;
136
- }, import("..").DefaultChainMeta, import("./SubstrateForeignAssetsModule").SubForeignAssetsModuleConfig, import("./SubstrateForeignAssetsModule").SubForeignAssetsTransferParams> | import("..").NewBalanceModule<"substrate-native", {
137
- id: string;
138
- decimals: number;
139
- symbol: string;
140
- name: string;
141
- networkId: string;
142
- type: "substrate-native";
143
- platform: "polkadot";
144
- existentialDeposit: string;
145
- isDefault?: boolean | undefined;
146
- logo?: string | undefined;
147
- coingeckoId?: string | undefined;
148
- noDiscovery?: boolean | undefined;
149
- mirrorOf?: string | undefined;
150
- } | {
151
- id: string;
152
- decimals: number;
153
- symbol: string;
154
- name: string;
155
- networkId: string;
156
- type: "substrate-native";
157
- platform: "polkadot";
158
- existentialDeposit: string;
159
- isCustom: true;
160
- isDefault?: boolean | undefined;
161
- logo?: string | undefined;
162
- coingeckoId?: string | undefined;
163
- noDiscovery?: boolean | undefined;
164
- mirrorOf?: string | undefined;
165
- }, import("./SubstrateNativeModule").SubNativeChainMeta, import("./SubstrateNativeModule").SubNativeModuleConfig, import("./SubstrateNativeModule").SubNativeTransferParams> | import("..").NewBalanceModule<"substrate-psp22", {
166
- id: string;
167
- decimals: number;
168
- symbol: string;
169
- name: string;
170
- networkId: string;
171
- type: "substrate-psp22";
172
- platform: "polkadot";
173
- existentialDeposit: string;
174
- contractAddress: string;
175
- isDefault?: boolean | undefined;
176
- logo?: string | undefined;
177
- coingeckoId?: string | undefined;
178
- noDiscovery?: boolean | undefined;
179
- mirrorOf?: string | undefined;
180
- }, import("..").DefaultChainMeta, import("./SubstratePsp22Module").SubPsp22ModuleConfig, import("./SubstratePsp22Module").SubPsp22TransferParams> | import("..").NewBalanceModule<"substrate-tokens", {
181
- id: string;
182
- decimals: number;
183
- symbol: string;
184
- name: string;
185
- networkId: string;
186
- type: "substrate-tokens";
187
- platform: "polkadot";
188
- onChainId: string | number;
189
- existentialDeposit: string;
190
- isDefault?: boolean | undefined;
191
- logo?: string | undefined;
192
- coingeckoId?: string | undefined;
193
- noDiscovery?: boolean | undefined;
194
- mirrorOf?: string | undefined;
195
- }, import("./SubstrateTokensModule").SubTokensChainMeta, import("./SubstrateTokensModule").SubTokensModuleConfig, import("./SubstrateTokensModule").SubTokensTransferParams>)[];
1
+ export declare const defaultBalanceModules: (import("..").NewBalanceModule<"evm-erc20", any, import("..").DefaultChainMeta, import("./EvmErc20Module").EvmErc20ModuleConfig> | import("..").NewBalanceModule<"evm-native", any, import("..").DefaultChainMeta, BalancesConfigTokenParams> | import("..").NewBalanceModule<"evm-uniswapv2", any, import("..").DefaultChainMeta, import("./EvmUniswapV2Module").EvmUniswapV2ModuleConfig> | import("..").NewBalanceModule<"substrate-assets", SubAssetsToken, import("./SubstrateAssetsModule").SubAssetsChainMeta, import("./SubstrateAssetsModule").SubAssetsModuleConfig, import("./SubstrateAssetsModule").SubAssetsTransferParams> | import("..").NewBalanceModule<"substrate-foreignassets", SubForeignAssetsToken, import("..").DefaultChainMeta, import("./SubstrateForeignAssetsModule").SubForeignAssetsModuleConfig, import("./SubstrateForeignAssetsModule").SubForeignAssetsTransferParams> | import("..").NewBalanceModule<"substrate-native", any, import("./SubstrateNativeModule").SubNativeChainMeta, any, import("./SubstrateNativeModule").SubNativeTransferParams> | import("..").NewBalanceModule<"substrate-psp22", SubPsp22Token, import("..").DefaultChainMeta, import("./SubstratePsp22Module").SubPsp22ModuleConfig, import("./SubstratePsp22Module").SubPsp22TransferParams> | import("..").NewBalanceModule<"substrate-tokens", SubTokensToken, import("./SubstrateTokensModule").SubTokensChainMeta, import("./SubstrateTokensModule").SubTokensModuleConfig, import("./SubstrateTokensModule").SubTokensTransferParams>)[];
196
2
  export * from "./EvmErc20Module";
197
3
  export * from "./EvmNativeModule";
198
4
  export * from "./EvmUniswapV2Module";
@@ -16,7 +16,7 @@ export declare const buildStorageCoders: <TBalanceModule extends AnyNewBalanceMo
16
16
  chains: Record<NetworkId, DotNetwork>;
17
17
  miniMetadatas: Map<DotNetworkId, MiniMetadata<TBalanceModule>>;
18
18
  coders: TCoders;
19
- }) => Map<string, { [Property in keyof TCoders]: {
19
+ }) => Map<DotNetworkId, { [Property in keyof TCoders]: {
20
20
  args: [import("scale-ts").Encoder<any[]>, import("scale-ts").Decoder<any[]>] & {
21
21
  enc: import("scale-ts").Encoder<any[]>;
22
22
  dec: import("scale-ts").Decoder<any[]>;
@@ -127,212 +127,11 @@ export declare class Balance {
127
127
  get source(): "evm-erc20" | "evm-native" | "evm-uniswapv2" | "substrate-assets" | "substrate-foreignassets" | "substrate-native" | "substrate-psp22" | "substrate-tokens";
128
128
  get status(): import("./balancetypes").BalanceStatus;
129
129
  get address(): string;
130
- get networkId(): string;
131
- get network(): {
132
- id: string;
133
- name: string;
134
- nativeTokenId: string;
135
- nativeCurrency: {
136
- decimals: number;
137
- symbol: string;
138
- name: string;
139
- coingeckoId?: string | undefined;
140
- mirrorOf?: string | undefined;
141
- logo?: string | undefined;
142
- };
143
- blockExplorerUrls: string[];
144
- genesisHash: `0x${string}`;
145
- platform: "polkadot";
146
- chainName: string;
147
- specName: string;
148
- specVersion: number;
149
- account: "*25519" | "secp256k1";
150
- prefix: number;
151
- rpcs: string[];
152
- topology: {
153
- type: "standalone";
154
- } | {
155
- type: "relay";
156
- } | {
157
- type: "parachain";
158
- relayId: string;
159
- paraId: number;
160
- };
161
- isTestnet?: boolean | undefined;
162
- isDefault?: boolean | undefined;
163
- forceScan?: boolean | undefined;
164
- logo?: string | undefined;
165
- themeColor?: string | undefined;
166
- chainspecQrUrl?: string | undefined;
167
- latestMetadataQrUrl?: string | undefined;
168
- overrideNativeTokenId?: string | undefined;
169
- oldPrefix?: number | undefined;
170
- registryTypes?: any;
171
- signedExtensions?: any;
172
- hasCheckMetadataHash?: boolean | undefined;
173
- hasExtrinsicSignatureTypePrefix?: boolean | undefined;
174
- isUnknownFeeToken?: boolean | undefined;
175
- } | {
176
- id: string;
177
- name: string;
178
- nativeTokenId: string;
179
- nativeCurrency: {
180
- decimals: number;
181
- symbol: string;
182
- name: string;
183
- coingeckoId?: string | undefined;
184
- mirrorOf?: string | undefined;
185
- logo?: string | undefined;
186
- };
187
- blockExplorerUrls: string[];
188
- platform: "ethereum";
189
- rpcs: string[];
190
- isTestnet?: boolean | undefined;
191
- isDefault?: boolean | undefined;
192
- forceScan?: boolean | undefined;
193
- logo?: string | undefined;
194
- themeColor?: string | undefined;
195
- substrateChainId?: string | undefined;
196
- preserveGasEstimate?: boolean | undefined;
197
- feeType?: "eip-1559" | "legacy" | undefined;
198
- l2FeeType?: {
199
- type: "op-stack";
200
- } | {
201
- type: "scroll";
202
- l1GasPriceOracle: `0x${string}`;
203
- } | undefined;
204
- contracts?: Partial<Record<"Erc20Aggregator" | "Multicall3", `0x${string}`>> | undefined;
205
- } | null;
206
- get tokenId(): string;
207
- get token(): {
208
- id: string;
209
- decimals: number;
210
- symbol: string;
211
- name: string;
212
- networkId: string;
213
- type: "evm-erc20";
214
- platform: "ethereum";
215
- contractAddress: `0x${string}`;
216
- isDefault?: boolean | undefined;
217
- logo?: string | undefined;
218
- coingeckoId?: string | undefined;
219
- noDiscovery?: boolean | undefined;
220
- mirrorOf?: string | undefined;
221
- isCustom?: boolean | undefined;
222
- } | {
223
- id: string;
224
- decimals: number;
225
- symbol: string;
226
- name: string;
227
- networkId: string;
228
- type: "evm-native";
229
- platform: "ethereum";
230
- isDefault?: boolean | undefined;
231
- logo?: string | undefined;
232
- coingeckoId?: string | undefined;
233
- noDiscovery?: boolean | undefined;
234
- mirrorOf?: string | undefined;
235
- } | {
236
- id: string;
237
- decimals: number;
238
- symbol: string;
239
- name: string;
240
- networkId: string;
241
- type: "evm-uniswapv2";
242
- platform: "ethereum";
243
- contractAddress: `0x${string}`;
244
- symbol0: string;
245
- symbol1: string;
246
- decimals0: number;
247
- decimals1: number;
248
- tokenAddress0: `0x${string}`;
249
- tokenAddress1: `0x${string}`;
250
- isDefault?: boolean | undefined;
251
- logo?: string | undefined;
252
- coingeckoId?: string | undefined;
253
- noDiscovery?: boolean | undefined;
254
- mirrorOf?: string | undefined;
255
- isCustom?: boolean | undefined;
256
- coingeckoId0?: string | undefined;
257
- coingeckoId1?: string | undefined;
258
- } | {
259
- id: string;
260
- decimals: number;
261
- symbol: string;
262
- name: string;
263
- networkId: string;
264
- type: "substrate-assets";
265
- platform: "polkadot";
266
- assetId: string;
267
- existentialDeposit: string;
268
- isDefault?: boolean | undefined;
269
- logo?: string | undefined;
270
- coingeckoId?: string | undefined;
271
- noDiscovery?: boolean | undefined;
272
- mirrorOf?: string | undefined;
273
- isFrozen?: boolean | undefined;
274
- } | {
275
- id: string;
276
- decimals: number;
277
- symbol: string;
278
- name: string;
279
- networkId: string;
280
- type: "substrate-foreignassets";
281
- platform: "polkadot";
282
- onChainId: string;
283
- existentialDeposit: string;
284
- isDefault?: boolean | undefined;
285
- logo?: string | undefined;
286
- coingeckoId?: string | undefined;
287
- noDiscovery?: boolean | undefined;
288
- mirrorOf?: string | undefined;
289
- isFrozen?: boolean | undefined;
290
- } | {
291
- id: string;
292
- decimals: number;
293
- symbol: string;
294
- name: string;
295
- networkId: string;
296
- type: "substrate-native";
297
- platform: "polkadot";
298
- existentialDeposit: string;
299
- isDefault?: boolean | undefined;
300
- logo?: string | undefined;
301
- coingeckoId?: string | undefined;
302
- noDiscovery?: boolean | undefined;
303
- mirrorOf?: string | undefined;
304
- } | {
305
- id: string;
306
- decimals: number;
307
- symbol: string;
308
- name: string;
309
- networkId: string;
310
- type: "substrate-psp22";
311
- platform: "polkadot";
312
- existentialDeposit: string;
313
- contractAddress: string;
314
- isDefault?: boolean | undefined;
315
- logo?: string | undefined;
316
- coingeckoId?: string | undefined;
317
- noDiscovery?: boolean | undefined;
318
- mirrorOf?: string | undefined;
319
- } | {
320
- id: string;
321
- decimals: number;
322
- symbol: string;
323
- name: string;
324
- networkId: string;
325
- type: "substrate-tokens";
326
- platform: "polkadot";
327
- onChainId: string | number;
328
- existentialDeposit: string;
329
- isDefault?: boolean | undefined;
330
- logo?: string | undefined;
331
- coingeckoId?: string | undefined;
332
- noDiscovery?: boolean | undefined;
333
- mirrorOf?: string | undefined;
334
- } | null;
335
- get decimals(): number | null;
130
+ get networkId(): NetworkId;
131
+ get network(): any;
132
+ get tokenId(): TokenId;
133
+ get token(): any;
134
+ get decimals(): any;
336
135
  get rates(): TokenRates | null;
337
136
  /**
338
137
  * A general method to get formatted values matching a certain type from this balance.
@@ -1,3 +1,4 @@
1
+ import { AnyMiniMetadataSchema } from "@talismn/chaindata-provider";
1
2
  import z from "zod/v4";
2
3
  import { AnyNewBalanceModule, InferChainMeta } from "../modules";
3
4
  /** For fast db access, you can calculate the primary key for a miniMetadata using this method */
@@ -9,21 +10,6 @@ export type MiniMetadataStatus =
9
10
  | "outdated"
10
11
  /** Metadata doesn't exist */
11
12
  | "none";
12
- export declare const MiniMetadataBaseSchema: z.ZodObject<{
13
- /** The DB id for this metadata */
14
- id: z.ZodString;
15
- /** The balance module which created this miniMetadata */
16
- source: z.ZodString;
17
- /** The chain this miniMetadata came from */
18
- chainId: z.ZodString;
19
- /** The chain specVersion which this miniMetadata is valid for */
20
- specVersion: z.ZodUInt32;
21
- /** the version of the balances library used to craft the mini metadata */
22
- libVersion: z.ZodString;
23
- /** The miniMetadata encoded as a hex string */
24
- data: z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>>;
25
- extra: z.ZodNullable<z.ZodAny>;
26
- }, z.core.$strict>;
27
- export type MiniMetadata<M extends AnyNewBalanceModule = AnyNewBalanceModule> = Omit<z.infer<typeof MiniMetadataBaseSchema>, "extra"> & {
13
+ export type MiniMetadata<M extends AnyNewBalanceModule = AnyNewBalanceModule> = Omit<z.infer<typeof AnyMiniMetadataSchema>, "extra"> & {
28
14
  extra: InferChainMeta<M>["extra"];
29
15
  };
@@ -8,8 +8,6 @@ var util = require('@talismn/util');
8
8
  var BigNumber = require('bignumber.js');
9
9
  var util$1 = require('@polkadot/util');
10
10
  var utilCrypto = require('@polkadot/util-crypto');
11
- var shared = require('@talismn/chaindata-provider/src/chaindata/shared');
12
- var z = require('zod/v4');
13
11
  var pako = require('pako');
14
12
  var viem = require('viem');
15
13
  var lodash = require('lodash');
@@ -28,13 +26,13 @@ var chainConnector = require('@talismn/chain-connector');
28
26
  var rxjs = require('rxjs');
29
27
  var scaleTs = require('scale-ts');
30
28
  var upperFirst = require('lodash/upperFirst');
29
+ var z = require('zod/v4');
31
30
  var apiContract = require('@polkadot/api-contract');
32
31
 
33
32
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
34
33
 
35
34
  var anylogger__default = /*#__PURE__*/_interopDefault(anylogger);
36
35
  var BigNumber__default = /*#__PURE__*/_interopDefault(BigNumber);
37
- var z__default = /*#__PURE__*/_interopDefault(z);
38
36
  var pako__default = /*#__PURE__*/_interopDefault(pako);
39
37
  var isEqual__default = /*#__PURE__*/_interopDefault(isEqual);
40
38
  var camelCase__default = /*#__PURE__*/_interopDefault(camelCase);
@@ -42,6 +40,7 @@ var PQueue__default = /*#__PURE__*/_interopDefault(PQueue);
42
40
  var groupBy__default = /*#__PURE__*/_interopDefault(groupBy);
43
41
  var PromisePool__default = /*#__PURE__*/_interopDefault(PromisePool);
44
42
  var upperFirst__default = /*#__PURE__*/_interopDefault(upperFirst);
43
+ var z__default = /*#__PURE__*/_interopDefault(z);
45
44
 
46
45
  // Record<string, unknown> | undefined
47
46
 
@@ -129,7 +128,7 @@ class EvmTokenFetcher {
129
128
 
130
129
  var pkg = {
131
130
  name: "@talismn/balances",
132
- version: "0.0.0-pr2043-20250619151012"};
131
+ version: "0.0.0-pr2043-20250619153855"};
133
132
 
134
133
  var log = anylogger__default.default(pkg.name);
135
134
 
@@ -939,23 +938,6 @@ const deriveMiniMetadataId = ({
939
938
  specVersion,
940
939
  libVersion
941
940
  }) => util$1.u8aToHex(utilCrypto.xxhashAsU8a(new TextEncoder().encode(`${source}${chainId}${specVersion}${libVersion}`), 64), undefined, false);
942
- const MiniMetadataBaseSchema = z__default.default.strictObject({
943
- /** The DB id for this metadata */
944
- id: z__default.default.string().nonempty(),
945
- /** The balance module which created this miniMetadata */
946
- source: z__default.default.string().nonempty(),
947
- // TODO make it an enum of balance module types
948
- /** The chain this miniMetadata came from */
949
- chainId: chaindataProvider.DotNetworkSchema.shape.id,
950
- /** The chain specVersion which this miniMetadata is valid for */
951
- specVersion: chaindataProvider.DotNetworkSchema.shape.specVersion,
952
- /** the version of the balances library used to craft the mini metadata */
953
- libVersion: z__default.default.string().nonempty(),
954
- /** The miniMetadata encoded as a hex string */
955
- data: shared.HexStringSchema.nullable(),
956
- // /** module specific information about the chain, such as pallet ids for specific features */
957
- extra: z__default.default.any().nullable()
958
- });
959
941
 
960
942
  // for DB version 3, Wallet version 1.21.0
961
943
  const upgradeRemoveSymbolFromNativeTokenId = async tx => {
@@ -7165,7 +7147,6 @@ exports.EvmNativeModule = EvmNativeModule;
7165
7147
  exports.EvmTokenFetcher = EvmTokenFetcher;
7166
7148
  exports.EvmUniswapV2Module = EvmUniswapV2Module;
7167
7149
  exports.FiatSumBalancesFormatter = FiatSumBalancesFormatter;
7168
- exports.MiniMetadataBaseSchema = MiniMetadataBaseSchema;
7169
7150
  exports.ONE_ALPHA_TOKEN = ONE_ALPHA_TOKEN;
7170
7151
  exports.PlanckSumBalancesFormatter = PlanckSumBalancesFormatter;
7171
7152
  exports.RpcStateQueryHelper = RpcStateQueryHelper;
@@ -8,8 +8,6 @@ var util = require('@talismn/util');
8
8
  var BigNumber = require('bignumber.js');
9
9
  var util$1 = require('@polkadot/util');
10
10
  var utilCrypto = require('@polkadot/util-crypto');
11
- var shared = require('@talismn/chaindata-provider/src/chaindata/shared');
12
- var z = require('zod/v4');
13
11
  var pako = require('pako');
14
12
  var viem = require('viem');
15
13
  var lodash = require('lodash');
@@ -28,13 +26,13 @@ var chainConnector = require('@talismn/chain-connector');
28
26
  var rxjs = require('rxjs');
29
27
  var scaleTs = require('scale-ts');
30
28
  var upperFirst = require('lodash/upperFirst');
29
+ var z = require('zod/v4');
31
30
  var apiContract = require('@polkadot/api-contract');
32
31
 
33
32
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
34
33
 
35
34
  var anylogger__default = /*#__PURE__*/_interopDefault(anylogger);
36
35
  var BigNumber__default = /*#__PURE__*/_interopDefault(BigNumber);
37
- var z__default = /*#__PURE__*/_interopDefault(z);
38
36
  var pako__default = /*#__PURE__*/_interopDefault(pako);
39
37
  var isEqual__default = /*#__PURE__*/_interopDefault(isEqual);
40
38
  var camelCase__default = /*#__PURE__*/_interopDefault(camelCase);
@@ -42,6 +40,7 @@ var PQueue__default = /*#__PURE__*/_interopDefault(PQueue);
42
40
  var groupBy__default = /*#__PURE__*/_interopDefault(groupBy);
43
41
  var PromisePool__default = /*#__PURE__*/_interopDefault(PromisePool);
44
42
  var upperFirst__default = /*#__PURE__*/_interopDefault(upperFirst);
43
+ var z__default = /*#__PURE__*/_interopDefault(z);
45
44
 
46
45
  // Record<string, unknown> | undefined
47
46
 
@@ -129,7 +128,7 @@ class EvmTokenFetcher {
129
128
 
130
129
  var pkg = {
131
130
  name: "@talismn/balances",
132
- version: "0.0.0-pr2043-20250619151012"};
131
+ version: "0.0.0-pr2043-20250619153855"};
133
132
 
134
133
  var log = anylogger__default.default(pkg.name);
135
134
 
@@ -939,23 +938,6 @@ const deriveMiniMetadataId = ({
939
938
  specVersion,
940
939
  libVersion
941
940
  }) => util$1.u8aToHex(utilCrypto.xxhashAsU8a(new TextEncoder().encode(`${source}${chainId}${specVersion}${libVersion}`), 64), undefined, false);
942
- const MiniMetadataBaseSchema = z__default.default.strictObject({
943
- /** The DB id for this metadata */
944
- id: z__default.default.string().nonempty(),
945
- /** The balance module which created this miniMetadata */
946
- source: z__default.default.string().nonempty(),
947
- // TODO make it an enum of balance module types
948
- /** The chain this miniMetadata came from */
949
- chainId: chaindataProvider.DotNetworkSchema.shape.id,
950
- /** The chain specVersion which this miniMetadata is valid for */
951
- specVersion: chaindataProvider.DotNetworkSchema.shape.specVersion,
952
- /** the version of the balances library used to craft the mini metadata */
953
- libVersion: z__default.default.string().nonempty(),
954
- /** The miniMetadata encoded as a hex string */
955
- data: shared.HexStringSchema.nullable(),
956
- // /** module specific information about the chain, such as pallet ids for specific features */
957
- extra: z__default.default.any().nullable()
958
- });
959
941
 
960
942
  // for DB version 3, Wallet version 1.21.0
961
943
  const upgradeRemoveSymbolFromNativeTokenId = async tx => {
@@ -7165,7 +7147,6 @@ exports.EvmNativeModule = EvmNativeModule;
7165
7147
  exports.EvmTokenFetcher = EvmTokenFetcher;
7166
7148
  exports.EvmUniswapV2Module = EvmUniswapV2Module;
7167
7149
  exports.FiatSumBalancesFormatter = FiatSumBalancesFormatter;
7168
- exports.MiniMetadataBaseSchema = MiniMetadataBaseSchema;
7169
7150
  exports.ONE_ALPHA_TOKEN = ONE_ALPHA_TOKEN;
7170
7151
  exports.PlanckSumBalancesFormatter = PlanckSumBalancesFormatter;
7171
7152
  exports.RpcStateQueryHelper = RpcStateQueryHelper;
@@ -1,13 +1,11 @@
1
1
  import { Dexie } from 'dexie';
2
2
  import anylogger from 'anylogger';
3
- import { evmErc20TokenId, DotNetworkSchema, EvmErc20TokenSchema, networkIdFromTokenId, evmNativeTokenId, evmUniswapV2TokenId, githubTokenLogoUrl, parseSubAssetTokenId, subAssetTokenId, parseSubForeignAssetTokenId, subForeignAssetTokenId, parseTokenId, subNativeTokenId, subPsp22TokenId, parseSubTokensTokenId, subTokensTokenId } from '@talismn/chaindata-provider';
3
+ import { evmErc20TokenId, EvmErc20TokenSchema, networkIdFromTokenId, evmNativeTokenId, evmUniswapV2TokenId, githubTokenLogoUrl, parseSubAssetTokenId, subAssetTokenId, parseSubForeignAssetTokenId, subForeignAssetTokenId, parseTokenId, subNativeTokenId, subPsp22TokenId, parseSubTokensTokenId, subTokensTokenId } from '@talismn/chaindata-provider';
4
4
  import { newTokenRates } from '@talismn/token-rates';
5
5
  import { isBigInt, BigMath, planckToTokens, isArrayOf, isTruthy, isEthereumAddress, hasOwnProperty, decodeAnyAddress, isNotNil, blake2Concat, Deferred } from '@talismn/util';
6
6
  import BigNumber from 'bignumber.js';
7
7
  import { u8aToHex, assert, stringCamelCase, u8aConcatStrict, u8aConcat, arrayChunk, u8aToString, hexToNumber, hexToU8a } from '@polkadot/util';
8
8
  import { xxhashAsU8a, blake2AsU8a } from '@polkadot/util-crypto';
9
- import { HexStringSchema } from '@talismn/chaindata-provider/src/chaindata/shared';
10
- import z from 'zod/v4';
11
9
  import pako from 'pako';
12
10
  import { parseAbi, isHex, hexToBigInt } from 'viem';
13
11
  import { fromPairs, toPairs, keys, groupBy as groupBy$1 } from 'lodash';
@@ -26,6 +24,7 @@ import { ChainConnectionError } from '@talismn/chain-connector';
26
24
  import { Observable, scan, share, map, switchAll, combineLatest, from, mergeMap, toArray, interval, startWith, exhaustMap, BehaviorSubject, debounceTime, takeUntil, distinctUntilChanged, switchMap, withLatestFrom, concatMap } from 'rxjs';
27
25
  import { u32, u128, Struct } from 'scale-ts';
28
26
  import upperFirst from 'lodash/upperFirst';
27
+ import z from 'zod/v4';
29
28
  import { Abi } from '@polkadot/api-contract';
30
29
 
31
30
  // Record<string, unknown> | undefined
@@ -114,7 +113,7 @@ class EvmTokenFetcher {
114
113
 
115
114
  var pkg = {
116
115
  name: "@talismn/balances",
117
- version: "0.0.0-pr2043-20250619151012"};
116
+ version: "0.0.0-pr2043-20250619153855"};
118
117
 
119
118
  var log = anylogger(pkg.name);
120
119
 
@@ -924,23 +923,6 @@ const deriveMiniMetadataId = ({
924
923
  specVersion,
925
924
  libVersion
926
925
  }) => u8aToHex(xxhashAsU8a(new TextEncoder().encode(`${source}${chainId}${specVersion}${libVersion}`), 64), undefined, false);
927
- const MiniMetadataBaseSchema = z.strictObject({
928
- /** The DB id for this metadata */
929
- id: z.string().nonempty(),
930
- /** The balance module which created this miniMetadata */
931
- source: z.string().nonempty(),
932
- // TODO make it an enum of balance module types
933
- /** The chain this miniMetadata came from */
934
- chainId: DotNetworkSchema.shape.id,
935
- /** The chain specVersion which this miniMetadata is valid for */
936
- specVersion: DotNetworkSchema.shape.specVersion,
937
- /** the version of the balances library used to craft the mini metadata */
938
- libVersion: z.string().nonempty(),
939
- /** The miniMetadata encoded as a hex string */
940
- data: HexStringSchema.nullable(),
941
- // /** module specific information about the chain, such as pallet ids for specific features */
942
- extra: z.any().nullable()
943
- });
944
926
 
945
927
  // for DB version 3, Wallet version 1.21.0
946
928
  const upgradeRemoveSymbolFromNativeTokenId = async tx => {
@@ -7139,4 +7121,4 @@ async function buildQueries(chainConnector, chaindataProvider, addressesByToken,
7139
7121
 
7140
7122
  const defaultBalanceModules = [EvmErc20Module, EvmNativeModule, EvmUniswapV2Module, SubAssetsModule, SubForeignAssetsModule, SubNativeModule, SubPsp22Module, SubTokensModule];
7141
7123
 
7142
- export { Balance, BalanceFormatter, BalanceValueGetter, Balances, Change24hCurrencyFormatter, DefaultBalanceModule, EvmErc20Module, EvmNativeModule, EvmTokenFetcher, EvmUniswapV2Module, FiatSumBalancesFormatter, MiniMetadataBaseSchema, ONE_ALPHA_TOKEN, PlanckSumBalancesFormatter, RpcStateQueryHelper, SCALE_FACTOR, SUBTENSOR_MIN_STAKE_AMOUNT_PLANK, SUBTENSOR_ROOT_NETUID, SubAssetsModule, SubForeignAssetsModule, SubNativeModule, SubPsp22Module, SubTokensModule, SumBalancesFormatter, TalismanBalancesDatabase, abiMulticall, balances, buildNetworkStorageCoders, buildStorageCoders, calculateAlphaPrice, calculateTaoAmountFromAlpha, calculateTaoFromDynamicInfo, compress, configureStore, db, decodeOutput, decompress, defaultBalanceModules, deriveMiniMetadataId, detectTransferMethod, erc20Abi, erc20BalancesAggregatorAbi, excludeFromFeePayableLocks, excludeFromTransferableAmount, filterBaseLocks, filterMirrorTokens, getBalanceId, getLockTitle, getUniqueChainIds, getValueId, includeInTotalExtraAmount, makeContractCaller, uniswapV2PairAbi };
7124
+ export { Balance, BalanceFormatter, BalanceValueGetter, Balances, Change24hCurrencyFormatter, DefaultBalanceModule, EvmErc20Module, EvmNativeModule, EvmTokenFetcher, EvmUniswapV2Module, FiatSumBalancesFormatter, ONE_ALPHA_TOKEN, PlanckSumBalancesFormatter, RpcStateQueryHelper, SCALE_FACTOR, SUBTENSOR_MIN_STAKE_AMOUNT_PLANK, SUBTENSOR_ROOT_NETUID, SubAssetsModule, SubForeignAssetsModule, SubNativeModule, SubPsp22Module, SubTokensModule, SumBalancesFormatter, TalismanBalancesDatabase, abiMulticall, balances, buildNetworkStorageCoders, buildStorageCoders, calculateAlphaPrice, calculateTaoAmountFromAlpha, calculateTaoFromDynamicInfo, compress, configureStore, db, decodeOutput, decompress, defaultBalanceModules, deriveMiniMetadataId, detectTransferMethod, erc20Abi, erc20BalancesAggregatorAbi, excludeFromFeePayableLocks, excludeFromTransferableAmount, filterBaseLocks, filterMirrorTokens, getBalanceId, getLockTitle, getUniqueChainIds, getValueId, includeInTotalExtraAmount, makeContractCaller, uniswapV2PairAbi };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@talismn/balances",
3
- "version": "0.0.0-pr2043-20250619151012",
3
+ "version": "0.0.0-pr2043-20250619153855",
4
4
  "author": "Talisman",
5
5
  "homepage": "https://talisman.xyz",
6
6
  "license": "GPL-3.0-or-later",
@@ -35,13 +35,13 @@
35
35
  "scale-ts": "^1.6.1",
36
36
  "viem": "^2.27.3",
37
37
  "zod": "^3.25.62",
38
- "@talismn/chain-connector": "0.0.0-pr2043-20250619151012",
39
- "@talismn/chain-connector-evm": "0.0.0-pr2043-20250619151012",
40
- "@talismn/chaindata-provider": "0.0.0-pr2043-20250619151012",
41
- "@talismn/sapi": "0.0.0-pr2043-20250619151012",
38
+ "@talismn/chain-connector": "0.0.0-pr2043-20250619153855",
39
+ "@talismn/chain-connector-evm": "0.0.0-pr2043-20250619153855",
40
+ "@talismn/chaindata-provider": "0.0.0-pr2043-20250619153855",
41
+ "@talismn/sapi": "0.0.0-pr2043-20250619153855",
42
42
  "@talismn/scale": "0.1.2",
43
43
  "@talismn/util": "0.4.2",
44
- "@talismn/token-rates": "0.0.0-pr2043-20250619151012"
44
+ "@talismn/token-rates": "0.0.0-pr2043-20250619153855"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@polkadot/api-contract": "16.1.2",