@magmaprotocol/magma-clmm-sdk 0.5.79 → 0.5.80

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
@@ -3395,14 +3395,14 @@ var _TransactionUtil = class {
3395
3395
  static buildCreateLockTransaction(sdk, params, allCoinAsset) {
3396
3396
  let tx = new Transaction();
3397
3397
  tx.setSender(sdk.senderAddress);
3398
- const { magma_token } = getPackagerConfigs(sdk.sdkOptions.magma_config);
3398
+ const { magma_token } = getPackagerConfigs(sdk.sdkOptions.ve33);
3399
3399
  const lockCoinInput = _TransactionUtil.buildCoinForAmount(tx, allCoinAsset, BigInt(params.amount), magma_token, false, true);
3400
3400
  tx = _TransactionUtil.buildCreateTransactionArgs(tx, params, sdk.sdkOptions, lockCoinInput);
3401
3401
  return tx;
3402
3402
  }
3403
3403
  static buildCreateTransactionArgs(tx, params, sdkOptions, lockCoinInput) {
3404
- const { integrate } = sdkOptions;
3405
- const { voting_escrow_id, magma_token } = getPackagerConfigs(sdkOptions.magma_config);
3404
+ const { integrate, ve33 } = sdkOptions;
3405
+ const { voting_escrow_id, magma_token } = getPackagerConfigs(ve33);
3406
3406
  const typeArguments = [magma_token];
3407
3407
  const functionName = "create_lock";
3408
3408
  const coins = tx.makeMoveVec({ elements: [lockCoinInput.targetCoin] });
@@ -3421,7 +3421,7 @@ var _TransactionUtil = class {
3421
3421
  return tx;
3422
3422
  }
3423
3423
  static buildIncreaseLockAmountTransaction(sdk, params, allCoinAsset) {
3424
- const { magma_token } = getPackagerConfigs(sdk.sdkOptions.magma_config);
3424
+ const { magma_token } = getPackagerConfigs(sdk.sdkOptions.ve33);
3425
3425
  let tx = new Transaction();
3426
3426
  tx.setSender(sdk.senderAddress);
3427
3427
  const lockCoinInput = _TransactionUtil.buildCoinForAmount(tx, allCoinAsset, BigInt(params.amount), magma_token, false, true);
@@ -3429,8 +3429,8 @@ var _TransactionUtil = class {
3429
3429
  return tx;
3430
3430
  }
3431
3431
  static buildIncreaseLockAmountTransactionArgs(tx, params, sdkOptions, increaseCoinInput) {
3432
- const { integrate } = sdkOptions;
3433
- const { voting_escrow_id, magma_token } = getPackagerConfigs(sdkOptions.magma_config);
3432
+ const { integrate, ve33 } = sdkOptions;
3433
+ const { voting_escrow_id, magma_token } = getPackagerConfigs(ve33);
3434
3434
  const typeArguments = [magma_token];
3435
3435
  const functionName = "increase_amount_single_coin";
3436
3436
  const args = [tx.object(voting_escrow_id), tx.object(params.lockId), increaseCoinInput.targetCoin, tx.object(CLOCK_ADDRESS)];
@@ -3445,8 +3445,8 @@ var _TransactionUtil = class {
3445
3445
  static buildMergeLockTransaction(sdk, params) {
3446
3446
  const tx = new Transaction();
3447
3447
  tx.setSender(sdk.senderAddress);
3448
- const { integrate } = sdk.sdkOptions;
3449
- const { voter_id, voting_escrow_id, magma_token, distribution_cfg } = getPackagerConfigs(sdk.sdkOptions.magma_config);
3448
+ const { integrate, ve33 } = sdk.sdkOptions;
3449
+ const { voter_id, voting_escrow_id, magma_token, distribution_cfg } = getPackagerConfigs(ve33);
3450
3450
  const typeArguments = [magma_token];
3451
3451
  const functionName = "merge_locks";
3452
3452
  const args = [
@@ -3468,8 +3468,8 @@ var _TransactionUtil = class {
3468
3468
  static buildTransferLockTransaction(sdk, params) {
3469
3469
  const tx = new Transaction();
3470
3470
  tx.setSender(sdk.senderAddress);
3471
- const { integrate } = sdk.sdkOptions;
3472
- const { voting_escrow_id, magma_token } = getPackagerConfigs(sdk.sdkOptions.magma_config);
3471
+ const { integrate, ve33 } = sdk.sdkOptions;
3472
+ const { voting_escrow_id, magma_token } = getPackagerConfigs(ve33);
3473
3473
  const typeArguments = [magma_token];
3474
3474
  const functionName = "transfer";
3475
3475
  const args = [tx.object(voting_escrow_id), tx.object(params.lockId), tx.object(params.to), tx.object(CLOCK_ADDRESS)];
@@ -3486,8 +3486,8 @@ var _TransactionUtil = class {
3486
3486
  tx.setSender(sdk.senderAddress);
3487
3487
  const oneDay = 24 * 60 * 60;
3488
3488
  const newLockDuration = Math.ceil((params.newLockEndAt - Date.now() / 1e3) / oneDay);
3489
- const { integrate } = sdk.sdkOptions;
3490
- const { voting_escrow_id, magma_token } = getPackagerConfigs(sdk.sdkOptions.magma_config);
3489
+ const { integrate, ve33 } = sdk.sdkOptions;
3490
+ const { voting_escrow_id, magma_token } = getPackagerConfigs(ve33);
3491
3491
  const typeArguments = [magma_token];
3492
3492
  const functionName = "increase_unlock_time";
3493
3493
  const args = [tx.object(voting_escrow_id), tx.object(params.lockId), tx.pure.u64(newLockDuration), tx.object(CLOCK_ADDRESS)];
@@ -3502,8 +3502,8 @@ var _TransactionUtil = class {
3502
3502
  static buildLockPermanentTransaction(sdk, params) {
3503
3503
  const tx = new Transaction();
3504
3504
  tx.setSender(sdk.senderAddress);
3505
- const { integrate } = sdk.sdkOptions;
3506
- const { voting_escrow_id, magma_token } = getPackagerConfigs(sdk.sdkOptions.magma_config);
3505
+ const { integrate, ve33 } = sdk.sdkOptions;
3506
+ const { voting_escrow_id, magma_token } = getPackagerConfigs(ve33);
3507
3507
  const typeArguments = [magma_token];
3508
3508
  const functionName = "lock_permanent";
3509
3509
  const args = [tx.object(voting_escrow_id), tx.object(params.lockId), tx.object(CLOCK_ADDRESS)];
@@ -3517,8 +3517,8 @@ var _TransactionUtil = class {
3517
3517
  static buildUnlockPermanentTransaction(sdk, params) {
3518
3518
  const tx = new Transaction();
3519
3519
  tx.setSender(sdk.senderAddress);
3520
- const { integrate } = sdk.sdkOptions;
3521
- const { voting_escrow_id, magma_token, distribution_cfg, voter_id } = getPackagerConfigs(sdk.sdkOptions.magma_config);
3520
+ const { integrate, ve33 } = sdk.sdkOptions;
3521
+ const { voting_escrow_id, magma_token, distribution_cfg, voter_id } = getPackagerConfigs(ve33);
3522
3522
  const typeArguments = [magma_token];
3523
3523
  const functionName = "unlock_permanent";
3524
3524
  const args = [
@@ -3538,8 +3538,8 @@ var _TransactionUtil = class {
3538
3538
  static buildBurnLockTransaction(sdk, lockId) {
3539
3539
  const tx = new Transaction();
3540
3540
  tx.setSender(sdk.senderAddress);
3541
- const { integrate } = sdk.sdkOptions;
3542
- const { voting_escrow_id, magma_token, distribution_cfg, voter_id } = getPackagerConfigs(sdk.sdkOptions.magma_config);
3541
+ const { integrate, ve33 } = sdk.sdkOptions;
3542
+ const { voting_escrow_id, magma_token, distribution_cfg, voter_id } = getPackagerConfigs(ve33);
3543
3543
  const typeArguments = [magma_token];
3544
3544
  const functionName = "burn_lock";
3545
3545
  const args = [
@@ -3559,8 +3559,8 @@ var _TransactionUtil = class {
3559
3559
  static buildSplitLockTransaction(sdk, lockId, splitAmount) {
3560
3560
  const tx = new Transaction();
3561
3561
  tx.setSender(sdk.senderAddress);
3562
- const { integrate } = sdk.sdkOptions;
3563
- const { voting_escrow_id, magma_token, distribution_cfg, voter_id } = getPackagerConfigs(sdk.sdkOptions.magma_config);
3562
+ const { integrate, ve33 } = sdk.sdkOptions;
3563
+ const { voting_escrow_id, magma_token, distribution_cfg, voter_id } = getPackagerConfigs(ve33);
3564
3564
  const typeArguments = [magma_token];
3565
3565
  const functionName = "split_lock";
3566
3566
  const args = [
@@ -3581,8 +3581,8 @@ var _TransactionUtil = class {
3581
3581
  static buildVoteTransaction(sdk, params) {
3582
3582
  const tx = new Transaction();
3583
3583
  tx.setSender(sdk.senderAddress);
3584
- const { integrate } = sdk.sdkOptions;
3585
- const { distribution_cfg, voting_escrow_id, magma_token, voter_id } = getPackagerConfigs(sdk.sdkOptions.magma_config);
3584
+ const { integrate, ve33 } = sdk.sdkOptions;
3585
+ const { distribution_cfg, voting_escrow_id, magma_token, voter_id } = getPackagerConfigs(ve33);
3586
3586
  const typeArguments = [magma_token];
3587
3587
  const functionName = "vote";
3588
3588
  const pools = tx.pure.vector("id", params.pools);
@@ -3609,8 +3609,8 @@ var _TransactionUtil = class {
3609
3609
  static buildClaimVotingRewardsTransaction(sdk, params) {
3610
3610
  const tx = new Transaction();
3611
3611
  tx.setSender(sdk.senderAddress);
3612
- const { integrate } = sdk.sdkOptions;
3613
- const { voting_escrow_id, magma_token, voter_id } = getPackagerConfigs(sdk.sdkOptions.magma_config);
3612
+ const { integrate, ve33 } = sdk.sdkOptions;
3613
+ const { voting_escrow_id, magma_token, voter_id } = getPackagerConfigs(ve33);
3614
3614
  const typeArguments = [magma_token, params.coinAType, params.coinBType];
3615
3615
  const functionName = "claim_voting_fee_rewards_single";
3616
3616
  const args = [tx.object(voter_id), tx.object(voting_escrow_id), tx.object(params.locks), tx.object(CLOCK_ADDRESS)];
@@ -3624,8 +3624,8 @@ var _TransactionUtil = class {
3624
3624
  static buildClaimVotingRewardsPoolsTransaction(sdk, params) {
3625
3625
  const tx = new Transaction();
3626
3626
  tx.setSender(sdk.senderAddress);
3627
- const { integrate, distribution } = sdk.sdkOptions;
3628
- const { voting_escrow_id, magma_token, voter_id } = getPackagerConfigs(sdk.sdkOptions.magma_config);
3627
+ const { integrate, distribution, ve33 } = sdk.sdkOptions;
3628
+ const { voting_escrow_id, magma_token, voter_id } = getPackagerConfigs(ve33);
3629
3629
  const typeArguments = [magma_token, params.coinAType, params.coinBType];
3630
3630
  const functionName = "claim_voting_fee_rewards";
3631
3631
  const locks = tx.makeMoveVec({
@@ -3643,8 +3643,8 @@ var _TransactionUtil = class {
3643
3643
  static buildClaimAndLockRebases(sdk, params) {
3644
3644
  const tx = new Transaction();
3645
3645
  tx.setSender(sdk.senderAddress);
3646
- const { integrate } = sdk.sdkOptions;
3647
- const { voting_escrow_id, magma_token, reward_distributor_id } = getPackagerConfigs(sdk.sdkOptions.magma_config);
3646
+ const { integrate, ve33 } = sdk.sdkOptions;
3647
+ const { voting_escrow_id, magma_token, reward_distributor_id } = getPackagerConfigs(ve33);
3648
3648
  const typeArguments = [magma_token];
3649
3649
  const functionName = "claim_and_lock";
3650
3650
  const args = [tx.object(reward_distributor_id), tx.object(voting_escrow_id), tx.object(params.lockId), tx.object(CLOCK_ADDRESS)];
@@ -3658,8 +3658,8 @@ var _TransactionUtil = class {
3658
3658
  static buildPoke(sdk, params) {
3659
3659
  const tx = new Transaction();
3660
3660
  tx.setSender(sdk.senderAddress);
3661
- const { integrate } = sdk.sdkOptions;
3662
- const { distribution_cfg, voting_escrow_id, magma_token, voter_id } = getPackagerConfigs(sdk.sdkOptions.magma_config);
3661
+ const { integrate, ve33 } = sdk.sdkOptions;
3662
+ const { distribution_cfg, voting_escrow_id, magma_token, voter_id } = getPackagerConfigs(ve33);
3663
3663
  const typeArguments = [magma_token];
3664
3664
  const functionName = "poke";
3665
3665
  const args = [
@@ -3679,8 +3679,8 @@ var _TransactionUtil = class {
3679
3679
  static buildClaimVotingBribe(sdk, locks, incentive_tokens) {
3680
3680
  const tx = new Transaction();
3681
3681
  tx.setSender(sdk.senderAddress);
3682
- const { integrate, distribution } = sdk.sdkOptions;
3683
- const { voting_escrow_id, magma_token, voter_id } = getPackagerConfigs(sdk.sdkOptions.magma_config);
3682
+ const { integrate, distribution, ve33 } = sdk.sdkOptions;
3683
+ const { voting_escrow_id, magma_token, voter_id } = getPackagerConfigs(ve33);
3684
3684
  const typeArguments = [magma_token, ...incentive_tokens];
3685
3685
  let targetFunc = `${integrate.published_at}::${Voter}::claim_voting_bribes_${incentive_tokens.length}`;
3686
3686
  if (incentive_tokens.length === 1) {
@@ -7523,8 +7523,8 @@ var SwapModule = class {
7523
7523
  * @returns {Promise<PreSwapParams>} A promise that resolves to the swap data.
7524
7524
  */
7525
7525
  async preswap(params) {
7526
- const { integrate, simulationAccount } = this.sdk.sdkOptions;
7527
- const { global_config_id } = getPackagerConfigs(this.sdk.sdkOptions.magma_config);
7526
+ const { integrate, simulationAccount, clmm_pool } = this.sdk.sdkOptions;
7527
+ const { global_config_id } = getPackagerConfigs(clmm_pool);
7528
7528
  const tx = new Transaction8();
7529
7529
  const typeArguments = [params.coinTypeA, params.coinTypeB];
7530
7530
  const args = [
@@ -7791,8 +7791,8 @@ var LockModule = class {
7791
7791
  }
7792
7792
  const tx = new Transaction9();
7793
7793
  tx.setSender(this.sdk.senderAddress);
7794
- const { integrate } = this.sdk.sdkOptions;
7795
- const { magma_token, voter_id } = getPackagerConfigs(this.sdk.sdkOptions.magma_config);
7794
+ const { integrate, ve33 } = this.sdk.sdkOptions;
7795
+ const { magma_token, voter_id } = getPackagerConfigs(ve33);
7796
7796
  const typeArguments = [magma_token, params.coinType];
7797
7797
  const allCoinAsset = await this._sdk.getOwnerCoinAssets(this._sdk.senderAddress);
7798
7798
  const coinInput = TransactionUtil.buildCoinForAmount(tx, allCoinAsset, BigInt(params.amount), params.coinType, false, true);
@@ -7817,8 +7817,8 @@ var LockModule = class {
7817
7817
  if (incentiveTokens.length < 1 || incentiveTokens.length > 3) {
7818
7818
  throw Error("incentiveTokens length must be between 1 and 3");
7819
7819
  }
7820
- const { integrate } = this.sdk.sdkOptions;
7821
- const { voting_escrow_id, magma_token, voter_id } = getPackagerConfigs(this.sdk.sdkOptions.magma_config);
7820
+ const { integrate, ve33 } = this.sdk.sdkOptions;
7821
+ const { voting_escrow_id, magma_token, voter_id } = getPackagerConfigs(ve33);
7822
7822
  const typeArguments = [magma_token, ...feeTokens, ...incentiveTokens];
7823
7823
  let targetFunc = `${integrate.published_at}::${Voter}::claim_voting_bribes_for_single_pool${incentiveTokens.length}`;
7824
7824
  if (incentiveTokens.length === 1) {
@@ -7836,8 +7836,8 @@ var LockModule = class {
7836
7836
  }
7837
7837
  async fastLocksOfUser(user) {
7838
7838
  const locksInfo = { owner: user, lockInfo: [] };
7839
- const { distribution } = this._sdk.sdkOptions;
7840
- const { magma_token } = getPackagerConfigs(this.sdk.sdkOptions.magma_config);
7839
+ const { distribution, ve33 } = this._sdk.sdkOptions;
7840
+ const { magma_token } = getPackagerConfigs(ve33);
7841
7841
  const ownerRes = await this._sdk.fullClient.getOwnedObjectsByPage(user, {
7842
7842
  options: { showType: true, showContent: true, showDisplay: true, showOwner: true },
7843
7843
  filter: {
@@ -7871,8 +7871,8 @@ var LockModule = class {
7871
7871
  }
7872
7872
  async locksOfUserV2(user) {
7873
7873
  const locksInfo = { owner: user, lockInfo: [] };
7874
- const { distribution } = this._sdk.sdkOptions;
7875
- const { magma_token } = getPackagerConfigs(this.sdk.sdkOptions.magma_config);
7874
+ const { distribution, ve33 } = this._sdk.sdkOptions;
7875
+ const { magma_token } = getPackagerConfigs(ve33);
7876
7876
  const ownerRes = await this._sdk.fullClient.getOwnedObjectsByPage(user, {
7877
7877
  options: { showType: true, showContent: true, showDisplay: true, showOwner: true },
7878
7878
  filter: {
@@ -7922,8 +7922,8 @@ var LockModule = class {
7922
7922
  }
7923
7923
  async locksOfUser(user) {
7924
7924
  const locksInfo = { owner: user, lockInfo: [] };
7925
- const { distribution } = this._sdk.sdkOptions;
7926
- const { magma_token } = getPackagerConfigs(this.sdk.sdkOptions.magma_config);
7925
+ const { distribution, ve33 } = this._sdk.sdkOptions;
7926
+ const { magma_token } = getPackagerConfigs(ve33);
7927
7927
  const ownerRes = await this._sdk.fullClient.getOwnedObjectsByPage(user, {
7928
7928
  options: { showType: true, showContent: true, showDisplay: true, showOwner: true },
7929
7929
  filter: {
@@ -8011,7 +8011,7 @@ var LockModule = class {
8011
8011
  "InvalidLockObject" /* InvalidLockObject */
8012
8012
  );
8013
8013
  }
8014
- const { magma_token } = getPackagerConfigs(this.sdk.sdkOptions.magma_config);
8014
+ const { magma_token } = getPackagerConfigs(this.sdk.sdkOptions.ve33);
8015
8015
  const aLockSummary = await this.aLockSummary(lockId);
8016
8016
  const poolIncentiveTokens = await this.getVotingBribeRewardTokens(lockId);
8017
8017
  const poolFeeTokens = await this.getVotingFeeRewardTokens(lockId);
@@ -8069,8 +8069,8 @@ var LockModule = class {
8069
8069
  }
8070
8070
  async aLockSummary(lock_id) {
8071
8071
  const tx = new Transaction9();
8072
- const { integrate, simulationAccount } = this.sdk.sdkOptions;
8073
- const { voting_escrow_id, magma_token, voter_id, reward_distributor_id } = getPackagerConfigs(this.sdk.sdkOptions.magma_config);
8072
+ const { integrate, simulationAccount, ve33 } = this.sdk.sdkOptions;
8073
+ const { voting_escrow_id, magma_token, voter_id, reward_distributor_id } = getPackagerConfigs(ve33);
8074
8074
  const typeArguments = [magma_token];
8075
8075
  const args = [
8076
8076
  tx.object(voter_id),
@@ -8122,8 +8122,8 @@ var LockModule = class {
8122
8122
  }
8123
8123
  async _aLockSummary(lock_id, tx) {
8124
8124
  tx = tx || new Transaction9();
8125
- const { integrate, simulationAccount } = this.sdk.sdkOptions;
8126
- const { voting_escrow_id, magma_token, voter_id, reward_distributor_id } = getPackagerConfigs(this.sdk.sdkOptions.magma_config);
8125
+ const { integrate, simulationAccount, ve33 } = this.sdk.sdkOptions;
8126
+ const { voting_escrow_id, magma_token, voter_id, reward_distributor_id } = getPackagerConfigs(ve33);
8127
8127
  const typeArguments = [magma_token];
8128
8128
  if (!checkInvalidSuiAddress(simulationAccount.address)) {
8129
8129
  throw Error("this config simulationAccount is not set right");
@@ -8165,8 +8165,8 @@ var LockModule = class {
8165
8165
  }
8166
8166
  async allLockSummary() {
8167
8167
  const tx = new Transaction9();
8168
- const { integrate, simulationAccount } = this.sdk.sdkOptions;
8169
- const { voting_escrow_id, magma_token, voter_id, minter_id } = getPackagerConfigs(this.sdk.sdkOptions.magma_config);
8168
+ const { integrate, simulationAccount, ve33 } = this.sdk.sdkOptions;
8169
+ const { voting_escrow_id, magma_token, voter_id, minter_id } = getPackagerConfigs(ve33);
8170
8170
  const typeArguments = [magma_token];
8171
8171
  const args = [tx.object(minter_id), tx.object(voter_id), tx.object(voting_escrow_id), tx.object(CLOCK_ADDRESS)];
8172
8172
  tx.moveCall({
@@ -8210,8 +8210,8 @@ var LockModule = class {
8210
8210
  }
8211
8211
  async poolWeights(pools) {
8212
8212
  const tx = new Transaction9();
8213
- const { integrate, simulationAccount } = this.sdk.sdkOptions;
8214
- const { magma_token, voter_id } = getPackagerConfigs(this.sdk.sdkOptions.magma_config);
8213
+ const { integrate, simulationAccount, ve33 } = this.sdk.sdkOptions;
8214
+ const { magma_token, voter_id } = getPackagerConfigs(ve33);
8215
8215
  const typeArguments = [magma_token];
8216
8216
  const poolsParams = tx.pure.vector("id", pools);
8217
8217
  const args = [tx.object(voter_id), poolsParams];
@@ -8252,8 +8252,8 @@ var LockModule = class {
8252
8252
  }
8253
8253
  async _getVotingFeeRewardTokens(lock_id, tx) {
8254
8254
  tx = tx || new Transaction9();
8255
- const { integrate, simulationAccount } = this.sdk.sdkOptions;
8256
- const { magma_token, voter_id } = getPackagerConfigs(this.sdk.sdkOptions.magma_config);
8255
+ const { integrate, simulationAccount, ve33 } = this.sdk.sdkOptions;
8256
+ const { magma_token, voter_id } = getPackagerConfigs(ve33);
8257
8257
  const typeArguments = [magma_token];
8258
8258
  const args = [tx.object(voter_id), tx.object(lock_id)];
8259
8259
  if (!checkInvalidSuiAddress(simulationAccount.address)) {
@@ -8293,8 +8293,8 @@ var LockModule = class {
8293
8293
  }
8294
8294
  async getVotingFeeRewardTokens(lock_id) {
8295
8295
  const tx = new Transaction9();
8296
- const { integrate, simulationAccount } = this.sdk.sdkOptions;
8297
- const { magma_token, voter_id } = getPackagerConfigs(this.sdk.sdkOptions.magma_config);
8296
+ const { integrate, simulationAccount, ve33 } = this.sdk.sdkOptions;
8297
+ const { magma_token, voter_id } = getPackagerConfigs(ve33);
8298
8298
  const typeArguments = [magma_token];
8299
8299
  const args = [tx.object(voter_id), tx.object(lock_id)];
8300
8300
  if (!checkInvalidSuiAddress(simulationAccount.address)) {
@@ -8337,8 +8337,8 @@ var LockModule = class {
8337
8337
  }
8338
8338
  async _getVotingBribeRewardTokens(lock_id, tx) {
8339
8339
  tx = tx || new Transaction9();
8340
- const { integrate, simulationAccount } = this.sdk.sdkOptions;
8341
- const { magma_token, voter_id } = getPackagerConfigs(this.sdk.sdkOptions.magma_config);
8340
+ const { integrate, simulationAccount, ve33 } = this.sdk.sdkOptions;
8341
+ const { magma_token, voter_id } = getPackagerConfigs(ve33);
8342
8342
  const typeArguments = [magma_token];
8343
8343
  if (!checkInvalidSuiAddress(simulationAccount.address)) {
8344
8344
  throw Error("this config simulationAccount is not set right");
@@ -8379,8 +8379,8 @@ var LockModule = class {
8379
8379
  // Return PoolId => tokens
8380
8380
  async getVotingBribeRewardTokens(lock_id) {
8381
8381
  const tx = new Transaction9();
8382
- const { integrate, simulationAccount } = this.sdk.sdkOptions;
8383
- const { magma_token, voter_id } = getPackagerConfigs(this.sdk.sdkOptions.magma_config);
8382
+ const { integrate, simulationAccount, ve33 } = this.sdk.sdkOptions;
8383
+ const { magma_token, voter_id } = getPackagerConfigs(ve33);
8384
8384
  const typeArguments = [magma_token];
8385
8385
  if (!checkInvalidSuiAddress(simulationAccount.address)) {
8386
8386
  throw Error("this config simulationAccount is not set right");
@@ -8431,8 +8431,8 @@ var LockModule = class {
8431
8431
  }
8432
8432
  _getFeeRewardsInner(lock_id, token_a, token_b, tx) {
8433
8433
  tx = tx || new Transaction9();
8434
- const { integrate } = this.sdk.sdkOptions;
8435
- const { magma_token, voter_id } = getPackagerConfigs(this.sdk.sdkOptions.magma_config);
8434
+ const { integrate, ve33 } = this.sdk.sdkOptions;
8435
+ const { magma_token, voter_id } = getPackagerConfigs(ve33);
8436
8436
  const typeArguments = [magma_token, token_a, token_b];
8437
8437
  const args = [tx.object(voter_id), tx.object(lock_id), tx.object(CLOCK_ADDRESS)];
8438
8438
  const targetFunc = `${integrate.published_at}::${Voter}::claimable_voting_fee_rewards`;
@@ -8491,8 +8491,8 @@ var LockModule = class {
8491
8491
  // if you have many tokens, call this function multi times
8492
8492
  async _getPoolFeeRewards(lock_id, token_a, token_b, poolFeeRewardTokens) {
8493
8493
  const tx = new Transaction9();
8494
- const { integrate, simulationAccount } = this.sdk.sdkOptions;
8495
- const { magma_token, voter_id } = getPackagerConfigs(this.sdk.sdkOptions.magma_config);
8494
+ const { integrate, simulationAccount, ve33 } = this.sdk.sdkOptions;
8495
+ const { magma_token, voter_id } = getPackagerConfigs(ve33);
8496
8496
  const typeArguments = [magma_token, token_a, token_b];
8497
8497
  const args = [tx.object(voter_id), tx.object(lock_id), tx.object(CLOCK_ADDRESS)];
8498
8498
  const targetFunc = `${integrate.published_at}::${Voter}::claimable_voting_fee_rewards`;
@@ -8546,8 +8546,8 @@ var LockModule = class {
8546
8546
  if (incentive_tokens.length > 3) {
8547
8547
  throw Error("Too many tokens");
8548
8548
  }
8549
- const { integrate, simulationAccount } = this.sdk.sdkOptions;
8550
- const { magma_token, voter_id } = getPackagerConfigs(this.sdk.sdkOptions.magma_config);
8549
+ const { integrate, simulationAccount, ve33 } = this.sdk.sdkOptions;
8550
+ const { magma_token, voter_id } = getPackagerConfigs(ve33);
8551
8551
  const typeArguments = [magma_token, ...incentive_tokens];
8552
8552
  const args = [tx.object(voter_id), tx.object(locksId), tx.object(CLOCK_ADDRESS)];
8553
8553
  let targetFunc = `${integrate.published_at}::${Voter}::claimable_voting_bribes_${incentive_tokens.length}`;
@@ -8615,8 +8615,8 @@ var LockModule = class {
8615
8615
  throw Error("Too many tokens");
8616
8616
  }
8617
8617
  const tx = new Transaction9();
8618
- const { integrate, simulationAccount } = this.sdk.sdkOptions;
8619
- const { magma_token, voter_id } = getPackagerConfigs(this.sdk.sdkOptions.magma_config);
8618
+ const { integrate, simulationAccount, ve33 } = this.sdk.sdkOptions;
8619
+ const { magma_token, voter_id } = getPackagerConfigs(ve33);
8620
8620
  const typeArguments = [magma_token, ...incentive_tokens];
8621
8621
  const args = [tx.object(voter_id), tx.object(locksId), tx.object(CLOCK_ADDRESS)];
8622
8622
  let targetFunc = `${integrate.published_at}::${Voter}::claimable_voting_bribes_${incentive_tokens.length}`;
@@ -8654,8 +8654,8 @@ var LockModule = class {
8654
8654
  }
8655
8655
  async getPoolBribeRewardTokens(pool_id) {
8656
8656
  const tx = new Transaction9();
8657
- const { integrate, simulationAccount } = this.sdk.sdkOptions;
8658
- const { magma_token, voter_id } = getPackagerConfigs(this.sdk.sdkOptions.magma_config);
8657
+ const { integrate, simulationAccount, ve33 } = this.sdk.sdkOptions;
8658
+ const { magma_token, voter_id } = getPackagerConfigs(ve33);
8659
8659
  const typeArguments = [magma_token];
8660
8660
  const args = [tx.object(voter_id), tx.object(pool_id)];
8661
8661
  tx.moveCall({
@@ -8690,8 +8690,8 @@ var LockModule = class {
8690
8690
  }
8691
8691
  async getLockVotingStats(lockId) {
8692
8692
  const tx = new Transaction9();
8693
- const { integrate, simulationAccount } = this.sdk.sdkOptions;
8694
- const { magma_token, voter_id } = getPackagerConfigs(this.sdk.sdkOptions.magma_config);
8693
+ const { integrate, simulationAccount, ve33 } = this.sdk.sdkOptions;
8694
+ const { magma_token, voter_id } = getPackagerConfigs(ve33);
8695
8695
  const args = [tx.object(voter_id), tx.object(lockId), tx.object(CLOCK_ADDRESS)];
8696
8696
  const typeArguments = [magma_token];
8697
8697
  tx.moveCall({
@@ -9794,16 +9794,9 @@ var ConfigModule = class {
9794
9794
  launchpad_pools_id: "",
9795
9795
  clmm_pools_id: "",
9796
9796
  admin_cap_id: "",
9797
- global_config_id: "",
9798
9797
  coin_list_handle: "",
9799
9798
  launchpad_pools_handle: "",
9800
- clmm_pools_handle: "",
9801
- voter_id: "",
9802
- minter_id: "",
9803
- reward_distributor_id: "",
9804
- distribution_cfg: "",
9805
- magma_token: "",
9806
- voting_escrow_id: ""
9799
+ clmm_pools_handle: ""
9807
9800
  };
9808
9801
  if (objects.data.length > 0) {
9809
9802
  for (const item of objects.data) {
@@ -9819,7 +9812,6 @@ var ConfigModule = class {
9819
9812
  tokenConfig.clmm_pools_id = item.parsedJson.pools_id;
9820
9813
  break;
9821
9814
  case `InitConfigEvent`:
9822
- tokenConfig.global_config_id = item.parsedJson.global_config_id;
9823
9815
  tokenConfig.admin_cap_id = item.parsedJson.admin_cap_id;
9824
9816
  break;
9825
9817
  default:
@@ -10094,7 +10086,7 @@ var GaugeModule = class {
10094
10086
  if (gauge === void 0) {
10095
10087
  throw Error(`Fetch gauge of pool ${params.poolId} failed`);
10096
10088
  }
10097
- const { distribution_cfg, magma_token } = getPackagerConfigs(this.sdk.sdkOptions.magma_config);
10089
+ const { distribution_cfg, magma_token } = getPackagerConfigs(this.sdk.sdkOptions.ve33);
10098
10090
  const { clmm_pool, integrate } = this.sdk.sdkOptions;
10099
10091
  const clmmConfig = getPackagerConfigs(clmm_pool);
10100
10092
  const typeArguments = [params.coinTypeA, params.coinTypeB, magma_token];
@@ -10121,7 +10113,7 @@ var GaugeModule = class {
10121
10113
  if (gauge === void 0) {
10122
10114
  throw Error(`Fetch gauge of pool ${params.poolId} failed`);
10123
10115
  }
10124
- const { magma_token } = getPackagerConfigs(this.sdk.sdkOptions.magma_config);
10116
+ const { magma_token } = getPackagerConfigs(this.sdk.sdkOptions.ve33);
10125
10117
  const { integrate } = this.sdk.sdkOptions;
10126
10118
  const typeArguments = [params.coinTypeA, params.coinTypeB, magma_token];
10127
10119
  const args = [tx.object(gauge), tx.object(params.poolId), tx.object(params.positionId), tx.object(CLOCK_ADDRESS)];
@@ -10171,7 +10163,7 @@ var GaugeModule = class {
10171
10163
  async getUserStakedPositionInfoOfPool(userAddr, pool, gauger, poolCoinA, poolCoinB) {
10172
10164
  const tx = new Transaction11();
10173
10165
  const { integrate, simulationAccount } = this.sdk.sdkOptions;
10174
- const { magma_token, voter_id } = getPackagerConfigs(this.sdk.sdkOptions.magma_config);
10166
+ const { magma_token, voter_id } = getPackagerConfigs(this.sdk.sdkOptions.ve33);
10175
10167
  const typeArguments = [poolCoinA, poolCoinB, magma_token];
10176
10168
  const args = [tx.object(voter_id), tx.object(gauger), tx.object(pool), tx.pure.address(userAddr), tx.object(CLOCK_ADDRESS)];
10177
10169
  tx.moveCall({
@@ -10195,7 +10187,7 @@ var GaugeModule = class {
10195
10187
  async getPoolGaguers() {
10196
10188
  const tx = new Transaction11();
10197
10189
  const { integrate, simulationAccount } = this.sdk.sdkOptions;
10198
- const { magma_token, voter_id } = getPackagerConfigs(this.sdk.sdkOptions.magma_config);
10190
+ const { magma_token, voter_id } = getPackagerConfigs(this.sdk.sdkOptions.ve33);
10199
10191
  const typeArguments = [magma_token];
10200
10192
  const args = [tx.object(voter_id)];
10201
10193
  tx.moveCall({
@@ -10235,7 +10227,7 @@ var GaugeModule = class {
10235
10227
  async getEmissions() {
10236
10228
  const tx = new Transaction11();
10237
10229
  const { integrate, simulationAccount } = this.sdk.sdkOptions;
10238
- const { magma_token, minter_id, voting_escrow_id } = getPackagerConfigs(this.sdk.sdkOptions.magma_config);
10230
+ const { magma_token, minter_id, voting_escrow_id } = getPackagerConfigs(this.sdk.sdkOptions.ve33);
10239
10231
  const typeArguments = [magma_token];
10240
10232
  const args = [tx.object(minter_id), tx.object(voting_escrow_id)];
10241
10233
  tx.moveCall({
@@ -10269,7 +10261,7 @@ var GaugeModule = class {
10269
10261
  async getRewardByPosition(params) {
10270
10262
  const tx = new Transaction11();
10271
10263
  const { integrate } = this.sdk.sdkOptions;
10272
- const { magma_token } = getPackagerConfigs(this.sdk.sdkOptions.magma_config);
10264
+ const { magma_token } = getPackagerConfigs(this.sdk.sdkOptions.ve33);
10273
10265
  const typeArguments = [params.coinTypeA, params.coinTypeB, magma_token];
10274
10266
  const args = [tx.object(params.gaugeId), tx.object(params.poolId), tx.object(params.positionId), tx.object(CLOCK_ADDRESS)];
10275
10267
  tx.moveCall({
@@ -10282,7 +10274,7 @@ var GaugeModule = class {
10282
10274
  async getAllRewardByPositions(paramsList) {
10283
10275
  const tx = new Transaction11();
10284
10276
  const { integrate } = this.sdk.sdkOptions;
10285
- const { magma_token } = getPackagerConfigs(this.sdk.sdkOptions.magma_config);
10277
+ const { magma_token } = getPackagerConfigs(this.sdk.sdkOptions.ve33);
10286
10278
  paramsList.forEach((params) => {
10287
10279
  const typeArguments = [params.coinTypeA, params.coinTypeB, magma_token];
10288
10280
  const args = [tx.object(params.gaugeId), tx.object(params.poolId), tx.object(params.positionId), tx.object(CLOCK_ADDRESS)];
@@ -10297,7 +10289,7 @@ var GaugeModule = class {
10297
10289
  async getEpochRewardByPool(pool, incentive_tokens) {
10298
10290
  const tx = new Transaction11();
10299
10291
  const { integrate, simulationAccount } = this.sdk.sdkOptions;
10300
- const { magma_token, voter_id } = getPackagerConfigs(this.sdk.sdkOptions.magma_config);
10292
+ const { magma_token, voter_id } = getPackagerConfigs(this.sdk.sdkOptions.ve33);
10301
10293
  const typeArguments = [magma_token, ...incentive_tokens];
10302
10294
  const args = [tx.object(voter_id), tx.object(pool), tx.object(CLOCK_ADDRESS)];
10303
10295
  let targetFunc = `${integrate.published_at}::${Voter}::epoch_reward_by_pool${incentive_tokens.length}`;
@@ -10433,8 +10425,18 @@ var DlmmModule = class {
10433
10425
  });
10434
10426
  return tx;
10435
10427
  }
10436
- // async mintByStrategySingle(params: MintByStrategySingleParams): Promise<Transaction> {}
10437
10428
  async mintByStrategy(params) {
10429
+ if (params.fixCoinA && params.fixCoinB) {
10430
+ if (params.amountATotal === 0 || params.amountBTotal === 0) {
10431
+ if (params.active_bin < params.max_bin && params.active_bin > params.min_bin) {
10432
+ if (params.amountATotal > 0) {
10433
+ params.min_bin = params.active_bin;
10434
+ } else if (params.amountBTotal > 0) {
10435
+ params.max_bin = params.active_bin;
10436
+ }
10437
+ }
10438
+ }
10439
+ }
10438
10440
  const tx = new Transaction12();
10439
10441
  const slippage = new Decimal10(params.slippage);
10440
10442
  const lower_slippage = new Decimal10(1).sub(slippage.div(new Decimal10(1e4)));
@@ -10476,7 +10478,9 @@ var DlmmModule = class {
10476
10478
  tx.object(dlmmConfig.factory),
10477
10479
  primaryCoinAInputs.targetCoin,
10478
10480
  primaryCoinBInputs.targetCoin,
10481
+ tx.pure.bool(params.fixCoinA),
10479
10482
  tx.pure.u64(params.amountATotal),
10483
+ tx.pure.bool(params.fixCoinB),
10480
10484
  tx.pure.u64(params.amountBTotal),
10481
10485
  tx.pure.u8(params.strategy),
10482
10486
  tx.pure.u32(get_storage_id_from_real_id(params.min_bin)),
@@ -11509,8 +11513,9 @@ var SDKConfig = {
11509
11513
  admin_cap_id: "0x39d78781750e193ce35c45ff32c6c0c3f2941fa3ddaf8595c90c555589ddb113",
11510
11514
  coin_list_handle: "0x49136005e90e28c4695419ed4194cc240603f1ea8eb84e62275eaff088a71063",
11511
11515
  launchpad_pools_handle: "0x5e194a8efcf653830daf85a85b52e3ae8f65dc39481d54b2382acda25068375c",
11512
- clmm_pools_handle: "0x37f60eb2d9d227949b95da8fea810db3c32d1e1fa8ed87434fc51664f87d83cb",
11513
- global_config_id: "0x4c4e1402401f72c7d8533d0ed8d5f8949da363c7a3319ccef261ffe153d32f8a",
11516
+ clmm_pools_handle: "0x37f60eb2d9d227949b95da8fea810db3c32d1e1fa8ed87434fc51664f87d83cb"
11517
+ },
11518
+ ve33Config: {
11514
11519
  voter_id: "0xaab0f3a90da96d29d743e09c269e1ae48ec1bae52a28cd38c49c5dc8c1bf92b8",
11515
11520
  voting_escrow_id: "0x7ab45fbe01da26e07ba21757916d540c8747cf7daa88f3171e13db17373d5adc",
11516
11521
  reward_distributor_id: "0x9f4f882245e49fd9213278dfbcb63a14fdbdd2ce7e25e9353a0cecdca30de853",
@@ -11528,6 +11533,11 @@ var clmmMainnet = {
11528
11533
  simulationAccount: {
11529
11534
  address: "0x0000000000000000000000000000000000000000000000000000000000000000"
11530
11535
  },
11536
+ ve33: {
11537
+ package_id: "0x7ab45fbe01da26e07ba21757916d540c8747cf7daa88f3171e13db17373d5adc",
11538
+ published_at: "0x7ab45fbe01da26e07ba21757916d540c8747cf7daa88f3171e13db17373d5adc",
11539
+ config: SDKConfig.ve33Config
11540
+ },
11531
11541
  magma_config: {
11532
11542
  package_id: "0x95b8d278b876cae22206131fb9724f701c9444515813042f54f0a426c9a3bc2f",
11533
11543
  published_at: "0x95b8d278b876cae22206131fb9724f701c9444515813042f54f0a426c9a3bc2f",
@@ -11576,8 +11586,8 @@ function initMainnetSDK(fullNodeUrl, simulationAccount) {
11576
11586
  import { getFullnodeUrl as getFullnodeUrl2 } from "@mysten/sui/client";
11577
11587
  var SDKConfig2 = {
11578
11588
  clmmConfig: {
11579
- pools_id: "0x50eb61dd5928cec5ea04711a2e9b72e5237e79e9fbcd2ce3d5469dc8708e0ee2",
11580
- global_config_id: "0x9774e359588ead122af1c7e7f64e14ade261cfeecdb5d0eb4a5b3b4c8ab8bd3e",
11589
+ pools_id: "0xd7037b38ae757d7a69b61146b27c288600b9aefbffbf884b856881dff6a4f27b",
11590
+ global_config_id: "0x83baa8b07800029302f75ac6906240e86cf05066d37eedcabc61a0d6b6dc6eda",
11581
11591
  global_vault_id: "0xf78d2ee3c312f298882cb680695e5e8c81b1d441a646caccc058006c2851ddea",
11582
11592
  admin_cap_id: "0xa456f86a53fc31e1243f065738ff1fc93f5a62cc080ff894a0fb3747556a799b"
11583
11593
  },
@@ -11585,11 +11595,13 @@ var SDKConfig2 = {
11585
11595
  coin_list_id: "0x257eb2ba592a5480bba0a97d05338fab17cc3283f8df6998a0e12e4ab9b84478",
11586
11596
  launchpad_pools_id: "0xdc3a7bd66a6dcff73c77c866e87d73826e446e9171f34e1c1b656377314f94da",
11587
11597
  clmm_pools_id: "0x26c85500f5dd2983bf35123918a144de24e18936d0b234ef2b49fbb2d3d6307d",
11588
- admin_cap_id: "0x1a496f6c67668eb2c27c99e07e1d61754715c1acf86dac45020c886ac601edb8",
11598
+ admin_cap_id: "0xd328ff427794b8ca0a69c3ebb0c0e4d2e81267ec4ba36e11487362c6508a4c0f",
11589
11599
  coin_list_handle: "0x3204350fc603609c91675e07b8f9ac0999b9607d83845086321fca7f469de235",
11590
11600
  launchpad_pools_handle: "0xae67ff87c34aceea4d28107f9c6c62e297a111e9f8e70b9abbc2f4c9f5ec20fd",
11591
- clmm_pools_handle: "0xd28736923703342b4752f5ed8c2f2a5c0cb2336c30e1fed42b387234ce8408ec",
11592
- global_config_id: "0xbbe54f3c2bd06c5ab7f93950025bff6710c9a83836d7145636fea383b315774d",
11601
+ clmm_pools_handle: "0xd28736923703342b4752f5ed8c2f2a5c0cb2336c30e1fed42b387234ce8408ec"
11602
+ },
11603
+ ve33Config: {
11604
+ // global_config_id: '0xbbe54f3c2bd06c5ab7f93950025bff6710c9a83836d7145636fea383b315774d',
11593
11605
  voter_id: "0x59571991a5c7041c4376d980061af5c7a6d8345006d6b5167bd1f00fc17b8ddb",
11594
11606
  voting_escrow_id: "0x9081c8044719135da4ff2d52907fcd40c19e2a40750cbba4c1d6a59610ae1446",
11595
11607
  reward_distributor_id: "0xdf213d8e0ca49c8f4a508e7d3b3a6983c4aafd639f7c99479fc75fb4451d752e",
@@ -11604,13 +11616,18 @@ var SDKConfig2 = {
11604
11616
  var clmmTestnet = {
11605
11617
  fullRpcUrl: getFullnodeUrl2("testnet"),
11606
11618
  magma_config: {
11607
- package_id: "0xf5ff7d5ba73b581bca6b4b9fa0049cd320360abd154b809f8700a8fd3cfaf7ca",
11608
- published_at: "0xf5ff7d5ba73b581bca6b4b9fa0049cd320360abd154b809f8700a8fd3cfaf7ca",
11619
+ package_id: "",
11620
+ published_at: "",
11609
11621
  config: SDKConfig2.magmaConfig
11610
11622
  },
11623
+ ve33: {
11624
+ package_id: "0x7ab45fbe01da26e07ba21757916d540c8747cf7daa88f3171e13db17373d5adc",
11625
+ published_at: "0x7ab45fbe01da26e07ba21757916d540c8747cf7daa88f3171e13db17373d5adc",
11626
+ config: SDKConfig2.ve33Config
11627
+ },
11611
11628
  clmm_pool: {
11612
- package_id: "0x23e0b5ab4aa63d0e6fd98fa5e247bcf9b36ad716b479d39e56b2ba9ff631e09d",
11613
- published_at: "0x23e0b5ab4aa63d0e6fd98fa5e247bcf9b36ad716b479d39e56b2ba9ff631e09d",
11629
+ package_id: "0xca1b84a430d03e22dae08a7273c8e9dcfdb40b7f559574105f008600eeb7b4bd",
11630
+ published_at: "0xca1b84a430d03e22dae08a7273c8e9dcfdb40b7f559574105f008600eeb7b4bd",
11614
11631
  config: SDKConfig2.clmmConfig
11615
11632
  },
11616
11633
  dlmm_pool: {
@@ -11623,8 +11640,8 @@ var clmmTestnet = {
11623
11640
  published_at: "0x45ac2371c33ca0df8dc784d62c8ce5126d42edd8c56820396524dff2ae0619b1"
11624
11641
  },
11625
11642
  integrate: {
11626
- package_id: "0x6d225cd7b90ca74b13e7de114c6eba2f844a1e5e1a4d7459048386bfff0d45df",
11627
- published_at: "0x6d225cd7b90ca74b13e7de114c6eba2f844a1e5e1a4d7459048386bfff0d45df"
11643
+ package_id: "0x975672d26fc9ba026a35f2001951fbcf5e37e75aca41db7c762d61b4e1e64986",
11644
+ published_at: "0x975672d26fc9ba026a35f2001951fbcf5e37e75aca41db7c762d61b4e1e64986"
11628
11645
  },
11629
11646
  simulationAccount: {
11630
11647
  address: "0x0000000000000000000000000000000000000000000000000000000000000000"
@@ -11641,7 +11658,7 @@ var clmmTestnet = {
11641
11658
  package_id: "0x56d90d0c055edb534b11e7548270bb458fd47c69b77bf40c14d5eb00e6e6cf64",
11642
11659
  published_at: "0x56d90d0c055edb534b11e7548270bb458fd47c69b77bf40c14d5eb00e6e6cf64"
11643
11660
  },
11644
- aggregatorUrl: "https://api-sui.devmagma.com/router",
11661
+ aggregatorUrl: "https://testnet.magmafinance.io/api/router",
11645
11662
  swapCountUrl: "https://api-sui.devmagma.com/v2/sui/swap/count"
11646
11663
  };
11647
11664
  function initTestnetSDK(fullNodeUrl, simulationAccount) {