@magmaprotocol/magma-clmm-sdk 0.5.30 → 0.5.32
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 +3 -0
- package/dist/index.js +66 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +66 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -3094,6 +3094,7 @@ declare class LockModule implements IModule {
|
|
|
3094
3094
|
claimVotingRewardsPayload(params: ClaimFeesParams): Promise<Transaction>;
|
|
3095
3095
|
claimVotingRewardsPoolsPayload(params: ClaimFeesPoolsParams): Promise<Transaction>;
|
|
3096
3096
|
claimAndLockRebasesPayload(params: ClaimAndLockParams): Promise<Transaction>;
|
|
3097
|
+
burnLockTransactionPayload(lockId: string): Promise<Transaction>;
|
|
3097
3098
|
pokePayload(params: PokeParams): Promise<Transaction>;
|
|
3098
3099
|
addBribeReward(params: AddBribeReward): Promise<Transaction>;
|
|
3099
3100
|
claimVotingBribe(locks: string[], incentive_tokens: string[]): Promise<Transaction>;
|
|
@@ -3841,6 +3842,8 @@ declare class TransactionUtil {
|
|
|
3841
3842
|
static buildIncreaseUnlockTimeTransaction(sdk: MagmaClmmSDK, params: IncreaseUnlockTimeParams): Transaction;
|
|
3842
3843
|
static buildLockPermanentTransaction(sdk: MagmaClmmSDK, params: LockPermanentParams): Transaction;
|
|
3843
3844
|
static buildUnlockPermanentTransaction(sdk: MagmaClmmSDK, params: LockPermanentParams): Transaction;
|
|
3845
|
+
static buildBurnLockTransaction(sdk: MagmaClmmSDK, lockId: string): Transaction;
|
|
3846
|
+
static buildSplitLockTransaction(sdk: MagmaClmmSDK, lockId: string, splitAmount: bigint | number | string): Transaction;
|
|
3844
3847
|
static buildVoteTransaction(sdk: MagmaClmmSDK, params: VoteParams): Transaction;
|
|
3845
3848
|
static buildClaimVotingRewardsTransaction(sdk: MagmaClmmSDK, params: ClaimFeesParams): Transaction;
|
|
3846
3849
|
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,
|
|
@@ -7445,6 +7501,12 @@ var LockModule = class {
|
|
|
7445
7501
|
}
|
|
7446
7502
|
return TransactionUtil.buildClaimAndLockRebases(this.sdk, params);
|
|
7447
7503
|
}
|
|
7504
|
+
async burnLockTransactionPayload(lockId) {
|
|
7505
|
+
if (this._sdk.senderAddress.length === 0) {
|
|
7506
|
+
throw Error("this config sdk senderAddress is empty");
|
|
7507
|
+
}
|
|
7508
|
+
return TransactionUtil.buildBurnLockTransaction(this.sdk, lockId);
|
|
7509
|
+
}
|
|
7448
7510
|
async pokePayload(params) {
|
|
7449
7511
|
if (this._sdk.senderAddress.length === 0) {
|
|
7450
7512
|
throw Error("this config sdk senderAddress is empty");
|