@broxus/js-core
Advanced tools
Comparing version 0.13.3 to 0.13.4
@@ -175,2 +175,5 @@ "use strict"; | ||
} | ||
get isActive() { | ||
return this._data.isActive; | ||
} | ||
get leftToken() { | ||
@@ -180,3 +183,3 @@ return this._data.tokens[0]; | ||
get lpToken() { | ||
return this._data.lpToken; | ||
return this._data.lpToken ?? {}; | ||
} | ||
@@ -187,3 +190,3 @@ get rightToken() { | ||
get tokens() { | ||
return this._data.tokens; | ||
return this._data.tokens ?? []; | ||
} | ||
@@ -240,2 +243,7 @@ get type() { | ||
__metadata("design:paramtypes", []) | ||
], DexPair.prototype, "isActive", null); | ||
__decorate([ | ||
mobx_1.computed, | ||
__metadata("design:type", Object), | ||
__metadata("design:paramtypes", []) | ||
], DexPair.prototype, "leftToken", null); | ||
@@ -242,0 +250,0 @@ __decorate([ |
@@ -10,3 +10,3 @@ "use strict"; | ||
const state = cachedState ?? (await (0, utils_1.getFullContractState)(connection, pairAddress)); | ||
const [balances, feeParams, roots, wallets, type] = await Promise.all([ | ||
const [balances, feeParams, roots, wallets, type, isActive] = await Promise.all([ | ||
DexPairUtils.getBalances(connection, pairAddress, state), | ||
@@ -17,2 +17,3 @@ DexPairUtils.getFeeParams(connection, pairAddress, state), | ||
DexPairUtils.getPoolType(connection, pairAddress, state), | ||
DexPairUtils.isActive(connection, pairAddress, state), | ||
]); | ||
@@ -36,2 +37,3 @@ const [lpTokenState, leftTokenState, rightTokenState] = await Promise.allSettled([ | ||
feeParams, | ||
isActive, | ||
lpToken: { | ||
@@ -69,3 +71,3 @@ address: roots.lp, | ||
.methods.getBalances({ answerId: 0 }) | ||
.call({ cachedState }); | ||
.call({ cachedState, responsible: true }); | ||
return ({ | ||
@@ -79,3 +81,3 @@ lpSupply: result.value0.lp_supply.toString(), | ||
.methods.getFeeParams({ answerId: 0 }) | ||
.call({ cachedState }); | ||
.call({ cachedState, responsible: true }); | ||
return ({ | ||
@@ -92,10 +94,14 @@ beneficiaryAddress: value0.beneficiary, | ||
.methods.isActive({ answerId: 0 }) | ||
.call({ cachedState }); | ||
.call({ cachedState, responsible: true }); | ||
return result.value0; | ||
} | ||
static getTokenRoots(connection, pairAddress, cachedState) { | ||
return (0, contracts_1.dexPairContract)(connection, pairAddress).methods.getTokenRoots({ answerId: 0 }).call({ cachedState }); | ||
return (0, contracts_1.dexPairContract)(connection, pairAddress) | ||
.methods.getTokenRoots({ answerId: 0 }) | ||
.call({ cachedState, responsible: true }); | ||
} | ||
static getTokenWallets(connection, pairAddress, cachedState) { | ||
return (0, contracts_1.dexPairContract)(connection, pairAddress).methods.getTokenWallets({ answerId: 0 }).call({ cachedState }); | ||
return (0, contracts_1.dexPairContract)(connection, pairAddress) | ||
.methods.getTokenWallets({ answerId: 0 }) | ||
.call({ cachedState, responsible: true }); | ||
} | ||
@@ -105,3 +111,3 @@ static async getPoolType(connection, pairAddress, cachedState) { | ||
.methods.getPoolType({ answerId: 0 }) | ||
.call({ cachedState }); | ||
.call({ cachedState, responsible: true }); | ||
return result.value0; | ||
@@ -179,3 +185,3 @@ } | ||
}) | ||
.call({ cachedState }); | ||
.call({ cachedState, responsible: true }); | ||
return ({ | ||
@@ -182,0 +188,0 @@ expectedAmount: result.expected_amount, |
@@ -54,2 +54,3 @@ import { type Address, type ProviderRpcClient, type SendInternalParams, type Subscriber, type Transaction } from 'everscale-inpage-provider'; | ||
get feeParams(): DexPairData['feeParams']; | ||
get isActive(): DexPairData['isActive']; | ||
get leftToken(): DexPairData['tokens'][number]; | ||
@@ -56,0 +57,0 @@ get lpToken(): DexPairData['lpToken']; |
@@ -172,2 +172,5 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
} | ||
get isActive() { | ||
return this._data.isActive; | ||
} | ||
get leftToken() { | ||
@@ -177,3 +180,3 @@ return this._data.tokens[0]; | ||
get lpToken() { | ||
return this._data.lpToken; | ||
return this._data.lpToken ?? {}; | ||
} | ||
@@ -184,3 +187,3 @@ get rightToken() { | ||
get tokens() { | ||
return this._data.tokens; | ||
return this._data.tokens ?? []; | ||
} | ||
@@ -236,2 +239,7 @@ get type() { | ||
__metadata("design:paramtypes", []) | ||
], DexPair.prototype, "isActive", null); | ||
__decorate([ | ||
computed, | ||
__metadata("design:type", Object), | ||
__metadata("design:paramtypes", []) | ||
], DexPair.prototype, "leftToken", null); | ||
@@ -238,0 +246,0 @@ __decorate([ |
@@ -85,2 +85,3 @@ import { type Address, type DecodedAbiFunctionOutputs, type FullContractState, type ProviderRpcClient } from 'everscale-inpage-provider'; | ||
feeParams?: DexPairFeeParams; | ||
isActive?: boolean; | ||
lpToken: DexPairTokenDetails; | ||
@@ -87,0 +88,0 @@ tokens: [leftToken: DexPairTokenDetails, rightToken: DexPairTokenDetails]; |
@@ -7,3 +7,3 @@ import { dexPairContract } from '../../models/dex-pair/contracts'; | ||
const state = cachedState ?? (await getFullContractState(connection, pairAddress)); | ||
const [balances, feeParams, roots, wallets, type] = await Promise.all([ | ||
const [balances, feeParams, roots, wallets, type, isActive] = await Promise.all([ | ||
DexPairUtils.getBalances(connection, pairAddress, state), | ||
@@ -14,2 +14,3 @@ DexPairUtils.getFeeParams(connection, pairAddress, state), | ||
DexPairUtils.getPoolType(connection, pairAddress, state), | ||
DexPairUtils.isActive(connection, pairAddress, state), | ||
]); | ||
@@ -33,2 +34,3 @@ const [lpTokenState, leftTokenState, rightTokenState] = await Promise.allSettled([ | ||
feeParams, | ||
isActive, | ||
lpToken: { | ||
@@ -66,3 +68,3 @@ address: roots.lp, | ||
.methods.getBalances({ answerId: 0 }) | ||
.call({ cachedState }); | ||
.call({ cachedState, responsible: true }); | ||
return ({ | ||
@@ -76,3 +78,3 @@ lpSupply: result.value0.lp_supply.toString(), | ||
.methods.getFeeParams({ answerId: 0 }) | ||
.call({ cachedState }); | ||
.call({ cachedState, responsible: true }); | ||
return ({ | ||
@@ -89,10 +91,14 @@ beneficiaryAddress: value0.beneficiary, | ||
.methods.isActive({ answerId: 0 }) | ||
.call({ cachedState }); | ||
.call({ cachedState, responsible: true }); | ||
return result.value0; | ||
} | ||
static getTokenRoots(connection, pairAddress, cachedState) { | ||
return dexPairContract(connection, pairAddress).methods.getTokenRoots({ answerId: 0 }).call({ cachedState }); | ||
return dexPairContract(connection, pairAddress) | ||
.methods.getTokenRoots({ answerId: 0 }) | ||
.call({ cachedState, responsible: true }); | ||
} | ||
static getTokenWallets(connection, pairAddress, cachedState) { | ||
return dexPairContract(connection, pairAddress).methods.getTokenWallets({ answerId: 0 }).call({ cachedState }); | ||
return dexPairContract(connection, pairAddress) | ||
.methods.getTokenWallets({ answerId: 0 }) | ||
.call({ cachedState, responsible: true }); | ||
} | ||
@@ -102,3 +108,3 @@ static async getPoolType(connection, pairAddress, cachedState) { | ||
.methods.getPoolType({ answerId: 0 }) | ||
.call({ cachedState }); | ||
.call({ cachedState, responsible: true }); | ||
return result.value0; | ||
@@ -176,3 +182,3 @@ } | ||
}) | ||
.call({ cachedState }); | ||
.call({ cachedState, responsible: true }); | ||
return ({ | ||
@@ -179,0 +185,0 @@ expectedAmount: result.expected_amount, |
{ | ||
"name": "@broxus/js-core", | ||
"version": "0.13.3", | ||
"version": "0.13.4", | ||
"description": "MobX-based JavaScript Core library", | ||
@@ -63,3 +63,3 @@ "license": "MIT", | ||
}, | ||
"gitHead": "d5615f1e7419842a35649875432c71a2ea4b8e06" | ||
"gitHead": "8e1b4acd4ea6829fda48340bcfb5bb0c4f538021" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1240094
26678