@magmaprotocol/magma-clmm-sdk 0.5.59 → 0.5.61
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 +1 -1
- package/dist/index.js +10 -12
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +11 -13
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -10506,7 +10506,7 @@ var GaugeModule = class {
|
|
|
10506
10506
|
|
|
10507
10507
|
// src/modules/dlmm.ts
|
|
10508
10508
|
import { Transaction as Transaction12 } from "@mysten/sui/transactions";
|
|
10509
|
-
import { get_real_id_from_price_x128 as get_real_id_from_price_x1282, get_storage_id_from_real_id } from "@magmaprotocol/calc_dlmm";
|
|
10509
|
+
import { get_real_id, get_real_id_from_price_x128 as get_real_id_from_price_x1282, get_storage_id_from_real_id } from "@magmaprotocol/calc_dlmm";
|
|
10510
10510
|
import Decimal10 from "decimal.js";
|
|
10511
10511
|
var DlmmModule = class {
|
|
10512
10512
|
_sdk;
|
|
@@ -10910,7 +10910,6 @@ var DlmmModule = class {
|
|
|
10910
10910
|
filter: { Package: this._sdk.sdkOptions.dlmm_pool.package_id }
|
|
10911
10911
|
});
|
|
10912
10912
|
const hasAssignPoolIds = assignPoolIds.length > 0;
|
|
10913
|
-
const pools = [];
|
|
10914
10913
|
for (const item of ownerRes.data) {
|
|
10915
10914
|
const type = extractStructTagFromType(item.data.type);
|
|
10916
10915
|
if (type.full_address === this.buildPositionType()) {
|
|
@@ -10926,21 +10925,20 @@ var DlmmModule = class {
|
|
|
10926
10925
|
}
|
|
10927
10926
|
}
|
|
10928
10927
|
}
|
|
10929
|
-
const pool_coins = await this.getPoolCoins(pools);
|
|
10930
|
-
const _params = [];
|
|
10931
|
-
for (const [key, value] of pool_coins.entries()) {
|
|
10932
|
-
_params.push({
|
|
10933
|
-
pool_id: key,
|
|
10934
|
-
coin_a: value[0],
|
|
10935
|
-
coin_b: value[1]
|
|
10936
|
-
});
|
|
10937
|
-
}
|
|
10938
10928
|
const poolMap = /* @__PURE__ */ new Set();
|
|
10939
10929
|
for (const item of allPosition) {
|
|
10940
10930
|
poolMap.add(item.pool);
|
|
10941
10931
|
}
|
|
10942
10932
|
const poolList = await this.getPoolInfo(Array.from(poolMap));
|
|
10943
10933
|
this.updateCache(`${DlmmScript}_positionList_poolList`, poolList, cacheTime24h);
|
|
10934
|
+
const _params = [];
|
|
10935
|
+
for (const pool of poolList) {
|
|
10936
|
+
_params.push({
|
|
10937
|
+
pool_id: pool.pool_id,
|
|
10938
|
+
coin_a: pool.coin_a,
|
|
10939
|
+
coin_b: pool.coin_b
|
|
10940
|
+
});
|
|
10941
|
+
}
|
|
10944
10942
|
const pool_reward_coins = await this.getPairRewarders(_params);
|
|
10945
10943
|
const out = [];
|
|
10946
10944
|
for (const item of allPosition) {
|
|
@@ -11031,7 +11029,7 @@ var DlmmModule = class {
|
|
|
11031
11029
|
liquidity: 0,
|
|
11032
11030
|
x_equivalent: 0,
|
|
11033
11031
|
y_equivalent: 0,
|
|
11034
|
-
|
|
11032
|
+
bin_real_ids: [],
|
|
11035
11033
|
bin_x_eq: [],
|
|
11036
11034
|
bin_y_eq: [],
|
|
11037
11035
|
bin_liquidity: []
|
|
@@ -11042,7 +11040,7 @@ var DlmmModule = class {
|
|
|
11042
11040
|
out.liquidity = item.parsedJson.liquidity;
|
|
11043
11041
|
out.x_equivalent = item.parsedJson.x_equivalent;
|
|
11044
11042
|
out.y_equivalent = item.parsedJson.y_equivalent;
|
|
11045
|
-
out.
|
|
11043
|
+
out.bin_real_ids = item.parsedJson.bin_ids.map((id) => get_real_id(id));
|
|
11046
11044
|
out.bin_x_eq = item.parsedJson.bin_x_eq;
|
|
11047
11045
|
out.bin_y_eq = item.parsedJson.bin_y_eq;
|
|
11048
11046
|
out.bin_liquidity = item.parsedJson.bin_liquidity;
|