@magmaprotocol/magma-clmm-sdk 0.5.29 → 0.5.31
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 +62 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +62 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -3841,6 +3841,8 @@ declare class TransactionUtil {
|
|
|
3841
3841
|
static buildIncreaseUnlockTimeTransaction(sdk: MagmaClmmSDK, params: IncreaseUnlockTimeParams): Transaction;
|
|
3842
3842
|
static buildLockPermanentTransaction(sdk: MagmaClmmSDK, params: LockPermanentParams): Transaction;
|
|
3843
3843
|
static buildUnlockPermanentTransaction(sdk: MagmaClmmSDK, params: LockPermanentParams): Transaction;
|
|
3844
|
+
static buildBurnLockTransaction(sdk: MagmaClmmSDK, lockId: string): Transaction;
|
|
3845
|
+
static buildSplitLockTransaction(sdk: MagmaClmmSDK, lockId: string, splitAmount: bigint | number | string): Transaction;
|
|
3844
3846
|
static buildVoteTransaction(sdk: MagmaClmmSDK, params: VoteParams): Transaction;
|
|
3845
3847
|
static buildClaimVotingRewardsTransaction(sdk: MagmaClmmSDK, params: ClaimFeesParams): Transaction;
|
|
3846
3848
|
static buildClaimVotingRewardsPoolsTransaction(sdk: MagmaClmmSDK, params: ClaimFeesPoolsParams): Transaction;
|
package/dist/index.js
CHANGED
|
@@ -3141,10 +3141,17 @@ var _TransactionUtil = class {
|
|
|
3141
3141
|
const tx = new import_transactions.Transaction();
|
|
3142
3142
|
tx.setSender(sdk.senderAddress);
|
|
3143
3143
|
const { integrate } = sdk.sdkOptions;
|
|
3144
|
-
const { voting_escrow_id, magma_token } = getPackagerConfigs(sdk.sdkOptions.magma_config);
|
|
3144
|
+
const { voter_id, voting_escrow_id, magma_token, distribution_cfg } = getPackagerConfigs(sdk.sdkOptions.magma_config);
|
|
3145
3145
|
const typeArguments = [magma_token];
|
|
3146
3146
|
const functionName = "merge_locks";
|
|
3147
|
-
const args = [
|
|
3147
|
+
const args = [
|
|
3148
|
+
tx.object(distribution_cfg),
|
|
3149
|
+
tx.object(voting_escrow_id),
|
|
3150
|
+
tx.object(voter_id),
|
|
3151
|
+
tx.object(params.fromLockId),
|
|
3152
|
+
tx.object(params.toLockId),
|
|
3153
|
+
tx.object(CLOCK_ADDRESS)
|
|
3154
|
+
];
|
|
3148
3155
|
tx.moveCall({
|
|
3149
3156
|
target: `${integrate.published_at}::${VotingEscrow}::${functionName}`,
|
|
3150
3157
|
typeArguments,
|
|
@@ -3207,10 +3214,59 @@ var _TransactionUtil = class {
|
|
|
3207
3214
|
const tx = new import_transactions.Transaction();
|
|
3208
3215
|
tx.setSender(sdk.senderAddress);
|
|
3209
3216
|
const { integrate } = sdk.sdkOptions;
|
|
3210
|
-
const { voting_escrow_id, magma_token } = getPackagerConfigs(sdk.sdkOptions.magma_config);
|
|
3217
|
+
const { voting_escrow_id, magma_token, distribution_cfg, voter_id } = getPackagerConfigs(sdk.sdkOptions.magma_config);
|
|
3211
3218
|
const typeArguments = [magma_token];
|
|
3212
3219
|
const functionName = "unlock_permanent";
|
|
3213
|
-
const args = [
|
|
3220
|
+
const args = [
|
|
3221
|
+
tx.object(distribution_cfg),
|
|
3222
|
+
tx.object(voting_escrow_id),
|
|
3223
|
+
tx.object(voter_id),
|
|
3224
|
+
tx.object(params.lockId),
|
|
3225
|
+
tx.object(CLOCK_ADDRESS)
|
|
3226
|
+
];
|
|
3227
|
+
tx.moveCall({
|
|
3228
|
+
target: `${integrate.published_at}::${VotingEscrow}::${functionName}`,
|
|
3229
|
+
typeArguments,
|
|
3230
|
+
arguments: args
|
|
3231
|
+
});
|
|
3232
|
+
return tx;
|
|
3233
|
+
}
|
|
3234
|
+
static buildBurnLockTransaction(sdk, lockId) {
|
|
3235
|
+
const tx = new import_transactions.Transaction();
|
|
3236
|
+
tx.setSender(sdk.senderAddress);
|
|
3237
|
+
const { integrate } = sdk.sdkOptions;
|
|
3238
|
+
const { voting_escrow_id, magma_token, distribution_cfg, voter_id } = getPackagerConfigs(sdk.sdkOptions.magma_config);
|
|
3239
|
+
const typeArguments = [magma_token];
|
|
3240
|
+
const functionName = "burn_lock";
|
|
3241
|
+
const args = [
|
|
3242
|
+
tx.object(distribution_cfg),
|
|
3243
|
+
tx.object(voting_escrow_id),
|
|
3244
|
+
tx.object(voter_id),
|
|
3245
|
+
tx.object(lockId),
|
|
3246
|
+
tx.object(CLOCK_ADDRESS)
|
|
3247
|
+
];
|
|
3248
|
+
tx.moveCall({
|
|
3249
|
+
target: `${integrate.published_at}::${VotingEscrow}::${functionName}`,
|
|
3250
|
+
typeArguments,
|
|
3251
|
+
arguments: args
|
|
3252
|
+
});
|
|
3253
|
+
return tx;
|
|
3254
|
+
}
|
|
3255
|
+
static buildSplitLockTransaction(sdk, lockId, splitAmount) {
|
|
3256
|
+
const tx = new import_transactions.Transaction();
|
|
3257
|
+
tx.setSender(sdk.senderAddress);
|
|
3258
|
+
const { integrate } = sdk.sdkOptions;
|
|
3259
|
+
const { voting_escrow_id, magma_token, distribution_cfg, voter_id } = getPackagerConfigs(sdk.sdkOptions.magma_config);
|
|
3260
|
+
const typeArguments = [magma_token];
|
|
3261
|
+
const functionName = "split_lock";
|
|
3262
|
+
const args = [
|
|
3263
|
+
tx.object(distribution_cfg),
|
|
3264
|
+
tx.object(voting_escrow_id),
|
|
3265
|
+
tx.object(voter_id),
|
|
3266
|
+
tx.object(lockId),
|
|
3267
|
+
tx.pure.u64(splitAmount),
|
|
3268
|
+
tx.object(CLOCK_ADDRESS)
|
|
3269
|
+
];
|
|
3214
3270
|
tx.moveCall({
|
|
3215
3271
|
target: `${integrate.published_at}::${VotingEscrow}::${functionName}`,
|
|
3216
3272
|
typeArguments,
|
|
@@ -7530,7 +7586,7 @@ var LockModule = class {
|
|
|
7530
7586
|
};
|
|
7531
7587
|
locksInfo.lockInfo.push(lockInfo);
|
|
7532
7588
|
} catch (error) {
|
|
7533
|
-
|
|
7589
|
+
console.error("fastLocksOfUser error", error);
|
|
7534
7590
|
}
|
|
7535
7591
|
}
|
|
7536
7592
|
return locksInfo;
|
|
@@ -7603,7 +7659,7 @@ var LockModule = class {
|
|
|
7603
7659
|
};
|
|
7604
7660
|
locksInfo.lockInfo.push(lockInfo);
|
|
7605
7661
|
} catch (error) {
|
|
7606
|
-
|
|
7662
|
+
console.error("locksOfUser error", error);
|
|
7607
7663
|
}
|
|
7608
7664
|
}
|
|
7609
7665
|
return locksInfo;
|