@hawksightco/hawk-sdk 1.3.98 → 1.3.99
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/src/classes/Transactions.d.ts +1 -0
- package/dist/src/classes/Transactions.d.ts.map +1 -1
- package/dist/src/classes/Transactions.js +105 -194
- package/dist/src/functions.d.ts +7 -0
- package/dist/src/functions.d.ts.map +1 -1
- package/dist/src/functions.js +10 -0
- package/dist/src/idl/iyf-extension-idl.d.ts +41 -77
- package/dist/src/idl/iyf-extension-idl.d.ts.map +1 -1
- package/dist/src/idl/iyf-extension-idl.js +41 -77
- package/dist/src/ixGenerator/MeteoraDlmmIxGenerator.d.ts +38 -0
- package/dist/src/ixGenerator/MeteoraDlmmIxGenerator.d.ts.map +1 -1
- package/dist/src/ixGenerator/MeteoraDlmmIxGenerator.js +110 -0
- package/package.json +1 -1
|
@@ -158,6 +158,7 @@ export declare class Transactions {
|
|
|
158
158
|
limitCloseAutomationIx({ connection, params, }: TxgenParams<MeteoraLimitCloseAutomation>): Promise<TransactionMetadataResponse>;
|
|
159
159
|
limitCloseAutomationIx2({ connection, params, }: TxgenParams<MeteoraLimitCloseAutomation2>): Promise<TransactionMetadataResponse>;
|
|
160
160
|
private removeLiquidityByRangeInfo;
|
|
161
|
+
private removeLiquidityByRange2Info;
|
|
161
162
|
/**
|
|
162
163
|
* Creates orca instruction that opens new position
|
|
163
164
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Transactions.d.ts","sourceRoot":"","sources":["../../../src/classes/Transactions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AAoBxC,OAAO,EACL,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,eAAe,EACf,+BAA+B,EAC/B,kCAAkC,EAClC,cAAc,EACd,0BAA0B,EAC1B,gBAAgB,EAChB,eAAe,EACf,QAAQ,EACR,WAAW,EACX,6BAA6B,EAC7B,2BA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CAAC;IA8DxE;;;;;;OAMG;IACG,kBAAkB,CAAC,EACvB,UAAU,EACV,MAAM,GACP,EAAE,WAAW,CAAC,kBAAkB,CAAC,GAAG,OAAO,CAAC,2BAA2B,CAAC;IA0CnE,oBAAoB,CAAC,EACzB,UAAU,EACV,MAAM,GACP,EAAE,WAAW,CAAC,eAAe,CAAC;IAuGzB,iBAAiB,CAAC,EACtB,UAAU,EACV,MAAM,GACP,EAAE,WAAW,CAAC,eAAe,CAAC;IAiGzB,qBAAqB,CAAC,EAC1B,UAAU,EACV,MAAM,GACP,EAAE,WAAW,CAAC,gBAAgB,CAAC;IAqF1B,sBAAsB,CAAC,EAC3B,UAAU,EACV,MAAM,GACP,EAAE,WAAW,CAAC,iBAAiB,CAAC;IAgJ3B,gBAAgB,CAAC,EACrB,UAAU,EACV,MAAM,GACP,EAAE,WAAW,CAAC,gBAAgB,CAAC;IA4C1B,iBAAiB,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,EAAE,WAAW,CAAC,YAAY,CAAC;IAgInE,sBAAsB,CAAC,EAC3B,UAAU,EACV,MAAM,GACP,EAAE,WAAW,CAAC,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"Transactions.d.ts","sourceRoot":"","sources":["../../../src/classes/Transactions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AAoBxC,OAAO,EACL,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,eAAe,EACf,+BAA+B,EAC/B,kCAAkC,EAClC,cAAc,EACd,0BAA0B,EAC1B,gBAAgB,EAChB,eAAe,EACf,QAAQ,EACR,WAAW,EACX,6BAA6B,EAC7B,2BAA2B,EAC3B,4BAA4B,EAC5B,gBAAgB,EAChB,iBAAiB,EACjB,WAAW,EACX,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,2BAA2B,EAC3B,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,EAEpB,gBAAgB,EAChB,+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148
1148
|
const authority = params.userWallet;
|
|
1149
1149
|
const iyfProgram = addresses_1.IYF_MAIN;
|
|
1150
1150
|
const hawksightAuthority = addresses_1.HS_AUTHORITY;
|
|
1151
|
-
const { params: _params, data } = this.
|
|
1152
|
-
|
|
1153
|
-
let userTokenX;
|
|
1154
|
-
let userTokenY;
|
|
1155
|
-
if (params.pdaTokenType === types_1.TokenType.STA) {
|
|
1156
|
-
userTokenX = (0, functions_1.generateUserPdaStorageAccount)(userPda, tokenXMint.pubkey);
|
|
1157
|
-
userTokenY = (0, functions_1.generateUserPdaStorageAccount)(userPda, tokenYMint.pubkey);
|
|
1158
|
-
}
|
|
1159
|
-
else if (params.pdaTokenType === types_1.TokenType.LTA) {
|
|
1160
|
-
userTokenX = (0, functions_1.generateLimitToken)(userPda, tokenXMint.pubkey);
|
|
1161
|
-
userTokenY = (0, functions_1.generateLimitToken)(userPda, tokenYMint.pubkey);
|
|
1162
|
-
}
|
|
1163
|
-
else {
|
|
1164
|
-
userTokenX = (0, functions_1.generateAta)(userPda, tokenXMint.pubkey);
|
|
1165
|
-
userTokenY = (0, functions_1.generateAta)(userPda, tokenYMint.pubkey);
|
|
1166
|
-
}
|
|
1151
|
+
const { params: _params, data } = this.removeLiquidityByRange2Info(ixs);
|
|
1152
|
+
let { position: _position, lbPair, binArrayBitmapExtension, reserveX, reserveY, tokenXMint, tokenYMint, sender, tokenXProgram, tokenYProgram, memoProgram, eventAuthority, program: meteoraDlmmProgram, binArrays, } = _params;
|
|
1167
1153
|
let ix;
|
|
1168
1154
|
if (params.isLimitOrder) {
|
|
1169
1155
|
const limitTokenX = (0, functions_1.generateLimitToken)(userPda, tokenXMint.pubkey);
|
|
1170
1156
|
const limitTokenY = (0, functions_1.generateLimitToken)(userPda, tokenYMint.pubkey);
|
|
1171
1157
|
const authorityTokenX = (0, functions_1.generateAta)(hawksightAuthority, tokenXMint.pubkey);
|
|
1172
1158
|
const authorityTokenY = (0, functions_1.generateAta)(hawksightAuthority, tokenYMint.pubkey);
|
|
1173
|
-
//
|
|
1174
|
-
const limitCloseAutomationIx = yield
|
|
1175
|
-
|
|
1176
|
-
.
|
|
1177
|
-
userPda,
|
|
1178
|
-
hawksightAuthority,
|
|
1179
|
-
authority,
|
|
1159
|
+
// Use MeteoraDlmmIxGenerator for limitOrderCloseV2
|
|
1160
|
+
const limitCloseAutomationIx = yield this.ix.meteoraDlmm.limitOrderCloseV2({
|
|
1161
|
+
connection,
|
|
1162
|
+
userWallet: params.userWallet,
|
|
1180
1163
|
position: _position.pubkey,
|
|
1181
1164
|
lbPair: lbPair.pubkey,
|
|
1182
|
-
binArrayBitmapExtension: binArrayBitmapExtension.pubkey,
|
|
1183
|
-
limitTokenX,
|
|
1184
|
-
limitTokenY,
|
|
1185
|
-
authorityTokenX,
|
|
1186
|
-
authorityTokenY,
|
|
1187
|
-
systemProgram: web3.SystemProgram.programId,
|
|
1188
|
-
reserveX: reserveX.pubkey,
|
|
1189
|
-
reserveY: reserveY.pubkey,
|
|
1190
1165
|
tokenXMint: tokenXMint.pubkey,
|
|
1191
1166
|
tokenYMint: tokenYMint.pubkey,
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1167
|
+
reserveX: reserveX.pubkey,
|
|
1168
|
+
reserveY: reserveY.pubkey,
|
|
1169
|
+
tokenXProgram: tokenXProgram.pubkey,
|
|
1170
|
+
tokenYProgram: tokenYProgram.pubkey,
|
|
1171
|
+
useFuelAccount: false, // todo: update this
|
|
1172
|
+
param: data,
|
|
1173
|
+
minBinId: params.minBinId,
|
|
1174
|
+
maxBinId: params.maxBinId,
|
|
1175
|
+
binArrays,
|
|
1176
|
+
});
|
|
1202
1177
|
// Instruction via main hawksight contract
|
|
1203
1178
|
// @ts-ignore
|
|
1204
1179
|
ix = yield anchor_1.Anchor.instance()
|
|
@@ -1213,64 +1188,31 @@ class Transactions {
|
|
|
1213
1188
|
}
|
|
1214
1189
|
else {
|
|
1215
1190
|
// @ts-ignore
|
|
1216
|
-
const limitCloseAutomationIx = yield
|
|
1217
|
-
|
|
1218
|
-
.
|
|
1219
|
-
farm,
|
|
1220
|
-
userPda,
|
|
1221
|
-
authority,
|
|
1222
|
-
iyfProgram,
|
|
1223
|
-
hawksightAuthority,
|
|
1191
|
+
const limitCloseAutomationIx = yield this.ix.meteoraDlmm.meteoraDlmmLimitCloseAutomationV2({
|
|
1192
|
+
connection,
|
|
1193
|
+
userWallet: params.userWallet,
|
|
1224
1194
|
position: _position.pubkey,
|
|
1225
1195
|
lbPair: lbPair.pubkey,
|
|
1226
|
-
binArrayBitmapExtension: binArrayBitmapExtension.pubkey,
|
|
1227
|
-
userTokenX,
|
|
1228
|
-
userTokenY,
|
|
1229
|
-
reserveX: reserveX.pubkey,
|
|
1230
|
-
reserveY: reserveY.pubkey,
|
|
1231
1196
|
tokenXMint: tokenXMint.pubkey,
|
|
1232
1197
|
tokenYMint: tokenYMint.pubkey,
|
|
1198
|
+
reserveX: reserveX.pubkey,
|
|
1199
|
+
reserveY: reserveY.pubkey,
|
|
1233
1200
|
tokenXProgram: tokenXProgram.pubkey,
|
|
1234
1201
|
tokenYProgram: tokenYProgram.pubkey,
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
// Instruction via main hawksight contract
|
|
1244
|
-
ix = yield
|
|
1245
|
-
.iyfMain.methods.iyfExtensionExecute(limitCloseAutomationIx.data)
|
|
1246
|
-
.accounts({
|
|
1247
|
-
farm,
|
|
1202
|
+
pdaTokenType: params.pdaTokenType,
|
|
1203
|
+
useFuelAccount: false,
|
|
1204
|
+
param: data,
|
|
1205
|
+
minBinId: params.minBinId,
|
|
1206
|
+
maxBinId: params.maxBinId,
|
|
1207
|
+
isHawkRefund: false,
|
|
1208
|
+
binArrays: binArrays,
|
|
1209
|
+
});
|
|
1210
|
+
// Instruction via main hawksight contract using iyfExtensionExecuteV2
|
|
1211
|
+
ix = yield this.ix.iyfMain.iyfExtensionExecuteV2(connection, {
|
|
1248
1212
|
userPda,
|
|
1249
|
-
authority,
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
})
|
|
1253
|
-
.remainingAccounts([
|
|
1254
|
-
limitCloseAutomationIx.keys[4],
|
|
1255
|
-
limitCloseAutomationIx.keys[5],
|
|
1256
|
-
limitCloseAutomationIx.keys[6],
|
|
1257
|
-
limitCloseAutomationIx.keys[7],
|
|
1258
|
-
limitCloseAutomationIx.keys[8],
|
|
1259
|
-
limitCloseAutomationIx.keys[9],
|
|
1260
|
-
limitCloseAutomationIx.keys[10],
|
|
1261
|
-
limitCloseAutomationIx.keys[11],
|
|
1262
|
-
limitCloseAutomationIx.keys[12],
|
|
1263
|
-
limitCloseAutomationIx.keys[13],
|
|
1264
|
-
limitCloseAutomationIx.keys[14],
|
|
1265
|
-
limitCloseAutomationIx.keys[15],
|
|
1266
|
-
limitCloseAutomationIx.keys[16],
|
|
1267
|
-
limitCloseAutomationIx.keys[17],
|
|
1268
|
-
limitCloseAutomationIx.keys[18],
|
|
1269
|
-
limitCloseAutomationIx.keys[19],
|
|
1270
|
-
limitCloseAutomationIx.keys[20],
|
|
1271
|
-
limitCloseAutomationIx.keys[21],
|
|
1272
|
-
])
|
|
1273
|
-
.instruction();
|
|
1213
|
+
authority: hawksightAuthority,
|
|
1214
|
+
ix: limitCloseAutomationIx,
|
|
1215
|
+
});
|
|
1274
1216
|
}
|
|
1275
1217
|
const mainInstructions = [
|
|
1276
1218
|
// Limit Close Automation Instruction (Hawksight CPI)
|
|
@@ -1290,13 +1232,6 @@ class Transactions {
|
|
|
1290
1232
|
const position = yield program.account.positionV2.fetch(params.position);
|
|
1291
1233
|
const dlmmPool = yield meteora_1.MeteoraDLMM.create(connection, position.lbPair, this.ix);
|
|
1292
1234
|
const userPda = (0, functions_1.generateUserPda)(params.userWallet);
|
|
1293
|
-
// Step 1: Claim all fees/rewards, remove all liquidity and close current position
|
|
1294
|
-
// const { userPositions } = await dlmmPool.getPositionsByUserAndLbPair(
|
|
1295
|
-
// userPda
|
|
1296
|
-
// );
|
|
1297
|
-
// const binIdsToRemove = userPositions[0].positionData.positionBinData.map(
|
|
1298
|
-
// (bin) => bin.binId
|
|
1299
|
-
// );
|
|
1300
1235
|
// Claim fees and/or rewards, remove liquidity, and possibly close position from Meteora API (if set)
|
|
1301
1236
|
const txn = yield dlmmPool.dlmm.removeLiquidity({
|
|
1302
1237
|
user: userPda,
|
|
@@ -1312,58 +1247,34 @@ class Transactions {
|
|
|
1312
1247
|
const authority = params.userWallet;
|
|
1313
1248
|
const iyfProgram = addresses_1.IYF_MAIN;
|
|
1314
1249
|
const hawksightAuthority = addresses_1.HS_AUTHORITY;
|
|
1315
|
-
const { params: _params, data } = this.
|
|
1316
|
-
|
|
1317
|
-
let userTokenX;
|
|
1318
|
-
let userTokenY;
|
|
1319
|
-
if (params.pdaTokenType === types_1.TokenType.STA) {
|
|
1320
|
-
userTokenX = (0, functions_1.generateUserPdaStorageAccount)(userPda, tokenXMint.pubkey);
|
|
1321
|
-
userTokenY = (0, functions_1.generateUserPdaStorageAccount)(userPda, tokenYMint.pubkey);
|
|
1322
|
-
}
|
|
1323
|
-
else if (params.pdaTokenType === types_1.TokenType.LTA) {
|
|
1324
|
-
userTokenX = (0, functions_1.generateLimitToken)(userPda, tokenXMint.pubkey);
|
|
1325
|
-
userTokenY = (0, functions_1.generateLimitToken)(userPda, tokenYMint.pubkey);
|
|
1326
|
-
}
|
|
1327
|
-
else {
|
|
1328
|
-
userTokenX = (0, functions_1.generateAta)(userPda, tokenXMint.pubkey);
|
|
1329
|
-
userTokenY = (0, functions_1.generateAta)(userPda, tokenYMint.pubkey);
|
|
1330
|
-
}
|
|
1250
|
+
const { params: _params, data } = this.removeLiquidityByRange2Info(ixs);
|
|
1251
|
+
let { position: _position, lbPair, binArrayBitmapExtension, reserveX, reserveY, tokenXMint, tokenYMint, sender, tokenXProgram, tokenYProgram, memoProgram, eventAuthority, program: meteoraDlmmProgram, binArrays, } = _params;
|
|
1331
1252
|
let ix;
|
|
1332
1253
|
if (params.isLimitOrder) {
|
|
1333
1254
|
const limitTokenX = (0, functions_1.generateLimitToken)(userPda, tokenXMint.pubkey);
|
|
1334
1255
|
const limitTokenY = (0, functions_1.generateLimitToken)(userPda, tokenYMint.pubkey);
|
|
1335
1256
|
const authorityTokenX = (0, functions_1.generateAta)(hawksightAuthority, tokenXMint.pubkey);
|
|
1336
1257
|
const authorityTokenY = (0, functions_1.generateAta)(hawksightAuthority, tokenYMint.pubkey);
|
|
1337
|
-
//
|
|
1338
|
-
const limitCloseAutomationIx = yield
|
|
1339
|
-
|
|
1340
|
-
.
|
|
1341
|
-
userPda,
|
|
1342
|
-
hawksightAuthority,
|
|
1343
|
-
authority,
|
|
1258
|
+
// Use MeteoraDlmmIxGenerator for limitOrderCloseV2
|
|
1259
|
+
const limitCloseAutomationIx = yield this.ix.meteoraDlmm.limitOrderCloseV2({
|
|
1260
|
+
connection,
|
|
1261
|
+
userWallet: params.userWallet,
|
|
1344
1262
|
position: _position.pubkey,
|
|
1345
1263
|
lbPair: lbPair.pubkey,
|
|
1346
|
-
binArrayBitmapExtension: binArrayBitmapExtension.pubkey,
|
|
1347
|
-
limitTokenX,
|
|
1348
|
-
limitTokenY,
|
|
1349
|
-
authorityTokenX,
|
|
1350
|
-
authorityTokenY,
|
|
1351
|
-
systemProgram: web3.SystemProgram.programId,
|
|
1352
|
-
reserveX: reserveX.pubkey,
|
|
1353
|
-
reserveY: reserveY.pubkey,
|
|
1354
1264
|
tokenXMint: tokenXMint.pubkey,
|
|
1355
1265
|
tokenYMint: tokenYMint.pubkey,
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1266
|
+
reserveX: reserveX.pubkey,
|
|
1267
|
+
reserveY: reserveY.pubkey,
|
|
1268
|
+
tokenXProgram: tokenXProgram.pubkey,
|
|
1269
|
+
tokenYProgram: tokenYProgram.pubkey,
|
|
1270
|
+
useFuelAccount: false,
|
|
1271
|
+
param: data,
|
|
1272
|
+
minBinId: params.minBinId,
|
|
1273
|
+
maxBinId: params.maxBinId,
|
|
1274
|
+
binArrays: binArrays,
|
|
1275
|
+
});
|
|
1366
1276
|
// Instruction via main hawksight contract
|
|
1277
|
+
// @ts-ignore
|
|
1367
1278
|
ix = yield anchor_1.Anchor.instance()
|
|
1368
1279
|
.iyfMain.methods.iyfExtensionExecuteV2(limitCloseAutomationIx.data)
|
|
1369
1280
|
.accounts({
|
|
@@ -1376,64 +1287,31 @@ class Transactions {
|
|
|
1376
1287
|
}
|
|
1377
1288
|
else {
|
|
1378
1289
|
// @ts-ignore
|
|
1379
|
-
const limitCloseAutomationIx = yield
|
|
1380
|
-
|
|
1381
|
-
.
|
|
1382
|
-
farm,
|
|
1383
|
-
userPda,
|
|
1384
|
-
authority,
|
|
1385
|
-
iyfProgram,
|
|
1386
|
-
hawksightAuthority,
|
|
1290
|
+
const limitCloseAutomationIx = yield this.ix.meteoraDlmm.meteoraDlmmLimitCloseAutomationV2({
|
|
1291
|
+
connection,
|
|
1292
|
+
userWallet: params.userWallet,
|
|
1387
1293
|
position: _position.pubkey,
|
|
1388
1294
|
lbPair: lbPair.pubkey,
|
|
1389
|
-
binArrayBitmapExtension: binArrayBitmapExtension.pubkey,
|
|
1390
|
-
userTokenX,
|
|
1391
|
-
userTokenY,
|
|
1392
|
-
reserveX: reserveX.pubkey,
|
|
1393
|
-
reserveY: reserveY.pubkey,
|
|
1394
1295
|
tokenXMint: tokenXMint.pubkey,
|
|
1395
1296
|
tokenYMint: tokenYMint.pubkey,
|
|
1297
|
+
reserveX: reserveX.pubkey,
|
|
1298
|
+
reserveY: reserveY.pubkey,
|
|
1396
1299
|
tokenXProgram: tokenXProgram.pubkey,
|
|
1397
1300
|
tokenYProgram: tokenYProgram.pubkey,
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
// Instruction via main hawksight contract
|
|
1407
|
-
ix = yield
|
|
1408
|
-
.iyfMain.methods.iyfExtensionExecute(limitCloseAutomationIx.data)
|
|
1409
|
-
.accounts({
|
|
1410
|
-
farm,
|
|
1301
|
+
pdaTokenType: params.pdaTokenType,
|
|
1302
|
+
useFuelAccount: false,
|
|
1303
|
+
param: data,
|
|
1304
|
+
minBinId: params.minBinId,
|
|
1305
|
+
maxBinId: params.maxBinId,
|
|
1306
|
+
isHawkRefund: params.isHawkRefund,
|
|
1307
|
+
binArrays: binArrays,
|
|
1308
|
+
});
|
|
1309
|
+
// Instruction via main hawksight contract using iyfExtensionExecuteV2
|
|
1310
|
+
ix = yield this.ix.iyfMain.iyfExtensionExecuteV2(connection, {
|
|
1411
1311
|
userPda,
|
|
1412
|
-
authority,
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
})
|
|
1416
|
-
.remainingAccounts([
|
|
1417
|
-
limitCloseAutomationIx.keys[4],
|
|
1418
|
-
limitCloseAutomationIx.keys[5],
|
|
1419
|
-
limitCloseAutomationIx.keys[6],
|
|
1420
|
-
limitCloseAutomationIx.keys[7],
|
|
1421
|
-
limitCloseAutomationIx.keys[8],
|
|
1422
|
-
limitCloseAutomationIx.keys[9],
|
|
1423
|
-
limitCloseAutomationIx.keys[10],
|
|
1424
|
-
limitCloseAutomationIx.keys[11],
|
|
1425
|
-
limitCloseAutomationIx.keys[12],
|
|
1426
|
-
limitCloseAutomationIx.keys[13],
|
|
1427
|
-
limitCloseAutomationIx.keys[14],
|
|
1428
|
-
limitCloseAutomationIx.keys[15],
|
|
1429
|
-
limitCloseAutomationIx.keys[16],
|
|
1430
|
-
limitCloseAutomationIx.keys[17],
|
|
1431
|
-
limitCloseAutomationIx.keys[18],
|
|
1432
|
-
limitCloseAutomationIx.keys[19],
|
|
1433
|
-
limitCloseAutomationIx.keys[20],
|
|
1434
|
-
limitCloseAutomationIx.keys[21],
|
|
1435
|
-
])
|
|
1436
|
-
.instruction();
|
|
1312
|
+
authority: hawksightAuthority,
|
|
1313
|
+
ix: limitCloseAutomationIx,
|
|
1314
|
+
});
|
|
1437
1315
|
}
|
|
1438
1316
|
const mainInstructions = [
|
|
1439
1317
|
// Limit Close Automation Instruction (Hawksight CPI)
|
|
@@ -1450,8 +1328,9 @@ class Transactions {
|
|
|
1450
1328
|
removeLiquidityByRangeInfo(ixs) {
|
|
1451
1329
|
for (const ix of ixs) {
|
|
1452
1330
|
const programIdMatch = ix.programId.equals(addresses_1.METEORA_DLMM_PROGRAM);
|
|
1453
|
-
const
|
|
1454
|
-
|
|
1331
|
+
const removeLiquidityByRange = (0, functions_1.sighashMatch)(ix.data, "RemoveLiquidityByRange");
|
|
1332
|
+
// Handle original RemoveLiquidityByRange instruction
|
|
1333
|
+
if (programIdMatch && removeLiquidityByRange) {
|
|
1455
1334
|
return {
|
|
1456
1335
|
data: ix.data,
|
|
1457
1336
|
params: {
|
|
@@ -1475,7 +1354,38 @@ class Transactions {
|
|
|
1475
1354
|
};
|
|
1476
1355
|
}
|
|
1477
1356
|
}
|
|
1478
|
-
throw new Error(`Unexpected error: Cannot find "RemoveLiquidityByRange" instruction from instructions`);
|
|
1357
|
+
throw new Error(`Unexpected error: Cannot find "RemoveLiquidityByRange" or "RemoveLiquidityByRange2" instruction from instructions`);
|
|
1358
|
+
}
|
|
1359
|
+
removeLiquidityByRange2Info(ixs) {
|
|
1360
|
+
for (const ix of ixs) {
|
|
1361
|
+
const programIdMatch = ix.programId.equals(addresses_1.METEORA_DLMM_PROGRAM);
|
|
1362
|
+
const removeLiquidityByRange2 = (0, functions_1.sighashMatch)(ix.data, "remove_liquidity_by_range2", undefined, true);
|
|
1363
|
+
// Handle RemoveLiquidityByRange2 instruction with different account structure
|
|
1364
|
+
if (programIdMatch && removeLiquidityByRange2) {
|
|
1365
|
+
return {
|
|
1366
|
+
data: ix.data,
|
|
1367
|
+
params: {
|
|
1368
|
+
position: ix.keys[0],
|
|
1369
|
+
lbPair: ix.keys[1],
|
|
1370
|
+
binArrayBitmapExtension: ix.keys[2],
|
|
1371
|
+
userTokenX: ix.keys[3],
|
|
1372
|
+
userTokenY: ix.keys[4],
|
|
1373
|
+
reserveX: ix.keys[5],
|
|
1374
|
+
reserveY: ix.keys[6],
|
|
1375
|
+
tokenXMint: ix.keys[7],
|
|
1376
|
+
tokenYMint: ix.keys[8],
|
|
1377
|
+
sender: ix.keys[9],
|
|
1378
|
+
tokenXProgram: ix.keys[10],
|
|
1379
|
+
tokenYProgram: ix.keys[11],
|
|
1380
|
+
memoProgram: ix.keys[12],
|
|
1381
|
+
eventAuthority: ix.keys[13],
|
|
1382
|
+
program: ix.keys[14],
|
|
1383
|
+
binArrays: ix.keys.slice(15).map(key => key.pubkey), // Remaining accounts as pubkeys
|
|
1384
|
+
},
|
|
1385
|
+
};
|
|
1386
|
+
}
|
|
1387
|
+
}
|
|
1388
|
+
throw new Error(`Unexpected error: Cannot find "RemoveLiquidityByRange" or "RemoveLiquidityByRange2" instruction from instructions`);
|
|
1479
1389
|
}
|
|
1480
1390
|
/**
|
|
1481
1391
|
* Creates orca instruction that opens new position
|
|
@@ -1491,6 +1401,7 @@ class Transactions {
|
|
|
1491
1401
|
const userPda = (0, functions_1.generateUserPda)(params.userWallet, farm);
|
|
1492
1402
|
const position = (0, functions_1.generateOrcaPositionPDA)(params.positionMint);
|
|
1493
1403
|
const positionTokenAccount = (0, functions_1.generateAta)(userPda, params.positionMint);
|
|
1404
|
+
// @ts-ignore
|
|
1494
1405
|
const extensionIx = yield anchor_1.Anchor.instance()
|
|
1495
1406
|
.iyfExtension.methods.orcaOpenPosition(params.tickLowerIndex, params.tickUpperIndex)
|
|
1496
1407
|
.accounts({
|
package/dist/src/functions.d.ts
CHANGED
|
@@ -397,5 +397,12 @@ export declare function getBatchedMultipleAccountsInfo(connection: web3.Connecti
|
|
|
397
397
|
export declare function getTokenProgramForMints(connection: web3.Connection, mints: web3.PublicKey[]): Promise<web3.PublicKey>;
|
|
398
398
|
export declare function getTokenProgramMapForMints(connection: web3.Connection, mints: web3.PublicKey[]): Promise<Record<string, web3.PublicKey>>;
|
|
399
399
|
export declare function getMeteoraStrategyType(strategyType: StrategyType, totalXAmount: BN, totalYAmount: BN): [MeteoraStrategyType, (boolean | undefined)];
|
|
400
|
+
/**
|
|
401
|
+
* Generate Hawksight fee accounts for X and Y tokens
|
|
402
|
+
*/
|
|
403
|
+
export declare function generateHawksightFeeAccounts(tokenXMint: web3.PublicKey, tokenYMint: web3.PublicKey, tokenXProgram: web3.PublicKey, tokenYProgram: web3.PublicKey): {
|
|
404
|
+
ownerFeeX: web3.PublicKey;
|
|
405
|
+
ownerFeeY: web3.PublicKey;
|
|
406
|
+
};
|
|
400
407
|
export {};
|
|
401
408
|
//# sourceMappingURL=functions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"functions.d.ts","sourceRoot":"","sources":["../../src/functions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,6BAA6B,CAAC;AACtD,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AAExC,OAAO,EACL,eAAe,EACf,kBAAkB,EAClB,mBAAmB,EACnB,2BAA2B,EAC3B,gBAAgB,EAChB,yBAAyB,EACzB,6BAA6B,EAC7B,WAAW,EACX,mBAAmB,EACnB,SAAS,EAET,YAAY,EACb,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"functions.d.ts","sourceRoot":"","sources":["../../src/functions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,6BAA6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,GAAG,SAAS,CAAC,CAAC,CAenJ;AAED;;GAEG;AACH,wBAAgB,4BAA4B,CAC1C,UAAU,EAAE,IAAI,CAAC,SAAS,EAC1B,UAAU,EAAE,IAAI,CAAC,SAAS,EAC1B,aAAa,EAAE,IAAI,CAAC,SAAS,EAC7B,aAAa,EAAE,IAAI,CAAC,SAAS,GAC5B;IACD,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC;IAC1B,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC;CAC3B,CAKA"}
|
package/dist/src/functions.js
CHANGED
|
@@ -103,6 +103,7 @@ exports.getBatchedMultipleAccountsInfo = getBatchedMultipleAccountsInfo;
|
|
|
103
103
|
exports.getTokenProgramForMints = getTokenProgramForMints;
|
|
104
104
|
exports.getTokenProgramMapForMints = getTokenProgramMapForMints;
|
|
105
105
|
exports.getMeteoraStrategyType = getMeteoraStrategyType;
|
|
106
|
+
exports.generateHawksightFeeAccounts = generateHawksightFeeAccounts;
|
|
106
107
|
const client = __importStar(require("@hawksightco/swagger-client"));
|
|
107
108
|
const web3 = __importStar(require("@solana/web3.js"));
|
|
108
109
|
const axios_1 = __importDefault(require("axios"));
|
|
@@ -1226,3 +1227,12 @@ function getMeteoraStrategyType(strategyType, totalXAmount, totalYAmount) {
|
|
|
1226
1227
|
}
|
|
1227
1228
|
return [_strategyType, singleSidedX];
|
|
1228
1229
|
}
|
|
1230
|
+
/**
|
|
1231
|
+
* Generate Hawksight fee accounts for X and Y tokens
|
|
1232
|
+
*/
|
|
1233
|
+
function generateHawksightFeeAccounts(tokenXMint, tokenYMint, tokenXProgram, tokenYProgram) {
|
|
1234
|
+
return {
|
|
1235
|
+
ownerFeeX: generateAta(addresses_1.SITE_FEE_OWNER, tokenXMint, tokenXProgram),
|
|
1236
|
+
ownerFeeY: generateAta(addresses_1.SITE_FEE_OWNER, tokenYMint, tokenYProgram),
|
|
1237
|
+
};
|
|
1238
|
+
}
|