@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 +31 -10
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +31 -10
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -10576,7 +10576,8 @@ var AlmmModule = class {
|
|
|
10576
10576
|
tx.object(global_config_id),
|
|
10577
10577
|
tx.pure.u64(params.base_fee),
|
|
10578
10578
|
tx.pure.u16(params.bin_step),
|
|
10579
|
-
tx.pure.u32(storage_id)
|
|
10579
|
+
tx.pure.u32(storage_id),
|
|
10580
|
+
tx.object(CLOCK_ADDRESS)
|
|
10580
10581
|
];
|
|
10581
10582
|
tx.moveCall({
|
|
10582
10583
|
target: `${integrate.published_at}::${AlmmScript}::create_pair`,
|
|
@@ -10854,13 +10855,20 @@ var AlmmModule = class {
|
|
|
10854
10855
|
async burnPosition(params) {
|
|
10855
10856
|
const tx = new Transaction12();
|
|
10856
10857
|
tx.setSender(this.sdk.senderAddress);
|
|
10857
|
-
const { integrate, clmm_pool } = this.sdk.sdkOptions;
|
|
10858
|
+
const { integrate, clmm_pool, almm_pool } = this.sdk.sdkOptions;
|
|
10858
10859
|
const clmmConfigs = getPackagerConfigs(clmm_pool);
|
|
10860
|
+
const almmConfig = getPackagerConfigs(almm_pool);
|
|
10859
10861
|
const typeArguments = [params.coin_a, params.coin_b, ...params.rewards_token];
|
|
10860
|
-
let args = [tx.object(params.pool_id), tx.object(params.position_id), tx.object(CLOCK_ADDRESS)];
|
|
10862
|
+
let args = [tx.object(almmConfig.factory), tx.object(params.pool_id), tx.object(params.position_id), tx.object(CLOCK_ADDRESS)];
|
|
10861
10863
|
let target = `${integrate.published_at}::${AlmmScript}::burn_position`;
|
|
10862
10864
|
if (params.rewards_token.length > 0) {
|
|
10863
|
-
args = [
|
|
10865
|
+
args = [
|
|
10866
|
+
tx.object(almmConfig.factory),
|
|
10867
|
+
tx.object(params.pool_id),
|
|
10868
|
+
tx.object(clmmConfigs.global_vault_id),
|
|
10869
|
+
tx.object(params.position_id),
|
|
10870
|
+
tx.object(CLOCK_ADDRESS)
|
|
10871
|
+
];
|
|
10864
10872
|
target = `${integrate.published_at}::${AlmmScript}::burn_position_reward${params.rewards_token.length}`;
|
|
10865
10873
|
}
|
|
10866
10874
|
tx.moveCall({
|
|
@@ -10873,13 +10881,21 @@ var AlmmModule = class {
|
|
|
10873
10881
|
async shrinkPosition(params) {
|
|
10874
10882
|
const tx = new Transaction12();
|
|
10875
10883
|
tx.setSender(this.sdk.senderAddress);
|
|
10876
|
-
const { integrate, clmm_pool } = this.sdk.sdkOptions;
|
|
10884
|
+
const { integrate, clmm_pool, almm_pool } = this.sdk.sdkOptions;
|
|
10877
10885
|
const clmmConfigs = getPackagerConfigs(clmm_pool);
|
|
10886
|
+
const almmConfig = getPackagerConfigs(almm_pool);
|
|
10878
10887
|
const typeArguments = [params.coin_a, params.coin_b, ...params.rewards_token];
|
|
10879
|
-
let args = [
|
|
10888
|
+
let args = [
|
|
10889
|
+
tx.object(almmConfig.factory),
|
|
10890
|
+
tx.object(params.pool_id),
|
|
10891
|
+
tx.object(params.position_id),
|
|
10892
|
+
tx.pure.u64(params.delta_percentage),
|
|
10893
|
+
tx.object(CLOCK_ADDRESS)
|
|
10894
|
+
];
|
|
10880
10895
|
let target = `${integrate.published_at}::${AlmmScript}::shrink_position`;
|
|
10881
10896
|
if (params.rewards_token.length > 0) {
|
|
10882
10897
|
args = [
|
|
10898
|
+
tx.object(almmConfig.factory),
|
|
10883
10899
|
tx.object(params.pool_id),
|
|
10884
10900
|
tx.object(clmmConfigs.global_vault_id),
|
|
10885
10901
|
tx.object(params.position_id),
|
|
@@ -10916,10 +10932,12 @@ var AlmmModule = class {
|
|
|
10916
10932
|
async collectReward(params, transaction) {
|
|
10917
10933
|
const tx = transaction || new Transaction12();
|
|
10918
10934
|
tx.setSender(this.sdk.senderAddress);
|
|
10919
|
-
const { integrate, clmm_pool } = this.sdk.sdkOptions;
|
|
10935
|
+
const { integrate, clmm_pool, almm_pool } = this.sdk.sdkOptions;
|
|
10920
10936
|
const clmmConfigs = getPackagerConfigs(clmm_pool);
|
|
10937
|
+
const almmConfig = getPackagerConfigs(almm_pool);
|
|
10921
10938
|
const typeArguments = [params.coin_a, params.coin_b, ...params.rewards_token];
|
|
10922
10939
|
const args = [
|
|
10940
|
+
tx.object(almmConfig.factory),
|
|
10923
10941
|
tx.object(params.pool_id),
|
|
10924
10942
|
tx.object(clmmConfigs.global_vault_id),
|
|
10925
10943
|
tx.object(params.position_id),
|
|
@@ -10939,9 +10957,10 @@ var AlmmModule = class {
|
|
|
10939
10957
|
async collectFees(params, transaction) {
|
|
10940
10958
|
const tx = transaction || new Transaction12();
|
|
10941
10959
|
tx.setSender(this.sdk.senderAddress);
|
|
10942
|
-
const { integrate } = this.sdk.sdkOptions;
|
|
10960
|
+
const { integrate, almm_pool } = this.sdk.sdkOptions;
|
|
10961
|
+
const almmConfig = getPackagerConfigs(almm_pool);
|
|
10943
10962
|
const typeArguments = [params.coin_a, params.coin_b];
|
|
10944
|
-
const args = [tx.object(params.pool_id), tx.object(params.position_id), tx.object(CLOCK_ADDRESS)];
|
|
10963
|
+
const args = [tx.object(almmConfig.factory), tx.object(params.pool_id), tx.object(params.position_id), tx.object(CLOCK_ADDRESS)];
|
|
10945
10964
|
const target = `${integrate.published_at}::${AlmmScript}::collect_fees`;
|
|
10946
10965
|
tx.moveCall({
|
|
10947
10966
|
target,
|
|
@@ -10991,8 +11010,9 @@ var AlmmModule = class {
|
|
|
10991
11010
|
async swap(params) {
|
|
10992
11011
|
const tx = new Transaction12();
|
|
10993
11012
|
tx.setSender(this.sdk.senderAddress);
|
|
10994
|
-
const { clmm_pool, integrate } = this.sdk.sdkOptions;
|
|
11013
|
+
const { clmm_pool, almm_pool, integrate } = this.sdk.sdkOptions;
|
|
10995
11014
|
const { global_config_id } = getPackagerConfigs(clmm_pool);
|
|
11015
|
+
const almmConfig = getPackagerConfigs(almm_pool);
|
|
10996
11016
|
const typeArguments = [params.coinTypeA, params.coinTypeB];
|
|
10997
11017
|
const allCoinAsset = await this._sdk.getOwnerCoinAssets(this._sdk.senderAddress);
|
|
10998
11018
|
const primaryCoinInputA = TransactionUtil.buildCoinForAmount(
|
|
@@ -11012,6 +11032,7 @@ var AlmmModule = class {
|
|
|
11012
11032
|
true
|
|
11013
11033
|
);
|
|
11014
11034
|
const args = [
|
|
11035
|
+
tx.object(almmConfig.factory),
|
|
11015
11036
|
tx.object(params.pair),
|
|
11016
11037
|
tx.object(global_config_id),
|
|
11017
11038
|
primaryCoinInputA.targetCoin,
|