@talismn/balances 0.7.2 → 0.8.0

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.
@@ -2,6 +2,7 @@ export declare const SUBTENSOR_ROOT_NETUID = 0;
2
2
  export declare const SUBTENSOR_MIN_STAKE_AMOUNT_PLANK = 1000000n;
3
3
  export declare const SCALE_FACTOR: bigint;
4
4
  export declare const ONE_ALPHA_TOKEN: bigint;
5
+ export declare const BITTENSOR_TESTNET_CHAIN_ID = "bittensor-testnet";
5
6
  export declare const EncodeParams_GetStakeInfoForColdkey: (address: string) => string;
6
7
  export declare const DecodeResult_GetStakeInfoForColdkey: (result: string) => {
7
8
  hotkey: import("polkadot-api").SS58String;
@@ -109,7 +109,7 @@ class EvmTokenFetcher {
109
109
 
110
110
  var packageJson = {
111
111
  name: "@talismn/balances",
112
- version: "0.7.2",
112
+ version: "0.8.0",
113
113
  author: "Talisman",
114
114
  homepage: "https://talisman.xyz",
115
115
  license: "GPL-3.0-or-later",
@@ -980,8 +980,7 @@ const getValueId = amount => {
980
980
  hotkey,
981
981
  netuid
982
982
  } = meta;
983
- if (hotkey && netuid) return `${hotkey.toString()}${netuid.toString()}`;
984
- return "";
983
+ if (hotkey && netuid !== undefined) return `${hotkey.toString()}${netuid.toString()}`;
985
984
  }
986
985
  return "";
987
986
  };
@@ -4691,6 +4690,7 @@ const SUBTENSOR_MIN_STAKE_AMOUNT_PLANK = 1000000n;
4691
4690
  const TAO_DECIMALS = 9n;
4692
4691
  const SCALE_FACTOR = 10n ** TAO_DECIMALS; // Equivalent to 10e9 for precision
4693
4692
  const ONE_ALPHA_TOKEN = SCALE_FACTOR;
4693
+ const BITTENSOR_TESTNET_CHAIN_ID = "bittensor-testnet";
4694
4694
  const BittensorAccountPrefix = 42;
4695
4695
  const BittensorAccountId = polkadotApi.AccountId(BittensorAccountPrefix);
4696
4696
 
@@ -4902,6 +4902,7 @@ async function subscribeSubtensorStaking(chaindataProvider, chainConnector, addr
4902
4902
  // mergeMap lets us run N concurrent queries, where N is the value of `concurrency`
4903
4903
  rxjs.mergeMap(async address => {
4904
4904
  const queryMethods = [async () => {
4905
+ if (chainId === BITTENSOR_TESTNET_CHAIN_ID) return [];
4905
4906
  const method = "StakeInfoRuntimeApi_get_stake_info_for_coldkey";
4906
4907
  const params = EncodeParams_GetStakeInfoForColdkey(address);
4907
4908
  const response = await chainConnector.send(chainId, "state_call", [method, params], undefined, {
@@ -109,7 +109,7 @@ class EvmTokenFetcher {
109
109
 
110
110
  var packageJson = {
111
111
  name: "@talismn/balances",
112
- version: "0.7.2",
112
+ version: "0.8.0",
113
113
  author: "Talisman",
114
114
  homepage: "https://talisman.xyz",
115
115
  license: "GPL-3.0-or-later",
@@ -980,8 +980,7 @@ const getValueId = amount => {
980
980
  hotkey,
981
981
  netuid
982
982
  } = meta;
983
- if (hotkey && netuid) return `${hotkey.toString()}${netuid.toString()}`;
984
- return "";
983
+ if (hotkey && netuid !== undefined) return `${hotkey.toString()}${netuid.toString()}`;
985
984
  }
986
985
  return "";
987
986
  };
@@ -4691,6 +4690,7 @@ const SUBTENSOR_MIN_STAKE_AMOUNT_PLANK = 1000000n;
4691
4690
  const TAO_DECIMALS = 9n;
4692
4691
  const SCALE_FACTOR = 10n ** TAO_DECIMALS; // Equivalent to 10e9 for precision
4693
4692
  const ONE_ALPHA_TOKEN = SCALE_FACTOR;
4693
+ const BITTENSOR_TESTNET_CHAIN_ID = "bittensor-testnet";
4694
4694
  const BittensorAccountPrefix = 42;
4695
4695
  const BittensorAccountId = polkadotApi.AccountId(BittensorAccountPrefix);
4696
4696
 
@@ -4902,6 +4902,7 @@ async function subscribeSubtensorStaking(chaindataProvider, chainConnector, addr
4902
4902
  // mergeMap lets us run N concurrent queries, where N is the value of `concurrency`
4903
4903
  rxjs.mergeMap(async address => {
4904
4904
  const queryMethods = [async () => {
4905
+ if (chainId === BITTENSOR_TESTNET_CHAIN_ID) return [];
4905
4906
  const method = "StakeInfoRuntimeApi_get_stake_info_for_coldkey";
4906
4907
  const params = EncodeParams_GetStakeInfoForColdkey(address);
4907
4908
  const response = await chainConnector.send(chainId, "state_call", [method, params], undefined, {
@@ -96,7 +96,7 @@ class EvmTokenFetcher {
96
96
 
97
97
  var packageJson = {
98
98
  name: "@talismn/balances",
99
- version: "0.7.2",
99
+ version: "0.8.0",
100
100
  author: "Talisman",
101
101
  homepage: "https://talisman.xyz",
102
102
  license: "GPL-3.0-or-later",
@@ -967,8 +967,7 @@ const getValueId = amount => {
967
967
  hotkey,
968
968
  netuid
969
969
  } = meta;
970
- if (hotkey && netuid) return `${hotkey.toString()}${netuid.toString()}`;
971
- return "";
970
+ if (hotkey && netuid !== undefined) return `${hotkey.toString()}${netuid.toString()}`;
972
971
  }
973
972
  return "";
974
973
  };
@@ -4678,6 +4677,7 @@ const SUBTENSOR_MIN_STAKE_AMOUNT_PLANK = 1000000n;
4678
4677
  const TAO_DECIMALS = 9n;
4679
4678
  const SCALE_FACTOR = 10n ** TAO_DECIMALS; // Equivalent to 10e9 for precision
4680
4679
  const ONE_ALPHA_TOKEN = SCALE_FACTOR;
4680
+ const BITTENSOR_TESTNET_CHAIN_ID = "bittensor-testnet";
4681
4681
  const BittensorAccountPrefix = 42;
4682
4682
  const BittensorAccountId = AccountId(BittensorAccountPrefix);
4683
4683
 
@@ -4889,6 +4889,7 @@ async function subscribeSubtensorStaking(chaindataProvider, chainConnector, addr
4889
4889
  // mergeMap lets us run N concurrent queries, where N is the value of `concurrency`
4890
4890
  mergeMap(async address => {
4891
4891
  const queryMethods = [async () => {
4892
+ if (chainId === BITTENSOR_TESTNET_CHAIN_ID) return [];
4892
4893
  const method = "StakeInfoRuntimeApi_get_stake_info_for_coldkey";
4893
4894
  const params = EncodeParams_GetStakeInfoForColdkey(address);
4894
4895
  const response = await chainConnector.send(chainId, "state_call", [method, params], undefined, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@talismn/balances",
3
- "version": "0.7.2",
3
+ "version": "0.8.0",
4
4
  "author": "Talisman",
5
5
  "homepage": "https://talisman.xyz",
6
6
  "license": "GPL-3.0-or-later",
@@ -34,9 +34,9 @@
34
34
  "scale-ts": "^1.6.1",
35
35
  "viem": "^2.21.34",
36
36
  "@talismn/chain-connector": "0.8.2",
37
- "@talismn/chain-connector-evm": "0.8.2",
38
37
  "@talismn/chaindata-provider": "0.8.2",
39
38
  "@talismn/token-rates": "1.0.2",
39
+ "@talismn/chain-connector-evm": "0.8.2",
40
40
  "@talismn/scale": "0.1.0",
41
41
  "@talismn/util": "0.3.1"
42
42
  },
@@ -53,8 +53,8 @@
53
53
  "jest": "^29.7.0",
54
54
  "ts-jest": "^29.2.5",
55
55
  "typescript": "^5.6.3",
56
- "@talismn/eslint-config": "0.0.3",
57
- "@talismn/tsconfig": "0.0.2"
56
+ "@talismn/tsconfig": "0.0.2",
57
+ "@talismn/eslint-config": "0.0.3"
58
58
  },
59
59
  "peerDependencies": {
60
60
  "@polkadot/api-contract": "*",