@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.mjs
CHANGED
|
@@ -2936,10 +2936,17 @@ var _TransactionUtil = class {
|
|
|
2936
2936
|
const tx = new Transaction();
|
|
2937
2937
|
tx.setSender(sdk.senderAddress);
|
|
2938
2938
|
const { integrate } = sdk.sdkOptions;
|
|
2939
|
-
const { voting_escrow_id, magma_token } = getPackagerConfigs(sdk.sdkOptions.magma_config);
|
|
2939
|
+
const { voter_id, voting_escrow_id, magma_token, distribution_cfg } = getPackagerConfigs(sdk.sdkOptions.magma_config);
|
|
2940
2940
|
const typeArguments = [magma_token];
|
|
2941
2941
|
const functionName = "merge_locks";
|
|
2942
|
-
const args = [
|
|
2942
|
+
const args = [
|
|
2943
|
+
tx.object(distribution_cfg),
|
|
2944
|
+
tx.object(voting_escrow_id),
|
|
2945
|
+
tx.object(voter_id),
|
|
2946
|
+
tx.object(params.fromLockId),
|
|
2947
|
+
tx.object(params.toLockId),
|
|
2948
|
+
tx.object(CLOCK_ADDRESS)
|
|
2949
|
+
];
|
|
2943
2950
|
tx.moveCall({
|
|
2944
2951
|
target: `${integrate.published_at}::${VotingEscrow}::${functionName}`,
|
|
2945
2952
|
typeArguments,
|
|
@@ -3002,10 +3009,59 @@ var _TransactionUtil = class {
|
|
|
3002
3009
|
const tx = new Transaction();
|
|
3003
3010
|
tx.setSender(sdk.senderAddress);
|
|
3004
3011
|
const { integrate } = sdk.sdkOptions;
|
|
3005
|
-
const { voting_escrow_id, magma_token } = getPackagerConfigs(sdk.sdkOptions.magma_config);
|
|
3012
|
+
const { voting_escrow_id, magma_token, distribution_cfg, voter_id } = getPackagerConfigs(sdk.sdkOptions.magma_config);
|
|
3006
3013
|
const typeArguments = [magma_token];
|
|
3007
3014
|
const functionName = "unlock_permanent";
|
|
3008
|
-
const args = [
|
|
3015
|
+
const args = [
|
|
3016
|
+
tx.object(distribution_cfg),
|
|
3017
|
+
tx.object(voting_escrow_id),
|
|
3018
|
+
tx.object(voter_id),
|
|
3019
|
+
tx.object(params.lockId),
|
|
3020
|
+
tx.object(CLOCK_ADDRESS)
|
|
3021
|
+
];
|
|
3022
|
+
tx.moveCall({
|
|
3023
|
+
target: `${integrate.published_at}::${VotingEscrow}::${functionName}`,
|
|
3024
|
+
typeArguments,
|
|
3025
|
+
arguments: args
|
|
3026
|
+
});
|
|
3027
|
+
return tx;
|
|
3028
|
+
}
|
|
3029
|
+
static buildBurnLockTransaction(sdk, lockId) {
|
|
3030
|
+
const tx = new Transaction();
|
|
3031
|
+
tx.setSender(sdk.senderAddress);
|
|
3032
|
+
const { integrate } = sdk.sdkOptions;
|
|
3033
|
+
const { voting_escrow_id, magma_token, distribution_cfg, voter_id } = getPackagerConfigs(sdk.sdkOptions.magma_config);
|
|
3034
|
+
const typeArguments = [magma_token];
|
|
3035
|
+
const functionName = "burn_lock";
|
|
3036
|
+
const args = [
|
|
3037
|
+
tx.object(distribution_cfg),
|
|
3038
|
+
tx.object(voting_escrow_id),
|
|
3039
|
+
tx.object(voter_id),
|
|
3040
|
+
tx.object(lockId),
|
|
3041
|
+
tx.object(CLOCK_ADDRESS)
|
|
3042
|
+
];
|
|
3043
|
+
tx.moveCall({
|
|
3044
|
+
target: `${integrate.published_at}::${VotingEscrow}::${functionName}`,
|
|
3045
|
+
typeArguments,
|
|
3046
|
+
arguments: args
|
|
3047
|
+
});
|
|
3048
|
+
return tx;
|
|
3049
|
+
}
|
|
3050
|
+
static buildSplitLockTransaction(sdk, lockId, splitAmount) {
|
|
3051
|
+
const tx = new Transaction();
|
|
3052
|
+
tx.setSender(sdk.senderAddress);
|
|
3053
|
+
const { integrate } = sdk.sdkOptions;
|
|
3054
|
+
const { voting_escrow_id, magma_token, distribution_cfg, voter_id } = getPackagerConfigs(sdk.sdkOptions.magma_config);
|
|
3055
|
+
const typeArguments = [magma_token];
|
|
3056
|
+
const functionName = "split_lock";
|
|
3057
|
+
const args = [
|
|
3058
|
+
tx.object(distribution_cfg),
|
|
3059
|
+
tx.object(voting_escrow_id),
|
|
3060
|
+
tx.object(voter_id),
|
|
3061
|
+
tx.object(lockId),
|
|
3062
|
+
tx.pure.u64(splitAmount),
|
|
3063
|
+
tx.object(CLOCK_ADDRESS)
|
|
3064
|
+
];
|
|
3009
3065
|
tx.moveCall({
|
|
3010
3066
|
target: `${integrate.published_at}::${VotingEscrow}::${functionName}`,
|
|
3011
3067
|
typeArguments,
|
|
@@ -7240,6 +7296,12 @@ var LockModule = class {
|
|
|
7240
7296
|
}
|
|
7241
7297
|
return TransactionUtil.buildClaimAndLockRebases(this.sdk, params);
|
|
7242
7298
|
}
|
|
7299
|
+
async burnLockTransactionPayload(lockId) {
|
|
7300
|
+
if (this._sdk.senderAddress.length === 0) {
|
|
7301
|
+
throw Error("this config sdk senderAddress is empty");
|
|
7302
|
+
}
|
|
7303
|
+
return TransactionUtil.buildBurnLockTransaction(this.sdk, lockId);
|
|
7304
|
+
}
|
|
7243
7305
|
async pokePayload(params) {
|
|
7244
7306
|
if (this._sdk.senderAddress.length === 0) {
|
|
7245
7307
|
throw Error("this config sdk senderAddress is empty");
|