@hawksightco/hawk-sdk 1.3.164 → 1.3.166
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 +2 -1
- package/dist/src/classes/Transactions.d.ts.map +1 -1
- package/dist/src/classes/Transactions.js +78 -0
- package/dist/src/classes/TxGeneratorAutomations.d.ts +12 -1
- package/dist/src/classes/TxGeneratorAutomations.d.ts.map +1 -1
- package/dist/src/classes/TxGeneratorAutomations.js +40 -0
- package/dist/src/idl/jupiter-idl.d.ts +1362 -1025
- package/dist/src/idl/jupiter-idl.d.ts.map +1 -1
- package/dist/src/idl/jupiter-idl.js +735 -1626
- package/dist/src/types.d.ts +6 -0
- package/dist/src/types.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as web3 from '@solana/web3.js';
|
|
2
|
-
import { MeteoraClaim, MeteoraClaimAll, MeteoraClose, MeteoraCompound, MeteoraCreatePositionAndDeposit, MeteoraCreatePositionAndDepositPda, MeteoraDeposit, MeteoraInitializeBinArrays, MeteoraRebalance, MeteoraWithdraw, Register, TxgenParams, InitializeStorageTokenAccount, MeteoraLimitCloseAutomation, MeteoraLimitCloseAutomation2, OrcaOpenPosition, OrcaClosePosition, OrcaDeposit, OrcaWithdraw, OrcaSweepDust, OrcaClaimRewards, TransactionMetadataResponse, MeteoraRebalance2, ClaimTokensFromSTA, RaydiumClosePosition, OpenAutomationIx, RaydiumWithdrawAndClosePosition, MeteoraCreatePoolAndPosition, ClaimTokenFromPda } from '../types';
|
|
2
|
+
import { MeteoraClaim, MeteoraClaimAll, MeteoraClose, MeteoraCompound, MeteoraRedeposit, MeteoraCreatePositionAndDeposit, MeteoraCreatePositionAndDepositPda, MeteoraDeposit, MeteoraInitializeBinArrays, MeteoraRebalance, MeteoraWithdraw, Register, TxgenParams, InitializeStorageTokenAccount, MeteoraLimitCloseAutomation, MeteoraLimitCloseAutomation2, OrcaOpenPosition, OrcaClosePosition, OrcaDeposit, OrcaWithdraw, OrcaSweepDust, OrcaClaimRewards, TransactionMetadataResponse, MeteoraRebalance2, ClaimTokensFromSTA, RaydiumClosePosition, OpenAutomationIx, RaydiumWithdrawAndClosePosition, MeteoraCreatePoolAndPosition, ClaimTokenFromPda } from '../types';
|
|
3
3
|
import { RaydiumIncreaseLiquidity, RaydiumOpenPosition, RaydiumDecreaseLiquidity } from '../types';
|
|
4
4
|
import { GeneralUtility } from './GeneralUtility';
|
|
5
5
|
import { MultiTransaction } from './MultiTransaction';
|
|
@@ -167,6 +167,7 @@ export declare class Transactions {
|
|
|
167
167
|
*/
|
|
168
168
|
claimTokensFromSta({ connection, params, }: TxgenParams<ClaimTokensFromSTA>): Promise<TransactionMetadataResponse>;
|
|
169
169
|
compoundAutomationIx({ connection, params, }: TxgenParams<MeteoraCompound>): Promise<TransactionMetadataResponse>;
|
|
170
|
+
redepositAutomationIx({ connection, params, }: TxgenParams<MeteoraRedeposit>): Promise<TransactionMetadataResponse>;
|
|
170
171
|
claimAutomationIx({ connection, params, }: TxgenParams<MeteoraCompound>): Promise<TransactionMetadataResponse>;
|
|
171
172
|
rebalanceAutomationIx({ connection, params, }: TxgenParams<MeteoraRebalance>): Promise<TransactionMetadataResponse>;
|
|
172
173
|
rebalanceAutomationIx2({ connection, params, }: TxgenParams<MeteoraRebalance2>): Promise<TransactionMetadataResponse>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Transactions.d.ts","sourceRoot":"","sources":["../../../src/classes/Transactions.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AAqBxC,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,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ACpC,UAAU,EACV,MAAM,GACP,EAAE,WAAW,CAAC,+BAA+B,CAAC,GAAG,OAAO,CAAC,2BAA2B,CAAC;IAkItF;;;;;;OAMG;IACG,oBAAoB,CAAC,EACzB,UAAU,EACV,MAAM,GACP,EAAE,WAAW,CAAC,oBAAoB,CAAC,GAAG,OAAO,CAAC,2BAA2B,CAAC;IAwB3E;;;;;;OAMG;IACG,wBAAwB,CAAC,EAC7B,UAAU,EACV,MAAM,GACP,EAAE,WAAW,CAAC,wBAAwB,CAAC,GAAG,OAAO,CAAC,2BAA2B,CAAC;IAyG/E;;;;;;OAMG;IACG,wBAAwB,CAAC,EAC7B,UAAU,EACV,MAAM,GACP,EAAE,WAAW,CAAC,wBAAwB,CAAC,GAAG,OAAO,CAAC,2BAA2B,CAAC;CAiGhF;AAED,eAAO,MAAM,KAAK,cAA6B,CAAC"}
|
|
1
|
+
{"version":3,"file":"Transactions.d.ts","sourceRoot":"","sources":["../../../src/classes/Transactions.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AAqBxC,OAAO,EACL,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,eAAe,EACf,gBAAgB,EAChB,+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,kBAAkB,EAClB,oBAAoB,EAEpB,gBAAgB,EAChB,+BAA+B,EAC/B,4BAA4B,EAC5B,iBAAiB,EAClB,MAAM,UAAU,CAAC;AA+BlB,OAAO,EAEL,wBAAwB,EACxB,mBAAmB,EACnB,wBAAwB,EACzB,MAAM,UAAU,CAAC;AAKlB,OAAO,EAAE,cAAc,EAAE,MAAM,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7B,UAAU,EACV,MAAM,GACP,EAAE,WAAW,CAAC,wBAAwB,CAAC,GAAG,OAAO,CAAC,2BAA2B,CAAC;IAyG/E;;;;;;OAMG;IACG,wBAAwB,CAAC,EAC7B,UAAU,EACV,MAAM,GACP,EAAE,WAAW,CAAC,wBAAwB,CAAC,GAAG,OAAO,CAAC,2BAA2B,CAAC;CAiGhF;AAED,eAAO,MAAM,KAAK,cAA6B,CAAC"}
|
|
@@ -849,6 +849,84 @@ class Transactions {
|
|
|
849
849
|
}
|
|
850
850
|
});
|
|
851
851
|
}
|
|
852
|
+
redepositAutomationIx(_a) {
|
|
853
|
+
return __awaiter(this, arguments, void 0, function* ({ connection, params, }) {
|
|
854
|
+
try {
|
|
855
|
+
const program = yield meteora_1.MeteoraDLMM.program(connection);
|
|
856
|
+
const position = yield program.account.positionV2.fetch(params.position);
|
|
857
|
+
// Validate position data
|
|
858
|
+
if (!position || !position.lbPair) {
|
|
859
|
+
throw new Error(`Invalid position data: ${params.position}`);
|
|
860
|
+
}
|
|
861
|
+
const dlmmPool = yield meteora_1.MeteoraDLMM.create(connection, position.lbPair, this.ix);
|
|
862
|
+
const userPda = (0, functions_1.generateUserPda)(params.userWallet);
|
|
863
|
+
const { userPositions } = yield dlmmPool.getPositionsByUserAndLbPair(userPda);
|
|
864
|
+
const userPosition = userPositions.find(userPosition => userPosition.publicKey.equals(params.position));
|
|
865
|
+
if (userPosition === undefined) {
|
|
866
|
+
throw new Error(`Position: ${params.position} does not exist.`);
|
|
867
|
+
}
|
|
868
|
+
// Validate position bin IDs
|
|
869
|
+
if (position.upperBinId === undefined ||
|
|
870
|
+
position.lowerBinId === undefined) {
|
|
871
|
+
throw new Error(`Position ${params.position} has invalid bin IDs: upper=${position.upperBinId}, lower=${position.lowerBinId}`);
|
|
872
|
+
}
|
|
873
|
+
// Step 1: Remove liquidity with claim (but NOT close - shouldClaimAndClose: false)
|
|
874
|
+
const removeLiquidityBuilder = yield dlmmPool.removeLiquidity(connection, params.userWallet, addresses_1.HS_AUTHORITY, {
|
|
875
|
+
user: userPda,
|
|
876
|
+
position: params.position,
|
|
877
|
+
fromBinId: position.lowerBinId,
|
|
878
|
+
toBinId: position.upperBinId,
|
|
879
|
+
bps: new bn_js_1.default(10000), // 100% withdrawal
|
|
880
|
+
shouldClaimAndClose: false, // Do NOT close position
|
|
881
|
+
}, hsToMeteora_1.meteoraToHawksightAutomationIxs);
|
|
882
|
+
// Configure fee destination based on useAta
|
|
883
|
+
if (!!params.useAta) {
|
|
884
|
+
removeLiquidityBuilder.replaceClaimFeeTokenToATA();
|
|
885
|
+
removeLiquidityBuilder.replaceClaimRewardToATA();
|
|
886
|
+
}
|
|
887
|
+
else {
|
|
888
|
+
removeLiquidityBuilder.replaceClaimFeeTokenToSTA();
|
|
889
|
+
removeLiquidityBuilder.replaceClaimRewardToSTA();
|
|
890
|
+
}
|
|
891
|
+
// Step 2: Add liquidity back to the SAME position with specified distribution
|
|
892
|
+
// Get slippage amount (6 bin slippage like compound)
|
|
893
|
+
const binStep = dlmmPool.dlmm.lbPair.binStep;
|
|
894
|
+
let slippageAmount = Math.round(6 * (binStep / 100) * 100) / 100;
|
|
895
|
+
const addLiquidityBuilder = yield dlmmPool.addLiquidityByStrategy(connection, params.userWallet, addresses_1.HS_AUTHORITY, {
|
|
896
|
+
positionPubKey: params.position,
|
|
897
|
+
user: userPda,
|
|
898
|
+
totalXAmount: new bn_js_1.default(100000), // Overridden on-chain
|
|
899
|
+
totalYAmount: new bn_js_1.default(100000), // Overridden on-chain
|
|
900
|
+
strategy: {
|
|
901
|
+
maxBinId: position.upperBinId,
|
|
902
|
+
minBinId: position.lowerBinId,
|
|
903
|
+
strategyType: types_3.StrategyTypeMap[params.distribution],
|
|
904
|
+
},
|
|
905
|
+
skipInputTokenCheck: true,
|
|
906
|
+
slippage: slippageAmount,
|
|
907
|
+
}, hsToMeteora_1.meteoraToHawksightAutomationIxs);
|
|
908
|
+
const mainInstructions = [
|
|
909
|
+
// Step 1: Initialize required ATAs
|
|
910
|
+
...removeLiquidityBuilder.createAtaIxs,
|
|
911
|
+
// Step 2: Remove liquidity and claim fees
|
|
912
|
+
...removeLiquidityBuilder.mainIxs,
|
|
913
|
+
// Step 3: Re-deposit liquidity with specified distribution
|
|
914
|
+
...addLiquidityBuilder.mainIxs,
|
|
915
|
+
];
|
|
916
|
+
return (0, functions_1.createTransactionMeta)({
|
|
917
|
+
payer: params.userWallet,
|
|
918
|
+
description: 'Automation IX: Meteora Redeposit instructions (withdraw liquidity, claim fees, and deposit back to same position)',
|
|
919
|
+
addressLookupTableAddresses: addresses_1.GLOBAL_ALT,
|
|
920
|
+
mainInstructions,
|
|
921
|
+
});
|
|
922
|
+
}
|
|
923
|
+
catch (error) {
|
|
924
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
925
|
+
console.error('redepositAutomationIx error:', errorMessage, error);
|
|
926
|
+
throw new Error(`Redeposit automation failed: ${errorMessage}`);
|
|
927
|
+
}
|
|
928
|
+
});
|
|
929
|
+
}
|
|
852
930
|
claimAutomationIx(_a) {
|
|
853
931
|
return __awaiter(this, arguments, void 0, function* ({ connection, params, }) {
|
|
854
932
|
try {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as web3 from "@solana/web3.js";
|
|
2
2
|
import * as _client from "@hawksightco/swagger-client";
|
|
3
|
-
import { MeteoraClose, MeteoraCompound, MeteoraLimitCloseAutomation, MeteoraLimitCloseAutomation2, MeteoraRebalance, MeteoraRebalance2, OpenAutomationIx, ResponseWithStatus, TransactionMetadata } from "../types";
|
|
3
|
+
import { MeteoraClose, MeteoraCompound, MeteoraRedeposit, MeteoraLimitCloseAutomation, MeteoraLimitCloseAutomation2, MeteoraRebalance, MeteoraRebalance2, OpenAutomationIx, ResponseWithStatus, TransactionMetadata } from "../types";
|
|
4
4
|
import { Client } from "./Client";
|
|
5
5
|
import { GeneralUtility } from "./GeneralUtility";
|
|
6
6
|
/**
|
|
@@ -38,6 +38,17 @@ export declare class TxGeneratorAutomations {
|
|
|
38
38
|
* @returns A ResponseWithStatus containing either TransactionMetadataResponse or TransactionMetadata.
|
|
39
39
|
*/
|
|
40
40
|
meteoraCompoundIxs(connection: web3.Connection, payer: string, params: MeteoraCompound): Promise<ResponseWithStatus<TransactionMetadata>>;
|
|
41
|
+
/**
|
|
42
|
+
* Creates meteora redeposit instruction (withdraw liquidity, claim fees, and deposit back to same position)
|
|
43
|
+
*
|
|
44
|
+
* NOTE: For hawksight devs only.
|
|
45
|
+
*
|
|
46
|
+
* @param connection The Solana web3 connection object for blockchain interactions.
|
|
47
|
+
* @param payer The public key of the payer for transaction fees.
|
|
48
|
+
* @param params Parameters required (position, distribution, useAta for fee destination)
|
|
49
|
+
* @returns A ResponseWithStatus containing either TransactionMetadataResponse or TransactionMetadata.
|
|
50
|
+
*/
|
|
51
|
+
meteoraRedepositIxs(connection: web3.Connection, payer: string, params: MeteoraRedeposit): Promise<ResponseWithStatus<TransactionMetadata>>;
|
|
41
52
|
/**
|
|
42
53
|
* Creates meteora auto-claim instruction (claim fee, reward)
|
|
43
54
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TxGeneratorAutomations.d.ts","sourceRoot":"","sources":["../../../src/classes/TxGeneratorAutomations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AACxC,OAAO,KAAK,OAAO,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,eAAe,EAAmC,2BAA2B,EAAE,4BAA4B,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,mBAAmB,EAAoD,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"TxGeneratorAutomations.d.ts","sourceRoot":"","sources":["../../../src/classes/TxGeneratorAutomations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AACxC,OAAO,KAAK,OAAO,MAAM,6BA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AgB,GAAG,OAAO,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,CAAC;IAyCjJ;;;;;;;;;OASG;IACG,oBAAoB,CAAC,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,CAAC;IAyCnJ;;;;;;;;;OASG;IACG,oBAAoB,CAAC,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,2BAA2B,GAAG,OAAO,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,CAAC;IAyC7J;;;;;;;;;OASG;IACG,qBAAqB,CAAC,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,4BAA4B,GAAG,OAAO,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,CAAC;IAyC/J;;;;;;;;;OASG;IACG,eAAe,CAAC,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,CAAC;IAiCzI;;;;;;;;;OASG;IACG,cAAc,CAAC,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,CAAC;CAwC7I"}
|
|
@@ -106,6 +106,46 @@ class TxGeneratorAutomations {
|
|
|
106
106
|
}
|
|
107
107
|
});
|
|
108
108
|
}
|
|
109
|
+
/**
|
|
110
|
+
* Creates meteora redeposit instruction (withdraw liquidity, claim fees, and deposit back to same position)
|
|
111
|
+
*
|
|
112
|
+
* NOTE: For hawksight devs only.
|
|
113
|
+
*
|
|
114
|
+
* @param connection The Solana web3 connection object for blockchain interactions.
|
|
115
|
+
* @param payer The public key of the payer for transaction fees.
|
|
116
|
+
* @param params Parameters required (position, distribution, useAta for fee destination)
|
|
117
|
+
* @returns A ResponseWithStatus containing either TransactionMetadataResponse or TransactionMetadata.
|
|
118
|
+
*/
|
|
119
|
+
meteoraRedepositIxs(connection, payer, params) {
|
|
120
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
121
|
+
// Initialize anchor
|
|
122
|
+
anchor_1.Anchor.initialize(connection);
|
|
123
|
+
try {
|
|
124
|
+
const result = yield Transactions_1.txgen.redepositAutomationIx({
|
|
125
|
+
connection,
|
|
126
|
+
params,
|
|
127
|
+
fetch: undefined,
|
|
128
|
+
});
|
|
129
|
+
return {
|
|
130
|
+
status: 200,
|
|
131
|
+
data: yield (0, functions_1.createTxMetadata)(this.generalUtility, connection, payer, result),
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
catch (e) {
|
|
135
|
+
// Extract error message properly
|
|
136
|
+
const errorMessage = e instanceof Error ? e.message : String(e);
|
|
137
|
+
console.error('meteoraRedepositIxs error:', errorMessage, e);
|
|
138
|
+
return {
|
|
139
|
+
status: 400,
|
|
140
|
+
data: {
|
|
141
|
+
code: "custom",
|
|
142
|
+
message: errorMessage,
|
|
143
|
+
path: [],
|
|
144
|
+
},
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
}
|
|
109
149
|
/**
|
|
110
150
|
* Creates meteora auto-claim instruction (claim fee, reward)
|
|
111
151
|
*
|