@magmaprotocol/magma-clmm-sdk 0.5.103 → 0.5.105
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.
- package/dist/index.d.ts +2 -0
- package/dist/index.js +16 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +16 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -10423,6 +10423,7 @@ import {
|
|
|
10423
10423
|
get_storage_id_from_real_id
|
|
10424
10424
|
} from "@magmaprotocol/calc_dlmm";
|
|
10425
10425
|
import Decimal10 from "decimal.js";
|
|
10426
|
+
import BN22 from "bn.js";
|
|
10426
10427
|
var AlmmModule = class {
|
|
10427
10428
|
_sdk;
|
|
10428
10429
|
_cache = {};
|
|
@@ -10449,6 +10450,18 @@ var AlmmModule = class {
|
|
|
10449
10450
|
throw new ClmmpoolsError(`Invalid objects. error: ${obj.error}`, "InvalidType" /* InvalidType */);
|
|
10450
10451
|
}
|
|
10451
10452
|
const fields = getObjectFields(obj);
|
|
10453
|
+
const rewarders = [];
|
|
10454
|
+
fields.rewarder_manager.fields.rewarders.forEach((item) => {
|
|
10455
|
+
const { emissions_per_second } = item.fields;
|
|
10456
|
+
const emissionSeconds = MathUtil.fromX64(new BN22(emissions_per_second));
|
|
10457
|
+
const emissionsEveryDay = Math.floor(emissionSeconds.toNumber() * 60 * 60 * 24);
|
|
10458
|
+
rewarders.push({
|
|
10459
|
+
emissions_per_second,
|
|
10460
|
+
coinAddress: extractStructTagFromType(item.fields.reward_coin.fields.name).source_address,
|
|
10461
|
+
growth_global: item.fields.growth_global,
|
|
10462
|
+
emissionsEveryDay
|
|
10463
|
+
});
|
|
10464
|
+
});
|
|
10452
10465
|
const poolInfo = {
|
|
10453
10466
|
pool_id: fields.id.id,
|
|
10454
10467
|
bin_step: fields.bin_step,
|
|
@@ -10459,7 +10472,9 @@ var AlmmModule = class {
|
|
|
10459
10472
|
active_index: fields.params.fields.active_index,
|
|
10460
10473
|
real_bin_id: get_real_id(fields.params.fields.active_index),
|
|
10461
10474
|
coinAmountA: fields.reserve_x,
|
|
10462
|
-
coinAmountB: fields.reserve_y
|
|
10475
|
+
coinAmountB: fields.reserve_y,
|
|
10476
|
+
liquidity: fields.liquidity,
|
|
10477
|
+
rewarder_infos: rewarders
|
|
10463
10478
|
};
|
|
10464
10479
|
poolList.push(poolInfo);
|
|
10465
10480
|
this.updateCache(`${fields.id.id}_getPoolObject`, poolInfo, cacheTime24h);
|