@magmaprotocol/magma-clmm-sdk 0.5.116 → 0.5.117

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
@@ -10789,7 +10789,8 @@ var AlmmModule = class {
10789
10789
  tx.object(global_config_id),
10790
10790
  tx.pure.u64(params.base_fee),
10791
10791
  tx.pure.u16(params.bin_step),
10792
- tx.pure.u32(storage_id)
10792
+ tx.pure.u32(storage_id),
10793
+ tx.object(CLOCK_ADDRESS)
10793
10794
  ];
10794
10795
  tx.moveCall({
10795
10796
  target: `${integrate.published_at}::${AlmmScript}::create_pair`,
@@ -11067,13 +11068,20 @@ var AlmmModule = class {
11067
11068
  async burnPosition(params) {
11068
11069
  const tx = new import_transactions12.Transaction();
11069
11070
  tx.setSender(this.sdk.senderAddress);
11070
- const { integrate, clmm_pool } = this.sdk.sdkOptions;
11071
+ const { integrate, clmm_pool, almm_pool } = this.sdk.sdkOptions;
11071
11072
  const clmmConfigs = getPackagerConfigs(clmm_pool);
11073
+ const almmConfig = getPackagerConfigs(almm_pool);
11072
11074
  const typeArguments = [params.coin_a, params.coin_b, ...params.rewards_token];
11073
- let args = [tx.object(params.pool_id), tx.object(params.position_id), tx.object(CLOCK_ADDRESS)];
11075
+ let args = [tx.object(almmConfig.factory), tx.object(params.pool_id), tx.object(params.position_id), tx.object(CLOCK_ADDRESS)];
11074
11076
  let target = `${integrate.published_at}::${AlmmScript}::burn_position`;
11075
11077
  if (params.rewards_token.length > 0) {
11076
- args = [tx.object(params.pool_id), tx.object(clmmConfigs.global_vault_id), tx.object(params.position_id), tx.object(CLOCK_ADDRESS)];
11078
+ args = [
11079
+ tx.object(almmConfig.factory),
11080
+ tx.object(params.pool_id),
11081
+ tx.object(clmmConfigs.global_vault_id),
11082
+ tx.object(params.position_id),
11083
+ tx.object(CLOCK_ADDRESS)
11084
+ ];
11077
11085
  target = `${integrate.published_at}::${AlmmScript}::burn_position_reward${params.rewards_token.length}`;
11078
11086
  }
11079
11087
  tx.moveCall({
@@ -11086,13 +11094,21 @@ var AlmmModule = class {
11086
11094
  async shrinkPosition(params) {
11087
11095
  const tx = new import_transactions12.Transaction();
11088
11096
  tx.setSender(this.sdk.senderAddress);
11089
- const { integrate, clmm_pool } = this.sdk.sdkOptions;
11097
+ const { integrate, clmm_pool, almm_pool } = this.sdk.sdkOptions;
11090
11098
  const clmmConfigs = getPackagerConfigs(clmm_pool);
11099
+ const almmConfig = getPackagerConfigs(almm_pool);
11091
11100
  const typeArguments = [params.coin_a, params.coin_b, ...params.rewards_token];
11092
- let args = [tx.object(params.pool_id), tx.object(params.position_id), tx.pure.u64(params.delta_percentage), tx.object(CLOCK_ADDRESS)];
11101
+ let args = [
11102
+ tx.object(almmConfig.factory),
11103
+ tx.object(params.pool_id),
11104
+ tx.object(params.position_id),
11105
+ tx.pure.u64(params.delta_percentage),
11106
+ tx.object(CLOCK_ADDRESS)
11107
+ ];
11093
11108
  let target = `${integrate.published_at}::${AlmmScript}::shrink_position`;
11094
11109
  if (params.rewards_token.length > 0) {
11095
11110
  args = [
11111
+ tx.object(almmConfig.factory),
11096
11112
  tx.object(params.pool_id),
11097
11113
  tx.object(clmmConfigs.global_vault_id),
11098
11114
  tx.object(params.position_id),
@@ -11129,10 +11145,12 @@ var AlmmModule = class {
11129
11145
  async collectReward(params, transaction) {
11130
11146
  const tx = transaction || new import_transactions12.Transaction();
11131
11147
  tx.setSender(this.sdk.senderAddress);
11132
- const { integrate, clmm_pool } = this.sdk.sdkOptions;
11148
+ const { integrate, clmm_pool, almm_pool } = this.sdk.sdkOptions;
11133
11149
  const clmmConfigs = getPackagerConfigs(clmm_pool);
11150
+ const almmConfig = getPackagerConfigs(almm_pool);
11134
11151
  const typeArguments = [params.coin_a, params.coin_b, ...params.rewards_token];
11135
11152
  const args = [
11153
+ tx.object(almmConfig.factory),
11136
11154
  tx.object(params.pool_id),
11137
11155
  tx.object(clmmConfigs.global_vault_id),
11138
11156
  tx.object(params.position_id),
@@ -11152,9 +11170,10 @@ var AlmmModule = class {
11152
11170
  async collectFees(params, transaction) {
11153
11171
  const tx = transaction || new import_transactions12.Transaction();
11154
11172
  tx.setSender(this.sdk.senderAddress);
11155
- const { integrate } = this.sdk.sdkOptions;
11173
+ const { integrate, almm_pool } = this.sdk.sdkOptions;
11174
+ const almmConfig = getPackagerConfigs(almm_pool);
11156
11175
  const typeArguments = [params.coin_a, params.coin_b];
11157
- const args = [tx.object(params.pool_id), tx.object(params.position_id), tx.object(CLOCK_ADDRESS)];
11176
+ const args = [tx.object(almmConfig.factory), tx.object(params.pool_id), tx.object(params.position_id), tx.object(CLOCK_ADDRESS)];
11158
11177
  const target = `${integrate.published_at}::${AlmmScript}::collect_fees`;
11159
11178
  tx.moveCall({
11160
11179
  target,
@@ -11204,8 +11223,9 @@ var AlmmModule = class {
11204
11223
  async swap(params) {
11205
11224
  const tx = new import_transactions12.Transaction();
11206
11225
  tx.setSender(this.sdk.senderAddress);
11207
- const { clmm_pool, integrate } = this.sdk.sdkOptions;
11226
+ const { clmm_pool, almm_pool, integrate } = this.sdk.sdkOptions;
11208
11227
  const { global_config_id } = getPackagerConfigs(clmm_pool);
11228
+ const almmConfig = getPackagerConfigs(almm_pool);
11209
11229
  const typeArguments = [params.coinTypeA, params.coinTypeB];
11210
11230
  const allCoinAsset = await this._sdk.getOwnerCoinAssets(this._sdk.senderAddress);
11211
11231
  const primaryCoinInputA = TransactionUtil.buildCoinForAmount(
@@ -11225,6 +11245,7 @@ var AlmmModule = class {
11225
11245
  true
11226
11246
  );
11227
11247
  const args = [
11248
+ tx.object(almmConfig.factory),
11228
11249
  tx.object(params.pair),
11229
11250
  tx.object(global_config_id),
11230
11251
  primaryCoinInputA.targetCoin,