@magmaprotocol/magma-clmm-sdk 0.5.110 → 0.5.111
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 +11 -32
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +11 -32
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -10752,8 +10752,7 @@ var AlmmModule = class {
|
|
|
10752
10752
|
tx.object(global_config_id),
|
|
10753
10753
|
tx.pure.u64(params.base_fee),
|
|
10754
10754
|
tx.pure.u16(params.bin_step),
|
|
10755
|
-
tx.pure.u32(storage_id)
|
|
10756
|
-
tx.object(CLOCK_ADDRESS)
|
|
10755
|
+
tx.pure.u32(storage_id)
|
|
10757
10756
|
];
|
|
10758
10757
|
tx.moveCall({
|
|
10759
10758
|
target: `${integrate.published_at}::${AlmmScript}::create_pair`,
|
|
@@ -11031,20 +11030,13 @@ var AlmmModule = class {
|
|
|
11031
11030
|
async burnPosition(params) {
|
|
11032
11031
|
const tx = new import_transactions12.Transaction();
|
|
11033
11032
|
tx.setSender(this.sdk.senderAddress);
|
|
11034
|
-
const { integrate, clmm_pool
|
|
11033
|
+
const { integrate, clmm_pool } = this.sdk.sdkOptions;
|
|
11035
11034
|
const clmmConfigs = getPackagerConfigs(clmm_pool);
|
|
11036
|
-
const almmConfig = getPackagerConfigs(almm_pool);
|
|
11037
11035
|
const typeArguments = [params.coin_a, params.coin_b, ...params.rewards_token];
|
|
11038
|
-
let args = [tx.object(
|
|
11036
|
+
let args = [tx.object(params.pool_id), tx.object(params.position_id), tx.object(CLOCK_ADDRESS)];
|
|
11039
11037
|
let target = `${integrate.published_at}::${AlmmScript}::burn_position`;
|
|
11040
11038
|
if (params.rewards_token.length > 0) {
|
|
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
|
+
args = [tx.object(params.pool_id), tx.object(clmmConfigs.global_vault_id), tx.object(params.position_id), tx.object(CLOCK_ADDRESS)];
|
|
11048
11040
|
target = `${integrate.published_at}::${AlmmScript}::burn_position_reward${params.rewards_token.length}`;
|
|
11049
11041
|
}
|
|
11050
11042
|
tx.moveCall({
|
|
@@ -11057,21 +11049,13 @@ var AlmmModule = class {
|
|
|
11057
11049
|
async shrinkPosition(params) {
|
|
11058
11050
|
const tx = new import_transactions12.Transaction();
|
|
11059
11051
|
tx.setSender(this.sdk.senderAddress);
|
|
11060
|
-
const { integrate, clmm_pool
|
|
11052
|
+
const { integrate, clmm_pool } = this.sdk.sdkOptions;
|
|
11061
11053
|
const clmmConfigs = getPackagerConfigs(clmm_pool);
|
|
11062
|
-
const almmConfig = getPackagerConfigs(almm_pool);
|
|
11063
11054
|
const typeArguments = [params.coin_a, params.coin_b, ...params.rewards_token];
|
|
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
|
+
let args = [tx.object(params.pool_id), tx.object(params.position_id), tx.pure.u64(params.delta_percentage), tx.object(CLOCK_ADDRESS)];
|
|
11071
11056
|
let target = `${integrate.published_at}::${AlmmScript}::shrink_position`;
|
|
11072
11057
|
if (params.rewards_token.length > 0) {
|
|
11073
11058
|
args = [
|
|
11074
|
-
tx.object(almmConfig.factory),
|
|
11075
11059
|
tx.object(params.pool_id),
|
|
11076
11060
|
tx.object(clmmConfigs.global_vault_id),
|
|
11077
11061
|
tx.object(params.position_id),
|
|
@@ -11108,12 +11092,10 @@ var AlmmModule = class {
|
|
|
11108
11092
|
async collectReward(params, transaction) {
|
|
11109
11093
|
const tx = transaction || new import_transactions12.Transaction();
|
|
11110
11094
|
tx.setSender(this.sdk.senderAddress);
|
|
11111
|
-
const { integrate, clmm_pool
|
|
11095
|
+
const { integrate, clmm_pool } = this.sdk.sdkOptions;
|
|
11112
11096
|
const clmmConfigs = getPackagerConfigs(clmm_pool);
|
|
11113
|
-
const almmConfig = getPackagerConfigs(almm_pool);
|
|
11114
11097
|
const typeArguments = [params.coin_a, params.coin_b, ...params.rewards_token];
|
|
11115
11098
|
const args = [
|
|
11116
|
-
tx.object(almmConfig.factory),
|
|
11117
11099
|
tx.object(params.pool_id),
|
|
11118
11100
|
tx.object(clmmConfigs.global_vault_id),
|
|
11119
11101
|
tx.object(params.position_id),
|
|
@@ -11133,10 +11115,9 @@ var AlmmModule = class {
|
|
|
11133
11115
|
async collectFees(params, transaction) {
|
|
11134
11116
|
const tx = transaction || new import_transactions12.Transaction();
|
|
11135
11117
|
tx.setSender(this.sdk.senderAddress);
|
|
11136
|
-
const { integrate
|
|
11137
|
-
const almmConfig = getPackagerConfigs(almm_pool);
|
|
11118
|
+
const { integrate } = this.sdk.sdkOptions;
|
|
11138
11119
|
const typeArguments = [params.coin_a, params.coin_b];
|
|
11139
|
-
const args = [tx.object(
|
|
11120
|
+
const args = [tx.object(params.pool_id), tx.object(params.position_id), tx.object(CLOCK_ADDRESS)];
|
|
11140
11121
|
const target = `${integrate.published_at}::${AlmmScript}::collect_fees`;
|
|
11141
11122
|
tx.moveCall({
|
|
11142
11123
|
target,
|
|
@@ -11186,9 +11167,8 @@ var AlmmModule = class {
|
|
|
11186
11167
|
async swap(params) {
|
|
11187
11168
|
const tx = new import_transactions12.Transaction();
|
|
11188
11169
|
tx.setSender(this.sdk.senderAddress);
|
|
11189
|
-
const { clmm_pool,
|
|
11170
|
+
const { clmm_pool, integrate } = this.sdk.sdkOptions;
|
|
11190
11171
|
const { global_config_id } = getPackagerConfigs(clmm_pool);
|
|
11191
|
-
const almmConfig = getPackagerConfigs(almm_pool);
|
|
11192
11172
|
const typeArguments = [params.coinTypeA, params.coinTypeB];
|
|
11193
11173
|
const allCoinAsset = await this._sdk.getOwnerCoinAssets(this._sdk.senderAddress);
|
|
11194
11174
|
const primaryCoinInputA = TransactionUtil.buildCoinForAmount(
|
|
@@ -11208,7 +11188,6 @@ var AlmmModule = class {
|
|
|
11208
11188
|
true
|
|
11209
11189
|
);
|
|
11210
11190
|
const args = [
|
|
11211
|
-
tx.object(almmConfig.factory),
|
|
11212
11191
|
tx.object(params.pair),
|
|
11213
11192
|
tx.object(global_config_id),
|
|
11214
11193
|
primaryCoinInputA.targetCoin,
|
|
@@ -11337,7 +11316,7 @@ var AlmmModule = class {
|
|
|
11337
11316
|
const cacheKey = `${position.pos_object_id}_getPositionList`;
|
|
11338
11317
|
this.updateCache(cacheKey, position, cacheTime24h);
|
|
11339
11318
|
if (hasAssignPoolIds) {
|
|
11340
|
-
if (assignPoolIds.includes(position.
|
|
11319
|
+
if (assignPoolIds.includes(position.pool)) {
|
|
11341
11320
|
allPosition.push(position);
|
|
11342
11321
|
}
|
|
11343
11322
|
} else {
|