@talismn/balances 0.0.0-pr2043-20250622002226 → 0.0.0-pr2043-20250622030228
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.
@@ -126,7 +126,7 @@ class EvmTokenFetcher {
|
|
126
126
|
|
127
127
|
var pkg = {
|
128
128
|
name: "@talismn/balances",
|
129
|
-
version: "0.0.0-pr2043-
|
129
|
+
version: "0.0.0-pr2043-20250622030228"};
|
130
130
|
|
131
131
|
var log = anylogger__default.default(pkg.name);
|
132
132
|
|
@@ -1265,17 +1265,6 @@ const erc20Abi = [{
|
|
1265
1265
|
const erc20BalancesAggregatorAbi = viem.parseAbi(["struct AccountToken {address account; address token;}", "function balances(AccountToken[] memory accountTokens) public view returns (uint256[] memory)"]);
|
1266
1266
|
|
1267
1267
|
const moduleType$7 = "evm-erc20";
|
1268
|
-
// {
|
1269
|
-
// tokens?: Array<
|
1270
|
-
// {
|
1271
|
-
// symbol?: string
|
1272
|
-
// decimals?: number
|
1273
|
-
// name?: string
|
1274
|
-
// contractAddress?: `0x${string}`
|
1275
|
-
// } & BalancesConfigTokenParams
|
1276
|
-
// >
|
1277
|
-
// }
|
1278
|
-
|
1279
1268
|
const EvmErc20TokenConfigSchema = z__default.default.strictObject({
|
1280
1269
|
contractAddress: chaindataProvider.EvmErc20TokenSchema.shape.contractAddress,
|
1281
1270
|
...TokenConfigBaseSchema.shape
|
@@ -1642,33 +1631,9 @@ const EvmNativeModule = hydrate => {
|
|
1642
1631
|
* In a future version of the balance libraries, we may build some kind of async scheduling system which will keep the list of tokens for each chain up to date without relying on a squid.
|
1643
1632
|
*/
|
1644
1633
|
async fetchEvmChainTokens() {
|
1645
|
-
//
|
1646
|
-
// TODO
|
1634
|
+
// token is currently generated in chaindata from the EthNetworkConfig["nativeCurrency"] field
|
1635
|
+
// TODO normalise this
|
1647
1636
|
return {};
|
1648
|
-
|
1649
|
-
// const symbol = moduleConfig?.symbol ?? "ETH"
|
1650
|
-
// const decimals = typeof moduleConfig?.decimals === "number" ? moduleConfig.decimals : 18
|
1651
|
-
// const name = moduleConfig?.name ?? symbol
|
1652
|
-
|
1653
|
-
// const id = evmNativeTokenId(networkId)
|
1654
|
-
// const nativeToken: EvmNativeToken = {
|
1655
|
-
// platform: "ethereum",
|
1656
|
-
// id,
|
1657
|
-
// type: "evm-native",
|
1658
|
-
// isDefault: true,
|
1659
|
-
// symbol,
|
1660
|
-
// decimals,
|
1661
|
-
// name,
|
1662
|
-
// logo: moduleConfig?.logo,
|
1663
|
-
// networkId,
|
1664
|
-
// }
|
1665
|
-
|
1666
|
-
// if (moduleConfig?.symbol) nativeToken.symbol = moduleConfig?.symbol
|
1667
|
-
// if (moduleConfig?.coingeckoId) nativeToken.coingeckoId = moduleConfig?.coingeckoId
|
1668
|
-
// if (moduleConfig?.mirrorOf) nativeToken.mirrorOf = moduleConfig?.mirrorOf
|
1669
|
-
// if (moduleConfig?.noDiscovery) nativeToken.noDiscovery = moduleConfig?.noDiscovery
|
1670
|
-
|
1671
|
-
// return { [nativeToken.id]: nativeToken }
|
1672
1637
|
},
|
1673
1638
|
async subscribeBalances({
|
1674
1639
|
addressesByToken,
|
@@ -2423,24 +2388,6 @@ const EvmUniswapV2TokenConfigSchema = z__default.default.strictObject({
|
|
2423
2388
|
coingeckoId0: chaindataProvider.EvmUniswapV2TokenSchema.shape.coingeckoId0.optional(),
|
2424
2389
|
coingeckoId1: chaindataProvider.EvmUniswapV2TokenSchema.shape.coingeckoId1.optional()
|
2425
2390
|
});
|
2426
|
-
|
2427
|
-
// {
|
2428
|
-
// pools?: Array<
|
2429
|
-
// {
|
2430
|
-
// contractAddress?: `0x${string}`
|
2431
|
-
// decimals?: number
|
2432
|
-
// symbol0?: string
|
2433
|
-
// symbol1?: string
|
2434
|
-
// decimals0?: number
|
2435
|
-
// decimals1?: number
|
2436
|
-
// tokenAddress0?: `0x${string}`
|
2437
|
-
// tokenAddress1?: `0x${string}`
|
2438
|
-
// coingeckoId0?: string
|
2439
|
-
// coingeckoId1?: string
|
2440
|
-
// } & BalancesConfigTokenParams
|
2441
|
-
// >
|
2442
|
-
// }
|
2443
|
-
|
2444
2391
|
const EvmUniswapV2Module = hydrate => {
|
2445
2392
|
const {
|
2446
2393
|
chainConnectors,
|
@@ -3146,15 +3093,6 @@ const UNSUPPORTED_CHAIN_META$3 = {
|
|
3146
3093
|
miniMetadata: null,
|
3147
3094
|
extra: null
|
3148
3095
|
};
|
3149
|
-
|
3150
|
-
// {
|
3151
|
-
// tokens?: Array<
|
3152
|
-
// {
|
3153
|
-
// assetId: number | string
|
3154
|
-
// } & BalancesConfigTokenParams
|
3155
|
-
// >
|
3156
|
-
// }
|
3157
|
-
|
3158
3096
|
const SubAssetsModule = hydrate => {
|
3159
3097
|
const {
|
3160
3098
|
chainConnectors,
|
@@ -3448,15 +3386,6 @@ const SubForeignAssetsTokenConfigSchema = z__default.default.strictObject({
|
|
3448
3386
|
onChainId: chaindataProvider.SubForeignAssetsTokenSchema.shape.onChainId,
|
3449
3387
|
...TokenConfigBaseSchema.shape
|
3450
3388
|
});
|
3451
|
-
|
3452
|
-
// {
|
3453
|
-
// tokens?: Array<
|
3454
|
-
// {
|
3455
|
-
// onChainId: string
|
3456
|
-
// } & BalancesConfigTokenParams
|
3457
|
-
// >
|
3458
|
-
// }
|
3459
|
-
|
3460
3389
|
const SubForeignAssetsModule = hydrate => {
|
3461
3390
|
const {
|
3462
3391
|
chainConnectors,
|
@@ -3515,7 +3444,6 @@ const SubForeignAssetsModule = hydrate => {
|
|
3515
3444
|
id,
|
3516
3445
|
type: "substrate-foreignassets",
|
3517
3446
|
platform: "polkadot",
|
3518
|
-
// isTestnet,
|
3519
3447
|
isDefault: tokenConfig?.isDefault ?? true,
|
3520
3448
|
symbol,
|
3521
3449
|
decimals,
|
@@ -5190,11 +5118,6 @@ const SubNativeModule = hydrate => {
|
|
5190
5118
|
existentialDeposit: existentialDeposit ?? "0",
|
5191
5119
|
networkId: chainId
|
5192
5120
|
};
|
5193
|
-
|
5194
|
-
// if (moduleConfig?.symbol) nativeToken.symbol = moduleConfig?.symbol
|
5195
|
-
// if (moduleConfig?.coingeckoId) nativeToken.coingeckoId = moduleConfig?.coingeckoId
|
5196
|
-
// if (moduleConfig?.mirrorOf) nativeToken.mirrorOf = moduleConfig?.mirrorOf
|
5197
|
-
|
5198
5121
|
return {
|
5199
5122
|
[nativeToken.id]: nativeToken
|
5200
5123
|
};
|
@@ -6452,18 +6375,6 @@ const SubPsp22TokenConfigSchema = z__default.default.strictObject({
|
|
6452
6375
|
contractAddress: chaindataProvider.SubPsp22TokenSchema.shape.contractAddress,
|
6453
6376
|
...TokenConfigBaseSchema.shape
|
6454
6377
|
});
|
6455
|
-
|
6456
|
-
// {
|
6457
|
-
// tokens?: Array<
|
6458
|
-
// {
|
6459
|
-
// symbol?: string
|
6460
|
-
// decimals?: number
|
6461
|
-
// ed?: string
|
6462
|
-
// contractAddress: string
|
6463
|
-
// } & BalancesConfigTokenParams
|
6464
|
-
// >
|
6465
|
-
// }
|
6466
|
-
|
6467
6378
|
const SubPsp22Module = hydrate => {
|
6468
6379
|
const {
|
6469
6380
|
chainConnectors,
|
@@ -6482,8 +6393,6 @@ const SubPsp22Module = hydrate => {
|
|
6482
6393
|
},
|
6483
6394
|
async fetchSubstrateChainTokens(chainId, _chainMeta, moduleConfig, tokens) {
|
6484
6395
|
if (!tokens?.length) return {};
|
6485
|
-
// const { isTestnet } = chainMeta
|
6486
|
-
|
6487
6396
|
const registry = new types.TypeRegistry();
|
6488
6397
|
const Psp22Abi = new apiContract.Abi(psp22Abi);
|
6489
6398
|
|
@@ -6498,7 +6407,6 @@ const SubPsp22Module = hydrate => {
|
|
6498
6407
|
try {
|
6499
6408
|
let symbol = tokenConfig?.symbol ?? "Unit";
|
6500
6409
|
let decimals = tokenConfig?.decimals ?? 0;
|
6501
|
-
// const existentialDeposit = tokenConfig?.existentialDeposit ?? "0"
|
6502
6410
|
const contractAddress = tokenConfig?.contractAddress ?? undefined;
|
6503
6411
|
if (contractAddress === undefined) continue;
|
6504
6412
|
await (async () => {
|
@@ -6519,13 +6427,11 @@ const SubPsp22Module = hydrate => {
|
|
6519
6427
|
id,
|
6520
6428
|
type: "substrate-psp22",
|
6521
6429
|
platform: "polkadot",
|
6522
|
-
// isTestnet,
|
6523
6430
|
isDefault: tokenConfig.isDefault ?? true,
|
6524
6431
|
symbol,
|
6525
6432
|
decimals,
|
6526
6433
|
name: tokenConfig?.name || symbol,
|
6527
6434
|
logo: tokenConfig?.logo,
|
6528
|
-
// existentialDeposit: "0",
|
6529
6435
|
contractAddress,
|
6530
6436
|
networkId: chainId
|
6531
6437
|
};
|
@@ -6722,19 +6628,6 @@ const UNSUPPORTED_CHAIN_META = {
|
|
6722
6628
|
miniMetadata: null,
|
6723
6629
|
extra: {}
|
6724
6630
|
};
|
6725
|
-
|
6726
|
-
// {
|
6727
|
-
// palletId?: string // TODO unlikely it will ever be used - remove this ?
|
6728
|
-
// tokens?: Array<
|
6729
|
-
// {
|
6730
|
-
// symbol?: string
|
6731
|
-
// decimals?: number
|
6732
|
-
// ed?: string
|
6733
|
-
// onChainId?: string | number
|
6734
|
-
// } & BalancesConfigTokenParams
|
6735
|
-
// >
|
6736
|
-
// }
|
6737
|
-
|
6738
6631
|
const SubTokensModule = hydrate => {
|
6739
6632
|
const {
|
6740
6633
|
chainConnectors,
|
@@ -126,7 +126,7 @@ class EvmTokenFetcher {
|
|
126
126
|
|
127
127
|
var pkg = {
|
128
128
|
name: "@talismn/balances",
|
129
|
-
version: "0.0.0-pr2043-
|
129
|
+
version: "0.0.0-pr2043-20250622030228"};
|
130
130
|
|
131
131
|
var log = anylogger__default.default(pkg.name);
|
132
132
|
|
@@ -1265,17 +1265,6 @@ const erc20Abi = [{
|
|
1265
1265
|
const erc20BalancesAggregatorAbi = viem.parseAbi(["struct AccountToken {address account; address token;}", "function balances(AccountToken[] memory accountTokens) public view returns (uint256[] memory)"]);
|
1266
1266
|
|
1267
1267
|
const moduleType$7 = "evm-erc20";
|
1268
|
-
// {
|
1269
|
-
// tokens?: Array<
|
1270
|
-
// {
|
1271
|
-
// symbol?: string
|
1272
|
-
// decimals?: number
|
1273
|
-
// name?: string
|
1274
|
-
// contractAddress?: `0x${string}`
|
1275
|
-
// } & BalancesConfigTokenParams
|
1276
|
-
// >
|
1277
|
-
// }
|
1278
|
-
|
1279
1268
|
const EvmErc20TokenConfigSchema = z__default.default.strictObject({
|
1280
1269
|
contractAddress: chaindataProvider.EvmErc20TokenSchema.shape.contractAddress,
|
1281
1270
|
...TokenConfigBaseSchema.shape
|
@@ -1642,33 +1631,9 @@ const EvmNativeModule = hydrate => {
|
|
1642
1631
|
* In a future version of the balance libraries, we may build some kind of async scheduling system which will keep the list of tokens for each chain up to date without relying on a squid.
|
1643
1632
|
*/
|
1644
1633
|
async fetchEvmChainTokens() {
|
1645
|
-
//
|
1646
|
-
// TODO
|
1634
|
+
// token is currently generated in chaindata from the EthNetworkConfig["nativeCurrency"] field
|
1635
|
+
// TODO normalise this
|
1647
1636
|
return {};
|
1648
|
-
|
1649
|
-
// const symbol = moduleConfig?.symbol ?? "ETH"
|
1650
|
-
// const decimals = typeof moduleConfig?.decimals === "number" ? moduleConfig.decimals : 18
|
1651
|
-
// const name = moduleConfig?.name ?? symbol
|
1652
|
-
|
1653
|
-
// const id = evmNativeTokenId(networkId)
|
1654
|
-
// const nativeToken: EvmNativeToken = {
|
1655
|
-
// platform: "ethereum",
|
1656
|
-
// id,
|
1657
|
-
// type: "evm-native",
|
1658
|
-
// isDefault: true,
|
1659
|
-
// symbol,
|
1660
|
-
// decimals,
|
1661
|
-
// name,
|
1662
|
-
// logo: moduleConfig?.logo,
|
1663
|
-
// networkId,
|
1664
|
-
// }
|
1665
|
-
|
1666
|
-
// if (moduleConfig?.symbol) nativeToken.symbol = moduleConfig?.symbol
|
1667
|
-
// if (moduleConfig?.coingeckoId) nativeToken.coingeckoId = moduleConfig?.coingeckoId
|
1668
|
-
// if (moduleConfig?.mirrorOf) nativeToken.mirrorOf = moduleConfig?.mirrorOf
|
1669
|
-
// if (moduleConfig?.noDiscovery) nativeToken.noDiscovery = moduleConfig?.noDiscovery
|
1670
|
-
|
1671
|
-
// return { [nativeToken.id]: nativeToken }
|
1672
1637
|
},
|
1673
1638
|
async subscribeBalances({
|
1674
1639
|
addressesByToken,
|
@@ -2423,24 +2388,6 @@ const EvmUniswapV2TokenConfigSchema = z__default.default.strictObject({
|
|
2423
2388
|
coingeckoId0: chaindataProvider.EvmUniswapV2TokenSchema.shape.coingeckoId0.optional(),
|
2424
2389
|
coingeckoId1: chaindataProvider.EvmUniswapV2TokenSchema.shape.coingeckoId1.optional()
|
2425
2390
|
});
|
2426
|
-
|
2427
|
-
// {
|
2428
|
-
// pools?: Array<
|
2429
|
-
// {
|
2430
|
-
// contractAddress?: `0x${string}`
|
2431
|
-
// decimals?: number
|
2432
|
-
// symbol0?: string
|
2433
|
-
// symbol1?: string
|
2434
|
-
// decimals0?: number
|
2435
|
-
// decimals1?: number
|
2436
|
-
// tokenAddress0?: `0x${string}`
|
2437
|
-
// tokenAddress1?: `0x${string}`
|
2438
|
-
// coingeckoId0?: string
|
2439
|
-
// coingeckoId1?: string
|
2440
|
-
// } & BalancesConfigTokenParams
|
2441
|
-
// >
|
2442
|
-
// }
|
2443
|
-
|
2444
2391
|
const EvmUniswapV2Module = hydrate => {
|
2445
2392
|
const {
|
2446
2393
|
chainConnectors,
|
@@ -3146,15 +3093,6 @@ const UNSUPPORTED_CHAIN_META$3 = {
|
|
3146
3093
|
miniMetadata: null,
|
3147
3094
|
extra: null
|
3148
3095
|
};
|
3149
|
-
|
3150
|
-
// {
|
3151
|
-
// tokens?: Array<
|
3152
|
-
// {
|
3153
|
-
// assetId: number | string
|
3154
|
-
// } & BalancesConfigTokenParams
|
3155
|
-
// >
|
3156
|
-
// }
|
3157
|
-
|
3158
3096
|
const SubAssetsModule = hydrate => {
|
3159
3097
|
const {
|
3160
3098
|
chainConnectors,
|
@@ -3448,15 +3386,6 @@ const SubForeignAssetsTokenConfigSchema = z__default.default.strictObject({
|
|
3448
3386
|
onChainId: chaindataProvider.SubForeignAssetsTokenSchema.shape.onChainId,
|
3449
3387
|
...TokenConfigBaseSchema.shape
|
3450
3388
|
});
|
3451
|
-
|
3452
|
-
// {
|
3453
|
-
// tokens?: Array<
|
3454
|
-
// {
|
3455
|
-
// onChainId: string
|
3456
|
-
// } & BalancesConfigTokenParams
|
3457
|
-
// >
|
3458
|
-
// }
|
3459
|
-
|
3460
3389
|
const SubForeignAssetsModule = hydrate => {
|
3461
3390
|
const {
|
3462
3391
|
chainConnectors,
|
@@ -3515,7 +3444,6 @@ const SubForeignAssetsModule = hydrate => {
|
|
3515
3444
|
id,
|
3516
3445
|
type: "substrate-foreignassets",
|
3517
3446
|
platform: "polkadot",
|
3518
|
-
// isTestnet,
|
3519
3447
|
isDefault: tokenConfig?.isDefault ?? true,
|
3520
3448
|
symbol,
|
3521
3449
|
decimals,
|
@@ -5190,11 +5118,6 @@ const SubNativeModule = hydrate => {
|
|
5190
5118
|
existentialDeposit: existentialDeposit ?? "0",
|
5191
5119
|
networkId: chainId
|
5192
5120
|
};
|
5193
|
-
|
5194
|
-
// if (moduleConfig?.symbol) nativeToken.symbol = moduleConfig?.symbol
|
5195
|
-
// if (moduleConfig?.coingeckoId) nativeToken.coingeckoId = moduleConfig?.coingeckoId
|
5196
|
-
// if (moduleConfig?.mirrorOf) nativeToken.mirrorOf = moduleConfig?.mirrorOf
|
5197
|
-
|
5198
5121
|
return {
|
5199
5122
|
[nativeToken.id]: nativeToken
|
5200
5123
|
};
|
@@ -6452,18 +6375,6 @@ const SubPsp22TokenConfigSchema = z__default.default.strictObject({
|
|
6452
6375
|
contractAddress: chaindataProvider.SubPsp22TokenSchema.shape.contractAddress,
|
6453
6376
|
...TokenConfigBaseSchema.shape
|
6454
6377
|
});
|
6455
|
-
|
6456
|
-
// {
|
6457
|
-
// tokens?: Array<
|
6458
|
-
// {
|
6459
|
-
// symbol?: string
|
6460
|
-
// decimals?: number
|
6461
|
-
// ed?: string
|
6462
|
-
// contractAddress: string
|
6463
|
-
// } & BalancesConfigTokenParams
|
6464
|
-
// >
|
6465
|
-
// }
|
6466
|
-
|
6467
6378
|
const SubPsp22Module = hydrate => {
|
6468
6379
|
const {
|
6469
6380
|
chainConnectors,
|
@@ -6482,8 +6393,6 @@ const SubPsp22Module = hydrate => {
|
|
6482
6393
|
},
|
6483
6394
|
async fetchSubstrateChainTokens(chainId, _chainMeta, moduleConfig, tokens) {
|
6484
6395
|
if (!tokens?.length) return {};
|
6485
|
-
// const { isTestnet } = chainMeta
|
6486
|
-
|
6487
6396
|
const registry = new types.TypeRegistry();
|
6488
6397
|
const Psp22Abi = new apiContract.Abi(psp22Abi);
|
6489
6398
|
|
@@ -6498,7 +6407,6 @@ const SubPsp22Module = hydrate => {
|
|
6498
6407
|
try {
|
6499
6408
|
let symbol = tokenConfig?.symbol ?? "Unit";
|
6500
6409
|
let decimals = tokenConfig?.decimals ?? 0;
|
6501
|
-
// const existentialDeposit = tokenConfig?.existentialDeposit ?? "0"
|
6502
6410
|
const contractAddress = tokenConfig?.contractAddress ?? undefined;
|
6503
6411
|
if (contractAddress === undefined) continue;
|
6504
6412
|
await (async () => {
|
@@ -6519,13 +6427,11 @@ const SubPsp22Module = hydrate => {
|
|
6519
6427
|
id,
|
6520
6428
|
type: "substrate-psp22",
|
6521
6429
|
platform: "polkadot",
|
6522
|
-
// isTestnet,
|
6523
6430
|
isDefault: tokenConfig.isDefault ?? true,
|
6524
6431
|
symbol,
|
6525
6432
|
decimals,
|
6526
6433
|
name: tokenConfig?.name || symbol,
|
6527
6434
|
logo: tokenConfig?.logo,
|
6528
|
-
// existentialDeposit: "0",
|
6529
6435
|
contractAddress,
|
6530
6436
|
networkId: chainId
|
6531
6437
|
};
|
@@ -6722,19 +6628,6 @@ const UNSUPPORTED_CHAIN_META = {
|
|
6722
6628
|
miniMetadata: null,
|
6723
6629
|
extra: {}
|
6724
6630
|
};
|
6725
|
-
|
6726
|
-
// {
|
6727
|
-
// palletId?: string // TODO unlikely it will ever be used - remove this ?
|
6728
|
-
// tokens?: Array<
|
6729
|
-
// {
|
6730
|
-
// symbol?: string
|
6731
|
-
// decimals?: number
|
6732
|
-
// ed?: string
|
6733
|
-
// onChainId?: string | number
|
6734
|
-
// } & BalancesConfigTokenParams
|
6735
|
-
// >
|
6736
|
-
// }
|
6737
|
-
|
6738
6631
|
const SubTokensModule = hydrate => {
|
6739
6632
|
const {
|
6740
6633
|
chainConnectors,
|
@@ -112,7 +112,7 @@ class EvmTokenFetcher {
|
|
112
112
|
|
113
113
|
var pkg = {
|
114
114
|
name: "@talismn/balances",
|
115
|
-
version: "0.0.0-pr2043-
|
115
|
+
version: "0.0.0-pr2043-20250622030228"};
|
116
116
|
|
117
117
|
var log = anylogger(pkg.name);
|
118
118
|
|
@@ -1251,17 +1251,6 @@ const erc20Abi = [{
|
|
1251
1251
|
const erc20BalancesAggregatorAbi = parseAbi(["struct AccountToken {address account; address token;}", "function balances(AccountToken[] memory accountTokens) public view returns (uint256[] memory)"]);
|
1252
1252
|
|
1253
1253
|
const moduleType$7 = "evm-erc20";
|
1254
|
-
// {
|
1255
|
-
// tokens?: Array<
|
1256
|
-
// {
|
1257
|
-
// symbol?: string
|
1258
|
-
// decimals?: number
|
1259
|
-
// name?: string
|
1260
|
-
// contractAddress?: `0x${string}`
|
1261
|
-
// } & BalancesConfigTokenParams
|
1262
|
-
// >
|
1263
|
-
// }
|
1264
|
-
|
1265
1254
|
const EvmErc20TokenConfigSchema = z.strictObject({
|
1266
1255
|
contractAddress: EvmErc20TokenSchema.shape.contractAddress,
|
1267
1256
|
...TokenConfigBaseSchema.shape
|
@@ -1628,33 +1617,9 @@ const EvmNativeModule = hydrate => {
|
|
1628
1617
|
* In a future version of the balance libraries, we may build some kind of async scheduling system which will keep the list of tokens for each chain up to date without relying on a squid.
|
1629
1618
|
*/
|
1630
1619
|
async fetchEvmChainTokens() {
|
1631
|
-
//
|
1632
|
-
// TODO
|
1620
|
+
// token is currently generated in chaindata from the EthNetworkConfig["nativeCurrency"] field
|
1621
|
+
// TODO normalise this
|
1633
1622
|
return {};
|
1634
|
-
|
1635
|
-
// const symbol = moduleConfig?.symbol ?? "ETH"
|
1636
|
-
// const decimals = typeof moduleConfig?.decimals === "number" ? moduleConfig.decimals : 18
|
1637
|
-
// const name = moduleConfig?.name ?? symbol
|
1638
|
-
|
1639
|
-
// const id = evmNativeTokenId(networkId)
|
1640
|
-
// const nativeToken: EvmNativeToken = {
|
1641
|
-
// platform: "ethereum",
|
1642
|
-
// id,
|
1643
|
-
// type: "evm-native",
|
1644
|
-
// isDefault: true,
|
1645
|
-
// symbol,
|
1646
|
-
// decimals,
|
1647
|
-
// name,
|
1648
|
-
// logo: moduleConfig?.logo,
|
1649
|
-
// networkId,
|
1650
|
-
// }
|
1651
|
-
|
1652
|
-
// if (moduleConfig?.symbol) nativeToken.symbol = moduleConfig?.symbol
|
1653
|
-
// if (moduleConfig?.coingeckoId) nativeToken.coingeckoId = moduleConfig?.coingeckoId
|
1654
|
-
// if (moduleConfig?.mirrorOf) nativeToken.mirrorOf = moduleConfig?.mirrorOf
|
1655
|
-
// if (moduleConfig?.noDiscovery) nativeToken.noDiscovery = moduleConfig?.noDiscovery
|
1656
|
-
|
1657
|
-
// return { [nativeToken.id]: nativeToken }
|
1658
1623
|
},
|
1659
1624
|
async subscribeBalances({
|
1660
1625
|
addressesByToken,
|
@@ -2409,24 +2374,6 @@ const EvmUniswapV2TokenConfigSchema = z.strictObject({
|
|
2409
2374
|
coingeckoId0: EvmUniswapV2TokenSchema.shape.coingeckoId0.optional(),
|
2410
2375
|
coingeckoId1: EvmUniswapV2TokenSchema.shape.coingeckoId1.optional()
|
2411
2376
|
});
|
2412
|
-
|
2413
|
-
// {
|
2414
|
-
// pools?: Array<
|
2415
|
-
// {
|
2416
|
-
// contractAddress?: `0x${string}`
|
2417
|
-
// decimals?: number
|
2418
|
-
// symbol0?: string
|
2419
|
-
// symbol1?: string
|
2420
|
-
// decimals0?: number
|
2421
|
-
// decimals1?: number
|
2422
|
-
// tokenAddress0?: `0x${string}`
|
2423
|
-
// tokenAddress1?: `0x${string}`
|
2424
|
-
// coingeckoId0?: string
|
2425
|
-
// coingeckoId1?: string
|
2426
|
-
// } & BalancesConfigTokenParams
|
2427
|
-
// >
|
2428
|
-
// }
|
2429
|
-
|
2430
2377
|
const EvmUniswapV2Module = hydrate => {
|
2431
2378
|
const {
|
2432
2379
|
chainConnectors,
|
@@ -3132,15 +3079,6 @@ const UNSUPPORTED_CHAIN_META$3 = {
|
|
3132
3079
|
miniMetadata: null,
|
3133
3080
|
extra: null
|
3134
3081
|
};
|
3135
|
-
|
3136
|
-
// {
|
3137
|
-
// tokens?: Array<
|
3138
|
-
// {
|
3139
|
-
// assetId: number | string
|
3140
|
-
// } & BalancesConfigTokenParams
|
3141
|
-
// >
|
3142
|
-
// }
|
3143
|
-
|
3144
3082
|
const SubAssetsModule = hydrate => {
|
3145
3083
|
const {
|
3146
3084
|
chainConnectors,
|
@@ -3434,15 +3372,6 @@ const SubForeignAssetsTokenConfigSchema = z.strictObject({
|
|
3434
3372
|
onChainId: SubForeignAssetsTokenSchema.shape.onChainId,
|
3435
3373
|
...TokenConfigBaseSchema.shape
|
3436
3374
|
});
|
3437
|
-
|
3438
|
-
// {
|
3439
|
-
// tokens?: Array<
|
3440
|
-
// {
|
3441
|
-
// onChainId: string
|
3442
|
-
// } & BalancesConfigTokenParams
|
3443
|
-
// >
|
3444
|
-
// }
|
3445
|
-
|
3446
3375
|
const SubForeignAssetsModule = hydrate => {
|
3447
3376
|
const {
|
3448
3377
|
chainConnectors,
|
@@ -3501,7 +3430,6 @@ const SubForeignAssetsModule = hydrate => {
|
|
3501
3430
|
id,
|
3502
3431
|
type: "substrate-foreignassets",
|
3503
3432
|
platform: "polkadot",
|
3504
|
-
// isTestnet,
|
3505
3433
|
isDefault: tokenConfig?.isDefault ?? true,
|
3506
3434
|
symbol,
|
3507
3435
|
decimals,
|
@@ -5176,11 +5104,6 @@ const SubNativeModule = hydrate => {
|
|
5176
5104
|
existentialDeposit: existentialDeposit ?? "0",
|
5177
5105
|
networkId: chainId
|
5178
5106
|
};
|
5179
|
-
|
5180
|
-
// if (moduleConfig?.symbol) nativeToken.symbol = moduleConfig?.symbol
|
5181
|
-
// if (moduleConfig?.coingeckoId) nativeToken.coingeckoId = moduleConfig?.coingeckoId
|
5182
|
-
// if (moduleConfig?.mirrorOf) nativeToken.mirrorOf = moduleConfig?.mirrorOf
|
5183
|
-
|
5184
5107
|
return {
|
5185
5108
|
[nativeToken.id]: nativeToken
|
5186
5109
|
};
|
@@ -6438,18 +6361,6 @@ const SubPsp22TokenConfigSchema = z.strictObject({
|
|
6438
6361
|
contractAddress: SubPsp22TokenSchema.shape.contractAddress,
|
6439
6362
|
...TokenConfigBaseSchema.shape
|
6440
6363
|
});
|
6441
|
-
|
6442
|
-
// {
|
6443
|
-
// tokens?: Array<
|
6444
|
-
// {
|
6445
|
-
// symbol?: string
|
6446
|
-
// decimals?: number
|
6447
|
-
// ed?: string
|
6448
|
-
// contractAddress: string
|
6449
|
-
// } & BalancesConfigTokenParams
|
6450
|
-
// >
|
6451
|
-
// }
|
6452
|
-
|
6453
6364
|
const SubPsp22Module = hydrate => {
|
6454
6365
|
const {
|
6455
6366
|
chainConnectors,
|
@@ -6468,8 +6379,6 @@ const SubPsp22Module = hydrate => {
|
|
6468
6379
|
},
|
6469
6380
|
async fetchSubstrateChainTokens(chainId, _chainMeta, moduleConfig, tokens) {
|
6470
6381
|
if (!tokens?.length) return {};
|
6471
|
-
// const { isTestnet } = chainMeta
|
6472
|
-
|
6473
6382
|
const registry = new TypeRegistry();
|
6474
6383
|
const Psp22Abi = new Abi(psp22Abi);
|
6475
6384
|
|
@@ -6484,7 +6393,6 @@ const SubPsp22Module = hydrate => {
|
|
6484
6393
|
try {
|
6485
6394
|
let symbol = tokenConfig?.symbol ?? "Unit";
|
6486
6395
|
let decimals = tokenConfig?.decimals ?? 0;
|
6487
|
-
// const existentialDeposit = tokenConfig?.existentialDeposit ?? "0"
|
6488
6396
|
const contractAddress = tokenConfig?.contractAddress ?? undefined;
|
6489
6397
|
if (contractAddress === undefined) continue;
|
6490
6398
|
await (async () => {
|
@@ -6505,13 +6413,11 @@ const SubPsp22Module = hydrate => {
|
|
6505
6413
|
id,
|
6506
6414
|
type: "substrate-psp22",
|
6507
6415
|
platform: "polkadot",
|
6508
|
-
// isTestnet,
|
6509
6416
|
isDefault: tokenConfig.isDefault ?? true,
|
6510
6417
|
symbol,
|
6511
6418
|
decimals,
|
6512
6419
|
name: tokenConfig?.name || symbol,
|
6513
6420
|
logo: tokenConfig?.logo,
|
6514
|
-
// existentialDeposit: "0",
|
6515
6421
|
contractAddress,
|
6516
6422
|
networkId: chainId
|
6517
6423
|
};
|
@@ -6708,19 +6614,6 @@ const UNSUPPORTED_CHAIN_META = {
|
|
6708
6614
|
miniMetadata: null,
|
6709
6615
|
extra: {}
|
6710
6616
|
};
|
6711
|
-
|
6712
|
-
// {
|
6713
|
-
// palletId?: string // TODO unlikely it will ever be used - remove this ?
|
6714
|
-
// tokens?: Array<
|
6715
|
-
// {
|
6716
|
-
// symbol?: string
|
6717
|
-
// decimals?: number
|
6718
|
-
// ed?: string
|
6719
|
-
// onChainId?: string | number
|
6720
|
-
// } & BalancesConfigTokenParams
|
6721
|
-
// >
|
6722
|
-
// }
|
6723
|
-
|
6724
6617
|
const SubTokensModule = hydrate => {
|
6725
6618
|
const {
|
6726
6619
|
chainConnectors,
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@talismn/balances",
|
3
|
-
"version": "0.0.0-pr2043-
|
3
|
+
"version": "0.0.0-pr2043-20250622030228",
|
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-
|
39
|
-
"@talismn/chain-connector-evm": "0.0.0-pr2043-
|
40
|
-
"@talismn/chaindata-provider": "0.0.0-pr2043-
|
41
|
-
"@talismn/sapi": "0.0.0-pr2043-
|
38
|
+
"@talismn/chain-connector": "0.0.0-pr2043-20250622030228",
|
39
|
+
"@talismn/chain-connector-evm": "0.0.0-pr2043-20250622030228",
|
40
|
+
"@talismn/chaindata-provider": "0.0.0-pr2043-20250622030228",
|
41
|
+
"@talismn/sapi": "0.0.0-pr2043-20250622030228",
|
42
42
|
"@talismn/scale": "0.1.2",
|
43
|
-
"@talismn/
|
44
|
-
"@talismn/
|
43
|
+
"@talismn/util": "0.0.0-pr2043-20250622030228",
|
44
|
+
"@talismn/token-rates": "0.0.0-pr2043-20250622030228"
|
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/
|
60
|
-
"@talismn/
|
59
|
+
"@talismn/eslint-config": "0.0.3",
|
60
|
+
"@talismn/tsconfig": "0.0.2"
|
61
61
|
},
|
62
62
|
"peerDependencies": {
|
63
63
|
"@polkadot/api-contract": "*",
|