@hawksightco/hawk-sdk 1.3.97 → 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/MultiTransaction.js +3 -3
- 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 +128 -200
- 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
|
@@ -223,10 +223,10 @@ class MultiTransaction {
|
|
|
223
223
|
let nonceIndex = 0;
|
|
224
224
|
for (const tuple of this.txs) {
|
|
225
225
|
const tx = this.transactionInstance(tuple[0], tuple[1], latestBlockhash);
|
|
226
|
-
const simulation =
|
|
227
|
-
const computeUnitLimit = Math.round(simulation.unitsConsumed * 1.15) +
|
|
226
|
+
// const simulation = await tx.simulateTransaction(connection);
|
|
227
|
+
// const computeUnitLimit = Math.round(simulation.unitsConsumed * 1.15) + 100_000; // + 15% + 100,000 additional CU to prevent exceeding CU.
|
|
228
228
|
tx.feeEstimate = estimate;
|
|
229
|
-
|
|
229
|
+
// await tx.addPriorityFeeIx(connection, computeUnitLimit, false, priorityLevel, priorityFeeMaxCap);
|
|
230
230
|
if (tx.hasNonceAdvanceIx) {
|
|
231
231
|
const nonceAccount = this.nonceAccounts[nonceIndex++];
|
|
232
232
|
const blockhash = nonceAccount.data.nonce;
|
|
@@ -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,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,+BAA+B,EAChC,MAAM,UAAU,CAAC;AA8BlB,OAAO,EAEL,wBAAwB,EACxB,mBAAmB,EACnB,wBAAwB,EACzB,MAAM,UAAU,CAAC;AAKlB,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAexD,qBAAa,YAAY;IACvB;;OAEG;IACH,OAAO;IAKP;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAe;IAEtC;;OAEG;IACI,EAAE,EAAE,iBAAiB,CAAC;IAE7B;;OA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GAAG,OAAO,CAAC,2BAA2B,CAAC;IAuEtE;;;;;;;OAOG;IACG,YAAY,CAAC,EACjB,UAAU,EACV,MAAM,GACP,EAAE,WAAW,CAAC,YAAY,CAAC,GAAG,OAAO,CAAC,2BAA2B,CAAC;IA8BnE;;;;;;;OAOG;IACG,eAAe,CACnB,EAAE,UAAU,EAAE,MAAM,EAAE,EAAE,WAAW,CAAC,eAAe,CAAC,EACpD,KAAK,EAAE,IAAI,CAAC,SAAS,EACrB,cAAc,EAAE,cAAc,GAC7B,OAAO,CAAC,gBAAgB,CAAC;IA6C5B;;;;;;;OAOG;IACG,oBAAoB,CAAC,EACzB,UAAU,EACV,MAAM,GACP,EAAE,WAAW,CAAC,YAAY,CAAC,GAAG,OAAO,CAAC,2BAA2B,CAAC;IA4BnE;;;;;;OAMG;IACG,iBAAiB,CAAC,EACtB,UAAU,EACV,MAAM,GACP,EAAE,WAAW,CAAC,iBAAiB,CAAC,GAAG,OAAO,CAAC,2BAA2B,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;
|
|
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,2BAA2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B,CAAC,EAC7B,UAAU,EACV,MAAM,GACP,EAAE,WAAW,CAAC,wBAAwB,CAAC,GAAG,OAAO,CAAC,2BAA2B,CAAC;CAmFhF;AAED,eAAO,MAAM,KAAK,cAA6B,CAAC"}
|
|
@@ -775,12 +775,29 @@ class Transactions {
|
|
|
775
775
|
...claimBuilder.mainIxs,
|
|
776
776
|
];
|
|
777
777
|
console.log('=== CLAIM AUTOMATION IX SUCCESS ===');
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
778
|
+
try {
|
|
779
|
+
console.log('Creating transaction metadata...');
|
|
780
|
+
const result = (0, functions_1.createTransactionMeta)({
|
|
781
|
+
payer: params.userWallet,
|
|
782
|
+
description: "Automation IX: Meteora Auto-claim instructions (claim fee, reward)",
|
|
783
|
+
addressLookupTableAddresses: addresses_1.GLOBAL_ALT,
|
|
784
|
+
mainInstructions,
|
|
785
|
+
});
|
|
786
|
+
console.log('Transaction metadata created successfully');
|
|
787
|
+
return result;
|
|
788
|
+
}
|
|
789
|
+
catch (metadataError) {
|
|
790
|
+
console.error('=== TRANSACTION METADATA ERROR ===');
|
|
791
|
+
console.error('Error creating transaction metadata:', metadataError);
|
|
792
|
+
console.error('Main instructions count:', mainInstructions.length);
|
|
793
|
+
console.error('Main instructions:', mainInstructions.map(ix => ({
|
|
794
|
+
programId: ix.programId.toString(),
|
|
795
|
+
keysCount: ix.keys.length,
|
|
796
|
+
dataLength: ix.data.length
|
|
797
|
+
})));
|
|
798
|
+
console.error('=== END METADATA ERROR LOG ===');
|
|
799
|
+
throw metadataError;
|
|
800
|
+
}
|
|
784
801
|
}
|
|
785
802
|
catch (error) {
|
|
786
803
|
console.error('=== CLAIM AUTOMATION IX ERROR ===');
|
|
@@ -1131,57 +1148,32 @@ class Transactions {
|
|
|
1131
1148
|
const authority = params.userWallet;
|
|
1132
1149
|
const iyfProgram = addresses_1.IYF_MAIN;
|
|
1133
1150
|
const hawksightAuthority = addresses_1.HS_AUTHORITY;
|
|
1134
|
-
const { params: _params, data } = this.
|
|
1135
|
-
|
|
1136
|
-
let userTokenX;
|
|
1137
|
-
let userTokenY;
|
|
1138
|
-
if (params.pdaTokenType === types_1.TokenType.STA) {
|
|
1139
|
-
userTokenX = (0, functions_1.generateUserPdaStorageAccount)(userPda, tokenXMint.pubkey);
|
|
1140
|
-
userTokenY = (0, functions_1.generateUserPdaStorageAccount)(userPda, tokenYMint.pubkey);
|
|
1141
|
-
}
|
|
1142
|
-
else if (params.pdaTokenType === types_1.TokenType.LTA) {
|
|
1143
|
-
userTokenX = (0, functions_1.generateLimitToken)(userPda, tokenXMint.pubkey);
|
|
1144
|
-
userTokenY = (0, functions_1.generateLimitToken)(userPda, tokenYMint.pubkey);
|
|
1145
|
-
}
|
|
1146
|
-
else {
|
|
1147
|
-
userTokenX = (0, functions_1.generateAta)(userPda, tokenXMint.pubkey);
|
|
1148
|
-
userTokenY = (0, functions_1.generateAta)(userPda, tokenYMint.pubkey);
|
|
1149
|
-
}
|
|
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;
|
|
1150
1153
|
let ix;
|
|
1151
1154
|
if (params.isLimitOrder) {
|
|
1152
1155
|
const limitTokenX = (0, functions_1.generateLimitToken)(userPda, tokenXMint.pubkey);
|
|
1153
1156
|
const limitTokenY = (0, functions_1.generateLimitToken)(userPda, tokenYMint.pubkey);
|
|
1154
1157
|
const authorityTokenX = (0, functions_1.generateAta)(hawksightAuthority, tokenXMint.pubkey);
|
|
1155
1158
|
const authorityTokenY = (0, functions_1.generateAta)(hawksightAuthority, tokenYMint.pubkey);
|
|
1156
|
-
//
|
|
1157
|
-
const limitCloseAutomationIx = yield
|
|
1158
|
-
|
|
1159
|
-
.
|
|
1160
|
-
userPda,
|
|
1161
|
-
hawksightAuthority,
|
|
1162
|
-
authority,
|
|
1159
|
+
// Use MeteoraDlmmIxGenerator for limitOrderCloseV2
|
|
1160
|
+
const limitCloseAutomationIx = yield this.ix.meteoraDlmm.limitOrderCloseV2({
|
|
1161
|
+
connection,
|
|
1162
|
+
userWallet: params.userWallet,
|
|
1163
1163
|
position: _position.pubkey,
|
|
1164
1164
|
lbPair: lbPair.pubkey,
|
|
1165
|
-
binArrayBitmapExtension: binArrayBitmapExtension.pubkey,
|
|
1166
|
-
limitTokenX,
|
|
1167
|
-
limitTokenY,
|
|
1168
|
-
authorityTokenX,
|
|
1169
|
-
authorityTokenY,
|
|
1170
|
-
systemProgram: web3.SystemProgram.programId,
|
|
1171
|
-
reserveX: reserveX.pubkey,
|
|
1172
|
-
reserveY: reserveY.pubkey,
|
|
1173
1165
|
tokenXMint: tokenXMint.pubkey,
|
|
1174
1166
|
tokenYMint: tokenYMint.pubkey,
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
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
|
+
});
|
|
1185
1177
|
// Instruction via main hawksight contract
|
|
1186
1178
|
// @ts-ignore
|
|
1187
1179
|
ix = yield anchor_1.Anchor.instance()
|
|
@@ -1196,64 +1188,31 @@ class Transactions {
|
|
|
1196
1188
|
}
|
|
1197
1189
|
else {
|
|
1198
1190
|
// @ts-ignore
|
|
1199
|
-
const limitCloseAutomationIx = yield
|
|
1200
|
-
|
|
1201
|
-
.
|
|
1202
|
-
farm,
|
|
1203
|
-
userPda,
|
|
1204
|
-
authority,
|
|
1205
|
-
iyfProgram,
|
|
1206
|
-
hawksightAuthority,
|
|
1191
|
+
const limitCloseAutomationIx = yield this.ix.meteoraDlmm.meteoraDlmmLimitCloseAutomationV2({
|
|
1192
|
+
connection,
|
|
1193
|
+
userWallet: params.userWallet,
|
|
1207
1194
|
position: _position.pubkey,
|
|
1208
1195
|
lbPair: lbPair.pubkey,
|
|
1209
|
-
binArrayBitmapExtension: binArrayBitmapExtension.pubkey,
|
|
1210
|
-
userTokenX,
|
|
1211
|
-
userTokenY,
|
|
1212
|
-
reserveX: reserveX.pubkey,
|
|
1213
|
-
reserveY: reserveY.pubkey,
|
|
1214
1196
|
tokenXMint: tokenXMint.pubkey,
|
|
1215
1197
|
tokenYMint: tokenYMint.pubkey,
|
|
1198
|
+
reserveX: reserveX.pubkey,
|
|
1199
|
+
reserveY: reserveY.pubkey,
|
|
1216
1200
|
tokenXProgram: tokenXProgram.pubkey,
|
|
1217
1201
|
tokenYProgram: tokenYProgram.pubkey,
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
// Instruction via main hawksight contract
|
|
1227
|
-
ix = yield
|
|
1228
|
-
.iyfMain.methods.iyfExtensionExecute(limitCloseAutomationIx.data)
|
|
1229
|
-
.accounts({
|
|
1230
|
-
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, {
|
|
1231
1212
|
userPda,
|
|
1232
|
-
authority,
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
})
|
|
1236
|
-
.remainingAccounts([
|
|
1237
|
-
limitCloseAutomationIx.keys[4],
|
|
1238
|
-
limitCloseAutomationIx.keys[5],
|
|
1239
|
-
limitCloseAutomationIx.keys[6],
|
|
1240
|
-
limitCloseAutomationIx.keys[7],
|
|
1241
|
-
limitCloseAutomationIx.keys[8],
|
|
1242
|
-
limitCloseAutomationIx.keys[9],
|
|
1243
|
-
limitCloseAutomationIx.keys[10],
|
|
1244
|
-
limitCloseAutomationIx.keys[11],
|
|
1245
|
-
limitCloseAutomationIx.keys[12],
|
|
1246
|
-
limitCloseAutomationIx.keys[13],
|
|
1247
|
-
limitCloseAutomationIx.keys[14],
|
|
1248
|
-
limitCloseAutomationIx.keys[15],
|
|
1249
|
-
limitCloseAutomationIx.keys[16],
|
|
1250
|
-
limitCloseAutomationIx.keys[17],
|
|
1251
|
-
limitCloseAutomationIx.keys[18],
|
|
1252
|
-
limitCloseAutomationIx.keys[19],
|
|
1253
|
-
limitCloseAutomationIx.keys[20],
|
|
1254
|
-
limitCloseAutomationIx.keys[21],
|
|
1255
|
-
])
|
|
1256
|
-
.instruction();
|
|
1213
|
+
authority: hawksightAuthority,
|
|
1214
|
+
ix: limitCloseAutomationIx,
|
|
1215
|
+
});
|
|
1257
1216
|
}
|
|
1258
1217
|
const mainInstructions = [
|
|
1259
1218
|
// Limit Close Automation Instruction (Hawksight CPI)
|
|
@@ -1273,13 +1232,6 @@ class Transactions {
|
|
|
1273
1232
|
const position = yield program.account.positionV2.fetch(params.position);
|
|
1274
1233
|
const dlmmPool = yield meteora_1.MeteoraDLMM.create(connection, position.lbPair, this.ix);
|
|
1275
1234
|
const userPda = (0, functions_1.generateUserPda)(params.userWallet);
|
|
1276
|
-
// Step 1: Claim all fees/rewards, remove all liquidity and close current position
|
|
1277
|
-
// const { userPositions } = await dlmmPool.getPositionsByUserAndLbPair(
|
|
1278
|
-
// userPda
|
|
1279
|
-
// );
|
|
1280
|
-
// const binIdsToRemove = userPositions[0].positionData.positionBinData.map(
|
|
1281
|
-
// (bin) => bin.binId
|
|
1282
|
-
// );
|
|
1283
1235
|
// Claim fees and/or rewards, remove liquidity, and possibly close position from Meteora API (if set)
|
|
1284
1236
|
const txn = yield dlmmPool.dlmm.removeLiquidity({
|
|
1285
1237
|
user: userPda,
|
|
@@ -1295,58 +1247,34 @@ class Transactions {
|
|
|
1295
1247
|
const authority = params.userWallet;
|
|
1296
1248
|
const iyfProgram = addresses_1.IYF_MAIN;
|
|
1297
1249
|
const hawksightAuthority = addresses_1.HS_AUTHORITY;
|
|
1298
|
-
const { params: _params, data } = this.
|
|
1299
|
-
|
|
1300
|
-
let userTokenX;
|
|
1301
|
-
let userTokenY;
|
|
1302
|
-
if (params.pdaTokenType === types_1.TokenType.STA) {
|
|
1303
|
-
userTokenX = (0, functions_1.generateUserPdaStorageAccount)(userPda, tokenXMint.pubkey);
|
|
1304
|
-
userTokenY = (0, functions_1.generateUserPdaStorageAccount)(userPda, tokenYMint.pubkey);
|
|
1305
|
-
}
|
|
1306
|
-
else if (params.pdaTokenType === types_1.TokenType.LTA) {
|
|
1307
|
-
userTokenX = (0, functions_1.generateLimitToken)(userPda, tokenXMint.pubkey);
|
|
1308
|
-
userTokenY = (0, functions_1.generateLimitToken)(userPda, tokenYMint.pubkey);
|
|
1309
|
-
}
|
|
1310
|
-
else {
|
|
1311
|
-
userTokenX = (0, functions_1.generateAta)(userPda, tokenXMint.pubkey);
|
|
1312
|
-
userTokenY = (0, functions_1.generateAta)(userPda, tokenYMint.pubkey);
|
|
1313
|
-
}
|
|
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;
|
|
1314
1252
|
let ix;
|
|
1315
1253
|
if (params.isLimitOrder) {
|
|
1316
1254
|
const limitTokenX = (0, functions_1.generateLimitToken)(userPda, tokenXMint.pubkey);
|
|
1317
1255
|
const limitTokenY = (0, functions_1.generateLimitToken)(userPda, tokenYMint.pubkey);
|
|
1318
1256
|
const authorityTokenX = (0, functions_1.generateAta)(hawksightAuthority, tokenXMint.pubkey);
|
|
1319
1257
|
const authorityTokenY = (0, functions_1.generateAta)(hawksightAuthority, tokenYMint.pubkey);
|
|
1320
|
-
//
|
|
1321
|
-
const limitCloseAutomationIx = yield
|
|
1322
|
-
|
|
1323
|
-
.
|
|
1324
|
-
userPda,
|
|
1325
|
-
hawksightAuthority,
|
|
1326
|
-
authority,
|
|
1258
|
+
// Use MeteoraDlmmIxGenerator for limitOrderCloseV2
|
|
1259
|
+
const limitCloseAutomationIx = yield this.ix.meteoraDlmm.limitOrderCloseV2({
|
|
1260
|
+
connection,
|
|
1261
|
+
userWallet: params.userWallet,
|
|
1327
1262
|
position: _position.pubkey,
|
|
1328
1263
|
lbPair: lbPair.pubkey,
|
|
1329
|
-
binArrayBitmapExtension: binArrayBitmapExtension.pubkey,
|
|
1330
|
-
limitTokenX,
|
|
1331
|
-
limitTokenY,
|
|
1332
|
-
authorityTokenX,
|
|
1333
|
-
authorityTokenY,
|
|
1334
|
-
systemProgram: web3.SystemProgram.programId,
|
|
1335
|
-
reserveX: reserveX.pubkey,
|
|
1336
|
-
reserveY: reserveY.pubkey,
|
|
1337
1264
|
tokenXMint: tokenXMint.pubkey,
|
|
1338
1265
|
tokenYMint: tokenYMint.pubkey,
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
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
|
+
});
|
|
1349
1276
|
// Instruction via main hawksight contract
|
|
1277
|
+
// @ts-ignore
|
|
1350
1278
|
ix = yield anchor_1.Anchor.instance()
|
|
1351
1279
|
.iyfMain.methods.iyfExtensionExecuteV2(limitCloseAutomationIx.data)
|
|
1352
1280
|
.accounts({
|
|
@@ -1359,64 +1287,31 @@ class Transactions {
|
|
|
1359
1287
|
}
|
|
1360
1288
|
else {
|
|
1361
1289
|
// @ts-ignore
|
|
1362
|
-
const limitCloseAutomationIx = yield
|
|
1363
|
-
|
|
1364
|
-
.
|
|
1365
|
-
farm,
|
|
1366
|
-
userPda,
|
|
1367
|
-
authority,
|
|
1368
|
-
iyfProgram,
|
|
1369
|
-
hawksightAuthority,
|
|
1290
|
+
const limitCloseAutomationIx = yield this.ix.meteoraDlmm.meteoraDlmmLimitCloseAutomationV2({
|
|
1291
|
+
connection,
|
|
1292
|
+
userWallet: params.userWallet,
|
|
1370
1293
|
position: _position.pubkey,
|
|
1371
1294
|
lbPair: lbPair.pubkey,
|
|
1372
|
-
binArrayBitmapExtension: binArrayBitmapExtension.pubkey,
|
|
1373
|
-
userTokenX,
|
|
1374
|
-
userTokenY,
|
|
1375
|
-
reserveX: reserveX.pubkey,
|
|
1376
|
-
reserveY: reserveY.pubkey,
|
|
1377
1295
|
tokenXMint: tokenXMint.pubkey,
|
|
1378
1296
|
tokenYMint: tokenYMint.pubkey,
|
|
1297
|
+
reserveX: reserveX.pubkey,
|
|
1298
|
+
reserveY: reserveY.pubkey,
|
|
1379
1299
|
tokenXProgram: tokenXProgram.pubkey,
|
|
1380
1300
|
tokenYProgram: tokenYProgram.pubkey,
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
// Instruction via main hawksight contract
|
|
1390
|
-
ix = yield
|
|
1391
|
-
.iyfMain.methods.iyfExtensionExecute(limitCloseAutomationIx.data)
|
|
1392
|
-
.accounts({
|
|
1393
|
-
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, {
|
|
1394
1311
|
userPda,
|
|
1395
|
-
authority,
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
})
|
|
1399
|
-
.remainingAccounts([
|
|
1400
|
-
limitCloseAutomationIx.keys[4],
|
|
1401
|
-
limitCloseAutomationIx.keys[5],
|
|
1402
|
-
limitCloseAutomationIx.keys[6],
|
|
1403
|
-
limitCloseAutomationIx.keys[7],
|
|
1404
|
-
limitCloseAutomationIx.keys[8],
|
|
1405
|
-
limitCloseAutomationIx.keys[9],
|
|
1406
|
-
limitCloseAutomationIx.keys[10],
|
|
1407
|
-
limitCloseAutomationIx.keys[11],
|
|
1408
|
-
limitCloseAutomationIx.keys[12],
|
|
1409
|
-
limitCloseAutomationIx.keys[13],
|
|
1410
|
-
limitCloseAutomationIx.keys[14],
|
|
1411
|
-
limitCloseAutomationIx.keys[15],
|
|
1412
|
-
limitCloseAutomationIx.keys[16],
|
|
1413
|
-
limitCloseAutomationIx.keys[17],
|
|
1414
|
-
limitCloseAutomationIx.keys[18],
|
|
1415
|
-
limitCloseAutomationIx.keys[19],
|
|
1416
|
-
limitCloseAutomationIx.keys[20],
|
|
1417
|
-
limitCloseAutomationIx.keys[21],
|
|
1418
|
-
])
|
|
1419
|
-
.instruction();
|
|
1312
|
+
authority: hawksightAuthority,
|
|
1313
|
+
ix: limitCloseAutomationIx,
|
|
1314
|
+
});
|
|
1420
1315
|
}
|
|
1421
1316
|
const mainInstructions = [
|
|
1422
1317
|
// Limit Close Automation Instruction (Hawksight CPI)
|
|
@@ -1433,8 +1328,9 @@ class Transactions {
|
|
|
1433
1328
|
removeLiquidityByRangeInfo(ixs) {
|
|
1434
1329
|
for (const ix of ixs) {
|
|
1435
1330
|
const programIdMatch = ix.programId.equals(addresses_1.METEORA_DLMM_PROGRAM);
|
|
1436
|
-
const
|
|
1437
|
-
|
|
1331
|
+
const removeLiquidityByRange = (0, functions_1.sighashMatch)(ix.data, "RemoveLiquidityByRange");
|
|
1332
|
+
// Handle original RemoveLiquidityByRange instruction
|
|
1333
|
+
if (programIdMatch && removeLiquidityByRange) {
|
|
1438
1334
|
return {
|
|
1439
1335
|
data: ix.data,
|
|
1440
1336
|
params: {
|
|
@@ -1458,7 +1354,38 @@ class Transactions {
|
|
|
1458
1354
|
};
|
|
1459
1355
|
}
|
|
1460
1356
|
}
|
|
1461
|
-
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`);
|
|
1462
1389
|
}
|
|
1463
1390
|
/**
|
|
1464
1391
|
* Creates orca instruction that opens new position
|
|
@@ -1474,6 +1401,7 @@ class Transactions {
|
|
|
1474
1401
|
const userPda = (0, functions_1.generateUserPda)(params.userWallet, farm);
|
|
1475
1402
|
const position = (0, functions_1.generateOrcaPositionPDA)(params.positionMint);
|
|
1476
1403
|
const positionTokenAccount = (0, functions_1.generateAta)(userPda, params.positionMint);
|
|
1404
|
+
// @ts-ignore
|
|
1477
1405
|
const extensionIx = yield anchor_1.Anchor.instance()
|
|
1478
1406
|
.iyfExtension.methods.orcaOpenPosition(params.tickLowerIndex, params.tickUpperIndex)
|
|
1479
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,6BAA6B,CAAC;AACtD,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AAExC,OAAO,EACL,eAAe,EACf,kBAAkB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AI,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
|
+
}
|