@magmaprotocol/magma-clmm-sdk 0.5.26 → 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.d.ts +1 -0
- package/dist/index.js +33 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +33 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -3098,6 +3098,7 @@ declare class LockModule implements IModule {
|
|
|
3098
3098
|
addBribeReward(params: AddBribeReward): Promise<Transaction>;
|
|
3099
3099
|
claimVotingBribe(locks: string[], incentive_tokens: string[]): Promise<Transaction>;
|
|
3100
3100
|
claimVotingFeeAndBribeForPool(lockId: string, poolId: string, feeTokens: string[], incentiveTokens: string[]): Promise<Transaction>;
|
|
3101
|
+
fastLocksOfUser(user: string): Promise<LocksInfo>;
|
|
3101
3102
|
locksOfUser(user: string): Promise<LocksInfo>;
|
|
3102
3103
|
aLockInfo(lockId: string): Promise<LockInfo>;
|
|
3103
3104
|
aLockSummary(lock_id: string): Promise<ALockSummary>;
|
package/dist/index.js
CHANGED
|
@@ -3174,7 +3174,7 @@ var _TransactionUtil = class {
|
|
|
3174
3174
|
tx.setGasBudget(1e8);
|
|
3175
3175
|
tx.setSender(sdk.senderAddress);
|
|
3176
3176
|
const oneDay = 24 * 60 * 60;
|
|
3177
|
-
const newLockDuration = Math.ceil((params.newLockEndAt - Date.now()) / oneDay);
|
|
3177
|
+
const newLockDuration = Math.ceil((params.newLockEndAt - Date.now() / 1e3) / oneDay);
|
|
3178
3178
|
const { integrate } = sdk.sdkOptions;
|
|
3179
3179
|
const { voting_escrow_id, magma_token } = getPackagerConfigs(sdk.sdkOptions.magma_config);
|
|
3180
3180
|
const typeArguments = [magma_token];
|
|
@@ -7500,6 +7500,37 @@ var LockModule = class {
|
|
|
7500
7500
|
});
|
|
7501
7501
|
return tx;
|
|
7502
7502
|
}
|
|
7503
|
+
async fastLocksOfUser(user) {
|
|
7504
|
+
const locksInfo = { owner: user, lockInfo: [] };
|
|
7505
|
+
const { distribution } = this._sdk.sdkOptions;
|
|
7506
|
+
const { magma_token } = getPackagerConfigs(this.sdk.sdkOptions.magma_config);
|
|
7507
|
+
const ownerRes = await this._sdk.fullClient.getOwnedObjectsByPage(user, {
|
|
7508
|
+
options: { showType: true, showContent: true, showDisplay: true, showOwner: true },
|
|
7509
|
+
filter: {
|
|
7510
|
+
MatchAll: [{ Package: distribution.package_id }, { StructType: `${distribution.package_id}::voting_escrow::Lock` }]
|
|
7511
|
+
}
|
|
7512
|
+
});
|
|
7513
|
+
for (const item of ownerRes.data) {
|
|
7514
|
+
const { fields } = item.data.content;
|
|
7515
|
+
const aLockSummary = await this.aLockSummary(fields.id.id);
|
|
7516
|
+
const lockInfo = {
|
|
7517
|
+
lock_id: fields.id.id,
|
|
7518
|
+
amount: fields.amount,
|
|
7519
|
+
start: fields.start,
|
|
7520
|
+
end: fields.end,
|
|
7521
|
+
permanent: fields.permanent,
|
|
7522
|
+
rebase_amount: {
|
|
7523
|
+
kind: "rebaseCoin" /* RebaseCoin */,
|
|
7524
|
+
token_addr: magma_token,
|
|
7525
|
+
amount: aLockSummary.reward_distributor_claimable
|
|
7526
|
+
},
|
|
7527
|
+
voting_power: aLockSummary.voting_power,
|
|
7528
|
+
voting_rewards: /* @__PURE__ */ new Map()
|
|
7529
|
+
};
|
|
7530
|
+
locksInfo.lockInfo.push(lockInfo);
|
|
7531
|
+
}
|
|
7532
|
+
return locksInfo;
|
|
7533
|
+
}
|
|
7503
7534
|
async locksOfUser(user) {
|
|
7504
7535
|
const locksInfo = { owner: user, lockInfo: [] };
|
|
7505
7536
|
const { distribution } = this._sdk.sdkOptions;
|
|
@@ -9367,7 +9398,7 @@ var RpcModule = class extends import_client.SuiClient {
|
|
|
9367
9398
|
}
|
|
9368
9399
|
};
|
|
9369
9400
|
|
|
9370
|
-
// src/modules/
|
|
9401
|
+
// src/modules/gaugeModule.ts
|
|
9371
9402
|
var import_transactions11 = require("@mysten/sui/transactions");
|
|
9372
9403
|
var GaugeModule = class {
|
|
9373
9404
|
_sdk;
|