@talismn/balances 0.0.0-pr2043-20250630051229 → 0.0.0-pr2043-20250703063959
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.
@@ -75,7 +75,7 @@ const DefaultBalanceModule = type => ({
|
|
75
75
|
|
76
76
|
var pkg = {
|
77
77
|
name: "@talismn/balances",
|
78
|
-
version: "0.0.0-pr2043-
|
78
|
+
version: "0.0.0-pr2043-20250703063959"};
|
79
79
|
|
80
80
|
var log = anylogger__default.default(pkg.name);
|
81
81
|
|
@@ -3011,7 +3011,7 @@ const SubAssetsTokenConfigSchema = z__default.default.strictObject({
|
|
3011
3011
|
assetId: chaindataProvider.SubAssetsTokenSchema.shape.assetId,
|
3012
3012
|
...TokenConfigBaseSchema.shape
|
3013
3013
|
});
|
3014
|
-
const UNSUPPORTED_CHAIN_META$
|
3014
|
+
const UNSUPPORTED_CHAIN_META$2 = {
|
3015
3015
|
miniMetadata: null,
|
3016
3016
|
extra: null
|
3017
3017
|
};
|
@@ -3026,7 +3026,7 @@ const SubAssetsModule = hydrate => {
|
|
3026
3026
|
...DefaultBalanceModule(moduleType$4),
|
3027
3027
|
// TODO make synchronous at the module definition level ?
|
3028
3028
|
async fetchSubstrateChainMeta(chainId, moduleConfig, metadataRpc) {
|
3029
|
-
if (!metadataRpc) return UNSUPPORTED_CHAIN_META$
|
3029
|
+
if (!metadataRpc) return UNSUPPORTED_CHAIN_META$2;
|
3030
3030
|
const metadata = scale.decAnyMetadata(metadataRpc);
|
3031
3031
|
scale.compactMetadata(metadata, [{
|
3032
3032
|
pallet: "Assets",
|
@@ -3298,7 +3298,7 @@ const tryEncode = (scaleCoder, ...args) => {
|
|
3298
3298
|
};
|
3299
3299
|
|
3300
3300
|
const moduleType$3 = "substrate-foreignassets";
|
3301
|
-
const UNSUPPORTED_CHAIN_META$
|
3301
|
+
const UNSUPPORTED_CHAIN_META$1 = {
|
3302
3302
|
miniMetadata: null,
|
3303
3303
|
extra: null
|
3304
3304
|
};
|
@@ -3316,9 +3316,9 @@ const SubForeignAssetsModule = hydrate => {
|
|
3316
3316
|
return {
|
3317
3317
|
...DefaultBalanceModule(moduleType$3),
|
3318
3318
|
async fetchSubstrateChainMeta(chainId, moduleConfig, metadataRpc) {
|
3319
|
-
if (metadataRpc === undefined) return UNSUPPORTED_CHAIN_META$
|
3319
|
+
if (metadataRpc === undefined) return UNSUPPORTED_CHAIN_META$1;
|
3320
3320
|
const metadataVersion = scale.getMetadataVersion(metadataRpc);
|
3321
|
-
if (metadataVersion < 14) return UNSUPPORTED_CHAIN_META$
|
3321
|
+
if (metadataVersion < 14) return UNSUPPORTED_CHAIN_META$1;
|
3322
3322
|
const metadata = scale.decAnyMetadata(metadataRpc);
|
3323
3323
|
scale.compactMetadata(metadata, [{
|
3324
3324
|
pallet: "ForeignAssets",
|
@@ -4727,7 +4727,7 @@ const getChainProperties = async (chainConnector, networkId) => {
|
|
4727
4727
|
|
4728
4728
|
const POLLING_WINDOW_SIZE = 20;
|
4729
4729
|
const MAX_SUBSCRIPTION_SIZE = 40;
|
4730
|
-
const
|
4730
|
+
const EMPTY_CHAIN_META = {
|
4731
4731
|
miniMetadata: null,
|
4732
4732
|
extra: null
|
4733
4733
|
};
|
@@ -4923,13 +4923,14 @@ const SubNativeModule = hydrate => {
|
|
4923
4923
|
return {
|
4924
4924
|
...DefaultBalanceModule(moduleType$2),
|
4925
4925
|
async fetchSubstrateChainMeta(chainId, moduleConfig, metadataRpc) {
|
4926
|
-
if (
|
4926
|
+
if (moduleConfig?.disable) return EMPTY_CHAIN_META;
|
4927
|
+
if (!metadataRpc) return EMPTY_CHAIN_META;
|
4927
4928
|
|
4928
4929
|
//
|
4929
4930
|
// process metadata into SCALE encoders/decoders
|
4930
4931
|
//
|
4931
4932
|
const metadataVersion = scale.getMetadataVersion(metadataRpc);
|
4932
|
-
if (metadataVersion < 14) return
|
4933
|
+
if (metadataVersion < 14) return EMPTY_CHAIN_META;
|
4933
4934
|
const metadata = scale.decAnyMetadata(metadataRpc);
|
4934
4935
|
const unifiedMetadata = scale.unifyMetadata(metadata);
|
4935
4936
|
|
@@ -4971,6 +4972,7 @@ const SubNativeModule = hydrate => {
|
|
4971
4972
|
},
|
4972
4973
|
// TotalColdkeyStake is used until v.2.2.1, then it is replaced by StakingHotkeys+Stake
|
4973
4974
|
// Need to keep TotalColdkeyStake for a while so chaindata keeps including it in miniMetadatas, so it doesnt break old versions of the wallet
|
4975
|
+
// TODO: Since chaindata v4 this is safe to now delete
|
4974
4976
|
{
|
4975
4977
|
pallet: "SubtensorModule",
|
4976
4978
|
items: ["TotalColdkeyStake", "StakingHotkeys", "Stake"]
|
@@ -6608,7 +6610,6 @@ const SubTokensModule = hydrate => {
|
|
6608
6610
|
if (controller.signal.aborted) return () => {};
|
6609
6611
|
const stateHelper = new RpcStateQueryHelper(chainConnector, queries);
|
6610
6612
|
return await stateHelper.subscribe((error, result) => {
|
6611
|
-
// console.log("SubstrateAssetsModule.callback", { error, result })
|
6612
6613
|
if (error) return callback(error);
|
6613
6614
|
const balances = result?.filter(b => b !== null) ?? [];
|
6614
6615
|
if (balances.length > 0) callback(null, new Balances(balances));
|
@@ -75,7 +75,7 @@ const DefaultBalanceModule = type => ({
|
|
75
75
|
|
76
76
|
var pkg = {
|
77
77
|
name: "@talismn/balances",
|
78
|
-
version: "0.0.0-pr2043-
|
78
|
+
version: "0.0.0-pr2043-20250703063959"};
|
79
79
|
|
80
80
|
var log = anylogger__default.default(pkg.name);
|
81
81
|
|
@@ -3011,7 +3011,7 @@ const SubAssetsTokenConfigSchema = z__default.default.strictObject({
|
|
3011
3011
|
assetId: chaindataProvider.SubAssetsTokenSchema.shape.assetId,
|
3012
3012
|
...TokenConfigBaseSchema.shape
|
3013
3013
|
});
|
3014
|
-
const UNSUPPORTED_CHAIN_META$
|
3014
|
+
const UNSUPPORTED_CHAIN_META$2 = {
|
3015
3015
|
miniMetadata: null,
|
3016
3016
|
extra: null
|
3017
3017
|
};
|
@@ -3026,7 +3026,7 @@ const SubAssetsModule = hydrate => {
|
|
3026
3026
|
...DefaultBalanceModule(moduleType$4),
|
3027
3027
|
// TODO make synchronous at the module definition level ?
|
3028
3028
|
async fetchSubstrateChainMeta(chainId, moduleConfig, metadataRpc) {
|
3029
|
-
if (!metadataRpc) return UNSUPPORTED_CHAIN_META$
|
3029
|
+
if (!metadataRpc) return UNSUPPORTED_CHAIN_META$2;
|
3030
3030
|
const metadata = scale.decAnyMetadata(metadataRpc);
|
3031
3031
|
scale.compactMetadata(metadata, [{
|
3032
3032
|
pallet: "Assets",
|
@@ -3298,7 +3298,7 @@ const tryEncode = (scaleCoder, ...args) => {
|
|
3298
3298
|
};
|
3299
3299
|
|
3300
3300
|
const moduleType$3 = "substrate-foreignassets";
|
3301
|
-
const UNSUPPORTED_CHAIN_META$
|
3301
|
+
const UNSUPPORTED_CHAIN_META$1 = {
|
3302
3302
|
miniMetadata: null,
|
3303
3303
|
extra: null
|
3304
3304
|
};
|
@@ -3316,9 +3316,9 @@ const SubForeignAssetsModule = hydrate => {
|
|
3316
3316
|
return {
|
3317
3317
|
...DefaultBalanceModule(moduleType$3),
|
3318
3318
|
async fetchSubstrateChainMeta(chainId, moduleConfig, metadataRpc) {
|
3319
|
-
if (metadataRpc === undefined) return UNSUPPORTED_CHAIN_META$
|
3319
|
+
if (metadataRpc === undefined) return UNSUPPORTED_CHAIN_META$1;
|
3320
3320
|
const metadataVersion = scale.getMetadataVersion(metadataRpc);
|
3321
|
-
if (metadataVersion < 14) return UNSUPPORTED_CHAIN_META$
|
3321
|
+
if (metadataVersion < 14) return UNSUPPORTED_CHAIN_META$1;
|
3322
3322
|
const metadata = scale.decAnyMetadata(metadataRpc);
|
3323
3323
|
scale.compactMetadata(metadata, [{
|
3324
3324
|
pallet: "ForeignAssets",
|
@@ -4727,7 +4727,7 @@ const getChainProperties = async (chainConnector, networkId) => {
|
|
4727
4727
|
|
4728
4728
|
const POLLING_WINDOW_SIZE = 20;
|
4729
4729
|
const MAX_SUBSCRIPTION_SIZE = 40;
|
4730
|
-
const
|
4730
|
+
const EMPTY_CHAIN_META = {
|
4731
4731
|
miniMetadata: null,
|
4732
4732
|
extra: null
|
4733
4733
|
};
|
@@ -4923,13 +4923,14 @@ const SubNativeModule = hydrate => {
|
|
4923
4923
|
return {
|
4924
4924
|
...DefaultBalanceModule(moduleType$2),
|
4925
4925
|
async fetchSubstrateChainMeta(chainId, moduleConfig, metadataRpc) {
|
4926
|
-
if (
|
4926
|
+
if (moduleConfig?.disable) return EMPTY_CHAIN_META;
|
4927
|
+
if (!metadataRpc) return EMPTY_CHAIN_META;
|
4927
4928
|
|
4928
4929
|
//
|
4929
4930
|
// process metadata into SCALE encoders/decoders
|
4930
4931
|
//
|
4931
4932
|
const metadataVersion = scale.getMetadataVersion(metadataRpc);
|
4932
|
-
if (metadataVersion < 14) return
|
4933
|
+
if (metadataVersion < 14) return EMPTY_CHAIN_META;
|
4933
4934
|
const metadata = scale.decAnyMetadata(metadataRpc);
|
4934
4935
|
const unifiedMetadata = scale.unifyMetadata(metadata);
|
4935
4936
|
|
@@ -4971,6 +4972,7 @@ const SubNativeModule = hydrate => {
|
|
4971
4972
|
},
|
4972
4973
|
// TotalColdkeyStake is used until v.2.2.1, then it is replaced by StakingHotkeys+Stake
|
4973
4974
|
// Need to keep TotalColdkeyStake for a while so chaindata keeps including it in miniMetadatas, so it doesnt break old versions of the wallet
|
4975
|
+
// TODO: Since chaindata v4 this is safe to now delete
|
4974
4976
|
{
|
4975
4977
|
pallet: "SubtensorModule",
|
4976
4978
|
items: ["TotalColdkeyStake", "StakingHotkeys", "Stake"]
|
@@ -6608,7 +6610,6 @@ const SubTokensModule = hydrate => {
|
|
6608
6610
|
if (controller.signal.aborted) return () => {};
|
6609
6611
|
const stateHelper = new RpcStateQueryHelper(chainConnector, queries);
|
6610
6612
|
return await stateHelper.subscribe((error, result) => {
|
6611
|
-
// console.log("SubstrateAssetsModule.callback", { error, result })
|
6612
6613
|
if (error) return callback(error);
|
6613
6614
|
const balances = result?.filter(b => b !== null) ?? [];
|
6614
6615
|
if (balances.length > 0) callback(null, new Balances(balances));
|
@@ -61,7 +61,7 @@ const DefaultBalanceModule = type => ({
|
|
61
61
|
|
62
62
|
var pkg = {
|
63
63
|
name: "@talismn/balances",
|
64
|
-
version: "0.0.0-pr2043-
|
64
|
+
version: "0.0.0-pr2043-20250703063959"};
|
65
65
|
|
66
66
|
var log = anylogger(pkg.name);
|
67
67
|
|
@@ -2997,7 +2997,7 @@ const SubAssetsTokenConfigSchema = z.strictObject({
|
|
2997
2997
|
assetId: SubAssetsTokenSchema.shape.assetId,
|
2998
2998
|
...TokenConfigBaseSchema.shape
|
2999
2999
|
});
|
3000
|
-
const UNSUPPORTED_CHAIN_META$
|
3000
|
+
const UNSUPPORTED_CHAIN_META$2 = {
|
3001
3001
|
miniMetadata: null,
|
3002
3002
|
extra: null
|
3003
3003
|
};
|
@@ -3012,7 +3012,7 @@ const SubAssetsModule = hydrate => {
|
|
3012
3012
|
...DefaultBalanceModule(moduleType$4),
|
3013
3013
|
// TODO make synchronous at the module definition level ?
|
3014
3014
|
async fetchSubstrateChainMeta(chainId, moduleConfig, metadataRpc) {
|
3015
|
-
if (!metadataRpc) return UNSUPPORTED_CHAIN_META$
|
3015
|
+
if (!metadataRpc) return UNSUPPORTED_CHAIN_META$2;
|
3016
3016
|
const metadata = decAnyMetadata(metadataRpc);
|
3017
3017
|
compactMetadata(metadata, [{
|
3018
3018
|
pallet: "Assets",
|
@@ -3284,7 +3284,7 @@ const tryEncode = (scaleCoder, ...args) => {
|
|
3284
3284
|
};
|
3285
3285
|
|
3286
3286
|
const moduleType$3 = "substrate-foreignassets";
|
3287
|
-
const UNSUPPORTED_CHAIN_META$
|
3287
|
+
const UNSUPPORTED_CHAIN_META$1 = {
|
3288
3288
|
miniMetadata: null,
|
3289
3289
|
extra: null
|
3290
3290
|
};
|
@@ -3302,9 +3302,9 @@ const SubForeignAssetsModule = hydrate => {
|
|
3302
3302
|
return {
|
3303
3303
|
...DefaultBalanceModule(moduleType$3),
|
3304
3304
|
async fetchSubstrateChainMeta(chainId, moduleConfig, metadataRpc) {
|
3305
|
-
if (metadataRpc === undefined) return UNSUPPORTED_CHAIN_META$
|
3305
|
+
if (metadataRpc === undefined) return UNSUPPORTED_CHAIN_META$1;
|
3306
3306
|
const metadataVersion = getMetadataVersion(metadataRpc);
|
3307
|
-
if (metadataVersion < 14) return UNSUPPORTED_CHAIN_META$
|
3307
|
+
if (metadataVersion < 14) return UNSUPPORTED_CHAIN_META$1;
|
3308
3308
|
const metadata = decAnyMetadata(metadataRpc);
|
3309
3309
|
compactMetadata(metadata, [{
|
3310
3310
|
pallet: "ForeignAssets",
|
@@ -4713,7 +4713,7 @@ const getChainProperties = async (chainConnector, networkId) => {
|
|
4713
4713
|
|
4714
4714
|
const POLLING_WINDOW_SIZE = 20;
|
4715
4715
|
const MAX_SUBSCRIPTION_SIZE = 40;
|
4716
|
-
const
|
4716
|
+
const EMPTY_CHAIN_META = {
|
4717
4717
|
miniMetadata: null,
|
4718
4718
|
extra: null
|
4719
4719
|
};
|
@@ -4909,13 +4909,14 @@ const SubNativeModule = hydrate => {
|
|
4909
4909
|
return {
|
4910
4910
|
...DefaultBalanceModule(moduleType$2),
|
4911
4911
|
async fetchSubstrateChainMeta(chainId, moduleConfig, metadataRpc) {
|
4912
|
-
if (
|
4912
|
+
if (moduleConfig?.disable) return EMPTY_CHAIN_META;
|
4913
|
+
if (!metadataRpc) return EMPTY_CHAIN_META;
|
4913
4914
|
|
4914
4915
|
//
|
4915
4916
|
// process metadata into SCALE encoders/decoders
|
4916
4917
|
//
|
4917
4918
|
const metadataVersion = getMetadataVersion(metadataRpc);
|
4918
|
-
if (metadataVersion < 14) return
|
4919
|
+
if (metadataVersion < 14) return EMPTY_CHAIN_META;
|
4919
4920
|
const metadata = decAnyMetadata(metadataRpc);
|
4920
4921
|
const unifiedMetadata = unifyMetadata(metadata);
|
4921
4922
|
|
@@ -4957,6 +4958,7 @@ const SubNativeModule = hydrate => {
|
|
4957
4958
|
},
|
4958
4959
|
// TotalColdkeyStake is used until v.2.2.1, then it is replaced by StakingHotkeys+Stake
|
4959
4960
|
// Need to keep TotalColdkeyStake for a while so chaindata keeps including it in miniMetadatas, so it doesnt break old versions of the wallet
|
4961
|
+
// TODO: Since chaindata v4 this is safe to now delete
|
4960
4962
|
{
|
4961
4963
|
pallet: "SubtensorModule",
|
4962
4964
|
items: ["TotalColdkeyStake", "StakingHotkeys", "Stake"]
|
@@ -6594,7 +6596,6 @@ const SubTokensModule = hydrate => {
|
|
6594
6596
|
if (controller.signal.aborted) return () => {};
|
6595
6597
|
const stateHelper = new RpcStateQueryHelper(chainConnector, queries);
|
6596
6598
|
return await stateHelper.subscribe((error, result) => {
|
6597
|
-
// console.log("SubstrateAssetsModule.callback", { error, result })
|
6598
6599
|
if (error) return callback(error);
|
6599
6600
|
const balances = result?.filter(b => b !== null) ?? [];
|
6600
6601
|
if (balances.length > 0) callback(null, new Balances(balances));
|
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-20250703063959",
|
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/
|
39
|
-
"@talismn/chain-connector": "0.0.0-pr2043-
|
40
|
-
"@talismn/
|
41
|
-
"@talismn/
|
38
|
+
"@talismn/chain-connector": "0.0.0-pr2043-20250703063959",
|
39
|
+
"@talismn/chain-connector-evm": "0.0.0-pr2043-20250703063959",
|
40
|
+
"@talismn/sapi": "0.0.6",
|
41
|
+
"@talismn/chaindata-provider": "0.0.0-pr2043-20250703063959",
|
42
42
|
"@talismn/scale": "0.1.2",
|
43
|
-
"@talismn/token-rates": "0.0.0-pr2043-
|
44
|
-
"@talismn/util": "0.0.0-pr2043-
|
43
|
+
"@talismn/token-rates": "0.0.0-pr2043-20250703063959",
|
44
|
+
"@talismn/util": "0.0.0-pr2043-20250703063959"
|
45
45
|
},
|
46
46
|
"devDependencies": {
|
47
47
|
"@polkadot/api-contract": "16.1.2",
|