@magmaprotocol/magma-clmm-sdk 0.5.109 → 0.5.110

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.js CHANGED
@@ -10752,7 +10752,8 @@ var AlmmModule = class {
10752
10752
  tx.object(global_config_id),
10753
10753
  tx.pure.u64(params.base_fee),
10754
10754
  tx.pure.u16(params.bin_step),
10755
- tx.pure.u32(storage_id)
10755
+ tx.pure.u32(storage_id),
10756
+ tx.object(CLOCK_ADDRESS)
10756
10757
  ];
10757
10758
  tx.moveCall({
10758
10759
  target: `${integrate.published_at}::${AlmmScript}::create_pair`,
@@ -11030,13 +11031,20 @@ var AlmmModule = class {
11030
11031
  async burnPosition(params) {
11031
11032
  const tx = new import_transactions12.Transaction();
11032
11033
  tx.setSender(this.sdk.senderAddress);
11033
- const { integrate, clmm_pool } = this.sdk.sdkOptions;
11034
+ const { integrate, clmm_pool, almm_pool } = this.sdk.sdkOptions;
11034
11035
  const clmmConfigs = getPackagerConfigs(clmm_pool);
11036
+ const almmConfig = getPackagerConfigs(almm_pool);
11035
11037
  const typeArguments = [params.coin_a, params.coin_b, ...params.rewards_token];
11036
- let args = [tx.object(params.pool_id), tx.object(params.position_id), tx.object(CLOCK_ADDRESS)];
11038
+ let args = [tx.object(almmConfig.factory), tx.object(params.pool_id), tx.object(params.position_id), tx.object(CLOCK_ADDRESS)];
11037
11039
  let target = `${integrate.published_at}::${AlmmScript}::burn_position`;
11038
11040
  if (params.rewards_token.length > 0) {
11039
- args = [tx.object(params.pool_id), tx.object(clmmConfigs.global_vault_id), tx.object(params.position_id), tx.object(CLOCK_ADDRESS)];
11041
+ args = [
11042
+ tx.object(almmConfig.factory),
11043
+ tx.object(params.pool_id),
11044
+ tx.object(clmmConfigs.global_vault_id),
11045
+ tx.object(params.position_id),
11046
+ tx.object(CLOCK_ADDRESS)
11047
+ ];
11040
11048
  target = `${integrate.published_at}::${AlmmScript}::burn_position_reward${params.rewards_token.length}`;
11041
11049
  }
11042
11050
  tx.moveCall({
@@ -11049,13 +11057,21 @@ var AlmmModule = class {
11049
11057
  async shrinkPosition(params) {
11050
11058
  const tx = new import_transactions12.Transaction();
11051
11059
  tx.setSender(this.sdk.senderAddress);
11052
- const { integrate, clmm_pool } = this.sdk.sdkOptions;
11060
+ const { integrate, clmm_pool, almm_pool } = this.sdk.sdkOptions;
11053
11061
  const clmmConfigs = getPackagerConfigs(clmm_pool);
11062
+ const almmConfig = getPackagerConfigs(almm_pool);
11054
11063
  const typeArguments = [params.coin_a, params.coin_b, ...params.rewards_token];
11055
- let args = [tx.object(params.pool_id), tx.object(params.position_id), tx.pure.u64(params.delta_percentage), tx.object(CLOCK_ADDRESS)];
11064
+ let args = [
11065
+ tx.object(almmConfig.factory),
11066
+ tx.object(params.pool_id),
11067
+ tx.object(params.position_id),
11068
+ tx.pure.u64(params.delta_percentage),
11069
+ tx.object(CLOCK_ADDRESS)
11070
+ ];
11056
11071
  let target = `${integrate.published_at}::${AlmmScript}::shrink_position`;
11057
11072
  if (params.rewards_token.length > 0) {
11058
11073
  args = [
11074
+ tx.object(almmConfig.factory),
11059
11075
  tx.object(params.pool_id),
11060
11076
  tx.object(clmmConfigs.global_vault_id),
11061
11077
  tx.object(params.position_id),
@@ -11092,10 +11108,12 @@ var AlmmModule = class {
11092
11108
  async collectReward(params, transaction) {
11093
11109
  const tx = transaction || new import_transactions12.Transaction();
11094
11110
  tx.setSender(this.sdk.senderAddress);
11095
- const { integrate, clmm_pool } = this.sdk.sdkOptions;
11111
+ const { integrate, clmm_pool, almm_pool } = this.sdk.sdkOptions;
11096
11112
  const clmmConfigs = getPackagerConfigs(clmm_pool);
11113
+ const almmConfig = getPackagerConfigs(almm_pool);
11097
11114
  const typeArguments = [params.coin_a, params.coin_b, ...params.rewards_token];
11098
11115
  const args = [
11116
+ tx.object(almmConfig.factory),
11099
11117
  tx.object(params.pool_id),
11100
11118
  tx.object(clmmConfigs.global_vault_id),
11101
11119
  tx.object(params.position_id),
@@ -11115,9 +11133,10 @@ var AlmmModule = class {
11115
11133
  async collectFees(params, transaction) {
11116
11134
  const tx = transaction || new import_transactions12.Transaction();
11117
11135
  tx.setSender(this.sdk.senderAddress);
11118
- const { integrate } = this.sdk.sdkOptions;
11136
+ const { integrate, almm_pool } = this.sdk.sdkOptions;
11137
+ const almmConfig = getPackagerConfigs(almm_pool);
11119
11138
  const typeArguments = [params.coin_a, params.coin_b];
11120
- const args = [tx.object(params.pool_id), tx.object(params.position_id), tx.object(CLOCK_ADDRESS)];
11139
+ const args = [tx.object(almmConfig.factory), tx.object(params.pool_id), tx.object(params.position_id), tx.object(CLOCK_ADDRESS)];
11121
11140
  const target = `${integrate.published_at}::${AlmmScript}::collect_fees`;
11122
11141
  tx.moveCall({
11123
11142
  target,
@@ -11167,8 +11186,9 @@ var AlmmModule = class {
11167
11186
  async swap(params) {
11168
11187
  const tx = new import_transactions12.Transaction();
11169
11188
  tx.setSender(this.sdk.senderAddress);
11170
- const { clmm_pool, integrate } = this.sdk.sdkOptions;
11189
+ const { clmm_pool, almm_pool, integrate } = this.sdk.sdkOptions;
11171
11190
  const { global_config_id } = getPackagerConfigs(clmm_pool);
11191
+ const almmConfig = getPackagerConfigs(almm_pool);
11172
11192
  const typeArguments = [params.coinTypeA, params.coinTypeB];
11173
11193
  const allCoinAsset = await this._sdk.getOwnerCoinAssets(this._sdk.senderAddress);
11174
11194
  const primaryCoinInputA = TransactionUtil.buildCoinForAmount(
@@ -11188,6 +11208,7 @@ var AlmmModule = class {
11188
11208
  true
11189
11209
  );
11190
11210
  const args = [
11211
+ tx.object(almmConfig.factory),
11191
11212
  tx.object(params.pair),
11192
11213
  tx.object(global_config_id),
11193
11214
  primaryCoinInputA.targetCoin,