@magmaprotocol/magma-clmm-sdk 0.5.108 → 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 +33 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +33 -11
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2835,7 +2835,8 @@ function buildPosition(object) {
|
|
|
2835
2835
|
fee_owed_a: "0",
|
|
2836
2836
|
fee_growth_inside_b: "0",
|
|
2837
2837
|
fee_owed_b: "0",
|
|
2838
|
-
position_status: "Exists" /* Exists
|
|
2838
|
+
position_status: "Exists" /* Exists */,
|
|
2839
|
+
name: fields.name
|
|
2839
2840
|
};
|
|
2840
2841
|
}
|
|
2841
2842
|
const deletedResponse = getObjectDeletedResponse(object);
|
|
@@ -10538,7 +10539,8 @@ var AlmmModule = class {
|
|
|
10538
10539
|
tx.object(global_config_id),
|
|
10539
10540
|
tx.pure.u64(params.base_fee),
|
|
10540
10541
|
tx.pure.u16(params.bin_step),
|
|
10541
|
-
tx.pure.u32(storage_id)
|
|
10542
|
+
tx.pure.u32(storage_id),
|
|
10543
|
+
tx.object(CLOCK_ADDRESS)
|
|
10542
10544
|
];
|
|
10543
10545
|
tx.moveCall({
|
|
10544
10546
|
target: `${integrate.published_at}::${AlmmScript}::create_pair`,
|
|
@@ -10816,13 +10818,20 @@ var AlmmModule = class {
|
|
|
10816
10818
|
async burnPosition(params) {
|
|
10817
10819
|
const tx = new Transaction12();
|
|
10818
10820
|
tx.setSender(this.sdk.senderAddress);
|
|
10819
|
-
const { integrate, clmm_pool } = this.sdk.sdkOptions;
|
|
10821
|
+
const { integrate, clmm_pool, almm_pool } = this.sdk.sdkOptions;
|
|
10820
10822
|
const clmmConfigs = getPackagerConfigs(clmm_pool);
|
|
10823
|
+
const almmConfig = getPackagerConfigs(almm_pool);
|
|
10821
10824
|
const typeArguments = [params.coin_a, params.coin_b, ...params.rewards_token];
|
|
10822
|
-
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)];
|
|
10823
10826
|
let target = `${integrate.published_at}::${AlmmScript}::burn_position`;
|
|
10824
10827
|
if (params.rewards_token.length > 0) {
|
|
10825
|
-
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
|
+
];
|
|
10826
10835
|
target = `${integrate.published_at}::${AlmmScript}::burn_position_reward${params.rewards_token.length}`;
|
|
10827
10836
|
}
|
|
10828
10837
|
tx.moveCall({
|
|
@@ -10835,13 +10844,21 @@ var AlmmModule = class {
|
|
|
10835
10844
|
async shrinkPosition(params) {
|
|
10836
10845
|
const tx = new Transaction12();
|
|
10837
10846
|
tx.setSender(this.sdk.senderAddress);
|
|
10838
|
-
const { integrate, clmm_pool } = this.sdk.sdkOptions;
|
|
10847
|
+
const { integrate, clmm_pool, almm_pool } = this.sdk.sdkOptions;
|
|
10839
10848
|
const clmmConfigs = getPackagerConfigs(clmm_pool);
|
|
10849
|
+
const almmConfig = getPackagerConfigs(almm_pool);
|
|
10840
10850
|
const typeArguments = [params.coin_a, params.coin_b, ...params.rewards_token];
|
|
10841
|
-
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
|
+
];
|
|
10842
10858
|
let target = `${integrate.published_at}::${AlmmScript}::shrink_position`;
|
|
10843
10859
|
if (params.rewards_token.length > 0) {
|
|
10844
10860
|
args = [
|
|
10861
|
+
tx.object(almmConfig.factory),
|
|
10845
10862
|
tx.object(params.pool_id),
|
|
10846
10863
|
tx.object(clmmConfigs.global_vault_id),
|
|
10847
10864
|
tx.object(params.position_id),
|
|
@@ -10878,10 +10895,12 @@ var AlmmModule = class {
|
|
|
10878
10895
|
async collectReward(params, transaction) {
|
|
10879
10896
|
const tx = transaction || new Transaction12();
|
|
10880
10897
|
tx.setSender(this.sdk.senderAddress);
|
|
10881
|
-
const { integrate, clmm_pool } = this.sdk.sdkOptions;
|
|
10898
|
+
const { integrate, clmm_pool, almm_pool } = this.sdk.sdkOptions;
|
|
10882
10899
|
const clmmConfigs = getPackagerConfigs(clmm_pool);
|
|
10900
|
+
const almmConfig = getPackagerConfigs(almm_pool);
|
|
10883
10901
|
const typeArguments = [params.coin_a, params.coin_b, ...params.rewards_token];
|
|
10884
10902
|
const args = [
|
|
10903
|
+
tx.object(almmConfig.factory),
|
|
10885
10904
|
tx.object(params.pool_id),
|
|
10886
10905
|
tx.object(clmmConfigs.global_vault_id),
|
|
10887
10906
|
tx.object(params.position_id),
|
|
@@ -10901,9 +10920,10 @@ var AlmmModule = class {
|
|
|
10901
10920
|
async collectFees(params, transaction) {
|
|
10902
10921
|
const tx = transaction || new Transaction12();
|
|
10903
10922
|
tx.setSender(this.sdk.senderAddress);
|
|
10904
|
-
const { integrate } = this.sdk.sdkOptions;
|
|
10923
|
+
const { integrate, almm_pool } = this.sdk.sdkOptions;
|
|
10924
|
+
const almmConfig = getPackagerConfigs(almm_pool);
|
|
10905
10925
|
const typeArguments = [params.coin_a, params.coin_b];
|
|
10906
|
-
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)];
|
|
10907
10927
|
const target = `${integrate.published_at}::${AlmmScript}::collect_fees`;
|
|
10908
10928
|
tx.moveCall({
|
|
10909
10929
|
target,
|
|
@@ -10953,8 +10973,9 @@ var AlmmModule = class {
|
|
|
10953
10973
|
async swap(params) {
|
|
10954
10974
|
const tx = new Transaction12();
|
|
10955
10975
|
tx.setSender(this.sdk.senderAddress);
|
|
10956
|
-
const { clmm_pool, integrate } = this.sdk.sdkOptions;
|
|
10976
|
+
const { clmm_pool, almm_pool, integrate } = this.sdk.sdkOptions;
|
|
10957
10977
|
const { global_config_id } = getPackagerConfigs(clmm_pool);
|
|
10978
|
+
const almmConfig = getPackagerConfigs(almm_pool);
|
|
10958
10979
|
const typeArguments = [params.coinTypeA, params.coinTypeB];
|
|
10959
10980
|
const allCoinAsset = await this._sdk.getOwnerCoinAssets(this._sdk.senderAddress);
|
|
10960
10981
|
const primaryCoinInputA = TransactionUtil.buildCoinForAmount(
|
|
@@ -10974,6 +10995,7 @@ var AlmmModule = class {
|
|
|
10974
10995
|
true
|
|
10975
10996
|
);
|
|
10976
10997
|
const args = [
|
|
10998
|
+
tx.object(almmConfig.factory),
|
|
10977
10999
|
tx.object(params.pair),
|
|
10978
11000
|
tx.object(global_config_id),
|
|
10979
11001
|
primaryCoinInputA.targetCoin,
|