@magmaprotocol/magma-clmm-sdk 0.5.27 → 0.5.28

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
@@ -2968,8 +2968,8 @@ var _TransactionUtil = class {
2968
2968
  const tx = new Transaction();
2969
2969
  tx.setGasBudget(1e8);
2970
2970
  tx.setSender(sdk.senderAddress);
2971
- const oneDay = 24 * 60 * 60 * 1e3;
2972
- const newLockDuration = Math.ceil((params.newLockEndAt - Date.now()) / oneDay);
2971
+ const oneDay = 24 * 60 * 60;
2972
+ const newLockDuration = Math.ceil((params.newLockEndAt - Date.now() / 1e3) / oneDay);
2973
2973
  const { integrate } = sdk.sdkOptions;
2974
2974
  const { voting_escrow_id, magma_token } = getPackagerConfigs(sdk.sdkOptions.magma_config);
2975
2975
  const typeArguments = [magma_token];
@@ -7295,6 +7295,37 @@ var LockModule = class {
7295
7295
  });
7296
7296
  return tx;
7297
7297
  }
7298
+ async fastLocksOfUser(user) {
7299
+ const locksInfo = { owner: user, lockInfo: [] };
7300
+ const { distribution } = this._sdk.sdkOptions;
7301
+ const { magma_token } = getPackagerConfigs(this.sdk.sdkOptions.magma_config);
7302
+ const ownerRes = await this._sdk.fullClient.getOwnedObjectsByPage(user, {
7303
+ options: { showType: true, showContent: true, showDisplay: true, showOwner: true },
7304
+ filter: {
7305
+ MatchAll: [{ Package: distribution.package_id }, { StructType: `${distribution.package_id}::voting_escrow::Lock` }]
7306
+ }
7307
+ });
7308
+ for (const item of ownerRes.data) {
7309
+ const { fields } = item.data.content;
7310
+ const aLockSummary = await this.aLockSummary(fields.id.id);
7311
+ const lockInfo = {
7312
+ lock_id: fields.id.id,
7313
+ amount: fields.amount,
7314
+ start: fields.start,
7315
+ end: fields.end,
7316
+ permanent: fields.permanent,
7317
+ rebase_amount: {
7318
+ kind: "rebaseCoin" /* RebaseCoin */,
7319
+ token_addr: magma_token,
7320
+ amount: aLockSummary.reward_distributor_claimable
7321
+ },
7322
+ voting_power: aLockSummary.voting_power,
7323
+ voting_rewards: /* @__PURE__ */ new Map()
7324
+ };
7325
+ locksInfo.lockInfo.push(lockInfo);
7326
+ }
7327
+ return locksInfo;
7328
+ }
7298
7329
  async locksOfUser(user) {
7299
7330
  const locksInfo = { owner: user, lockInfo: [] };
7300
7331
  const { distribution } = this._sdk.sdkOptions;
@@ -9164,7 +9195,7 @@ var RpcModule = class extends SuiClient {
9164
9195
  }
9165
9196
  };
9166
9197
 
9167
- // src/modules/gauge.ts
9198
+ // src/modules/gaugeModule.ts
9168
9199
  import { Transaction as Transaction11 } from "@mysten/sui/transactions";
9169
9200
  var GaugeModule = class {
9170
9201
  _sdk;