@talismn/balances 0.0.0-pr2043-20250619072437 → 0.0.0-pr2043-20250619091841

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.
@@ -7,7 +7,6 @@ export declare const defaultBalanceModules: (import("..").NewBalanceModule<"evm-
7
7
  type: "evm-erc20";
8
8
  platform: "ethereum";
9
9
  contractAddress: `0x${string}`;
10
- isTestnet?: boolean | undefined;
11
10
  isDefault?: boolean | undefined;
12
11
  logo?: string | undefined;
13
12
  coingeckoId?: string | undefined;
@@ -24,7 +23,6 @@ export declare const defaultBalanceModules: (import("..").NewBalanceModule<"evm-
24
23
  platform: "ethereum";
25
24
  contractAddress: `0x${string}`;
26
25
  isCustom: true;
27
- isTestnet?: boolean | undefined;
28
26
  isDefault?: boolean | undefined;
29
27
  logo?: string | undefined;
30
28
  coingeckoId?: string | undefined;
@@ -38,7 +36,6 @@ export declare const defaultBalanceModules: (import("..").NewBalanceModule<"evm-
38
36
  networkId: string;
39
37
  type: "evm-native";
40
38
  platform: "ethereum";
41
- isTestnet?: boolean | undefined;
42
39
  isDefault?: boolean | undefined;
43
40
  logo?: string | undefined;
44
41
  coingeckoId?: string | undefined;
@@ -53,7 +50,6 @@ export declare const defaultBalanceModules: (import("..").NewBalanceModule<"evm-
53
50
  type: "evm-native";
54
51
  platform: "ethereum";
55
52
  isCustom: true;
56
- isTestnet?: boolean | undefined;
57
53
  isDefault?: boolean | undefined;
58
54
  logo?: string | undefined;
59
55
  coingeckoId?: string | undefined;
@@ -74,7 +70,6 @@ export declare const defaultBalanceModules: (import("..").NewBalanceModule<"evm-
74
70
  decimals1: number;
75
71
  tokenAddress0: `0x${string}`;
76
72
  tokenAddress1: `0x${string}`;
77
- isTestnet?: boolean | undefined;
78
73
  isDefault?: boolean | undefined;
79
74
  logo?: string | undefined;
80
75
  coingeckoId?: string | undefined;
@@ -99,7 +94,6 @@ export declare const defaultBalanceModules: (import("..").NewBalanceModule<"evm-
99
94
  tokenAddress0: `0x${string}`;
100
95
  tokenAddress1: `0x${string}`;
101
96
  isCustom: true;
102
- isTestnet?: boolean | undefined;
103
97
  isDefault?: boolean | undefined;
104
98
  logo?: string | undefined;
105
99
  coingeckoId?: string | undefined;
@@ -117,7 +111,6 @@ export declare const defaultBalanceModules: (import("..").NewBalanceModule<"evm-
117
111
  platform: "polkadot";
118
112
  assetId: string;
119
113
  existentialDeposit: string;
120
- isTestnet?: boolean | undefined;
121
114
  isDefault?: boolean | undefined;
122
115
  logo?: string | undefined;
123
116
  coingeckoId?: string | undefined;
@@ -134,7 +127,6 @@ export declare const defaultBalanceModules: (import("..").NewBalanceModule<"evm-
134
127
  platform: "polkadot";
135
128
  onChainId: string;
136
129
  existentialDeposit: string;
137
- isTestnet?: boolean | undefined;
138
130
  isDefault?: boolean | undefined;
139
131
  logo?: string | undefined;
140
132
  coingeckoId?: string | undefined;
@@ -150,7 +142,6 @@ export declare const defaultBalanceModules: (import("..").NewBalanceModule<"evm-
150
142
  type: "substrate-native";
151
143
  platform: "polkadot";
152
144
  existentialDeposit: string;
153
- isTestnet?: boolean | undefined;
154
145
  isDefault?: boolean | undefined;
155
146
  logo?: string | undefined;
156
147
  coingeckoId?: string | undefined;
@@ -166,7 +157,6 @@ export declare const defaultBalanceModules: (import("..").NewBalanceModule<"evm-
166
157
  platform: "polkadot";
167
158
  existentialDeposit: string;
168
159
  isCustom: true;
169
- isTestnet?: boolean | undefined;
170
160
  isDefault?: boolean | undefined;
171
161
  logo?: string | undefined;
172
162
  coingeckoId?: string | undefined;
@@ -182,7 +172,6 @@ export declare const defaultBalanceModules: (import("..").NewBalanceModule<"evm-
182
172
  platform: "polkadot";
183
173
  existentialDeposit: string;
184
174
  contractAddress: string;
185
- isTestnet?: boolean | undefined;
186
175
  isDefault?: boolean | undefined;
187
176
  logo?: string | undefined;
188
177
  coingeckoId?: string | undefined;
@@ -198,7 +187,6 @@ export declare const defaultBalanceModules: (import("..").NewBalanceModule<"evm-
198
187
  platform: "polkadot";
199
188
  onChainId: string | number;
200
189
  existentialDeposit: string;
201
- isTestnet?: boolean | undefined;
202
190
  isDefault?: boolean | undefined;
203
191
  logo?: string | undefined;
204
192
  coingeckoId?: string | undefined;
@@ -216,7 +216,6 @@ export declare class Balance {
216
216
  type: "evm-erc20";
217
217
  platform: "ethereum";
218
218
  contractAddress: `0x${string}`;
219
- isTestnet?: boolean | undefined;
220
219
  isDefault?: boolean | undefined;
221
220
  logo?: string | undefined;
222
221
  coingeckoId?: string | undefined;
@@ -231,7 +230,6 @@ export declare class Balance {
231
230
  networkId: string;
232
231
  type: "evm-native";
233
232
  platform: "ethereum";
234
- isTestnet?: boolean | undefined;
235
233
  isDefault?: boolean | undefined;
236
234
  logo?: string | undefined;
237
235
  coingeckoId?: string | undefined;
@@ -252,7 +250,6 @@ export declare class Balance {
252
250
  decimals1: number;
253
251
  tokenAddress0: `0x${string}`;
254
252
  tokenAddress1: `0x${string}`;
255
- isTestnet?: boolean | undefined;
256
253
  isDefault?: boolean | undefined;
257
254
  logo?: string | undefined;
258
255
  coingeckoId?: string | undefined;
@@ -271,7 +268,6 @@ export declare class Balance {
271
268
  platform: "polkadot";
272
269
  assetId: string;
273
270
  existentialDeposit: string;
274
- isTestnet?: boolean | undefined;
275
271
  isDefault?: boolean | undefined;
276
272
  logo?: string | undefined;
277
273
  coingeckoId?: string | undefined;
@@ -288,7 +284,6 @@ export declare class Balance {
288
284
  platform: "polkadot";
289
285
  onChainId: string;
290
286
  existentialDeposit: string;
291
- isTestnet?: boolean | undefined;
292
287
  isDefault?: boolean | undefined;
293
288
  logo?: string | undefined;
294
289
  coingeckoId?: string | undefined;
@@ -304,7 +299,6 @@ export declare class Balance {
304
299
  type: "substrate-native";
305
300
  platform: "polkadot";
306
301
  existentialDeposit: string;
307
- isTestnet?: boolean | undefined;
308
302
  isDefault?: boolean | undefined;
309
303
  logo?: string | undefined;
310
304
  coingeckoId?: string | undefined;
@@ -320,7 +314,6 @@ export declare class Balance {
320
314
  platform: "polkadot";
321
315
  existentialDeposit: string;
322
316
  contractAddress: string;
323
- isTestnet?: boolean | undefined;
324
317
  isDefault?: boolean | undefined;
325
318
  logo?: string | undefined;
326
319
  coingeckoId?: string | undefined;
@@ -336,7 +329,6 @@ export declare class Balance {
336
329
  platform: "polkadot";
337
330
  onChainId: string | number;
338
331
  existentialDeposit: string;
339
- isTestnet?: boolean | undefined;
340
332
  isDefault?: boolean | undefined;
341
333
  logo?: string | undefined;
342
334
  coingeckoId?: string | undefined;
@@ -126,7 +126,7 @@ class EvmTokenFetcher {
126
126
 
127
127
  var pkg = {
128
128
  name: "@talismn/balances",
129
- version: "0.0.0-pr2043-20250619072437"};
129
+ version: "0.0.0-pr2043-20250619091841"};
130
130
 
131
131
  var log = anylogger__default.default(pkg.name);
132
132
 
@@ -410,13 +410,13 @@ class Balance {
410
410
  return this.#storage.networkId;
411
411
  }
412
412
  get network() {
413
- return this.#db?.networks && this.networkId && this.#db?.networks[this.networkId] || null;
413
+ return this.#db?.networks?.[this.networkId] || null;
414
414
  }
415
415
  get tokenId() {
416
416
  return this.#storage.tokenId;
417
417
  }
418
418
  get token() {
419
- return this.#db?.tokens && this.#db?.tokens[this.tokenId] || null;
419
+ return this.#db?.tokens?.[this.tokenId] || null;
420
420
  }
421
421
  get decimals() {
422
422
  return this.token?.decimals || null;
@@ -5397,12 +5397,9 @@ const SubNativeModule = hydrate => {
5397
5397
  return acc;
5398
5398
  }, {});
5399
5399
  const initialBalancesByNetwork = lodash.groupBy(initialBalances ?? [], "networkId");
5400
- const {
5401
- abort,
5402
- signal
5403
- } = new AbortController();
5400
+ const controller = new AbortController();
5404
5401
  const safeCallback = (error, result) => {
5405
- if (signal.aborted) return;
5402
+ if (controller.signal.aborted) return;
5406
5403
  // typescript isnt happy with fowarding parameters as is
5407
5404
  return error ? callback(error, undefined) : callback(error, result);
5408
5405
  };
@@ -5410,19 +5407,19 @@ const SubNativeModule = hydrate => {
5410
5407
  try {
5411
5408
  // this is what we want to be done separately for each network
5412
5409
  // this will update the DB so minimetadata will be available when it's used, veeeeery far down the tree of subscribeChainBalances
5413
- await getMiniMetadata(chaindataProvider$1, chainConnector$1, networkId, moduleType$2, signal);
5410
+ await getMiniMetadata(chaindataProvider$1, chainConnector$1, networkId, moduleType$2, controller.signal);
5414
5411
  } catch (err) {
5415
- if (!signal.aborted) log.warn("Failed to get native token miniMetadata for network", networkId, err);
5412
+ if (!controller.signal.aborted) log.warn("Failed to get native token miniMetadata for network", networkId, err);
5416
5413
  return () => {};
5417
5414
  }
5418
- if (signal.aborted) return () => {};
5415
+ if (controller.signal.aborted) return () => {};
5419
5416
  return subscribeChainBalances(networkId, {
5420
5417
  addressesByToken: addressesByTokenByNetwork[networkId] ?? {},
5421
5418
  initialBalances: initialBalancesByNetwork[networkId] ?? []
5422
5419
  }, safeCallback);
5423
5420
  }));
5424
5421
  return () => {
5425
- abort();
5422
+ controller.abort();
5426
5423
  unsubsribeFns.then(fns => fns.forEach(unsubscribe => unsubscribe()));
5427
5424
  };
5428
5425
  },
@@ -126,7 +126,7 @@ class EvmTokenFetcher {
126
126
 
127
127
  var pkg = {
128
128
  name: "@talismn/balances",
129
- version: "0.0.0-pr2043-20250619072437"};
129
+ version: "0.0.0-pr2043-20250619091841"};
130
130
 
131
131
  var log = anylogger__default.default(pkg.name);
132
132
 
@@ -410,13 +410,13 @@ class Balance {
410
410
  return this.#storage.networkId;
411
411
  }
412
412
  get network() {
413
- return this.#db?.networks && this.networkId && this.#db?.networks[this.networkId] || null;
413
+ return this.#db?.networks?.[this.networkId] || null;
414
414
  }
415
415
  get tokenId() {
416
416
  return this.#storage.tokenId;
417
417
  }
418
418
  get token() {
419
- return this.#db?.tokens && this.#db?.tokens[this.tokenId] || null;
419
+ return this.#db?.tokens?.[this.tokenId] || null;
420
420
  }
421
421
  get decimals() {
422
422
  return this.token?.decimals || null;
@@ -5397,12 +5397,9 @@ const SubNativeModule = hydrate => {
5397
5397
  return acc;
5398
5398
  }, {});
5399
5399
  const initialBalancesByNetwork = lodash.groupBy(initialBalances ?? [], "networkId");
5400
- const {
5401
- abort,
5402
- signal
5403
- } = new AbortController();
5400
+ const controller = new AbortController();
5404
5401
  const safeCallback = (error, result) => {
5405
- if (signal.aborted) return;
5402
+ if (controller.signal.aborted) return;
5406
5403
  // typescript isnt happy with fowarding parameters as is
5407
5404
  return error ? callback(error, undefined) : callback(error, result);
5408
5405
  };
@@ -5410,19 +5407,19 @@ const SubNativeModule = hydrate => {
5410
5407
  try {
5411
5408
  // this is what we want to be done separately for each network
5412
5409
  // this will update the DB so minimetadata will be available when it's used, veeeeery far down the tree of subscribeChainBalances
5413
- await getMiniMetadata(chaindataProvider$1, chainConnector$1, networkId, moduleType$2, signal);
5410
+ await getMiniMetadata(chaindataProvider$1, chainConnector$1, networkId, moduleType$2, controller.signal);
5414
5411
  } catch (err) {
5415
- if (!signal.aborted) log.warn("Failed to get native token miniMetadata for network", networkId, err);
5412
+ if (!controller.signal.aborted) log.warn("Failed to get native token miniMetadata for network", networkId, err);
5416
5413
  return () => {};
5417
5414
  }
5418
- if (signal.aborted) return () => {};
5415
+ if (controller.signal.aborted) return () => {};
5419
5416
  return subscribeChainBalances(networkId, {
5420
5417
  addressesByToken: addressesByTokenByNetwork[networkId] ?? {},
5421
5418
  initialBalances: initialBalancesByNetwork[networkId] ?? []
5422
5419
  }, safeCallback);
5423
5420
  }));
5424
5421
  return () => {
5425
- abort();
5422
+ controller.abort();
5426
5423
  unsubsribeFns.then(fns => fns.forEach(unsubscribe => unsubscribe()));
5427
5424
  };
5428
5425
  },
@@ -111,7 +111,7 @@ class EvmTokenFetcher {
111
111
 
112
112
  var pkg = {
113
113
  name: "@talismn/balances",
114
- version: "0.0.0-pr2043-20250619072437"};
114
+ version: "0.0.0-pr2043-20250619091841"};
115
115
 
116
116
  var log = anylogger(pkg.name);
117
117
 
@@ -395,13 +395,13 @@ class Balance {
395
395
  return this.#storage.networkId;
396
396
  }
397
397
  get network() {
398
- return this.#db?.networks && this.networkId && this.#db?.networks[this.networkId] || null;
398
+ return this.#db?.networks?.[this.networkId] || null;
399
399
  }
400
400
  get tokenId() {
401
401
  return this.#storage.tokenId;
402
402
  }
403
403
  get token() {
404
- return this.#db?.tokens && this.#db?.tokens[this.tokenId] || null;
404
+ return this.#db?.tokens?.[this.tokenId] || null;
405
405
  }
406
406
  get decimals() {
407
407
  return this.token?.decimals || null;
@@ -5382,12 +5382,9 @@ const SubNativeModule = hydrate => {
5382
5382
  return acc;
5383
5383
  }, {});
5384
5384
  const initialBalancesByNetwork = groupBy$1(initialBalances ?? [], "networkId");
5385
- const {
5386
- abort,
5387
- signal
5388
- } = new AbortController();
5385
+ const controller = new AbortController();
5389
5386
  const safeCallback = (error, result) => {
5390
- if (signal.aborted) return;
5387
+ if (controller.signal.aborted) return;
5391
5388
  // typescript isnt happy with fowarding parameters as is
5392
5389
  return error ? callback(error, undefined) : callback(error, result);
5393
5390
  };
@@ -5395,19 +5392,19 @@ const SubNativeModule = hydrate => {
5395
5392
  try {
5396
5393
  // this is what we want to be done separately for each network
5397
5394
  // this will update the DB so minimetadata will be available when it's used, veeeeery far down the tree of subscribeChainBalances
5398
- await getMiniMetadata(chaindataProvider, chainConnector, networkId, moduleType$2, signal);
5395
+ await getMiniMetadata(chaindataProvider, chainConnector, networkId, moduleType$2, controller.signal);
5399
5396
  } catch (err) {
5400
- if (!signal.aborted) log.warn("Failed to get native token miniMetadata for network", networkId, err);
5397
+ if (!controller.signal.aborted) log.warn("Failed to get native token miniMetadata for network", networkId, err);
5401
5398
  return () => {};
5402
5399
  }
5403
- if (signal.aborted) return () => {};
5400
+ if (controller.signal.aborted) return () => {};
5404
5401
  return subscribeChainBalances(networkId, {
5405
5402
  addressesByToken: addressesByTokenByNetwork[networkId] ?? {},
5406
5403
  initialBalances: initialBalancesByNetwork[networkId] ?? []
5407
5404
  }, safeCallback);
5408
5405
  }));
5409
5406
  return () => {
5410
- abort();
5407
+ controller.abort();
5411
5408
  unsubsribeFns.then(fns => fns.forEach(unsubscribe => unsubscribe()));
5412
5409
  };
5413
5410
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@talismn/balances",
3
- "version": "0.0.0-pr2043-20250619072437",
3
+ "version": "0.0.0-pr2043-20250619091841",
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-20250619072437",
39
- "@talismn/chain-connector-evm": "0.0.0-pr2043-20250619072437",
40
- "@talismn/chaindata-provider": "0.0.0-pr2043-20250619072437",
38
+ "@talismn/chain-connector": "0.0.0-pr2043-20250619091841",
39
+ "@talismn/chain-connector-evm": "0.0.0-pr2043-20250619091841",
40
+ "@talismn/sapi": "0.0.0-pr2043-20250619091841",
41
+ "@talismn/chaindata-provider": "0.0.0-pr2043-20250619091841",
41
42
  "@talismn/scale": "0.1.2",
42
- "@talismn/token-rates": "0.0.0-pr2043-20250619072437",
43
- "@talismn/util": "0.4.2",
44
- "@talismn/sapi": "0.0.0-pr2043-20250619072437"
43
+ "@talismn/token-rates": "0.0.0-pr2043-20250619091841",
44
+ "@talismn/util": "0.4.2"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@polkadot/api-contract": "16.1.2",