@meteora-ag/dlmm 1.0.53 → 1.0.55
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.d.ts +108 -57
- package/dist/index.js +175 -87
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +148 -60
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -2
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@ var _web3js = require('@solana/web3.js');
|
|
|
9
9
|
|
|
10
10
|
// src/dlmm/idl.ts
|
|
11
11
|
var IDL = {
|
|
12
|
-
"version": "0.
|
|
12
|
+
"version": "0.8.0",
|
|
13
13
|
"name": "lb_clmm",
|
|
14
14
|
"constants": [
|
|
15
15
|
{
|
|
@@ -2307,7 +2307,7 @@ var IDL = {
|
|
|
2307
2307
|
]
|
|
2308
2308
|
},
|
|
2309
2309
|
{
|
|
2310
|
-
"name": "
|
|
2310
|
+
"name": "setActivationPoint",
|
|
2311
2311
|
"accounts": [
|
|
2312
2312
|
{
|
|
2313
2313
|
"name": "lbPair",
|
|
@@ -2322,13 +2322,13 @@ var IDL = {
|
|
|
2322
2322
|
],
|
|
2323
2323
|
"args": [
|
|
2324
2324
|
{
|
|
2325
|
-
"name": "
|
|
2325
|
+
"name": "activationPoint",
|
|
2326
2326
|
"type": "u64"
|
|
2327
2327
|
}
|
|
2328
2328
|
]
|
|
2329
2329
|
},
|
|
2330
2330
|
{
|
|
2331
|
-
"name": "
|
|
2331
|
+
"name": "setLockReleasePoint",
|
|
2332
2332
|
"accounts": [
|
|
2333
2333
|
{
|
|
2334
2334
|
"name": "position",
|
|
@@ -2358,7 +2358,7 @@ var IDL = {
|
|
|
2358
2358
|
],
|
|
2359
2359
|
"args": [
|
|
2360
2360
|
{
|
|
2361
|
-
"name": "
|
|
2361
|
+
"name": "newLockReleasePoint",
|
|
2362
2362
|
"type": "u64"
|
|
2363
2363
|
}
|
|
2364
2364
|
]
|
|
@@ -2582,7 +2582,7 @@ var IDL = {
|
|
|
2582
2582
|
]
|
|
2583
2583
|
},
|
|
2584
2584
|
{
|
|
2585
|
-
"name": "
|
|
2585
|
+
"name": "setPreActivationDuration",
|
|
2586
2586
|
"accounts": [
|
|
2587
2587
|
{
|
|
2588
2588
|
"name": "lbPair",
|
|
@@ -2597,7 +2597,7 @@ var IDL = {
|
|
|
2597
2597
|
],
|
|
2598
2598
|
"args": [
|
|
2599
2599
|
{
|
|
2600
|
-
"name": "
|
|
2600
|
+
"name": "preActivationDuration",
|
|
2601
2601
|
"type": "u16"
|
|
2602
2602
|
}
|
|
2603
2603
|
]
|
|
@@ -2788,10 +2788,16 @@ var IDL = {
|
|
|
2788
2788
|
},
|
|
2789
2789
|
{
|
|
2790
2790
|
"name": "requireBaseFactorSeed",
|
|
2791
|
+
"docs": [
|
|
2792
|
+
"Require base factor seed"
|
|
2793
|
+
],
|
|
2791
2794
|
"type": "u8"
|
|
2792
2795
|
},
|
|
2793
2796
|
{
|
|
2794
2797
|
"name": "baseFactorSeed",
|
|
2798
|
+
"docs": [
|
|
2799
|
+
"Base factor seed"
|
|
2800
|
+
],
|
|
2795
2801
|
"type": {
|
|
2796
2802
|
"array": [
|
|
2797
2803
|
"u8",
|
|
@@ -2800,13 +2806,18 @@ var IDL = {
|
|
|
2800
2806
|
}
|
|
2801
2807
|
},
|
|
2802
2808
|
{
|
|
2803
|
-
"name": "
|
|
2804
|
-
"
|
|
2805
|
-
"
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2809
|
+
"name": "activationType",
|
|
2810
|
+
"docs": [
|
|
2811
|
+
"Activation type"
|
|
2812
|
+
],
|
|
2813
|
+
"type": "u8"
|
|
2814
|
+
},
|
|
2815
|
+
{
|
|
2816
|
+
"name": "padding0",
|
|
2817
|
+
"docs": [
|
|
2818
|
+
"padding 0"
|
|
2819
|
+
],
|
|
2820
|
+
"type": "u8"
|
|
2810
2821
|
},
|
|
2811
2822
|
{
|
|
2812
2823
|
"name": "tokenXMint",
|
|
@@ -2846,11 +2857,16 @@ var IDL = {
|
|
|
2846
2857
|
}
|
|
2847
2858
|
},
|
|
2848
2859
|
{
|
|
2849
|
-
"name": "
|
|
2860
|
+
"name": "padding1",
|
|
2850
2861
|
"docs": [
|
|
2851
|
-
"Fee owner
|
|
2862
|
+
"_padding_1, previous Fee owner, BE CAREFUL FOR TOMBSTONE WHEN REUSE !!"
|
|
2852
2863
|
],
|
|
2853
|
-
"type":
|
|
2864
|
+
"type": {
|
|
2865
|
+
"array": [
|
|
2866
|
+
"u8",
|
|
2867
|
+
32
|
|
2868
|
+
]
|
|
2869
|
+
}
|
|
2854
2870
|
},
|
|
2855
2871
|
{
|
|
2856
2872
|
"name": "rewardInfos",
|
|
@@ -2902,7 +2918,7 @@ var IDL = {
|
|
|
2902
2918
|
{
|
|
2903
2919
|
"name": "preActivationSwapAddress",
|
|
2904
2920
|
"docs": [
|
|
2905
|
-
"Address allowed to swap when the current
|
|
2921
|
+
"Address allowed to swap when the current point is greater than or equal to the pre-activation point. The pre-activation point is calculated as `activation_point - pre_activation_duration`."
|
|
2906
2922
|
],
|
|
2907
2923
|
"type": "publicKey"
|
|
2908
2924
|
},
|
|
@@ -2914,23 +2930,23 @@ var IDL = {
|
|
|
2914
2930
|
"type": "publicKey"
|
|
2915
2931
|
},
|
|
2916
2932
|
{
|
|
2917
|
-
"name": "
|
|
2933
|
+
"name": "activationPoint",
|
|
2918
2934
|
"docs": [
|
|
2919
|
-
"
|
|
2935
|
+
"Time point to enable the pair. Only applicable for permission pair."
|
|
2920
2936
|
],
|
|
2921
2937
|
"type": "u64"
|
|
2922
2938
|
},
|
|
2923
2939
|
{
|
|
2924
|
-
"name": "
|
|
2940
|
+
"name": "preActivationDuration",
|
|
2925
2941
|
"docs": [
|
|
2926
|
-
"
|
|
2942
|
+
"Duration before activation activation_point. Used to calculate pre-activation time point for pre_activation_swap_address"
|
|
2927
2943
|
],
|
|
2928
2944
|
"type": "u64"
|
|
2929
2945
|
},
|
|
2930
2946
|
{
|
|
2931
2947
|
"name": "padding2",
|
|
2932
2948
|
"docs": [
|
|
2933
|
-
"
|
|
2949
|
+
"_padding 2 is reclaimed free space from swap_cap_deactivate_point and swap_cap_amount before, BE CAREFUL FOR TOMBSTONE WHEN REUSE !!"
|
|
2934
2950
|
],
|
|
2935
2951
|
"type": {
|
|
2936
2952
|
"array": [
|
|
@@ -2940,7 +2956,7 @@ var IDL = {
|
|
|
2940
2956
|
}
|
|
2941
2957
|
},
|
|
2942
2958
|
{
|
|
2943
|
-
"name": "
|
|
2959
|
+
"name": "lockDuration",
|
|
2944
2960
|
"docs": [
|
|
2945
2961
|
"Liquidity lock duration for positions which created before activate. Only applicable for permission pair."
|
|
2946
2962
|
],
|
|
@@ -2976,7 +2992,7 @@ var IDL = {
|
|
|
2976
2992
|
{
|
|
2977
2993
|
"name": "idx",
|
|
2978
2994
|
"docs": [
|
|
2979
|
-
"Index of latest observation
|
|
2995
|
+
"Index of latest observation"
|
|
2980
2996
|
],
|
|
2981
2997
|
"type": "u64"
|
|
2982
2998
|
},
|
|
@@ -3232,9 +3248,9 @@ var IDL = {
|
|
|
3232
3248
|
"type": "publicKey"
|
|
3233
3249
|
},
|
|
3234
3250
|
{
|
|
3235
|
-
"name": "
|
|
3251
|
+
"name": "lockReleasePoint",
|
|
3236
3252
|
"docs": [
|
|
3237
|
-
"
|
|
3253
|
+
"Time point which the locked liquidity can be withdraw"
|
|
3238
3254
|
],
|
|
3239
3255
|
"type": "u64"
|
|
3240
3256
|
},
|
|
@@ -3706,8 +3722,12 @@ var IDL = {
|
|
|
3706
3722
|
"type": "i32"
|
|
3707
3723
|
},
|
|
3708
3724
|
{
|
|
3709
|
-
"name": "
|
|
3725
|
+
"name": "lockDuration",
|
|
3710
3726
|
"type": "u64"
|
|
3727
|
+
},
|
|
3728
|
+
{
|
|
3729
|
+
"name": "activationType",
|
|
3730
|
+
"type": "u8"
|
|
3711
3731
|
}
|
|
3712
3732
|
]
|
|
3713
3733
|
}
|
|
@@ -4282,6 +4302,23 @@ var IDL = {
|
|
|
4282
4302
|
]
|
|
4283
4303
|
}
|
|
4284
4304
|
},
|
|
4305
|
+
{
|
|
4306
|
+
"name": "ActivationType",
|
|
4307
|
+
"docs": [
|
|
4308
|
+
"Type of the activation"
|
|
4309
|
+
],
|
|
4310
|
+
"type": {
|
|
4311
|
+
"kind": "enum",
|
|
4312
|
+
"variants": [
|
|
4313
|
+
{
|
|
4314
|
+
"name": "Slot"
|
|
4315
|
+
},
|
|
4316
|
+
{
|
|
4317
|
+
"name": "Timestamp"
|
|
4318
|
+
}
|
|
4319
|
+
]
|
|
4320
|
+
}
|
|
4321
|
+
},
|
|
4285
4322
|
{
|
|
4286
4323
|
"name": "PairType",
|
|
4287
4324
|
"docs": [
|
|
@@ -4784,7 +4821,7 @@ var IDL = {
|
|
|
4784
4821
|
]
|
|
4785
4822
|
},
|
|
4786
4823
|
{
|
|
4787
|
-
"name": "
|
|
4824
|
+
"name": "UpdatePositionLockReleasePoint",
|
|
4788
4825
|
"fields": [
|
|
4789
4826
|
{
|
|
4790
4827
|
"name": "position",
|
|
@@ -4792,17 +4829,17 @@ var IDL = {
|
|
|
4792
4829
|
"index": false
|
|
4793
4830
|
},
|
|
4794
4831
|
{
|
|
4795
|
-
"name": "
|
|
4832
|
+
"name": "currentPoint",
|
|
4796
4833
|
"type": "u64",
|
|
4797
4834
|
"index": false
|
|
4798
4835
|
},
|
|
4799
4836
|
{
|
|
4800
|
-
"name": "
|
|
4837
|
+
"name": "newLockReleasePoint",
|
|
4801
4838
|
"type": "u64",
|
|
4802
4839
|
"index": false
|
|
4803
4840
|
},
|
|
4804
4841
|
{
|
|
4805
|
-
"name": "
|
|
4842
|
+
"name": "oldLockReleasePoint",
|
|
4806
4843
|
"type": "u64",
|
|
4807
4844
|
"index": false
|
|
4808
4845
|
},
|
|
@@ -5097,43 +5134,38 @@ var IDL = {
|
|
|
5097
5134
|
},
|
|
5098
5135
|
{
|
|
5099
5136
|
"code": 6052,
|
|
5100
|
-
"name": "
|
|
5137
|
+
"name": "AlreadyPassActivationPoint",
|
|
5101
5138
|
"msg": "Already activated"
|
|
5102
5139
|
},
|
|
5103
5140
|
{
|
|
5104
5141
|
"code": 6053,
|
|
5105
|
-
"name": "LastSlotCannotBeSmallerThanActivateSlot",
|
|
5106
|
-
"msg": "Last slot cannot be smaller than activate slot"
|
|
5107
|
-
},
|
|
5108
|
-
{
|
|
5109
|
-
"code": 6054,
|
|
5110
5142
|
"name": "ExceedMaxSwappedAmount",
|
|
5111
5143
|
"msg": "Swapped amount is exceeded max swapped amount"
|
|
5112
5144
|
},
|
|
5113
5145
|
{
|
|
5114
|
-
"code":
|
|
5146
|
+
"code": 6054,
|
|
5115
5147
|
"name": "InvalidStrategyParameters",
|
|
5116
5148
|
"msg": "Invalid strategy parameters"
|
|
5117
5149
|
},
|
|
5118
5150
|
{
|
|
5119
|
-
"code":
|
|
5151
|
+
"code": 6055,
|
|
5120
5152
|
"name": "LiquidityLocked",
|
|
5121
5153
|
"msg": "Liquidity locked"
|
|
5122
5154
|
},
|
|
5123
5155
|
{
|
|
5124
|
-
"code":
|
|
5125
|
-
"name": "InvalidLockReleaseSlot",
|
|
5126
|
-
"msg": "Invalid lock release slot"
|
|
5127
|
-
},
|
|
5128
|
-
{
|
|
5129
|
-
"code": 6058,
|
|
5156
|
+
"code": 6056,
|
|
5130
5157
|
"name": "BinRangeIsNotEmpty",
|
|
5131
5158
|
"msg": "Bin range is not empty"
|
|
5132
5159
|
},
|
|
5133
5160
|
{
|
|
5134
|
-
"code":
|
|
5161
|
+
"code": 6057,
|
|
5135
5162
|
"name": "NotExactAmountOut",
|
|
5136
5163
|
"msg": "Amount out is not matched with exact amount out"
|
|
5164
|
+
},
|
|
5165
|
+
{
|
|
5166
|
+
"code": 6058,
|
|
5167
|
+
"name": "InvalidActivationType",
|
|
5168
|
+
"msg": "Invalid activation type"
|
|
5137
5169
|
}
|
|
5138
5170
|
]
|
|
5139
5171
|
};
|
|
@@ -5187,6 +5219,7 @@ var MAX_BIN_PER_TX = 69;
|
|
|
5187
5219
|
var MAX_ACTIVE_BIN_SLIPPAGE = 3;
|
|
5188
5220
|
|
|
5189
5221
|
// src/dlmm/types/index.ts
|
|
5222
|
+
var _borsh = require('@coral-xyz/borsh');
|
|
5190
5223
|
var PositionVersion = /* @__PURE__ */ ((PositionVersion2) => {
|
|
5191
5224
|
PositionVersion2[PositionVersion2["V1"] = 0] = "V1";
|
|
5192
5225
|
PositionVersion2[PositionVersion2["V2"] = 1] = "V2";
|
|
@@ -5220,11 +5253,28 @@ var StrategyType = /* @__PURE__ */ ((StrategyType2) => {
|
|
|
5220
5253
|
StrategyType2[StrategyType2["BidAskBalanced"] = 8] = "BidAskBalanced";
|
|
5221
5254
|
return StrategyType2;
|
|
5222
5255
|
})(StrategyType || {});
|
|
5256
|
+
var ActivationType = /* @__PURE__ */ ((ActivationType2) => {
|
|
5257
|
+
ActivationType2[ActivationType2["Slot"] = 0] = "Slot";
|
|
5258
|
+
ActivationType2[ActivationType2["Timestamp"] = 1] = "Timestamp";
|
|
5259
|
+
return ActivationType2;
|
|
5260
|
+
})(ActivationType || {});
|
|
5223
5261
|
var BitmapType = /* @__PURE__ */ ((BitmapType2) => {
|
|
5224
5262
|
BitmapType2[BitmapType2["U1024"] = 0] = "U1024";
|
|
5225
5263
|
BitmapType2[BitmapType2["U512"] = 1] = "U512";
|
|
5226
5264
|
return BitmapType2;
|
|
5227
5265
|
})(BitmapType || {});
|
|
5266
|
+
var ClockLayout = _borsh.struct.call(void 0, [
|
|
5267
|
+
_borsh.u64.call(void 0, "slot"),
|
|
5268
|
+
_borsh.i64.call(void 0, "epochStartTimestamp"),
|
|
5269
|
+
_borsh.u64.call(void 0, "epoch"),
|
|
5270
|
+
_borsh.u64.call(void 0, "leaderScheduleEpoch"),
|
|
5271
|
+
_borsh.i64.call(void 0, "unixTimestamp")
|
|
5272
|
+
]);
|
|
5273
|
+
var PairStatus = /* @__PURE__ */ ((PairStatus2) => {
|
|
5274
|
+
PairStatus2[PairStatus2["Enabled"] = 0] = "Enabled";
|
|
5275
|
+
PairStatus2[PairStatus2["Disabled"] = 1] = "Disabled";
|
|
5276
|
+
return PairStatus2;
|
|
5277
|
+
})(PairStatus || {});
|
|
5228
5278
|
|
|
5229
5279
|
// src/dlmm/index.ts
|
|
5230
5280
|
|
|
@@ -7443,15 +7493,27 @@ var _bytes = require('@coral-xyz/anchor/dist/cjs/utils/bytes');
|
|
|
7443
7493
|
|
|
7444
7494
|
|
|
7445
7495
|
var DLMM = class {
|
|
7446
|
-
constructor(pubkey, program, lbPair, binArrayBitmapExtension, tokenX, tokenY, opt) {
|
|
7496
|
+
constructor(pubkey, program, lbPair, binArrayBitmapExtension, tokenX, tokenY, clock, opt) {
|
|
7447
7497
|
this.pubkey = pubkey;
|
|
7448
7498
|
this.program = program;
|
|
7449
7499
|
this.lbPair = lbPair;
|
|
7450
7500
|
this.binArrayBitmapExtension = binArrayBitmapExtension;
|
|
7451
7501
|
this.tokenX = tokenX;
|
|
7452
7502
|
this.tokenY = tokenY;
|
|
7503
|
+
this.clock = clock;
|
|
7453
7504
|
this.opt = opt;
|
|
7454
7505
|
}
|
|
7506
|
+
validateSwapActivation() {
|
|
7507
|
+
if (this.lbPair.status == 1 /* Disabled */) {
|
|
7508
|
+
throw new Error("Pair is disabled");
|
|
7509
|
+
}
|
|
7510
|
+
if (this.lbPair.pairType == 1 /* Permissioned */) {
|
|
7511
|
+
const currentPoint = this.lbPair.activationType == 0 /* Slot */ ? this.clock.slot : this.clock.unixTimestamp;
|
|
7512
|
+
if (currentPoint < this.lbPair.activationPoint) {
|
|
7513
|
+
throw new Error("Pair is disabled");
|
|
7514
|
+
}
|
|
7515
|
+
}
|
|
7516
|
+
}
|
|
7455
7517
|
/** Static public method */
|
|
7456
7518
|
/**
|
|
7457
7519
|
* The function `getLbPairs` retrieves a list of LB pair accounts using a connection and optional
|
|
@@ -7539,7 +7601,11 @@ var DLMM = class {
|
|
|
7539
7601
|
dlmm,
|
|
7540
7602
|
program.programId
|
|
7541
7603
|
)[0];
|
|
7542
|
-
const accountsToFetch = [
|
|
7604
|
+
const accountsToFetch = [
|
|
7605
|
+
dlmm,
|
|
7606
|
+
binArrayBitMapExtensionPubkey,
|
|
7607
|
+
_web3js.SYSVAR_CLOCK_PUBKEY
|
|
7608
|
+
];
|
|
7543
7609
|
const accountsInfo = await chunkedGetMultipleAccountInfos(
|
|
7544
7610
|
connection,
|
|
7545
7611
|
accountsToFetch
|
|
@@ -7559,6 +7625,10 @@ var DLMM = class {
|
|
|
7559
7625
|
binArrayBitMapAccountInfoBuffer
|
|
7560
7626
|
);
|
|
7561
7627
|
}
|
|
7628
|
+
const clockAccountInfoBuffer = _optionalChain([accountsInfo, 'access', _31 => _31[2], 'optionalAccess', _32 => _32.data]);
|
|
7629
|
+
if (!clockAccountInfoBuffer)
|
|
7630
|
+
throw new Error(`Clock account not found`);
|
|
7631
|
+
const clock = ClockLayout.decode(clockAccountInfoBuffer);
|
|
7562
7632
|
const reserveAccountsInfo = await chunkedGetMultipleAccountInfos(
|
|
7563
7633
|
program.provider.connection,
|
|
7564
7634
|
[
|
|
@@ -7602,6 +7672,7 @@ var DLMM = class {
|
|
|
7602
7672
|
binArrayBitmapExtension,
|
|
7603
7673
|
tokenX,
|
|
7604
7674
|
tokenY,
|
|
7675
|
+
clock,
|
|
7605
7676
|
opt
|
|
7606
7677
|
);
|
|
7607
7678
|
}
|
|
@@ -7615,7 +7686,7 @@ var DLMM = class {
|
|
|
7615
7686
|
* objects.
|
|
7616
7687
|
*/
|
|
7617
7688
|
static async createMultiple(connection, dlmmList, opt) {
|
|
7618
|
-
const cluster = _optionalChain([opt, 'optionalAccess',
|
|
7689
|
+
const cluster = _optionalChain([opt, 'optionalAccess', _33 => _33.cluster]) || "mainnet-beta";
|
|
7619
7690
|
const provider = new (0, _anchor.AnchorProvider)(
|
|
7620
7691
|
connection,
|
|
7621
7692
|
{},
|
|
@@ -7623,21 +7694,30 @@ var DLMM = class {
|
|
|
7623
7694
|
);
|
|
7624
7695
|
const program = new (0, _anchor.Program)(
|
|
7625
7696
|
IDL,
|
|
7626
|
-
_nullishCoalesce(_optionalChain([opt, 'optionalAccess',
|
|
7697
|
+
_nullishCoalesce(_optionalChain([opt, 'optionalAccess', _34 => _34.programId]), () => ( LBCLMM_PROGRAM_IDS[cluster])),
|
|
7627
7698
|
provider
|
|
7628
7699
|
);
|
|
7629
7700
|
const binArrayBitMapExtensions = dlmmList.map(
|
|
7630
7701
|
(lbPair) => deriveBinArrayBitmapExtension(lbPair, program.programId)[0]
|
|
7631
7702
|
);
|
|
7632
|
-
const accountsToFetch = [
|
|
7703
|
+
const accountsToFetch = [
|
|
7704
|
+
...dlmmList,
|
|
7705
|
+
...binArrayBitMapExtensions,
|
|
7706
|
+
_web3js.SYSVAR_CLOCK_PUBKEY
|
|
7707
|
+
];
|
|
7633
7708
|
const accountsInfo = await chunkedGetMultipleAccountInfos(
|
|
7634
7709
|
connection,
|
|
7635
7710
|
accountsToFetch
|
|
7636
7711
|
);
|
|
7712
|
+
const clockAccount = accountsInfo.pop();
|
|
7713
|
+
const clockAccountInfoBuffer = _optionalChain([clockAccount, 'optionalAccess', _35 => _35.data]);
|
|
7714
|
+
if (!clockAccountInfoBuffer)
|
|
7715
|
+
throw new Error(`Clock account not found`);
|
|
7716
|
+
const clock = ClockLayout.decode(clockAccountInfoBuffer);
|
|
7637
7717
|
const lbPairArraysMap = /* @__PURE__ */ new Map();
|
|
7638
7718
|
for (let i = 0; i < dlmmList.length; i++) {
|
|
7639
7719
|
const lbPairPubKey = dlmmList[i];
|
|
7640
|
-
const lbPairAccountInfoBuffer = _optionalChain([accountsInfo, 'access',
|
|
7720
|
+
const lbPairAccountInfoBuffer = _optionalChain([accountsInfo, 'access', _36 => _36[i], 'optionalAccess', _37 => _37.data]);
|
|
7641
7721
|
if (!lbPairAccountInfoBuffer)
|
|
7642
7722
|
throw new Error(`LB Pair account ${lbPairPubKey.toBase58()} not found`);
|
|
7643
7723
|
const binArrayAccInfo = program.coder.accounts.decode(
|
|
@@ -7650,7 +7730,7 @@ var DLMM = class {
|
|
|
7650
7730
|
for (let i = dlmmList.length; i < accountsInfo.length; i++) {
|
|
7651
7731
|
const index = i - dlmmList.length;
|
|
7652
7732
|
const lbPairPubkey = dlmmList[index];
|
|
7653
|
-
const binArrayBitMapAccountInfoBuffer = _optionalChain([accountsInfo, 'access',
|
|
7733
|
+
const binArrayBitMapAccountInfoBuffer = _optionalChain([accountsInfo, 'access', _38 => _38[i], 'optionalAccess', _39 => _39.data]);
|
|
7654
7734
|
if (binArrayBitMapAccountInfoBuffer) {
|
|
7655
7735
|
const binArrayBitMapExtensionAccInfo = program.coder.accounts.decode(
|
|
7656
7736
|
"binArrayBitmapExtension",
|
|
@@ -7719,6 +7799,7 @@ var DLMM = class {
|
|
|
7719
7799
|
binArrayBitmapExtension,
|
|
7720
7800
|
tokenX,
|
|
7721
7801
|
tokenY,
|
|
7802
|
+
clock,
|
|
7722
7803
|
opt
|
|
7723
7804
|
);
|
|
7724
7805
|
})
|
|
@@ -7733,7 +7814,7 @@ var DLMM = class {
|
|
|
7733
7814
|
);
|
|
7734
7815
|
const program = new (0, _anchor.Program)(
|
|
7735
7816
|
IDL,
|
|
7736
|
-
_nullishCoalesce(_optionalChain([opt, 'optionalAccess',
|
|
7817
|
+
_nullishCoalesce(_optionalChain([opt, 'optionalAccess', _40 => _40.programId]), () => ( LBCLMM_PROGRAM_IDS[_nullishCoalesce(_optionalChain([opt, 'optionalAccess', _41 => _41.cluster]), () => ( "mainnet-beta"))])),
|
|
7737
7818
|
provider
|
|
7738
7819
|
);
|
|
7739
7820
|
const presetParameter = await program.account.presetParameter.all();
|
|
@@ -7751,7 +7832,7 @@ var DLMM = class {
|
|
|
7751
7832
|
* Pair account, and the value is an object of PositionInfo
|
|
7752
7833
|
*/
|
|
7753
7834
|
static async getAllLbPairPositionsByUser(connection, userPubKey, opt) {
|
|
7754
|
-
const cluster = _optionalChain([opt, 'optionalAccess',
|
|
7835
|
+
const cluster = _optionalChain([opt, 'optionalAccess', _42 => _42.cluster]) || "mainnet-beta";
|
|
7755
7836
|
const provider = new (0, _anchor.AnchorProvider)(
|
|
7756
7837
|
connection,
|
|
7757
7838
|
{},
|
|
@@ -7759,7 +7840,7 @@ var DLMM = class {
|
|
|
7759
7840
|
);
|
|
7760
7841
|
const program = new (0, _anchor.Program)(
|
|
7761
7842
|
IDL,
|
|
7762
|
-
_nullishCoalesce(_optionalChain([opt, 'optionalAccess',
|
|
7843
|
+
_nullishCoalesce(_optionalChain([opt, 'optionalAccess', _43 => _43.programId]), () => ( LBCLMM_PROGRAM_IDS[cluster])),
|
|
7763
7844
|
provider
|
|
7764
7845
|
);
|
|
7765
7846
|
const [positions, positionsV2] = await Promise.all([
|
|
@@ -7992,8 +8073,8 @@ var DLMM = class {
|
|
|
7992
8073
|
const { mintXDecimal, mintYDecimal } = lbPairMintMap.get(
|
|
7993
8074
|
lbPair.toBase58()
|
|
7994
8075
|
);
|
|
7995
|
-
const reserveXBalance = _nullishCoalesce(_optionalChain([lbPairReserveMap, 'access',
|
|
7996
|
-
const reserveYBalance = _nullishCoalesce(_optionalChain([lbPairReserveMap, 'access',
|
|
8076
|
+
const reserveXBalance = _nullishCoalesce(_optionalChain([lbPairReserveMap, 'access', _44 => _44.get, 'call', _45 => _45(lbPair.toBase58()), 'optionalAccess', _46 => _46.reserveX]), () => ( BigInt(0)));
|
|
8077
|
+
const reserveYBalance = _nullishCoalesce(_optionalChain([lbPairReserveMap, 'access', _47 => _47.get, 'call', _48 => _48(lbPair.toBase58()), 'optionalAccess', _49 => _49.reserveY]), () => ( BigInt(0)));
|
|
7997
8078
|
const tokenX = {
|
|
7998
8079
|
publicKey: lbPairAcc.tokenXMint,
|
|
7999
8080
|
reserve: lbPairAcc.reserveX,
|
|
@@ -8025,7 +8106,7 @@ var DLMM = class {
|
|
|
8025
8106
|
tokenX,
|
|
8026
8107
|
tokenY,
|
|
8027
8108
|
lbPairPositionsData: [
|
|
8028
|
-
..._nullishCoalesce(_optionalChain([positionsMap, 'access',
|
|
8109
|
+
..._nullishCoalesce(_optionalChain([positionsMap, 'access', _50 => _50.get, 'call', _51 => _51(lbPair.toBase58()), 'optionalAccess', _52 => _52.lbPairPositionsData]), () => ( [])),
|
|
8029
8110
|
{
|
|
8030
8111
|
publicKey: positionPubKey,
|
|
8031
8112
|
positionData,
|
|
@@ -8061,8 +8142,8 @@ var DLMM = class {
|
|
|
8061
8142
|
getTokenDecimals(program.provider.connection, lbPairAcc.tokenXMint),
|
|
8062
8143
|
getTokenDecimals(program.provider.connection, lbPairAcc.tokenYMint)
|
|
8063
8144
|
]);
|
|
8064
|
-
const reserveXBalance = _nullishCoalesce(_optionalChain([lbPairReserveMapV2, 'access',
|
|
8065
|
-
const reserveYBalance = _nullishCoalesce(_optionalChain([lbPairReserveMapV2, 'access',
|
|
8145
|
+
const reserveXBalance = _nullishCoalesce(_optionalChain([lbPairReserveMapV2, 'access', _53 => _53.get, 'call', _54 => _54(lbPair.toBase58()), 'optionalAccess', _55 => _55.reserveX]), () => ( BigInt(0)));
|
|
8146
|
+
const reserveYBalance = _nullishCoalesce(_optionalChain([lbPairReserveMapV2, 'access', _56 => _56.get, 'call', _57 => _57(lbPair.toBase58()), 'optionalAccess', _58 => _58.reserveY]), () => ( BigInt(0)));
|
|
8066
8147
|
const tokenX = {
|
|
8067
8148
|
publicKey: lbPairAcc.tokenXMint,
|
|
8068
8149
|
reserve: lbPairAcc.reserveX,
|
|
@@ -8094,7 +8175,7 @@ var DLMM = class {
|
|
|
8094
8175
|
tokenX,
|
|
8095
8176
|
tokenY,
|
|
8096
8177
|
lbPairPositionsData: [
|
|
8097
|
-
..._nullishCoalesce(_optionalChain([positionsMap, 'access',
|
|
8178
|
+
..._nullishCoalesce(_optionalChain([positionsMap, 'access', _59 => _59.get, 'call', _60 => _60(lbPair.toBase58()), 'optionalAccess', _61 => _61.lbPairPositionsData]), () => ( [])),
|
|
8098
8179
|
{
|
|
8099
8180
|
publicKey: positionPubKey,
|
|
8100
8181
|
positionData,
|
|
@@ -8107,7 +8188,7 @@ var DLMM = class {
|
|
|
8107
8188
|
return positionsMap;
|
|
8108
8189
|
}
|
|
8109
8190
|
static async migratePosition(connection, positions, newPositions, walletPubkey, opt) {
|
|
8110
|
-
const cluster = _optionalChain([opt, 'optionalAccess',
|
|
8191
|
+
const cluster = _optionalChain([opt, 'optionalAccess', _62 => _62.cluster]) || "mainnet-beta";
|
|
8111
8192
|
const provider = new (0, _anchor.AnchorProvider)(
|
|
8112
8193
|
connection,
|
|
8113
8194
|
{},
|
|
@@ -8115,7 +8196,7 @@ var DLMM = class {
|
|
|
8115
8196
|
);
|
|
8116
8197
|
const program = new (0, _anchor.Program)(
|
|
8117
8198
|
IDL,
|
|
8118
|
-
_nullishCoalesce(_optionalChain([opt, 'optionalAccess',
|
|
8199
|
+
_nullishCoalesce(_optionalChain([opt, 'optionalAccess', _63 => _63.programId]), () => ( LBCLMM_PROGRAM_IDS[cluster])),
|
|
8119
8200
|
provider
|
|
8120
8201
|
);
|
|
8121
8202
|
const positionsState = await program.account.position.fetchMultiple(
|
|
@@ -8165,7 +8246,7 @@ var DLMM = class {
|
|
|
8165
8246
|
return (min ? binId.floor() : binId.ceil()).toNumber();
|
|
8166
8247
|
}
|
|
8167
8248
|
/** Public methods */
|
|
8168
|
-
static async createPermissionLbPair(connection, binStep, tokenX, tokenY, activeId, baseKey, creatorKey, feeBps,
|
|
8249
|
+
static async createPermissionLbPair(connection, binStep, tokenX, tokenY, activeId, baseKey, creatorKey, feeBps, lockDuration, activationType, opt) {
|
|
8169
8250
|
const provider = new (0, _anchor.AnchorProvider)(
|
|
8170
8251
|
connection,
|
|
8171
8252
|
{},
|
|
@@ -8173,7 +8254,7 @@ var DLMM = class {
|
|
|
8173
8254
|
);
|
|
8174
8255
|
const program = new (0, _anchor.Program)(
|
|
8175
8256
|
IDL,
|
|
8176
|
-
_nullishCoalesce(_optionalChain([opt, 'optionalAccess',
|
|
8257
|
+
_nullishCoalesce(_optionalChain([opt, 'optionalAccess', _64 => _64.programId]), () => ( LBCLMM_PROGRAM_IDS[opt.cluster])),
|
|
8177
8258
|
provider
|
|
8178
8259
|
);
|
|
8179
8260
|
const [lbPair] = derivePermissionLbPair(
|
|
@@ -8197,7 +8278,8 @@ var DLMM = class {
|
|
|
8197
8278
|
baseFactor: computeBaseFactorFromFeeBps(binStep, feeBps).toNumber(),
|
|
8198
8279
|
minBinId: minBinId.toNumber(),
|
|
8199
8280
|
maxBinId: maxBinId.toNumber(),
|
|
8200
|
-
|
|
8281
|
+
lockDuration,
|
|
8282
|
+
activationType
|
|
8201
8283
|
};
|
|
8202
8284
|
return program.methods.initializePermissionLbPair(ixData).accounts({
|
|
8203
8285
|
lbPair,
|
|
@@ -8222,7 +8304,7 @@ var DLMM = class {
|
|
|
8222
8304
|
);
|
|
8223
8305
|
const program = new (0, _anchor.Program)(
|
|
8224
8306
|
IDL,
|
|
8225
|
-
_nullishCoalesce(_optionalChain([opt, 'optionalAccess',
|
|
8307
|
+
_nullishCoalesce(_optionalChain([opt, 'optionalAccess', _65 => _65.programId]), () => ( LBCLMM_PROGRAM_IDS[opt.cluster])),
|
|
8226
8308
|
provider
|
|
8227
8309
|
);
|
|
8228
8310
|
const existsPool = await this.getPairPubkeyIfExists(
|
|
@@ -8358,7 +8440,7 @@ var DLMM = class {
|
|
|
8358
8440
|
swapForY,
|
|
8359
8441
|
new (0, _anchor.BN)(activeIdToLoop),
|
|
8360
8442
|
this.lbPair,
|
|
8361
|
-
_nullishCoalesce(_optionalChain([this, 'access',
|
|
8443
|
+
_nullishCoalesce(_optionalChain([this, 'access', _66 => _66.binArrayBitmapExtension, 'optionalAccess', _67 => _67.account]), () => ( null))
|
|
8362
8444
|
);
|
|
8363
8445
|
if (binArrayIndex === null)
|
|
8364
8446
|
shouldStop = true;
|
|
@@ -9788,6 +9870,7 @@ var DLMM = class {
|
|
|
9788
9870
|
swapQuoteExactOut(outAmount, swapForY, allowedSlippage, binArrays) {
|
|
9789
9871
|
const currentTimestamp = Date.now() / 1e3;
|
|
9790
9872
|
let outAmountLeft = outAmount;
|
|
9873
|
+
this.validateSwapActivation();
|
|
9791
9874
|
let vParameterClone = Object.assign({}, this.lbPair.vParameters);
|
|
9792
9875
|
let activeId = new (0, _anchor.BN)(this.lbPair.activeId);
|
|
9793
9876
|
const binStep = this.lbPair.binStep;
|
|
@@ -9808,7 +9891,7 @@ var DLMM = class {
|
|
|
9808
9891
|
swapForY,
|
|
9809
9892
|
activeId,
|
|
9810
9893
|
this.lbPair,
|
|
9811
|
-
_nullishCoalesce(_optionalChain([this, 'access',
|
|
9894
|
+
_nullishCoalesce(_optionalChain([this, 'access', _68 => _68.binArrayBitmapExtension, 'optionalAccess', _69 => _69.account]), () => ( null)),
|
|
9812
9895
|
binArrays
|
|
9813
9896
|
);
|
|
9814
9897
|
if (binArrayAccountToSwap == null) {
|
|
@@ -9888,6 +9971,7 @@ var DLMM = class {
|
|
|
9888
9971
|
swapQuote(inAmount, swapForY, allowedSlippage, binArrays, isPartialFill) {
|
|
9889
9972
|
const currentTimestamp = Date.now() / 1e3;
|
|
9890
9973
|
let inAmountLeft = inAmount;
|
|
9974
|
+
this.validateSwapActivation();
|
|
9891
9975
|
let vParameterClone = Object.assign({}, this.lbPair.vParameters);
|
|
9892
9976
|
let activeId = new (0, _anchor.BN)(this.lbPair.activeId);
|
|
9893
9977
|
const binStep = this.lbPair.binStep;
|
|
@@ -9908,7 +9992,7 @@ var DLMM = class {
|
|
|
9908
9992
|
swapForY,
|
|
9909
9993
|
activeId,
|
|
9910
9994
|
this.lbPair,
|
|
9911
|
-
_nullishCoalesce(_optionalChain([this, 'access',
|
|
9995
|
+
_nullishCoalesce(_optionalChain([this, 'access', _70 => _70.binArrayBitmapExtension, 'optionalAccess', _71 => _71.account]), () => ( null)),
|
|
9912
9996
|
binArrays
|
|
9913
9997
|
);
|
|
9914
9998
|
if (binArrayAccountToSwap == null) {
|
|
@@ -10290,8 +10374,8 @@ var DLMM = class {
|
|
|
10290
10374
|
})
|
|
10291
10375
|
);
|
|
10292
10376
|
}
|
|
10293
|
-
async
|
|
10294
|
-
const
|
|
10377
|
+
async setActivationPoint(activationPoint) {
|
|
10378
|
+
const setActivationPointTx = await this.program.methods.setActivationPoint(activationPoint).accounts({
|
|
10295
10379
|
lbPair: this.pubkey,
|
|
10296
10380
|
admin: this.lbPair.creator
|
|
10297
10381
|
}).transaction();
|
|
@@ -10300,10 +10384,10 @@ var DLMM = class {
|
|
|
10300
10384
|
feePayer: this.lbPair.creator,
|
|
10301
10385
|
blockhash,
|
|
10302
10386
|
lastValidBlockHeight
|
|
10303
|
-
}).add(
|
|
10387
|
+
}).add(setActivationPointTx);
|
|
10304
10388
|
}
|
|
10305
10389
|
/**
|
|
10306
|
-
* The function `updateWhitelistedWallet` is used to whitelist a wallet, enabling it to deposit into a permissioned pool before the activation
|
|
10390
|
+
* The function `updateWhitelistedWallet` is used to whitelist a wallet, enabling it to deposit into a permissioned pool before the activation point.
|
|
10307
10391
|
* @param
|
|
10308
10392
|
* - `walletsToWhitelist`: The public key of the wallet.
|
|
10309
10393
|
* - `overrideIndexes`: Index of the whitelisted wallet to be inserted. Check DLMM.lbPair.whitelistedWallet for the index
|
|
@@ -10845,7 +10929,7 @@ var DLMM = class {
|
|
|
10845
10929
|
swapForY,
|
|
10846
10930
|
new (0, _anchor.BN)(activeBinId),
|
|
10847
10931
|
this.lbPair,
|
|
10848
|
-
_nullishCoalesce(_optionalChain([this, 'access',
|
|
10932
|
+
_nullishCoalesce(_optionalChain([this, 'access', _72 => _72.binArrayBitmapExtension, 'optionalAccess', _73 => _73.account]), () => ( null))
|
|
10849
10933
|
);
|
|
10850
10934
|
if (toBinArrayIndex === null)
|
|
10851
10935
|
return true;
|
|
@@ -10882,7 +10966,7 @@ var DLMM = class {
|
|
|
10882
10966
|
swapForY,
|
|
10883
10967
|
new (0, _anchor.BN)(activeBinId),
|
|
10884
10968
|
this.lbPair,
|
|
10885
|
-
_nullishCoalesce(_optionalChain([this, 'access',
|
|
10969
|
+
_nullishCoalesce(_optionalChain([this, 'access', _74 => _74.binArrayBitmapExtension, 'optionalAccess', _75 => _75.account]), () => ( null))
|
|
10886
10970
|
);
|
|
10887
10971
|
const accountsToFetch = [];
|
|
10888
10972
|
const [binArrayBitMapExtensionPubkey] = deriveBinArrayBitmapExtension(
|
|
@@ -10913,13 +10997,13 @@ var DLMM = class {
|
|
|
10913
10997
|
let fromBinArray = null;
|
|
10914
10998
|
let toBinArray = null;
|
|
10915
10999
|
let binArrayBitmapExtension = null;
|
|
10916
|
-
if (!!_optionalChain([binArrayAccounts, 'optionalAccess',
|
|
11000
|
+
if (!!_optionalChain([binArrayAccounts, 'optionalAccess', _76 => _76[0]])) {
|
|
10917
11001
|
binArrayBitmapExtension = binArrayBitMapExtensionPubkey;
|
|
10918
11002
|
}
|
|
10919
|
-
if (!!_optionalChain([binArrayAccounts, 'optionalAccess',
|
|
11003
|
+
if (!!_optionalChain([binArrayAccounts, 'optionalAccess', _77 => _77[1]])) {
|
|
10920
11004
|
fromBinArray = fromBinArrayPubkey;
|
|
10921
11005
|
}
|
|
10922
|
-
if (!!_optionalChain([binArrayAccounts, 'optionalAccess',
|
|
11006
|
+
if (!!_optionalChain([binArrayAccounts, 'optionalAccess', _78 => _78[2]]) && !!toBinArrayIndex) {
|
|
10923
11007
|
toBinArray = toBinArrayPubkey;
|
|
10924
11008
|
}
|
|
10925
11009
|
const { blockhash, lastValidBlockHeight } = await this.program.provider.connection.getLatestBlockhash("confirmed");
|
|
@@ -10993,7 +11077,7 @@ var DLMM = class {
|
|
|
10993
11077
|
maxAmountIn = maxAmountIn.add(maxFee);
|
|
10994
11078
|
if (amount0.gt(maxAmountIn)) {
|
|
10995
11079
|
return {
|
|
10996
|
-
withdrawAmount: maxAmountOut
|
|
11080
|
+
withdrawAmount: amount1.add(maxAmountOut)
|
|
10997
11081
|
};
|
|
10998
11082
|
}
|
|
10999
11083
|
const fee = computeFeeFromAmount(
|
|
@@ -11005,7 +11089,7 @@ var DLMM = class {
|
|
|
11005
11089
|
const amount0AfterFee = amount0.sub(fee);
|
|
11006
11090
|
const amountOut = isWithdrawForY ? mulShr(price, amount0AfterFee, SCALE_OFFSET, 1 /* Down */) : shlDiv(amount0AfterFee, price, SCALE_OFFSET, 1 /* Down */);
|
|
11007
11091
|
return {
|
|
11008
|
-
withdrawAmount: amount1.add(amountOut
|
|
11092
|
+
withdrawAmount: amount1.add(amountOut)
|
|
11009
11093
|
};
|
|
11010
11094
|
}
|
|
11011
11095
|
async getWithdrawSingleSideAmount(positionPubkey, isWithdrawForY) {
|
|
@@ -11031,8 +11115,6 @@ var DLMM = class {
|
|
|
11031
11115
|
lowerBinArrayPubKey,
|
|
11032
11116
|
upperBinArrayPubKey
|
|
11033
11117
|
]);
|
|
11034
|
-
if (!lowerBinArray || !upperBinArray)
|
|
11035
|
-
throw new Error("BinArray not found");
|
|
11036
11118
|
for (let idx = 0; idx < position.liquidityShares.length; idx++) {
|
|
11037
11119
|
const shareToRemove = position.liquidityShares[idx];
|
|
11038
11120
|
if (shareToRemove.eq(new (0, _anchor.BN)(0))) {
|
|
@@ -11041,6 +11123,9 @@ var DLMM = class {
|
|
|
11041
11123
|
const binId = new (0, _anchor.BN)(position.lowerBinId).add(new (0, _anchor.BN)(idx));
|
|
11042
11124
|
const binArrayIndex = binIdToBinArrayIndex(binId);
|
|
11043
11125
|
const binArray = binArrayIndex.eq(lowerBinArrayIdx) ? lowerBinArray : upperBinArray;
|
|
11126
|
+
if (!binArray) {
|
|
11127
|
+
throw new Error("BinArray not found");
|
|
11128
|
+
}
|
|
11044
11129
|
const bin = getBinFromBinArray(binId.toNumber(), binArray);
|
|
11045
11130
|
if (isWithdrawForY) {
|
|
11046
11131
|
if (binId.gt(new (0, _anchor.BN)(this.lbPair.activeId))) {
|
|
@@ -11658,7 +11743,7 @@ var DLMMError = class extends Error {
|
|
|
11658
11743
|
const anchorError = _anchor.AnchorError.parse(
|
|
11659
11744
|
JSON.parse(JSON.stringify(error)).logs
|
|
11660
11745
|
);
|
|
11661
|
-
if (_optionalChain([anchorError, 'optionalAccess',
|
|
11746
|
+
if (_optionalChain([anchorError, 'optionalAccess', _79 => _79.program, 'access', _80 => _80.toBase58, 'call', _81 => _81()]) === LBCLMM_PROGRAM_IDS["mainnet-beta"]) {
|
|
11662
11747
|
_errorCode = anchorError.error.errorCode.number;
|
|
11663
11748
|
_errorName = anchorError.error.errorCode.code;
|
|
11664
11749
|
_errorMessage = anchorError.error.errorMessage;
|
|
@@ -11765,5 +11850,8 @@ var src_default = DLMM;
|
|
|
11765
11850
|
|
|
11766
11851
|
|
|
11767
11852
|
|
|
11768
|
-
|
|
11853
|
+
|
|
11854
|
+
|
|
11855
|
+
|
|
11856
|
+
exports.ADMIN = ADMIN; exports.ActivationType = ActivationType; exports.BASIS_POINT_MAX = BASIS_POINT_MAX; exports.BIN_ARRAY_BITMAP_SIZE = BIN_ARRAY_BITMAP_SIZE; exports.BIN_ARRAY_FEE = BIN_ARRAY_FEE; exports.BitmapType = BitmapType; exports.ClockLayout = ClockLayout; exports.DLMMError = DLMMError; exports.EXTENSION_BINARRAY_BITMAP_SIZE = EXTENSION_BINARRAY_BITMAP_SIZE; exports.FEE_PRECISION = FEE_PRECISION; exports.IDL = IDL; exports.LBCLMM_PROGRAM_IDS = LBCLMM_PROGRAM_IDS; exports.MAX_ACTIVE_BIN_SLIPPAGE = MAX_ACTIVE_BIN_SLIPPAGE; exports.MAX_BIN_ARRAY_SIZE = MAX_BIN_ARRAY_SIZE; exports.MAX_BIN_LENGTH_ALLOWED_IN_ONE_TX = MAX_BIN_LENGTH_ALLOWED_IN_ONE_TX; exports.MAX_BIN_PER_POSITION = MAX_BIN_PER_POSITION; exports.MAX_BIN_PER_TX = MAX_BIN_PER_TX; exports.MAX_CLAIM_ALL_ALLOWED = MAX_CLAIM_ALL_ALLOWED; exports.MAX_FEE_RATE = MAX_FEE_RATE; exports.Network = Network; exports.POSITION_FEE = POSITION_FEE; exports.PRECISION = PRECISION; exports.PairStatus = PairStatus; exports.PairType = PairType; exports.PositionVersion = PositionVersion; exports.SCALE = SCALE; exports.SCALE_OFFSET = SCALE_OFFSET; exports.SIMULATION_USER = SIMULATION_USER; exports.Strategy = Strategy; exports.StrategyType = StrategyType; exports.autoFillXByStrategy = autoFillXByStrategy; exports.autoFillXByWeight = autoFillXByWeight; exports.autoFillYByStrategy = autoFillYByStrategy; exports.autoFillYByWeight = autoFillYByWeight; exports.binIdToBinArrayIndex = binIdToBinArrayIndex; exports.calculateBidAskDistribution = calculateBidAskDistribution; exports.calculateNormalDistribution = calculateNormalDistribution; exports.calculateSpotDistribution = calculateSpotDistribution; exports.chunkedFetchMultipleBinArrayBitmapExtensionAccount = chunkedFetchMultipleBinArrayBitmapExtensionAccount; exports.chunkedFetchMultiplePoolAccount = chunkedFetchMultiplePoolAccount; exports.chunkedGetMultipleAccountInfos = chunkedGetMultipleAccountInfos; exports.chunks = chunks; exports.computeBudgetIx = computeBudgetIx; exports.computeFee = computeFee; exports.computeFeeFromAmount = computeFeeFromAmount; exports.computeProtocolFee = computeProtocolFee; exports.default = src_default; exports.deriveBinArray = deriveBinArray; exports.deriveBinArrayBitmapExtension = deriveBinArrayBitmapExtension; exports.deriveLbPair = deriveLbPair; exports.deriveLbPair2 = deriveLbPair2; exports.deriveOracle = deriveOracle; exports.derivePermissionLbPair = derivePermissionLbPair; exports.derivePosition = derivePosition; exports.derivePresetParameter = derivePresetParameter; exports.derivePresetParameter2 = derivePresetParameter2; exports.deriveReserve = deriveReserve; exports.findNextBinArrayIndexWithLiquidity = findNextBinArrayIndexWithLiquidity; exports.findNextBinArrayWithLiquidity = findNextBinArrayWithLiquidity; exports.fromWeightDistributionToAmount = fromWeightDistributionToAmount; exports.fromWeightDistributionToAmountOneSide = fromWeightDistributionToAmountOneSide; exports.getBaseFee = getBaseFee; exports.getBinArrayLowerUpperBinId = getBinArrayLowerUpperBinId; exports.getBinArraysRequiredByPositionRange = getBinArraysRequiredByPositionRange; exports.getBinFromBinArray = getBinFromBinArray; exports.getOrCreateATAInstruction = getOrCreateATAInstruction; exports.getOutAmount = getOutAmount; exports.getPriceOfBinByBinId = getPriceOfBinByBinId; exports.getTokenBalance = getTokenBalance; exports.getTokenDecimals = getTokenDecimals; exports.getTokensMintFromPoolAddress = getTokensMintFromPoolAddress; exports.getTotalFee = getTotalFee; exports.getVariableFee = getVariableFee; exports.isBinIdWithinBinArray = isBinIdWithinBinArray; exports.isOverflowDefaultBinArrayBitmap = isOverflowDefaultBinArrayBitmap; exports.parseLogs = parseLogs; exports.swapExactInQuoteAtBin = swapExactInQuoteAtBin; exports.swapExactOutQuoteAtBin = swapExactOutQuoteAtBin; exports.toAmountAskSide = toAmountAskSide; exports.toAmountBidSide = toAmountBidSide; exports.toAmountBothSide = toAmountBothSide; exports.toAmountsBothSideByStrategy = toAmountsBothSideByStrategy; exports.toAmountsOneSideByStrategy = toAmountsOneSideByStrategy; exports.toStrategyParameters = toStrategyParameters; exports.toWeightDistribution = toWeightDistribution; exports.unwrapSOLInstruction = unwrapSOLInstruction; exports.wrapSOLInstruction = wrapSOLInstruction;
|
|
11769
11857
|
//# sourceMappingURL=index.js.map
|