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