@magmaprotocol/magma-clmm-sdk 0.5.35 → 0.5.37

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.mjs CHANGED
@@ -9859,6 +9859,26 @@ var DlmmModule = class {
9859
9859
  get sdk() {
9860
9860
  return this._sdk;
9861
9861
  }
9862
+ async getPoolInfo(pools) {
9863
+ const objects = await this._sdk.fullClient.batchGetObjects(pools, { showContent: true });
9864
+ const poolList = [];
9865
+ objects.forEach((obj) => {
9866
+ if (obj.error != null || obj.data?.content?.dataType !== "moveObject") {
9867
+ throw new ClmmpoolsError(`Invalid objects. error: ${obj.error}`, "InvalidType" /* InvalidType */);
9868
+ }
9869
+ const fields = getObjectFields(obj);
9870
+ poolList.push({
9871
+ pool_id: fields.id.id,
9872
+ bin_step: fields.bin_step,
9873
+ coin_a: fields.x.fields.name,
9874
+ coin_b: fields.y.fields.name,
9875
+ base_factor: fields.params.fields.base_factor,
9876
+ base_fee: fields.params.fields.base_factor / 1e4 * (fields.bin_step / 1e4),
9877
+ active_index: fields.params.fields.active_index
9878
+ });
9879
+ });
9880
+ return poolList;
9881
+ }
9862
9882
  // eg: fetch pool active_index
9863
9883
  async fetchPairParams(params) {
9864
9884
  const tx = new Transaction12();