@meteora-ag/dlmm 1.3.10 → 1.3.12-rc.0
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 +1 -0
- package/dist/index.js +81 -37
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +85 -41
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -2
package/dist/index.d.ts
CHANGED
|
@@ -6094,6 +6094,7 @@ declare class DLMM {
|
|
|
6094
6094
|
positions: LbPosition[];
|
|
6095
6095
|
}): Promise<Transaction[]>;
|
|
6096
6096
|
setActivationPoint(activationPoint: BN): Promise<Transaction>;
|
|
6097
|
+
setPairStatus(enabled: boolean): Promise<Transaction>;
|
|
6097
6098
|
/**
|
|
6098
6099
|
* The function `claimSwapFee` is used to claim swap fees for a specific position owned by a specific owner.
|
|
6099
6100
|
* @param
|
package/dist/index.js
CHANGED
|
@@ -6472,13 +6472,42 @@ function generateBinAmount(amount, binStep, binId, tokenXDecimal, tokenYDecimal,
|
|
|
6472
6472
|
return new (0, _anchor.BN)(c1.sub(c0).floor().toString());
|
|
6473
6473
|
}
|
|
6474
6474
|
|
|
6475
|
-
// src/dlmm/helpers/index.ts
|
|
6476
|
-
var _helpers = require('@solana-developers/helpers');
|
|
6477
|
-
|
|
6478
6475
|
// src/dlmm/helpers/computeUnit.ts
|
|
6476
|
+
|
|
6479
6477
|
var DEFAULT_ADD_LIQUIDITY_CU = 8e5;
|
|
6480
6478
|
var MIN_CU_BUFFER = 5e4;
|
|
6481
6479
|
var MAX_CU_BUFFER = 2e5;
|
|
6480
|
+
var getSimulationComputeUnits = async (connection, instructions, payer, lookupTables, commitment = "confirmed") => {
|
|
6481
|
+
const testInstructions = [
|
|
6482
|
+
// Set an arbitrarily high number in simulation
|
|
6483
|
+
// so we can be sure the transaction will succeed
|
|
6484
|
+
// and get the real compute units used
|
|
6485
|
+
_web3js.ComputeBudgetProgram.setComputeUnitLimit({ units: 14e5 }),
|
|
6486
|
+
...instructions
|
|
6487
|
+
];
|
|
6488
|
+
const testTransaction = new (0, _web3js.VersionedTransaction)(
|
|
6489
|
+
new (0, _web3js.TransactionMessage)({
|
|
6490
|
+
instructions: testInstructions,
|
|
6491
|
+
payerKey: payer,
|
|
6492
|
+
// RecentBlockhash can by any public key during simulation
|
|
6493
|
+
// since 'replaceRecentBlockhash' is set to 'true' below
|
|
6494
|
+
recentBlockhash: _web3js.PublicKey.default.toString()
|
|
6495
|
+
}).compileToV0Message(lookupTables)
|
|
6496
|
+
);
|
|
6497
|
+
const rpcResponse = await connection.simulateTransaction(testTransaction, {
|
|
6498
|
+
replaceRecentBlockhash: true,
|
|
6499
|
+
sigVerify: false,
|
|
6500
|
+
commitment
|
|
6501
|
+
});
|
|
6502
|
+
if (_optionalChain([rpcResponse, 'optionalAccess', _21 => _21.value, 'optionalAccess', _22 => _22.err])) {
|
|
6503
|
+
const logs = _optionalChain([rpcResponse, 'access', _23 => _23.value, 'access', _24 => _24.logs, 'optionalAccess', _25 => _25.join, 'call', _26 => _26("\n \u2022 ")]) || "No logs available";
|
|
6504
|
+
throw new Error(
|
|
6505
|
+
`Transaction simulation failed:
|
|
6506
|
+
\u2022${logs}` + JSON.stringify(_optionalChain([rpcResponse, 'optionalAccess', _27 => _27.value, 'optionalAccess', _28 => _28.err]))
|
|
6507
|
+
);
|
|
6508
|
+
}
|
|
6509
|
+
return rpcResponse.value.unitsConsumed || null;
|
|
6510
|
+
};
|
|
6482
6511
|
|
|
6483
6512
|
// src/dlmm/helpers/derive.ts
|
|
6484
6513
|
|
|
@@ -7615,7 +7644,7 @@ async function getTokensMintFromPoolAddress(connection, poolAddress, opt) {
|
|
|
7615
7644
|
);
|
|
7616
7645
|
const program = new (0, _anchor.Program)(
|
|
7617
7646
|
IDL,
|
|
7618
|
-
LBCLMM_PROGRAM_IDS[_nullishCoalesce(_optionalChain([opt, 'optionalAccess',
|
|
7647
|
+
LBCLMM_PROGRAM_IDS[_nullishCoalesce(_optionalChain([opt, 'optionalAccess', _29 => _29.cluster]), () => ( "mainnet-beta"))],
|
|
7619
7648
|
provider
|
|
7620
7649
|
);
|
|
7621
7650
|
const poolAccount = await program.account.lbPair.fetchNullable(
|
|
@@ -7693,7 +7722,7 @@ async function getTokenBalance(conn, tokenAccount) {
|
|
|
7693
7722
|
var parseLogs = (eventParser, logs) => {
|
|
7694
7723
|
if (!logs.length)
|
|
7695
7724
|
throw new Error("No logs found");
|
|
7696
|
-
for (const event of _optionalChain([eventParser, 'optionalAccess',
|
|
7725
|
+
for (const event of _optionalChain([eventParser, 'optionalAccess', _30 => _30.parseLogs, 'call', _31 => _31(logs)])) {
|
|
7697
7726
|
return event.data;
|
|
7698
7727
|
}
|
|
7699
7728
|
throw new Error("No events found");
|
|
@@ -7750,7 +7779,7 @@ var getEstimatedComputeUnitUsageWithBuffer = async (connection, instructions, fe
|
|
|
7750
7779
|
}
|
|
7751
7780
|
buffer = Math.max(0, buffer);
|
|
7752
7781
|
buffer = Math.min(1, buffer);
|
|
7753
|
-
const estimatedComputeUnitUsage = await
|
|
7782
|
+
const estimatedComputeUnitUsage = await getSimulationComputeUnits(
|
|
7754
7783
|
connection,
|
|
7755
7784
|
instructions,
|
|
7756
7785
|
feePayer,
|
|
@@ -7808,13 +7837,13 @@ var DLMM = class {
|
|
|
7808
7837
|
);
|
|
7809
7838
|
const program = new (0, _anchor.Program)(
|
|
7810
7839
|
IDL,
|
|
7811
|
-
_nullishCoalesce(_optionalChain([opt, 'optionalAccess',
|
|
7840
|
+
_nullishCoalesce(_optionalChain([opt, 'optionalAccess', _32 => _32.programId]), () => ( LBCLMM_PROGRAM_IDS[_nullishCoalesce(_optionalChain([opt, 'optionalAccess', _33 => _33.cluster]), () => ( "mainnet-beta"))])),
|
|
7812
7841
|
provider
|
|
7813
7842
|
);
|
|
7814
7843
|
return program.account.lbPair.all();
|
|
7815
7844
|
}
|
|
7816
7845
|
static async getPairPubkeyIfExists(connection, tokenX, tokenY, binStep, baseFactor, opt) {
|
|
7817
|
-
const cluster = _optionalChain([opt, 'optionalAccess',
|
|
7846
|
+
const cluster = _optionalChain([opt, 'optionalAccess', _34 => _34.cluster]) || "mainnet-beta";
|
|
7818
7847
|
const provider = new (0, _anchor.AnchorProvider)(
|
|
7819
7848
|
connection,
|
|
7820
7849
|
{},
|
|
@@ -7822,7 +7851,7 @@ var DLMM = class {
|
|
|
7822
7851
|
);
|
|
7823
7852
|
const program = new (0, _anchor.Program)(
|
|
7824
7853
|
IDL,
|
|
7825
|
-
_nullishCoalesce(_optionalChain([opt, 'optionalAccess',
|
|
7854
|
+
_nullishCoalesce(_optionalChain([opt, 'optionalAccess', _35 => _35.programId]), () => ( LBCLMM_PROGRAM_IDS[cluster])),
|
|
7826
7855
|
provider
|
|
7827
7856
|
);
|
|
7828
7857
|
try {
|
|
@@ -7861,7 +7890,7 @@ var DLMM = class {
|
|
|
7861
7890
|
* @returns The `create` function returns a `Promise` that resolves to a `DLMM` object.
|
|
7862
7891
|
*/
|
|
7863
7892
|
static async create(connection, dlmm, opt) {
|
|
7864
|
-
const cluster = _optionalChain([opt, 'optionalAccess',
|
|
7893
|
+
const cluster = _optionalChain([opt, 'optionalAccess', _36 => _36.cluster]) || "mainnet-beta";
|
|
7865
7894
|
const provider = new (0, _anchor.AnchorProvider)(
|
|
7866
7895
|
connection,
|
|
7867
7896
|
{},
|
|
@@ -7869,7 +7898,7 @@ var DLMM = class {
|
|
|
7869
7898
|
);
|
|
7870
7899
|
const program = new (0, _anchor.Program)(
|
|
7871
7900
|
IDL,
|
|
7872
|
-
_nullishCoalesce(_optionalChain([opt, 'optionalAccess',
|
|
7901
|
+
_nullishCoalesce(_optionalChain([opt, 'optionalAccess', _37 => _37.programId]), () => ( LBCLMM_PROGRAM_IDS[cluster])),
|
|
7873
7902
|
provider
|
|
7874
7903
|
);
|
|
7875
7904
|
const binArrayBitMapExtensionPubkey = deriveBinArrayBitmapExtension(
|
|
@@ -7885,14 +7914,14 @@ var DLMM = class {
|
|
|
7885
7914
|
connection,
|
|
7886
7915
|
accountsToFetch
|
|
7887
7916
|
);
|
|
7888
|
-
const lbPairAccountInfoBuffer = _optionalChain([accountsInfo, 'access',
|
|
7917
|
+
const lbPairAccountInfoBuffer = _optionalChain([accountsInfo, 'access', _38 => _38[0], 'optionalAccess', _39 => _39.data]);
|
|
7889
7918
|
if (!lbPairAccountInfoBuffer)
|
|
7890
7919
|
throw new Error(`LB Pair account ${dlmm.toBase58()} not found`);
|
|
7891
7920
|
const lbPairAccInfo = program.coder.accounts.decode(
|
|
7892
7921
|
"lbPair",
|
|
7893
7922
|
lbPairAccountInfoBuffer
|
|
7894
7923
|
);
|
|
7895
|
-
const binArrayBitMapAccountInfoBuffer = _optionalChain([accountsInfo, 'access',
|
|
7924
|
+
const binArrayBitMapAccountInfoBuffer = _optionalChain([accountsInfo, 'access', _40 => _40[1], 'optionalAccess', _41 => _41.data]);
|
|
7896
7925
|
let binArrayBitMapExtensionAccInfo = null;
|
|
7897
7926
|
if (binArrayBitMapAccountInfoBuffer) {
|
|
7898
7927
|
binArrayBitMapExtensionAccInfo = program.coder.accounts.decode(
|
|
@@ -7900,7 +7929,7 @@ var DLMM = class {
|
|
|
7900
7929
|
binArrayBitMapAccountInfoBuffer
|
|
7901
7930
|
);
|
|
7902
7931
|
}
|
|
7903
|
-
const clockAccountInfoBuffer = _optionalChain([accountsInfo, 'access',
|
|
7932
|
+
const clockAccountInfoBuffer = _optionalChain([accountsInfo, 'access', _42 => _42[2], 'optionalAccess', _43 => _43.data]);
|
|
7904
7933
|
if (!clockAccountInfoBuffer)
|
|
7905
7934
|
throw new Error(`Clock account not found`);
|
|
7906
7935
|
const clock = ClockLayout.decode(clockAccountInfoBuffer);
|
|
@@ -7961,7 +7990,7 @@ var DLMM = class {
|
|
|
7961
7990
|
* objects.
|
|
7962
7991
|
*/
|
|
7963
7992
|
static async createMultiple(connection, dlmmList, opt) {
|
|
7964
|
-
const cluster = _optionalChain([opt, 'optionalAccess',
|
|
7993
|
+
const cluster = _optionalChain([opt, 'optionalAccess', _44 => _44.cluster]) || "mainnet-beta";
|
|
7965
7994
|
const provider = new (0, _anchor.AnchorProvider)(
|
|
7966
7995
|
connection,
|
|
7967
7996
|
{},
|
|
@@ -7969,7 +7998,7 @@ var DLMM = class {
|
|
|
7969
7998
|
);
|
|
7970
7999
|
const program = new (0, _anchor.Program)(
|
|
7971
8000
|
IDL,
|
|
7972
|
-
_nullishCoalesce(_optionalChain([opt, 'optionalAccess',
|
|
8001
|
+
_nullishCoalesce(_optionalChain([opt, 'optionalAccess', _45 => _45.programId]), () => ( LBCLMM_PROGRAM_IDS[cluster])),
|
|
7973
8002
|
provider
|
|
7974
8003
|
);
|
|
7975
8004
|
const binArrayBitMapExtensions = dlmmList.map(
|
|
@@ -7985,14 +8014,14 @@ var DLMM = class {
|
|
|
7985
8014
|
accountsToFetch
|
|
7986
8015
|
);
|
|
7987
8016
|
const clockAccount = accountsInfo.pop();
|
|
7988
|
-
const clockAccountInfoBuffer = _optionalChain([clockAccount, 'optionalAccess',
|
|
8017
|
+
const clockAccountInfoBuffer = _optionalChain([clockAccount, 'optionalAccess', _46 => _46.data]);
|
|
7989
8018
|
if (!clockAccountInfoBuffer)
|
|
7990
8019
|
throw new Error(`Clock account not found`);
|
|
7991
8020
|
const clock = ClockLayout.decode(clockAccountInfoBuffer);
|
|
7992
8021
|
const lbPairArraysMap = /* @__PURE__ */ new Map();
|
|
7993
8022
|
for (let i = 0; i < dlmmList.length; i++) {
|
|
7994
8023
|
const lbPairPubKey = dlmmList[i];
|
|
7995
|
-
const lbPairAccountInfoBuffer = _optionalChain([accountsInfo, 'access',
|
|
8024
|
+
const lbPairAccountInfoBuffer = _optionalChain([accountsInfo, 'access', _47 => _47[i], 'optionalAccess', _48 => _48.data]);
|
|
7996
8025
|
if (!lbPairAccountInfoBuffer)
|
|
7997
8026
|
throw new Error(`LB Pair account ${lbPairPubKey.toBase58()} not found`);
|
|
7998
8027
|
const binArrayAccInfo = program.coder.accounts.decode(
|
|
@@ -8005,7 +8034,7 @@ var DLMM = class {
|
|
|
8005
8034
|
for (let i = dlmmList.length; i < accountsInfo.length; i++) {
|
|
8006
8035
|
const index = i - dlmmList.length;
|
|
8007
8036
|
const lbPairPubkey = dlmmList[index];
|
|
8008
|
-
const binArrayBitMapAccountInfoBuffer = _optionalChain([accountsInfo, 'access',
|
|
8037
|
+
const binArrayBitMapAccountInfoBuffer = _optionalChain([accountsInfo, 'access', _49 => _49[i], 'optionalAccess', _50 => _50.data]);
|
|
8009
8038
|
if (binArrayBitMapAccountInfoBuffer) {
|
|
8010
8039
|
const binArrayBitMapExtensionAccInfo = program.coder.accounts.decode(
|
|
8011
8040
|
"binArrayBitmapExtension",
|
|
@@ -8089,7 +8118,7 @@ var DLMM = class {
|
|
|
8089
8118
|
);
|
|
8090
8119
|
const program = new (0, _anchor.Program)(
|
|
8091
8120
|
IDL,
|
|
8092
|
-
_nullishCoalesce(_optionalChain([opt, 'optionalAccess',
|
|
8121
|
+
_nullishCoalesce(_optionalChain([opt, 'optionalAccess', _51 => _51.programId]), () => ( LBCLMM_PROGRAM_IDS[_nullishCoalesce(_optionalChain([opt, 'optionalAccess', _52 => _52.cluster]), () => ( "mainnet-beta"))])),
|
|
8093
8122
|
provider
|
|
8094
8123
|
);
|
|
8095
8124
|
const presetParameter = await program.account.presetParameter.all();
|
|
@@ -8107,7 +8136,7 @@ var DLMM = class {
|
|
|
8107
8136
|
* Pair account, and the value is an object of PositionInfo
|
|
8108
8137
|
*/
|
|
8109
8138
|
static async getAllLbPairPositionsByUser(connection, userPubKey, opt) {
|
|
8110
|
-
const cluster = _optionalChain([opt, 'optionalAccess',
|
|
8139
|
+
const cluster = _optionalChain([opt, 'optionalAccess', _53 => _53.cluster]) || "mainnet-beta";
|
|
8111
8140
|
const provider = new (0, _anchor.AnchorProvider)(
|
|
8112
8141
|
connection,
|
|
8113
8142
|
{},
|
|
@@ -8115,7 +8144,7 @@ var DLMM = class {
|
|
|
8115
8144
|
);
|
|
8116
8145
|
const program = new (0, _anchor.Program)(
|
|
8117
8146
|
IDL,
|
|
8118
|
-
_nullishCoalesce(_optionalChain([opt, 'optionalAccess',
|
|
8147
|
+
_nullishCoalesce(_optionalChain([opt, 'optionalAccess', _54 => _54.programId]), () => ( LBCLMM_PROGRAM_IDS[cluster])),
|
|
8119
8148
|
provider
|
|
8120
8149
|
);
|
|
8121
8150
|
const positionsV2 = await program.account.positionV2.all([
|
|
@@ -8249,8 +8278,8 @@ var DLMM = class {
|
|
|
8249
8278
|
getTokenDecimals(program.provider.connection, lbPairAcc.tokenXMint),
|
|
8250
8279
|
getTokenDecimals(program.provider.connection, lbPairAcc.tokenYMint)
|
|
8251
8280
|
]);
|
|
8252
|
-
const reserveXBalance = _nullishCoalesce(_optionalChain([lbPairReserveMapV2, 'access',
|
|
8253
|
-
const reserveYBalance = _nullishCoalesce(_optionalChain([lbPairReserveMapV2, 'access',
|
|
8281
|
+
const reserveXBalance = _nullishCoalesce(_optionalChain([lbPairReserveMapV2, 'access', _55 => _55.get, 'call', _56 => _56(lbPair.toBase58()), 'optionalAccess', _57 => _57.reserveX]), () => ( BigInt(0)));
|
|
8282
|
+
const reserveYBalance = _nullishCoalesce(_optionalChain([lbPairReserveMapV2, 'access', _58 => _58.get, 'call', _59 => _59(lbPair.toBase58()), 'optionalAccess', _60 => _60.reserveY]), () => ( BigInt(0)));
|
|
8254
8283
|
const tokenX = {
|
|
8255
8284
|
publicKey: lbPairAcc.tokenXMint,
|
|
8256
8285
|
reserve: lbPairAcc.reserveX,
|
|
@@ -8296,7 +8325,7 @@ var DLMM = class {
|
|
|
8296
8325
|
tokenX,
|
|
8297
8326
|
tokenY,
|
|
8298
8327
|
lbPairPositionsData: [
|
|
8299
|
-
..._nullishCoalesce(_optionalChain([positionsMap, 'access',
|
|
8328
|
+
..._nullishCoalesce(_optionalChain([positionsMap, 'access', _61 => _61.get, 'call', _62 => _62(lbPair.toBase58()), 'optionalAccess', _63 => _63.lbPairPositionsData]), () => ( [])),
|
|
8300
8329
|
{
|
|
8301
8330
|
publicKey: positionPubKey,
|
|
8302
8331
|
positionData,
|
|
@@ -8325,7 +8354,7 @@ var DLMM = class {
|
|
|
8325
8354
|
);
|
|
8326
8355
|
const program = new (0, _anchor.Program)(
|
|
8327
8356
|
IDL,
|
|
8328
|
-
_nullishCoalesce(_optionalChain([opt, 'optionalAccess',
|
|
8357
|
+
_nullishCoalesce(_optionalChain([opt, 'optionalAccess', _64 => _64.programId]), () => ( LBCLMM_PROGRAM_IDS[opt.cluster])),
|
|
8329
8358
|
provider
|
|
8330
8359
|
);
|
|
8331
8360
|
const [lbPair] = derivePermissionLbPair(
|
|
@@ -8374,7 +8403,7 @@ var DLMM = class {
|
|
|
8374
8403
|
);
|
|
8375
8404
|
const program = new (0, _anchor.Program)(
|
|
8376
8405
|
IDL,
|
|
8377
|
-
_nullishCoalesce(_optionalChain([opt, 'optionalAccess',
|
|
8406
|
+
_nullishCoalesce(_optionalChain([opt, 'optionalAccess', _65 => _65.programId]), () => ( LBCLMM_PROGRAM_IDS[opt.cluster])),
|
|
8378
8407
|
provider
|
|
8379
8408
|
);
|
|
8380
8409
|
const [lbPair] = deriveCustomizablePermissionlessLbPair(
|
|
@@ -8423,7 +8452,7 @@ var DLMM = class {
|
|
|
8423
8452
|
);
|
|
8424
8453
|
const program = new (0, _anchor.Program)(
|
|
8425
8454
|
IDL,
|
|
8426
|
-
_nullishCoalesce(_optionalChain([opt, 'optionalAccess',
|
|
8455
|
+
_nullishCoalesce(_optionalChain([opt, 'optionalAccess', _66 => _66.programId]), () => ( LBCLMM_PROGRAM_IDS[opt.cluster])),
|
|
8427
8456
|
provider
|
|
8428
8457
|
);
|
|
8429
8458
|
const existsPool = await this.getPairPubkeyIfExists(
|
|
@@ -8559,7 +8588,7 @@ var DLMM = class {
|
|
|
8559
8588
|
swapForY,
|
|
8560
8589
|
new (0, _anchor.BN)(activeIdToLoop),
|
|
8561
8590
|
this.lbPair,
|
|
8562
|
-
_nullishCoalesce(_optionalChain([this, 'access',
|
|
8591
|
+
_nullishCoalesce(_optionalChain([this, 'access', _67 => _67.binArrayBitmapExtension, 'optionalAccess', _68 => _68.account]), () => ( null))
|
|
8563
8592
|
);
|
|
8564
8593
|
if (binArrayIndex === null)
|
|
8565
8594
|
shouldStop = true;
|
|
@@ -10046,7 +10075,7 @@ var DLMM = class {
|
|
|
10046
10075
|
swapForY,
|
|
10047
10076
|
activeId,
|
|
10048
10077
|
this.lbPair,
|
|
10049
|
-
_nullishCoalesce(_optionalChain([this, 'access',
|
|
10078
|
+
_nullishCoalesce(_optionalChain([this, 'access', _69 => _69.binArrayBitmapExtension, 'optionalAccess', _70 => _70.account]), () => ( null)),
|
|
10050
10079
|
binArrays
|
|
10051
10080
|
);
|
|
10052
10081
|
if (binArrayAccountToSwap == null) {
|
|
@@ -10151,7 +10180,7 @@ var DLMM = class {
|
|
|
10151
10180
|
swapForY,
|
|
10152
10181
|
activeId,
|
|
10153
10182
|
this.lbPair,
|
|
10154
|
-
_nullishCoalesce(_optionalChain([this, 'access',
|
|
10183
|
+
_nullishCoalesce(_optionalChain([this, 'access', _71 => _71.binArrayBitmapExtension, 'optionalAccess', _72 => _72.account]), () => ( null)),
|
|
10155
10184
|
binArrays
|
|
10156
10185
|
);
|
|
10157
10186
|
if (binArrayAccountToSwap == null) {
|
|
@@ -10586,6 +10615,21 @@ var DLMM = class {
|
|
|
10586
10615
|
lastValidBlockHeight
|
|
10587
10616
|
}).add(setActivationPointTx);
|
|
10588
10617
|
}
|
|
10618
|
+
async setPairStatus(enabled) {
|
|
10619
|
+
const pairStatus = enabled ? 0 : 1;
|
|
10620
|
+
const tx = await this.program.methods.setPairStatus(pairStatus).accounts(
|
|
10621
|
+
{
|
|
10622
|
+
lbPair: this.pubkey,
|
|
10623
|
+
admin: this.lbPair.creator
|
|
10624
|
+
}
|
|
10625
|
+
).transaction();
|
|
10626
|
+
const { blockhash, lastValidBlockHeight } = await this.program.provider.connection.getLatestBlockhash("confirmed");
|
|
10627
|
+
return new (0, _web3js.Transaction)({
|
|
10628
|
+
feePayer: this.lbPair.creator,
|
|
10629
|
+
blockhash,
|
|
10630
|
+
lastValidBlockHeight
|
|
10631
|
+
}).add(tx);
|
|
10632
|
+
}
|
|
10589
10633
|
/**
|
|
10590
10634
|
* The function `claimSwapFee` is used to claim swap fees for a specific position owned by a specific owner.
|
|
10591
10635
|
* @param
|
|
@@ -11330,7 +11374,7 @@ var DLMM = class {
|
|
|
11330
11374
|
swapForY,
|
|
11331
11375
|
new (0, _anchor.BN)(activeBinId),
|
|
11332
11376
|
this.lbPair,
|
|
11333
|
-
_nullishCoalesce(_optionalChain([this, 'access',
|
|
11377
|
+
_nullishCoalesce(_optionalChain([this, 'access', _73 => _73.binArrayBitmapExtension, 'optionalAccess', _74 => _74.account]), () => ( null))
|
|
11334
11378
|
);
|
|
11335
11379
|
if (toBinArrayIndex === null)
|
|
11336
11380
|
return true;
|
|
@@ -11367,7 +11411,7 @@ var DLMM = class {
|
|
|
11367
11411
|
swapForY,
|
|
11368
11412
|
new (0, _anchor.BN)(activeBinId),
|
|
11369
11413
|
this.lbPair,
|
|
11370
|
-
_nullishCoalesce(_optionalChain([this, 'access',
|
|
11414
|
+
_nullishCoalesce(_optionalChain([this, 'access', _75 => _75.binArrayBitmapExtension, 'optionalAccess', _76 => _76.account]), () => ( null))
|
|
11371
11415
|
);
|
|
11372
11416
|
const accountsToFetch = [];
|
|
11373
11417
|
const [binArrayBitMapExtensionPubkey] = deriveBinArrayBitmapExtension(
|
|
@@ -11398,13 +11442,13 @@ var DLMM = class {
|
|
|
11398
11442
|
let fromBinArray = null;
|
|
11399
11443
|
let toBinArray = null;
|
|
11400
11444
|
let binArrayBitmapExtension = null;
|
|
11401
|
-
if (!!_optionalChain([binArrayAccounts, 'optionalAccess',
|
|
11445
|
+
if (!!_optionalChain([binArrayAccounts, 'optionalAccess', _77 => _77[0]])) {
|
|
11402
11446
|
binArrayBitmapExtension = binArrayBitMapExtensionPubkey;
|
|
11403
11447
|
}
|
|
11404
|
-
if (!!_optionalChain([binArrayAccounts, 'optionalAccess',
|
|
11448
|
+
if (!!_optionalChain([binArrayAccounts, 'optionalAccess', _78 => _78[1]])) {
|
|
11405
11449
|
fromBinArray = fromBinArrayPubkey;
|
|
11406
11450
|
}
|
|
11407
|
-
if (!!_optionalChain([binArrayAccounts, 'optionalAccess',
|
|
11451
|
+
if (!!_optionalChain([binArrayAccounts, 'optionalAccess', _79 => _79[2]]) && !!toBinArrayIndex) {
|
|
11408
11452
|
toBinArray = toBinArrayPubkey;
|
|
11409
11453
|
}
|
|
11410
11454
|
const { blockhash, lastValidBlockHeight } = await this.program.provider.connection.getLatestBlockhash("confirmed");
|
|
@@ -11880,7 +11924,7 @@ var DLMM = class {
|
|
|
11880
11924
|
const [lowerBinId2] = getBinArrayLowerUpperBinId(index);
|
|
11881
11925
|
return bins.map((b, i) => [lowerBinId2.toNumber() + i, b]);
|
|
11882
11926
|
}));
|
|
11883
|
-
const version = _nullishCoalesce(_optionalChain([binArrays, 'access',
|
|
11927
|
+
const version = _nullishCoalesce(_optionalChain([binArrays, 'access', _80 => _80.find, 'call', _81 => _81((binArray) => binArray != null), 'optionalAccess', _82 => _82.version]), () => ( 1));
|
|
11884
11928
|
return Array.from(enumerateBins(
|
|
11885
11929
|
binsById,
|
|
11886
11930
|
lowerBinId,
|