@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 +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
|
@@ -10539,7 +10539,8 @@ var AlmmModule = class {
|
|
|
10539
10539
|
tx.object(global_config_id),
|
|
10540
10540
|
tx.pure.u64(params.base_fee),
|
|
10541
10541
|
tx.pure.u16(params.bin_step),
|
|
10542
|
-
tx.pure.u32(storage_id)
|
|
10542
|
+
tx.pure.u32(storage_id),
|
|
10543
|
+
tx.object(CLOCK_ADDRESS)
|
|
10543
10544
|
];
|
|
10544
10545
|
tx.moveCall({
|
|
10545
10546
|
target: `${integrate.published_at}::${AlmmScript}::create_pair`,
|
|
@@ -10817,13 +10818,20 @@ var AlmmModule = class {
|
|
|
10817
10818
|
async burnPosition(params) {
|
|
10818
10819
|
const tx = new Transaction12();
|
|
10819
10820
|
tx.setSender(this.sdk.senderAddress);
|
|
10820
|
-
const { integrate, clmm_pool } = this.sdk.sdkOptions;
|
|
10821
|
+
const { integrate, clmm_pool, almm_pool } = this.sdk.sdkOptions;
|
|
10821
10822
|
const clmmConfigs = getPackagerConfigs(clmm_pool);
|
|
10823
|
+
const almmConfig = getPackagerConfigs(almm_pool);
|
|
10822
10824
|
const typeArguments = [params.coin_a, params.coin_b, ...params.rewards_token];
|
|
10823
|
-
let args = [tx.object(params.pool_id), tx.object(params.position_id), tx.object(CLOCK_ADDRESS)];
|
|
10825
|
+
let args = [tx.object(almmConfig.factory), tx.object(params.pool_id), tx.object(params.position_id), tx.object(CLOCK_ADDRESS)];
|
|
10824
10826
|
let target = `${integrate.published_at}::${AlmmScript}::burn_position`;
|
|
10825
10827
|
if (params.rewards_token.length > 0) {
|
|
10826
|
-
args = [
|
|
10828
|
+
args = [
|
|
10829
|
+
tx.object(almmConfig.factory),
|
|
10830
|
+
tx.object(params.pool_id),
|
|
10831
|
+
tx.object(clmmConfigs.global_vault_id),
|
|
10832
|
+
tx.object(params.position_id),
|
|
10833
|
+
tx.object(CLOCK_ADDRESS)
|
|
10834
|
+
];
|
|
10827
10835
|
target = `${integrate.published_at}::${AlmmScript}::burn_position_reward${params.rewards_token.length}`;
|
|
10828
10836
|
}
|
|
10829
10837
|
tx.moveCall({
|
|
@@ -10836,13 +10844,21 @@ var AlmmModule = class {
|
|
|
10836
10844
|
async shrinkPosition(params) {
|
|
10837
10845
|
const tx = new Transaction12();
|
|
10838
10846
|
tx.setSender(this.sdk.senderAddress);
|
|
10839
|
-
const { integrate, clmm_pool } = this.sdk.sdkOptions;
|
|
10847
|
+
const { integrate, clmm_pool, almm_pool } = this.sdk.sdkOptions;
|
|
10840
10848
|
const clmmConfigs = getPackagerConfigs(clmm_pool);
|
|
10849
|
+
const almmConfig = getPackagerConfigs(almm_pool);
|
|
10841
10850
|
const typeArguments = [params.coin_a, params.coin_b, ...params.rewards_token];
|
|
10842
|
-
let args = [
|
|
10851
|
+
let args = [
|
|
10852
|
+
tx.object(almmConfig.factory),
|
|
10853
|
+
tx.object(params.pool_id),
|
|
10854
|
+
tx.object(params.position_id),
|
|
10855
|
+
tx.pure.u64(params.delta_percentage),
|
|
10856
|
+
tx.object(CLOCK_ADDRESS)
|
|
10857
|
+
];
|
|
10843
10858
|
let target = `${integrate.published_at}::${AlmmScript}::shrink_position`;
|
|
10844
10859
|
if (params.rewards_token.length > 0) {
|
|
10845
10860
|
args = [
|
|
10861
|
+
tx.object(almmConfig.factory),
|
|
10846
10862
|
tx.object(params.pool_id),
|
|
10847
10863
|
tx.object(clmmConfigs.global_vault_id),
|
|
10848
10864
|
tx.object(params.position_id),
|
|
@@ -10879,10 +10895,12 @@ var AlmmModule = class {
|
|
|
10879
10895
|
async collectReward(params, transaction) {
|
|
10880
10896
|
const tx = transaction || new Transaction12();
|
|
10881
10897
|
tx.setSender(this.sdk.senderAddress);
|
|
10882
|
-
const { integrate, clmm_pool } = this.sdk.sdkOptions;
|
|
10898
|
+
const { integrate, clmm_pool, almm_pool } = this.sdk.sdkOptions;
|
|
10883
10899
|
const clmmConfigs = getPackagerConfigs(clmm_pool);
|
|
10900
|
+
const almmConfig = getPackagerConfigs(almm_pool);
|
|
10884
10901
|
const typeArguments = [params.coin_a, params.coin_b, ...params.rewards_token];
|
|
10885
10902
|
const args = [
|
|
10903
|
+
tx.object(almmConfig.factory),
|
|
10886
10904
|
tx.object(params.pool_id),
|
|
10887
10905
|
tx.object(clmmConfigs.global_vault_id),
|
|
10888
10906
|
tx.object(params.position_id),
|
|
@@ -10902,9 +10920,10 @@ var AlmmModule = class {
|
|
|
10902
10920
|
async collectFees(params, transaction) {
|
|
10903
10921
|
const tx = transaction || new Transaction12();
|
|
10904
10922
|
tx.setSender(this.sdk.senderAddress);
|
|
10905
|
-
const { integrate } = this.sdk.sdkOptions;
|
|
10923
|
+
const { integrate, almm_pool } = this.sdk.sdkOptions;
|
|
10924
|
+
const almmConfig = getPackagerConfigs(almm_pool);
|
|
10906
10925
|
const typeArguments = [params.coin_a, params.coin_b];
|
|
10907
|
-
const args = [tx.object(params.pool_id), tx.object(params.position_id), tx.object(CLOCK_ADDRESS)];
|
|
10926
|
+
const args = [tx.object(almmConfig.factory), tx.object(params.pool_id), tx.object(params.position_id), tx.object(CLOCK_ADDRESS)];
|
|
10908
10927
|
const target = `${integrate.published_at}::${AlmmScript}::collect_fees`;
|
|
10909
10928
|
tx.moveCall({
|
|
10910
10929
|
target,
|
|
@@ -10954,8 +10973,9 @@ var AlmmModule = class {
|
|
|
10954
10973
|
async swap(params) {
|
|
10955
10974
|
const tx = new Transaction12();
|
|
10956
10975
|
tx.setSender(this.sdk.senderAddress);
|
|
10957
|
-
const { clmm_pool, integrate } = this.sdk.sdkOptions;
|
|
10976
|
+
const { clmm_pool, almm_pool, integrate } = this.sdk.sdkOptions;
|
|
10958
10977
|
const { global_config_id } = getPackagerConfigs(clmm_pool);
|
|
10978
|
+
const almmConfig = getPackagerConfigs(almm_pool);
|
|
10959
10979
|
const typeArguments = [params.coinTypeA, params.coinTypeB];
|
|
10960
10980
|
const allCoinAsset = await this._sdk.getOwnerCoinAssets(this._sdk.senderAddress);
|
|
10961
10981
|
const primaryCoinInputA = TransactionUtil.buildCoinForAmount(
|
|
@@ -10975,6 +10995,7 @@ var AlmmModule = class {
|
|
|
10975
10995
|
true
|
|
10976
10996
|
);
|
|
10977
10997
|
const args = [
|
|
10998
|
+
tx.object(almmConfig.factory),
|
|
10978
10999
|
tx.object(params.pair),
|
|
10979
11000
|
tx.object(global_config_id),
|
|
10980
11001
|
primaryCoinInputA.targetCoin,
|