@talismn/balances 0.0.0-pr2249-20251220031245 → 0.0.0-pr2249-20251222072741
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.
|
@@ -2311,16 +2311,11 @@ const calculatePendingRootClaimable = ({
|
|
|
2311
2311
|
const dynamicInfo = dynamicInfoByNetuid[netuid];
|
|
2312
2312
|
const scaledAlphaPrice = dynamicInfo ? getScaledAlphaPrice(dynamicInfo.alpha_in, dynamicInfo.tao_in) : 0n;
|
|
2313
2313
|
// Calculate claimable = claimable_rate * root_stake
|
|
2314
|
-
// Note:
|
|
2315
|
-
// We'll need to handle the fixed-point multiplication correctly
|
|
2316
|
-
// For now, we'll do a simple multiplication and assume I96F32 is represented
|
|
2317
|
-
// as a bigint with appropriate scaling
|
|
2314
|
+
// Note: claimableRate is a I96F32, a fixed-point number format
|
|
2318
2315
|
|
|
2319
2316
|
// Multiply claimable_rate by root_stake
|
|
2320
|
-
// I96F32 multiplication: (a * b) / 2^32
|
|
2321
|
-
|
|
2322
|
-
// This might need adjustment based on actual I96F32 implementation
|
|
2323
|
-
const pendingRootClaim = stake * claimableRate / 2n ** 32n;
|
|
2317
|
+
// I96F32 multiplication: round((a * b) / 2^32)
|
|
2318
|
+
const pendingRootClaim = stake * claimableRate + (1n << 31n) >> 32n;
|
|
2324
2319
|
pendingRootClaimBalances.push({
|
|
2325
2320
|
address,
|
|
2326
2321
|
tokenId: chaindataProvider.subDTaoTokenId(networkId, netuid, hotkey),
|
|
@@ -2311,16 +2311,11 @@ const calculatePendingRootClaimable = ({
|
|
|
2311
2311
|
const dynamicInfo = dynamicInfoByNetuid[netuid];
|
|
2312
2312
|
const scaledAlphaPrice = dynamicInfo ? getScaledAlphaPrice(dynamicInfo.alpha_in, dynamicInfo.tao_in) : 0n;
|
|
2313
2313
|
// Calculate claimable = claimable_rate * root_stake
|
|
2314
|
-
// Note:
|
|
2315
|
-
// We'll need to handle the fixed-point multiplication correctly
|
|
2316
|
-
// For now, we'll do a simple multiplication and assume I96F32 is represented
|
|
2317
|
-
// as a bigint with appropriate scaling
|
|
2314
|
+
// Note: claimableRate is a I96F32, a fixed-point number format
|
|
2318
2315
|
|
|
2319
2316
|
// Multiply claimable_rate by root_stake
|
|
2320
|
-
// I96F32 multiplication: (a * b) / 2^32
|
|
2321
|
-
|
|
2322
|
-
// This might need adjustment based on actual I96F32 implementation
|
|
2323
|
-
const pendingRootClaim = stake * claimableRate / 2n ** 32n;
|
|
2317
|
+
// I96F32 multiplication: round((a * b) / 2^32)
|
|
2318
|
+
const pendingRootClaim = stake * claimableRate + (1n << 31n) >> 32n;
|
|
2324
2319
|
pendingRootClaimBalances.push({
|
|
2325
2320
|
address,
|
|
2326
2321
|
tokenId: chaindataProvider.subDTaoTokenId(networkId, netuid, hotkey),
|
|
@@ -2302,16 +2302,11 @@ const calculatePendingRootClaimable = ({
|
|
|
2302
2302
|
const dynamicInfo = dynamicInfoByNetuid[netuid];
|
|
2303
2303
|
const scaledAlphaPrice = dynamicInfo ? getScaledAlphaPrice(dynamicInfo.alpha_in, dynamicInfo.tao_in) : 0n;
|
|
2304
2304
|
// Calculate claimable = claimable_rate * root_stake
|
|
2305
|
-
// Note:
|
|
2306
|
-
// We'll need to handle the fixed-point multiplication correctly
|
|
2307
|
-
// For now, we'll do a simple multiplication and assume I96F32 is represented
|
|
2308
|
-
// as a bigint with appropriate scaling
|
|
2305
|
+
// Note: claimableRate is a I96F32, a fixed-point number format
|
|
2309
2306
|
|
|
2310
2307
|
// Multiply claimable_rate by root_stake
|
|
2311
|
-
// I96F32 multiplication: (a * b) / 2^32
|
|
2312
|
-
|
|
2313
|
-
// This might need adjustment based on actual I96F32 implementation
|
|
2314
|
-
const pendingRootClaim = stake * claimableRate / 2n ** 32n;
|
|
2308
|
+
// I96F32 multiplication: round((a * b) / 2^32)
|
|
2309
|
+
const pendingRootClaim = stake * claimableRate + (1n << 31n) >> 32n;
|
|
2315
2310
|
pendingRootClaimBalances.push({
|
|
2316
2311
|
address,
|
|
2317
2312
|
tokenId: subDTaoTokenId(networkId, netuid, hotkey),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@talismn/balances",
|
|
3
|
-
"version": "0.0.0-pr2249-
|
|
3
|
+
"version": "0.0.0-pr2249-20251222072741",
|
|
4
4
|
"author": "Talisman",
|
|
5
5
|
"homepage": "https://talisman.xyz",
|
|
6
6
|
"license": "GPL-3.0-or-later",
|
|
@@ -38,14 +38,14 @@
|
|
|
38
38
|
"scale-ts": "^1.6.1",
|
|
39
39
|
"viem": "^2.27.3",
|
|
40
40
|
"zod": "^3.25.76",
|
|
41
|
+
"@talismn/chain-connectors": "0.0.0-pr2249-20251222072741",
|
|
42
|
+
"@talismn/crypto": "0.3.0",
|
|
41
43
|
"@talismn/sapi": "0.1.0",
|
|
42
44
|
"@talismn/scale": "0.3.0",
|
|
43
|
-
"@talismn/chain-connectors": "0.0.0-pr2249-20251220031245",
|
|
44
45
|
"@talismn/solana": "0.0.5",
|
|
45
|
-
"@talismn/
|
|
46
|
-
"@talismn/token-rates": "0.0.0-pr2249-
|
|
47
|
-
"@talismn/
|
|
48
|
-
"@talismn/crypto": "0.3.0"
|
|
46
|
+
"@talismn/chaindata-provider": "0.0.0-pr2249-20251222072741",
|
|
47
|
+
"@talismn/token-rates": "0.0.0-pr2249-20251222072741",
|
|
48
|
+
"@talismn/util": "0.5.6"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@polkadot/api-contract": "16.1.2",
|