@talismn/balances 0.0.0-pr2043-20250620112438 → 0.0.0-pr2043-20250621032133

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,6 +7,14 @@ export { uniswapV2PairAbi };
7
7
  type ModuleType = "evm-uniswapv2";
8
8
  export type EvmUniswapV2ChainMeta = DefaultChainMeta;
9
9
  export declare const EvmUniswapV2TokenConfigSchema: z.ZodObject<{
10
+ symbol0: z.ZodOptional<z.ZodString>;
11
+ symbol1: z.ZodOptional<z.ZodString>;
12
+ decimals0: z.ZodOptional<z.ZodInt>;
13
+ decimals1: z.ZodOptional<z.ZodInt>;
14
+ tokenAddress0: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>>;
15
+ tokenAddress1: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>>;
16
+ coingeckoId0: z.ZodOptional<z.ZodOptional<z.ZodString>>;
17
+ coingeckoId1: z.ZodOptional<z.ZodOptional<z.ZodString>>;
10
18
  symbol: z.ZodOptional<z.ZodString>;
11
19
  networkId: z.ZodOptional<z.ZodString>;
12
20
  isDefault: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
@@ -17,14 +25,6 @@ export declare const EvmUniswapV2TokenConfigSchema: z.ZodObject<{
17
25
  noDiscovery: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
18
26
  mirrorOf: z.ZodOptional<z.ZodOptional<z.ZodString>>;
19
27
  contractAddress: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
20
- symbol0: z.ZodOptional<z.ZodString>;
21
- symbol1: z.ZodOptional<z.ZodString>;
22
- decimals0: z.ZodOptional<z.ZodInt>;
23
- decimals1: z.ZodOptional<z.ZodInt>;
24
- tokenAddress0: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>>;
25
- tokenAddress1: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>>;
26
- coingeckoId0: z.ZodOptional<z.ZodOptional<z.ZodString>>;
27
- coingeckoId1: z.ZodOptional<z.ZodOptional<z.ZodString>>;
28
28
  }, z.core.$strict>;
29
29
  export type EvmUniswapV2TokenConfig = z.infer<typeof EvmUniswapV2TokenConfigSchema>;
30
30
  export type EvmUniswapV2ModuleConfig = DefaultModuleConfig;
@@ -17,7 +17,6 @@ export declare const SubAssetsTokenConfigSchema: z.ZodObject<{
17
17
  noDiscovery: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
18
18
  mirrorOf: z.ZodOptional<z.ZodOptional<z.ZodString>>;
19
19
  assetId: z.ZodPipe<z.ZodUnion<readonly [z.ZodUInt32, z.ZodString]>, z.ZodTransform<string, string | number>>;
20
- existentialDeposit: z.ZodOptional<z.ZodString>;
21
20
  }, z.core.$strict>;
22
21
  export type SubAssetsTokenConfig = z.infer<typeof SubAssetsTokenConfigSchema>;
23
22
  export type SubAssetsModuleConfig = DefaultModuleConfig;
@@ -17,7 +17,6 @@ export declare const SubForeignAssetsTokenConfigSchema: z.ZodObject<{
17
17
  noDiscovery: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
18
18
  mirrorOf: z.ZodOptional<z.ZodOptional<z.ZodString>>;
19
19
  onChainId: z.ZodString;
20
- existentialDeposit: z.ZodOptional<z.ZodString>;
21
20
  }, z.core.$strict>;
22
21
  export type SubForeignAssetsTokenConfig = z.infer<typeof SubForeignAssetsTokenConfigSchema>;
23
22
  export type SubForeignAssetsModuleConfig = DefaultModuleConfig;
@@ -16,7 +16,6 @@ export declare const SubPsp22TokenConfigSchema: z.ZodObject<{
16
16
  noDiscovery: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
17
17
  mirrorOf: z.ZodOptional<z.ZodOptional<z.ZodString>>;
18
18
  contractAddress: z.ZodString;
19
- existentialDeposit: z.ZodOptional<z.ZodString>;
20
19
  }, z.core.$strict>;
21
20
  export type SubPsp22TokenConfig = z.infer<typeof SubPsp22TokenConfigSchema>;
22
21
  export type SubPsp22ChainMeta = DefaultChainMeta;
@@ -6,6 +6,7 @@ import { ChainMeta, NewBalanceModule, NewTransferParamsType } from "../BalanceMo
6
6
  import { NewBalanceType } from "../types";
7
7
  type ModuleType = "substrate-tokens";
8
8
  export declare const SubTokensTokenConfigSchema: z.ZodObject<{
9
+ existentialDeposit: z.ZodOptional<z.ZodString>;
9
10
  symbol: z.ZodOptional<z.ZodString>;
10
11
  networkId: z.ZodOptional<z.ZodString>;
11
12
  isDefault: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
@@ -16,7 +17,6 @@ export declare const SubTokensTokenConfigSchema: z.ZodObject<{
16
17
  noDiscovery: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
17
18
  mirrorOf: z.ZodOptional<z.ZodOptional<z.ZodString>>;
18
19
  onChainId: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
19
- existentialDeposit: z.ZodOptional<z.ZodString>;
20
20
  }, z.core.$strict>;
21
21
  export type SubTokensTokenConfig = z.infer<typeof SubTokensTokenConfigSchema>;
22
22
  export type SubTokensChainMeta = ChainMeta<{
@@ -124,6 +124,14 @@ export declare const defaultBalanceModules: (import("..").NewBalanceModule<"evm-
124
124
  coingeckoId1?: string | undefined;
125
125
  }, import("..").DefaultChainMeta, undefined, {
126
126
  contractAddress: `0x${string}`;
127
+ symbol0?: string | undefined;
128
+ symbol1?: string | undefined;
129
+ decimals0?: number | undefined;
130
+ decimals1?: number | undefined;
131
+ tokenAddress0?: `0x${string}` | undefined;
132
+ tokenAddress1?: `0x${string}` | undefined;
133
+ coingeckoId0?: string | undefined;
134
+ coingeckoId1?: string | undefined;
127
135
  symbol?: string | undefined;
128
136
  networkId?: string | undefined;
129
137
  isDefault?: boolean | undefined;
@@ -133,14 +141,6 @@ export declare const defaultBalanceModules: (import("..").NewBalanceModule<"evm-
133
141
  coingeckoId?: string | undefined;
134
142
  noDiscovery?: boolean | undefined;
135
143
  mirrorOf?: string | undefined;
136
- symbol0?: string | undefined;
137
- symbol1?: string | undefined;
138
- decimals0?: number | undefined;
139
- decimals1?: number | undefined;
140
- tokenAddress0?: `0x${string}` | undefined;
141
- tokenAddress1?: `0x${string}` | undefined;
142
- coingeckoId0?: string | undefined;
143
- coingeckoId1?: string | undefined;
144
144
  }> | import("..").NewBalanceModule<"substrate-assets", {
145
145
  id: string;
146
146
  networkId: string;
@@ -168,7 +168,6 @@ export declare const defaultBalanceModules: (import("..").NewBalanceModule<"evm-
168
168
  coingeckoId?: string | undefined;
169
169
  noDiscovery?: boolean | undefined;
170
170
  mirrorOf?: string | undefined;
171
- existentialDeposit?: string | undefined;
172
171
  }, import("./SubstrateAssetsModule").SubAssetsTransferParams> | import("..").NewBalanceModule<"substrate-foreignassets", {
173
172
  id: string;
174
173
  networkId: string;
@@ -196,7 +195,6 @@ export declare const defaultBalanceModules: (import("..").NewBalanceModule<"evm-
196
195
  coingeckoId?: string | undefined;
197
196
  noDiscovery?: boolean | undefined;
198
197
  mirrorOf?: string | undefined;
199
- existentialDeposit?: string | undefined;
200
198
  }, import("./SubstrateForeignAssetsModule").SubForeignAssetsTransferParams> | import("..").NewBalanceModule<"substrate-native", {
201
199
  id: string;
202
200
  networkId: string;
@@ -245,7 +243,6 @@ export declare const defaultBalanceModules: (import("..").NewBalanceModule<"evm-
245
243
  symbol: string;
246
244
  type: "substrate-psp22";
247
245
  platform: "polkadot";
248
- existentialDeposit: string;
249
246
  contractAddress: string;
250
247
  isDefault?: boolean | undefined;
251
248
  name?: string | undefined;
@@ -253,6 +250,7 @@ export declare const defaultBalanceModules: (import("..").NewBalanceModule<"evm-
253
250
  coingeckoId?: string | undefined;
254
251
  noDiscovery?: boolean | undefined;
255
252
  mirrorOf?: string | undefined;
253
+ existentialDeposit?: string | undefined;
256
254
  }, import("..").DefaultChainMeta, undefined, {
257
255
  contractAddress: string;
258
256
  symbol?: string | undefined;
@@ -264,7 +262,6 @@ export declare const defaultBalanceModules: (import("..").NewBalanceModule<"evm-
264
262
  coingeckoId?: string | undefined;
265
263
  noDiscovery?: boolean | undefined;
266
264
  mirrorOf?: string | undefined;
267
- existentialDeposit?: string | undefined;
268
265
  }, import("./SubstratePsp22Module").SubPsp22TransferParams> | import("..").NewBalanceModule<"substrate-tokens", {
269
266
  id: string;
270
267
  networkId: string;
@@ -284,6 +281,7 @@ export declare const defaultBalanceModules: (import("..").NewBalanceModule<"evm-
284
281
  palletId?: string | undefined;
285
282
  }, {
286
283
  onChainId: string | number;
284
+ existentialDeposit?: string | undefined;
287
285
  symbol?: string | undefined;
288
286
  networkId?: string | undefined;
289
287
  isDefault?: boolean | undefined;
@@ -293,7 +291,6 @@ export declare const defaultBalanceModules: (import("..").NewBalanceModule<"evm-
293
291
  coingeckoId?: string | undefined;
294
292
  noDiscovery?: boolean | undefined;
295
293
  mirrorOf?: string | undefined;
296
- existentialDeposit?: string | undefined;
297
294
  }, import("./SubstrateTokensModule").SubTokensTransferParams>)[];
298
295
  export * from "./EvmErc20Module";
299
296
  export * from "./EvmNativeModule";
@@ -324,7 +324,6 @@ export declare class Balance {
324
324
  symbol: string;
325
325
  type: "substrate-psp22";
326
326
  platform: "polkadot";
327
- existentialDeposit: string;
328
327
  contractAddress: string;
329
328
  isDefault?: boolean | undefined;
330
329
  name?: string | undefined;
@@ -332,6 +331,7 @@ export declare class Balance {
332
331
  coingeckoId?: string | undefined;
333
332
  noDiscovery?: boolean | undefined;
334
333
  mirrorOf?: string | undefined;
334
+ existentialDeposit?: string | undefined;
335
335
  } | {
336
336
  id: string;
337
337
  networkId: string;
@@ -9,6 +9,7 @@ var BigNumber = require('bignumber.js');
9
9
  var util$1 = require('@polkadot/util');
10
10
  var utilCrypto = require('@polkadot/util-crypto');
11
11
  var pako = require('pako');
12
+ var z = require('zod/v4');
12
13
  var viem = require('viem');
13
14
  var lodash = require('lodash');
14
15
  var isEqual = require('lodash/isEqual');
@@ -16,7 +17,6 @@ var txwrapperCore = require('@substrate/txwrapper-core');
16
17
  var scale = require('@talismn/scale');
17
18
  var camelCase = require('lodash/camelCase');
18
19
  var PQueue = require('p-queue');
19
- var z = require('zod/v4');
20
20
  var sapi = require('@talismn/sapi');
21
21
  var types = require('@polkadot/types');
22
22
  var groupBy = require('lodash/groupBy');
@@ -33,10 +33,10 @@ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
33
33
  var anylogger__default = /*#__PURE__*/_interopDefault(anylogger);
34
34
  var BigNumber__default = /*#__PURE__*/_interopDefault(BigNumber);
35
35
  var pako__default = /*#__PURE__*/_interopDefault(pako);
36
+ var z__default = /*#__PURE__*/_interopDefault(z);
36
37
  var isEqual__default = /*#__PURE__*/_interopDefault(isEqual);
37
38
  var camelCase__default = /*#__PURE__*/_interopDefault(camelCase);
38
39
  var PQueue__default = /*#__PURE__*/_interopDefault(PQueue);
39
- var z__default = /*#__PURE__*/_interopDefault(z);
40
40
  var groupBy__default = /*#__PURE__*/_interopDefault(groupBy);
41
41
  var upperFirst__default = /*#__PURE__*/_interopDefault(upperFirst);
42
42
 
@@ -126,7 +126,7 @@ class EvmTokenFetcher {
126
126
 
127
127
  var pkg = {
128
128
  name: "@talismn/balances",
129
- version: "0.0.0-pr2043-20250620112438"};
129
+ version: "0.0.0-pr2043-20250621032133"};
130
130
 
131
131
  var log = anylogger__default.default(pkg.name);
132
132
 
@@ -1276,8 +1276,9 @@ const moduleType$7 = "evm-erc20";
1276
1276
  // >
1277
1277
  // }
1278
1278
 
1279
- const EvmErc20TokenConfigSchema = TokenConfigBaseSchema.extend({
1280
- contractAddress: chaindataProvider.EvmErc20TokenSchema.shape.contractAddress
1279
+ const EvmErc20TokenConfigSchema = z__default.default.strictObject({
1280
+ contractAddress: chaindataProvider.EvmErc20TokenSchema.shape.contractAddress,
1281
+ ...TokenConfigBaseSchema.shape
1281
1282
  });
1282
1283
  const EvmErc20Module = hydrate => {
1283
1284
  const {
@@ -2409,8 +2410,9 @@ const uniswapV2PairAbi = [{
2409
2410
  }];
2410
2411
 
2411
2412
  const moduleType$5 = "evm-uniswapv2";
2412
- const EvmUniswapV2TokenConfigSchema = TokenConfigBaseSchema.extend({
2413
+ const EvmUniswapV2TokenConfigSchema = z__default.default.strictObject({
2413
2414
  contractAddress: chaindataProvider.EvmUniswapV2TokenSchema.shape.contractAddress,
2415
+ ...TokenConfigBaseSchema.shape,
2414
2416
  // the ones below are unused and prone to error, feels better to always fetch these from chain
2415
2417
  symbol0: chaindataProvider.EvmUniswapV2TokenSchema.shape.symbol0.optional(),
2416
2418
  symbol1: chaindataProvider.EvmUniswapV2TokenSchema.shape.symbol1.optional(),
@@ -3136,9 +3138,9 @@ const decompress = data => {
3136
3138
  };
3137
3139
 
3138
3140
  const moduleType$4 = "substrate-assets";
3139
- const SubAssetsTokenConfigSchema = TokenConfigBaseSchema.extend({
3141
+ const SubAssetsTokenConfigSchema = z__default.default.strictObject({
3140
3142
  assetId: chaindataProvider.SubAssetsTokenSchema.shape.assetId,
3141
- existentialDeposit: chaindataProvider.SubAssetsTokenSchema.shape.existentialDeposit.optional()
3143
+ ...TokenConfigBaseSchema.shape
3142
3144
  });
3143
3145
  const UNSUPPORTED_CHAIN_META$3 = {
3144
3146
  miniMetadata: null,
@@ -3442,9 +3444,9 @@ const UNSUPPORTED_CHAIN_META$2 = {
3442
3444
  miniMetadata: null,
3443
3445
  extra: null
3444
3446
  };
3445
- const SubForeignAssetsTokenConfigSchema = TokenConfigBaseSchema.extend({
3447
+ const SubForeignAssetsTokenConfigSchema = z__default.default.strictObject({
3446
3448
  onChainId: chaindataProvider.SubForeignAssetsTokenSchema.shape.onChainId,
3447
- existentialDeposit: chaindataProvider.SubForeignAssetsTokenSchema.shape.existentialDeposit.optional()
3449
+ ...TokenConfigBaseSchema.shape
3448
3450
  });
3449
3451
 
3450
3452
  // {
@@ -6446,9 +6448,9 @@ var psp22Abi = {
6446
6448
  };
6447
6449
 
6448
6450
  const moduleType$1 = "substrate-psp22";
6449
- const SubPsp22TokenConfigSchema = TokenConfigBaseSchema.extend({
6451
+ const SubPsp22TokenConfigSchema = z__default.default.strictObject({
6450
6452
  contractAddress: chaindataProvider.SubPsp22TokenSchema.shape.contractAddress,
6451
- existentialDeposit: chaindataProvider.SubPsp22TokenSchema.shape.existentialDeposit.optional()
6453
+ ...TokenConfigBaseSchema.shape
6452
6454
  });
6453
6455
 
6454
6456
  // {
@@ -6496,7 +6498,7 @@ const SubPsp22Module = hydrate => {
6496
6498
  try {
6497
6499
  let symbol = tokenConfig?.symbol ?? "Unit";
6498
6500
  let decimals = tokenConfig?.decimals ?? 0;
6499
- const existentialDeposit = tokenConfig?.existentialDeposit ?? "0";
6501
+ // const existentialDeposit = tokenConfig?.existentialDeposit ?? "0"
6500
6502
  const contractAddress = tokenConfig?.contractAddress ?? undefined;
6501
6503
  if (contractAddress === undefined) continue;
6502
6504
  await (async () => {
@@ -6523,7 +6525,7 @@ const SubPsp22Module = hydrate => {
6523
6525
  decimals,
6524
6526
  name: tokenConfig?.name || symbol,
6525
6527
  logo: tokenConfig?.logo,
6526
- existentialDeposit,
6528
+ // existentialDeposit: "0",
6527
6529
  contractAddress,
6528
6530
  networkId: chainId
6529
6531
  };
@@ -6710,8 +6712,9 @@ const fetchBalances = async (chainConnector, tokens, addressesByToken) => {
6710
6712
  };
6711
6713
 
6712
6714
  const moduleType = "substrate-tokens";
6713
- const SubTokensTokenConfigSchema = TokenConfigBaseSchema.extend({
6715
+ const SubTokensTokenConfigSchema = z__default.default.strictObject({
6714
6716
  onChainId: chaindataProvider.SubTokensTokenSchema.shape.onChainId,
6717
+ ...TokenConfigBaseSchema.shape,
6715
6718
  existentialDeposit: chaindataProvider.SubTokensTokenSchema.shape.existentialDeposit.optional()
6716
6719
  });
6717
6720
  const defaultPalletId = "Tokens";
@@ -9,6 +9,7 @@ var BigNumber = require('bignumber.js');
9
9
  var util$1 = require('@polkadot/util');
10
10
  var utilCrypto = require('@polkadot/util-crypto');
11
11
  var pako = require('pako');
12
+ var z = require('zod/v4');
12
13
  var viem = require('viem');
13
14
  var lodash = require('lodash');
14
15
  var isEqual = require('lodash/isEqual');
@@ -16,7 +17,6 @@ var txwrapperCore = require('@substrate/txwrapper-core');
16
17
  var scale = require('@talismn/scale');
17
18
  var camelCase = require('lodash/camelCase');
18
19
  var PQueue = require('p-queue');
19
- var z = require('zod/v4');
20
20
  var sapi = require('@talismn/sapi');
21
21
  var types = require('@polkadot/types');
22
22
  var groupBy = require('lodash/groupBy');
@@ -33,10 +33,10 @@ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
33
33
  var anylogger__default = /*#__PURE__*/_interopDefault(anylogger);
34
34
  var BigNumber__default = /*#__PURE__*/_interopDefault(BigNumber);
35
35
  var pako__default = /*#__PURE__*/_interopDefault(pako);
36
+ var z__default = /*#__PURE__*/_interopDefault(z);
36
37
  var isEqual__default = /*#__PURE__*/_interopDefault(isEqual);
37
38
  var camelCase__default = /*#__PURE__*/_interopDefault(camelCase);
38
39
  var PQueue__default = /*#__PURE__*/_interopDefault(PQueue);
39
- var z__default = /*#__PURE__*/_interopDefault(z);
40
40
  var groupBy__default = /*#__PURE__*/_interopDefault(groupBy);
41
41
  var upperFirst__default = /*#__PURE__*/_interopDefault(upperFirst);
42
42
 
@@ -126,7 +126,7 @@ class EvmTokenFetcher {
126
126
 
127
127
  var pkg = {
128
128
  name: "@talismn/balances",
129
- version: "0.0.0-pr2043-20250620112438"};
129
+ version: "0.0.0-pr2043-20250621032133"};
130
130
 
131
131
  var log = anylogger__default.default(pkg.name);
132
132
 
@@ -1276,8 +1276,9 @@ const moduleType$7 = "evm-erc20";
1276
1276
  // >
1277
1277
  // }
1278
1278
 
1279
- const EvmErc20TokenConfigSchema = TokenConfigBaseSchema.extend({
1280
- contractAddress: chaindataProvider.EvmErc20TokenSchema.shape.contractAddress
1279
+ const EvmErc20TokenConfigSchema = z__default.default.strictObject({
1280
+ contractAddress: chaindataProvider.EvmErc20TokenSchema.shape.contractAddress,
1281
+ ...TokenConfigBaseSchema.shape
1281
1282
  });
1282
1283
  const EvmErc20Module = hydrate => {
1283
1284
  const {
@@ -2409,8 +2410,9 @@ const uniswapV2PairAbi = [{
2409
2410
  }];
2410
2411
 
2411
2412
  const moduleType$5 = "evm-uniswapv2";
2412
- const EvmUniswapV2TokenConfigSchema = TokenConfigBaseSchema.extend({
2413
+ const EvmUniswapV2TokenConfigSchema = z__default.default.strictObject({
2413
2414
  contractAddress: chaindataProvider.EvmUniswapV2TokenSchema.shape.contractAddress,
2415
+ ...TokenConfigBaseSchema.shape,
2414
2416
  // the ones below are unused and prone to error, feels better to always fetch these from chain
2415
2417
  symbol0: chaindataProvider.EvmUniswapV2TokenSchema.shape.symbol0.optional(),
2416
2418
  symbol1: chaindataProvider.EvmUniswapV2TokenSchema.shape.symbol1.optional(),
@@ -3136,9 +3138,9 @@ const decompress = data => {
3136
3138
  };
3137
3139
 
3138
3140
  const moduleType$4 = "substrate-assets";
3139
- const SubAssetsTokenConfigSchema = TokenConfigBaseSchema.extend({
3141
+ const SubAssetsTokenConfigSchema = z__default.default.strictObject({
3140
3142
  assetId: chaindataProvider.SubAssetsTokenSchema.shape.assetId,
3141
- existentialDeposit: chaindataProvider.SubAssetsTokenSchema.shape.existentialDeposit.optional()
3143
+ ...TokenConfigBaseSchema.shape
3142
3144
  });
3143
3145
  const UNSUPPORTED_CHAIN_META$3 = {
3144
3146
  miniMetadata: null,
@@ -3442,9 +3444,9 @@ const UNSUPPORTED_CHAIN_META$2 = {
3442
3444
  miniMetadata: null,
3443
3445
  extra: null
3444
3446
  };
3445
- const SubForeignAssetsTokenConfigSchema = TokenConfigBaseSchema.extend({
3447
+ const SubForeignAssetsTokenConfigSchema = z__default.default.strictObject({
3446
3448
  onChainId: chaindataProvider.SubForeignAssetsTokenSchema.shape.onChainId,
3447
- existentialDeposit: chaindataProvider.SubForeignAssetsTokenSchema.shape.existentialDeposit.optional()
3449
+ ...TokenConfigBaseSchema.shape
3448
3450
  });
3449
3451
 
3450
3452
  // {
@@ -6446,9 +6448,9 @@ var psp22Abi = {
6446
6448
  };
6447
6449
 
6448
6450
  const moduleType$1 = "substrate-psp22";
6449
- const SubPsp22TokenConfigSchema = TokenConfigBaseSchema.extend({
6451
+ const SubPsp22TokenConfigSchema = z__default.default.strictObject({
6450
6452
  contractAddress: chaindataProvider.SubPsp22TokenSchema.shape.contractAddress,
6451
- existentialDeposit: chaindataProvider.SubPsp22TokenSchema.shape.existentialDeposit.optional()
6453
+ ...TokenConfigBaseSchema.shape
6452
6454
  });
6453
6455
 
6454
6456
  // {
@@ -6496,7 +6498,7 @@ const SubPsp22Module = hydrate => {
6496
6498
  try {
6497
6499
  let symbol = tokenConfig?.symbol ?? "Unit";
6498
6500
  let decimals = tokenConfig?.decimals ?? 0;
6499
- const existentialDeposit = tokenConfig?.existentialDeposit ?? "0";
6501
+ // const existentialDeposit = tokenConfig?.existentialDeposit ?? "0"
6500
6502
  const contractAddress = tokenConfig?.contractAddress ?? undefined;
6501
6503
  if (contractAddress === undefined) continue;
6502
6504
  await (async () => {
@@ -6523,7 +6525,7 @@ const SubPsp22Module = hydrate => {
6523
6525
  decimals,
6524
6526
  name: tokenConfig?.name || symbol,
6525
6527
  logo: tokenConfig?.logo,
6526
- existentialDeposit,
6528
+ // existentialDeposit: "0",
6527
6529
  contractAddress,
6528
6530
  networkId: chainId
6529
6531
  };
@@ -6710,8 +6712,9 @@ const fetchBalances = async (chainConnector, tokens, addressesByToken) => {
6710
6712
  };
6711
6713
 
6712
6714
  const moduleType = "substrate-tokens";
6713
- const SubTokensTokenConfigSchema = TokenConfigBaseSchema.extend({
6715
+ const SubTokensTokenConfigSchema = z__default.default.strictObject({
6714
6716
  onChainId: chaindataProvider.SubTokensTokenSchema.shape.onChainId,
6717
+ ...TokenConfigBaseSchema.shape,
6715
6718
  existentialDeposit: chaindataProvider.SubTokensTokenSchema.shape.existentialDeposit.optional()
6716
6719
  });
6717
6720
  const defaultPalletId = "Tokens";
@@ -7,6 +7,7 @@ import BigNumber from 'bignumber.js';
7
7
  import { u8aToHex, assert, stringCamelCase, u8aConcatStrict, arrayChunk, u8aToString, hexToNumber, hexToU8a } from '@polkadot/util';
8
8
  import { xxhashAsU8a } from '@polkadot/util-crypto';
9
9
  import pako from 'pako';
10
+ import z from 'zod/v4';
10
11
  import { parseAbi, isHex, hexToBigInt } from 'viem';
11
12
  import { fromPairs, toPairs, keys, groupBy as groupBy$1 } from 'lodash';
12
13
  import isEqual from 'lodash/isEqual';
@@ -14,7 +15,6 @@ import { defineMethod } from '@substrate/txwrapper-core';
14
15
  import { unifyMetadata, decAnyMetadata, getDynamicBuilder, getLookupFn, compactMetadata, encodeMetadata, decodeScale, papiParse, getMetadataVersion, encodeStateKey } from '@talismn/scale';
15
16
  import camelCase from 'lodash/camelCase';
16
17
  import PQueue from 'p-queue';
17
- import z from 'zod/v4';
18
18
  import { fetchBestMetadata, getScaleApi } from '@talismn/sapi';
19
19
  import { Metadata, TypeRegistry } from '@polkadot/types';
20
20
  import groupBy from 'lodash/groupBy';
@@ -112,7 +112,7 @@ class EvmTokenFetcher {
112
112
 
113
113
  var pkg = {
114
114
  name: "@talismn/balances",
115
- version: "0.0.0-pr2043-20250620112438"};
115
+ version: "0.0.0-pr2043-20250621032133"};
116
116
 
117
117
  var log = anylogger(pkg.name);
118
118
 
@@ -1262,8 +1262,9 @@ const moduleType$7 = "evm-erc20";
1262
1262
  // >
1263
1263
  // }
1264
1264
 
1265
- const EvmErc20TokenConfigSchema = TokenConfigBaseSchema.extend({
1266
- contractAddress: EvmErc20TokenSchema.shape.contractAddress
1265
+ const EvmErc20TokenConfigSchema = z.strictObject({
1266
+ contractAddress: EvmErc20TokenSchema.shape.contractAddress,
1267
+ ...TokenConfigBaseSchema.shape
1267
1268
  });
1268
1269
  const EvmErc20Module = hydrate => {
1269
1270
  const {
@@ -2395,8 +2396,9 @@ const uniswapV2PairAbi = [{
2395
2396
  }];
2396
2397
 
2397
2398
  const moduleType$5 = "evm-uniswapv2";
2398
- const EvmUniswapV2TokenConfigSchema = TokenConfigBaseSchema.extend({
2399
+ const EvmUniswapV2TokenConfigSchema = z.strictObject({
2399
2400
  contractAddress: EvmUniswapV2TokenSchema.shape.contractAddress,
2401
+ ...TokenConfigBaseSchema.shape,
2400
2402
  // the ones below are unused and prone to error, feels better to always fetch these from chain
2401
2403
  symbol0: EvmUniswapV2TokenSchema.shape.symbol0.optional(),
2402
2404
  symbol1: EvmUniswapV2TokenSchema.shape.symbol1.optional(),
@@ -3122,9 +3124,9 @@ const decompress = data => {
3122
3124
  };
3123
3125
 
3124
3126
  const moduleType$4 = "substrate-assets";
3125
- const SubAssetsTokenConfigSchema = TokenConfigBaseSchema.extend({
3127
+ const SubAssetsTokenConfigSchema = z.strictObject({
3126
3128
  assetId: SubAssetsTokenSchema.shape.assetId,
3127
- existentialDeposit: SubAssetsTokenSchema.shape.existentialDeposit.optional()
3129
+ ...TokenConfigBaseSchema.shape
3128
3130
  });
3129
3131
  const UNSUPPORTED_CHAIN_META$3 = {
3130
3132
  miniMetadata: null,
@@ -3428,9 +3430,9 @@ const UNSUPPORTED_CHAIN_META$2 = {
3428
3430
  miniMetadata: null,
3429
3431
  extra: null
3430
3432
  };
3431
- const SubForeignAssetsTokenConfigSchema = TokenConfigBaseSchema.extend({
3433
+ const SubForeignAssetsTokenConfigSchema = z.strictObject({
3432
3434
  onChainId: SubForeignAssetsTokenSchema.shape.onChainId,
3433
- existentialDeposit: SubForeignAssetsTokenSchema.shape.existentialDeposit.optional()
3435
+ ...TokenConfigBaseSchema.shape
3434
3436
  });
3435
3437
 
3436
3438
  // {
@@ -6432,9 +6434,9 @@ var psp22Abi = {
6432
6434
  };
6433
6435
 
6434
6436
  const moduleType$1 = "substrate-psp22";
6435
- const SubPsp22TokenConfigSchema = TokenConfigBaseSchema.extend({
6437
+ const SubPsp22TokenConfigSchema = z.strictObject({
6436
6438
  contractAddress: SubPsp22TokenSchema.shape.contractAddress,
6437
- existentialDeposit: SubPsp22TokenSchema.shape.existentialDeposit.optional()
6439
+ ...TokenConfigBaseSchema.shape
6438
6440
  });
6439
6441
 
6440
6442
  // {
@@ -6482,7 +6484,7 @@ const SubPsp22Module = hydrate => {
6482
6484
  try {
6483
6485
  let symbol = tokenConfig?.symbol ?? "Unit";
6484
6486
  let decimals = tokenConfig?.decimals ?? 0;
6485
- const existentialDeposit = tokenConfig?.existentialDeposit ?? "0";
6487
+ // const existentialDeposit = tokenConfig?.existentialDeposit ?? "0"
6486
6488
  const contractAddress = tokenConfig?.contractAddress ?? undefined;
6487
6489
  if (contractAddress === undefined) continue;
6488
6490
  await (async () => {
@@ -6509,7 +6511,7 @@ const SubPsp22Module = hydrate => {
6509
6511
  decimals,
6510
6512
  name: tokenConfig?.name || symbol,
6511
6513
  logo: tokenConfig?.logo,
6512
- existentialDeposit,
6514
+ // existentialDeposit: "0",
6513
6515
  contractAddress,
6514
6516
  networkId: chainId
6515
6517
  };
@@ -6696,8 +6698,9 @@ const fetchBalances = async (chainConnector, tokens, addressesByToken) => {
6696
6698
  };
6697
6699
 
6698
6700
  const moduleType = "substrate-tokens";
6699
- const SubTokensTokenConfigSchema = TokenConfigBaseSchema.extend({
6701
+ const SubTokensTokenConfigSchema = z.strictObject({
6700
6702
  onChainId: SubTokensTokenSchema.shape.onChainId,
6703
+ ...TokenConfigBaseSchema.shape,
6701
6704
  existentialDeposit: SubTokensTokenSchema.shape.existentialDeposit.optional()
6702
6705
  });
6703
6706
  const defaultPalletId = "Tokens";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@talismn/balances",
3
- "version": "0.0.0-pr2043-20250620112438",
3
+ "version": "0.0.0-pr2043-20250621032133",
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-20250620112438",
39
- "@talismn/chain-connector-evm": "0.0.0-pr2043-20250620112438",
40
- "@talismn/chaindata-provider": "0.0.0-pr2043-20250620112438",
41
- "@talismn/sapi": "0.0.0-pr2043-20250620112438",
38
+ "@talismn/chain-connector": "0.0.0-pr2043-20250621032133",
39
+ "@talismn/chain-connector-evm": "0.0.0-pr2043-20250621032133",
40
+ "@talismn/chaindata-provider": "0.0.0-pr2043-20250621032133",
42
41
  "@talismn/scale": "0.1.2",
43
- "@talismn/util": "0.0.0-pr2043-20250620112438",
44
- "@talismn/token-rates": "0.0.0-pr2043-20250620112438"
42
+ "@talismn/sapi": "0.0.0-pr2043-20250621032133",
43
+ "@talismn/util": "0.0.0-pr2043-20250621032133",
44
+ "@talismn/token-rates": "0.0.0-pr2043-20250621032133"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@polkadot/api-contract": "16.1.2",
@@ -56,8 +56,8 @@
56
56
  "jest": "^29.7.0",
57
57
  "ts-jest": "^29.2.5",
58
58
  "typescript": "^5.6.3",
59
- "@talismn/eslint-config": "0.0.3",
60
- "@talismn/tsconfig": "0.0.2"
59
+ "@talismn/tsconfig": "0.0.2",
60
+ "@talismn/eslint-config": "0.0.3"
61
61
  },
62
62
  "peerDependencies": {
63
63
  "@polkadot/api-contract": "*",