@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.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 = [tx.object(voting_escrow_id), tx.object(params.fromLockId), tx.object(params.toLockId), tx.object(CLOCK_ADDRESS)];
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 = [tx.object(voting_escrow_id), tx.object(params.lockId), tx.object(CLOCK_ADDRESS)];
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,
@@ -7325,7 +7381,7 @@ var LockModule = class {
7325
7381
  };
7326
7382
  locksInfo.lockInfo.push(lockInfo);
7327
7383
  } catch (error) {
7328
- throw Error("fastLocksOfUser error");
7384
+ console.error("fastLocksOfUser error", error);
7329
7385
  }
7330
7386
  }
7331
7387
  return locksInfo;
@@ -7398,7 +7454,7 @@ var LockModule = class {
7398
7454
  };
7399
7455
  locksInfo.lockInfo.push(lockInfo);
7400
7456
  } catch (error) {
7401
- throw Error("locksOfUser error");
7457
+ console.error("locksOfUser error", error);
7402
7458
  }
7403
7459
  }
7404
7460
  return locksInfo;