@hawksightco/hawk-sdk 1.3.23 → 1.3.24
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.
|
@@ -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;;OAEG;IACH,OAAO,CAAC,OAAO,CAAmB;IAElC;;;;OAIG;IACH,MAAM,CAAC,WAAW,IAAI,YAAY;IAOlC;;;;;;OAMG;IACH,eAAe,CACb,UAAU,EAAE,IAAI,CAAC,SAAS,EAC1B,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AAC;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;
|
|
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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A2B,CAAC;IA0LpE;;;;;;;OAOG;IACG,YAAY,CAAC,EACjB,UAAU,EACV,MAAM,GACP,EAAE,WAAW,CAAC,YAAY,CAAC,GAAG,OAAO,CAAC,2BAA2B,CAAC;IAkHnE;;;;;;;OAOG;IACG,eAAe,CAAC,EACpB,UAAU,EACV,MAAM,GACP,EAAE,WAAW,CAAC,YAAY,CAAC,GAAG,OAAO,CAAC,2BAA2B,CAAC;IAqOnE;;;;;;;OAOG;IACG,gBAAgB,CAAC,EACrB,UAAU,EACV,MAAM,GACP,EAAE,WAAW,CAAC,gBAAgB,CAAC,GAAG,OAAO,CAAC,2BAA2B,CAAC;IAsJvE;;;;;;OAMG;IACG,mBAAmB,CAAC,EACxB,UAAU,EACV,MAAM,GACP,EAAE,WAAW,CAAC,mBAAmB,CAAC,GAAG,OAAO,CAAC,2BAA2B,CAAC;IA8H1E;;;;;;;OAOG;IACG,+BAA+B,CAAC,EACpC,UAAU,EACV,MAAM,GACP,EAAE,WAAW,CAAC,+BAA+B,CAAC,GAAG,OAAO,CAAC,2BAA2B,CAAC;IA8GtF;;;;;;OAMG;IACG,oBAAoB,CAAC,EACzB,UAAU,EACV,MAAM,GACP,EAAE,WAAW,CAAC,oBAAoB,CAAC,GAAG,OAAO,CAAC,2BAA2B,CAAC;IAuB3E;;;;;;OAMG;IACG,wBAAwB,CAAC,EAC7B,UAAU,EACV,MAAM,GACP,EAAE,WAAW,CAAC,wBAAwB,CAAC,GAAG,OAAO,CAAC,2BAA2B,CAAC;IAmG/E;;;;;;OAMG;IACG,wBAAwB,CAAC,EAC7B,UAAU,EACV,MAAM,GACP,EAAE,WAAW,CAAC,wBAAwB,CAAC,GAAG,OAAO,CAAC,2BAA2B,CAAC;CAmFhF;AAED,eAAO,MAAM,KAAK,cAA6B,CAAC"}
|
|
@@ -660,50 +660,76 @@ class Transactions {
|
|
|
660
660
|
}
|
|
661
661
|
compoundAutomationIx(_a) {
|
|
662
662
|
return __awaiter(this, arguments, void 0, function* ({ connection, params, }) {
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
663
|
+
try {
|
|
664
|
+
const program = yield meteora_1.MeteoraDLMM.program(connection);
|
|
665
|
+
const position = yield program.account.positionV2.fetch(params.position);
|
|
666
|
+
// Validate position data
|
|
667
|
+
if (!position || !position.lbPair) {
|
|
668
|
+
throw new Error(`Invalid position data: ${params.position}`);
|
|
669
|
+
}
|
|
670
|
+
const dlmmPool = yield meteora_1.MeteoraDLMM.create(connection, position.lbPair, this.ix);
|
|
671
|
+
const userPda = (0, functions_1.generateUserPda)(params.userWallet);
|
|
672
|
+
const { userPositions } = yield dlmmPool.getPositionsByUserAndLbPair(userPda);
|
|
673
|
+
const userPosition = userPositions.find((userPosition) => userPosition.publicKey.equals(params.position));
|
|
674
|
+
if (userPosition === undefined) {
|
|
675
|
+
throw new Error(`Position: ${params.position} does not exist.`);
|
|
676
|
+
}
|
|
677
|
+
// Validate position bin IDs
|
|
678
|
+
if (position.upperBinId === undefined || position.lowerBinId === undefined) {
|
|
679
|
+
throw new Error(`Position ${params.position} has invalid bin IDs: upper=${position.upperBinId}, lower=${position.lowerBinId}`);
|
|
680
|
+
}
|
|
681
|
+
console.log(`Position validation passed: upperBinId=${position.upperBinId}, lowerBinId=${position.lowerBinId}, lbPair=${position.lbPair.toString()}`);
|
|
682
|
+
// Claim fee and claim reward ixs
|
|
683
|
+
const fn = new meteora_1.MeteoraFunctions(this.ix);
|
|
684
|
+
const claimBuilder = yield fn.claimAllRewardsByPosition(connection, params.userWallet, addresses_1.HS_AUTHORITY, {
|
|
685
|
+
owner: userPda,
|
|
686
|
+
position: params.position,
|
|
687
|
+
lbPair: position.lbPair,
|
|
688
|
+
pdaTokenType: types_1.TokenType.ATA,
|
|
689
|
+
}, hsToMeteora_1.meteoraToHawksightAutomationIxs);
|
|
690
|
+
// Re-deposit fees (TODO: How to re-deposit reward tokens that is not X or Y token?)
|
|
691
|
+
console.log(`Attempting addLiquidityByStrategy with strategy: maxBinId=${position.upperBinId}, minBinId=${position.lowerBinId}, strategyType=SPOT-IMBALANCED`);
|
|
692
|
+
const addLiquidityBuilder = yield dlmmPool.addLiquidityByStrategy(connection, params.userWallet, addresses_1.HS_AUTHORITY, {
|
|
693
|
+
positionPubKey: params.position,
|
|
694
|
+
user: userPda,
|
|
695
|
+
totalXAmount: new bn_js_1.default(100000), // This is overriden on-chain, so value here do not matter
|
|
696
|
+
totalYAmount: new bn_js_1.default(100000), // This is overriden on-chain, so value here do not matter
|
|
697
|
+
strategy: {
|
|
698
|
+
maxBinId: position.upperBinId,
|
|
699
|
+
minBinId: position.lowerBinId,
|
|
700
|
+
strategyType: types_3.StrategyTypeMap["SPOT-IMBALANCED"], // TODO: how to get the right distribution from chain??
|
|
701
|
+
},
|
|
702
|
+
skipInputTokenCheck: true,
|
|
703
|
+
}, hsToMeteora_1.meteoraToHawksightAutomationIxs);
|
|
704
|
+
console.log(`addLiquidityByStrategy completed successfully`);
|
|
705
|
+
const mainInstructions = [
|
|
706
|
+
// Step 1: Initialize ATA
|
|
707
|
+
...claimBuilder.createAtaIxs,
|
|
708
|
+
// Step 2: Claim rewards and fees
|
|
709
|
+
...claimBuilder.mainIxs,
|
|
710
|
+
// Step 3: Re-deposit fees
|
|
711
|
+
...addLiquidityBuilder.mainIxs,
|
|
712
|
+
];
|
|
713
|
+
return (0, functions_1.createTransactionMeta)({
|
|
714
|
+
payer: params.userWallet,
|
|
715
|
+
description: "Automation IX: Meteora Auto-compound instructions (claim fee, reward, and deposit to position)",
|
|
716
|
+
addressLookupTableAddresses: addresses_1.GLOBAL_ALT,
|
|
717
|
+
mainInstructions,
|
|
718
|
+
});
|
|
719
|
+
}
|
|
720
|
+
catch (error) {
|
|
721
|
+
// Enhanced error handling with more specific error messages
|
|
722
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
723
|
+
console.error('compoundAutomationIx error:', errorMessage, error);
|
|
724
|
+
// Check for specific Meteora DLMM errors
|
|
725
|
+
if (errorMessage.includes('getSimulationComputeUnits') || errorMessage.includes('getEstimatedComputeUnit')) {
|
|
726
|
+
throw new Error(`Meteora DLMM compute unit estimation failed: ${errorMessage}. This usually indicates invalid position parameters or pool state.`);
|
|
727
|
+
}
|
|
728
|
+
if (errorMessage.includes('addLiquidityByStrategy')) {
|
|
729
|
+
throw new Error(`Meteora addLiquidityByStrategy failed: ${errorMessage}. Check position bin IDs and strategy parameters.`);
|
|
730
|
+
}
|
|
731
|
+
throw new Error(`Compound automation failed: ${errorMessage}`);
|
|
671
732
|
}
|
|
672
|
-
// Claim fee and claim reward ixs
|
|
673
|
-
const fn = new meteora_1.MeteoraFunctions(this.ix);
|
|
674
|
-
const claimBuilder = yield fn.claimAllRewardsByPosition(connection, params.userWallet, addresses_1.HS_AUTHORITY, {
|
|
675
|
-
owner: userPda,
|
|
676
|
-
position: params.position,
|
|
677
|
-
lbPair: position.lbPair,
|
|
678
|
-
pdaTokenType: types_1.TokenType.ATA,
|
|
679
|
-
}, hsToMeteora_1.meteoraToHawksightAutomationIxs);
|
|
680
|
-
// Re-deposit fees (TODO: How to re-deposit reward tokens that is not X or Y token?)
|
|
681
|
-
const addLiquidityBuilder = yield dlmmPool.addLiquidityByStrategy(connection, params.userWallet, addresses_1.HS_AUTHORITY, {
|
|
682
|
-
positionPubKey: params.position,
|
|
683
|
-
user: userPda,
|
|
684
|
-
totalXAmount: new bn_js_1.default(100000), // This is overriden on-chain, so value here do not matter
|
|
685
|
-
totalYAmount: new bn_js_1.default(100000), // This is overriden on-chain, so value here do not matter
|
|
686
|
-
strategy: {
|
|
687
|
-
maxBinId: position.upperBinId,
|
|
688
|
-
minBinId: position.lowerBinId,
|
|
689
|
-
strategyType: types_3.StrategyTypeMap["SPOT-IMBALANCED"], // TODO: how to get the right distribution from chain??
|
|
690
|
-
},
|
|
691
|
-
skipInputTokenCheck: true,
|
|
692
|
-
}, hsToMeteora_1.meteoraToHawksightAutomationIxs);
|
|
693
|
-
const mainInstructions = [
|
|
694
|
-
// Step 1: Initialize ATA
|
|
695
|
-
...claimBuilder.createAtaIxs,
|
|
696
|
-
// Step 2: Claim rewards and fees
|
|
697
|
-
...claimBuilder.mainIxs,
|
|
698
|
-
// Step 3: Re-deposit fees
|
|
699
|
-
...addLiquidityBuilder.mainIxs,
|
|
700
|
-
];
|
|
701
|
-
return (0, functions_1.createTransactionMeta)({
|
|
702
|
-
payer: params.userWallet,
|
|
703
|
-
description: "Automation IX: Meteora Auto-compound instructions (claim fee, reward, and deposit to position)",
|
|
704
|
-
addressLookupTableAddresses: addresses_1.GLOBAL_ALT,
|
|
705
|
-
mainInstructions,
|
|
706
|
-
});
|
|
707
733
|
});
|
|
708
734
|
}
|
|
709
735
|
claimAutomationIx(_a) {
|
|
@@ -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;AACvS,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAIlD;;;;;;GAMG;AACH,qBAAa,sBAAsB;IAkB/B,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,cAAc;IAjBjC;;OAEG;IACH,SAAS,CAAC,aAAa,EAAE,OAAO,CAAC,aAAa,CAAC;IAE/C;;OAEG;IACH,SAAS,CAAC,cAAc,EAAE,MAAM,CAAC;IAEjC;;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}
|
|
94
94
|
catch (e) {
|
|
95
|
+
// Extract error message properly
|
|
96
|
+
const errorMessage = e instanceof Error ? e.message : String(e);
|
|
97
|
+
console.error('meteoraCompoundIxs error:', errorMessage, e);
|
|
95
98
|
return {
|
|
96
99
|
status: 400,
|
|
97
100
|
data: {
|
|
98
101
|
code: "custom",
|
|
99
|
-
message:
|
|
102
|
+
message: errorMessage,
|
|
100
103
|
path: [],
|
|
101
104
|
},
|
|
102
105
|
};
|