@hawksightco/hawk-sdk 1.1.1 → 1.1.3
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/Transaction.d.ts +1 -1
- package/dist/src/classes/Transaction.d.ts.map +1 -1
- package/dist/src/classes/Transaction.js +5 -2
- package/dist/src/classes/Transactions.d.ts.map +1 -1
- package/dist/src/classes/Transactions.js +91 -81
- package/dist/src/classes/TxGenerator.d.ts +6 -6
- package/dist/src/classes/TxGenerator.d.ts.map +1 -1
- package/dist/src/classes/TxGenerator.js +16 -16
- package/dist/src/meteora.js +2 -2
- package/package.json +3 -1
|
@@ -109,7 +109,7 @@ export declare class Transaction {
|
|
|
109
109
|
* @param connection
|
|
110
110
|
* @returns
|
|
111
111
|
*/
|
|
112
|
-
simulateTransaction(connection: web3.Connection): Promise<SimulatedTransactionResponse>;
|
|
112
|
+
simulateTransaction(connection: web3.Connection, signers?: web3.Keypair[]): Promise<SimulatedTransactionResponse>;
|
|
113
113
|
/**
|
|
114
114
|
* Builds transaction object
|
|
115
115
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Transaction.d.ts","sourceRoot":"","sources":["../../../src/classes/Transaction.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,MAAM,6BAA6B,CAAC;AACtD,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AAGxC,OAAO,EACL,4BAA4B,EAC5B,2BAA2B,EAC5B,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD;;;GAGG;AACH,qBAAa,WAAW;IA+CpB,QAAQ,CAAC,kBAAkB,EAAE,2BAA2B;IACxD,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS;IACjC,OAAO,CAAC,eAAe;IACvB,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,yBAAyB,EAAE;IAC/C,OAAO,CAAC,cAAc;I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,EAAE,CAAC;IAwFzC;;;;;;;;;;;;OAYG;IACG,mBAAmB,CACvB,UAAU,EAAE,IAAI,CAAC,UAAU,EAC3B,sBAAsB,CAAC,EAAE,MAAM,GAC9B,OAAO,CAAC,MAAM,CAAC;IAiBlB;;;;;OAKG;IACG,mBAAmB,CACvB,UAAU,EAAE,IAAI,CAAC,UAAU,EAC3B,OAAO,GAAE,IAAI,CAAC,OAAO,EAAO,GAC3B,OAAO,CAAC,4BAA4B,CAAC;IAyCxC;;OAEG;IACH,gBAAgB,CACd,eAAe,EAAE,IAAI,CAAC,8BAA8B,GACnD,CAAC,IAAI,CAAC,kBAAkB,EAAE,IAAI,CAAC,oBAAoB,CAAC;IAcvD;;;;OAIG;IACH,OAAO,CAAC,kBAAkB;IAW1B;;OAEG;IACH,OAAO,CAAC,4BAA4B;IAgBpC;;OAEG;IACH,OAAO,CAAC,4BAA4B;IAgBpC;;OAEG;IACH,OAAO,CAAC,oBAAoB;CAW7B"}
|
|
@@ -253,8 +253,8 @@ class Transaction {
|
|
|
253
253
|
* @param connection
|
|
254
254
|
* @returns
|
|
255
255
|
*/
|
|
256
|
-
simulateTransaction(
|
|
257
|
-
return __awaiter(this,
|
|
256
|
+
simulateTransaction(connection_1) {
|
|
257
|
+
return __awaiter(this, arguments, void 0, function* (connection, signers = []) {
|
|
258
258
|
const testInstructions = [
|
|
259
259
|
...this.instructions,
|
|
260
260
|
];
|
|
@@ -272,6 +272,9 @@ class Transaction {
|
|
|
272
272
|
payerKey: this.payerKey,
|
|
273
273
|
recentBlockhash: web3.PublicKey.default.toString(),
|
|
274
274
|
}).compileToV0Message(this.alts));
|
|
275
|
+
if (signers.length > 0) {
|
|
276
|
+
testVersionedTxn.sign(signers);
|
|
277
|
+
}
|
|
275
278
|
const simulation = yield connection.simulateTransaction(testVersionedTxn, {
|
|
276
279
|
replaceRecentBlockhash: true,
|
|
277
280
|
sigVerify: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Transactions.d.ts","sourceRoot":"","sources":["../../../src/classes/Transactions.ts"],"names":[],"mappings":";AACA,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AAgBxC,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,+BAA+B,EAC/B,cAAc,EACd,0BAA0B,EAC1B,gBAAgB,EAChB,eAAe,EACf,QAAQ,EAER,WAAW,EACX,6BAA6B,EAC7B,2BAA2B,EAC3B,gBAAgB,EAChB,iBAAiB,EACjB,WAAW,EACX,YAAY,EACZ,gBAAgB,EAChB,2BAA2B,EAC5B,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"Transactions.d.ts","sourceRoot":"","sources":["../../../src/classes/Transactions.ts"],"names":[],"mappings":";AACA,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AAgBxC,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,+BAA+B,EAC/B,cAAc,EACd,0BAA0B,EAC1B,gBAAgB,EAChB,eAAe,EACf,QAAQ,EAER,WAAW,EACX,6BAA6B,EAC7B,2BAA2B,EAC3B,gBAAgB,EAChB,iBAAiB,EACjB,WAAW,EACX,YAAY,EACZ,gBAAgB,EAChB,2BAA2B,EAC5B,MAAM,UAAU,CAAC;AA2BlB,qBAAa,YAAY;IACvB;;;;;;OAMG;IACH,eAAe,CACb,UAAU,EAAE,IAAI,CAAC,SAAS,EAC1B,IAAI,GAAE,IAAI,CAAC,SAAqB,GAC/B,IAAI,CAAC,SAAS;IAIjB;;;;;;;OAOG;IACG,QAAQ,CAAC,EACb,UAAU,EACV,MAAM,GACP,EAAE,WAAW,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAC,2BAA2B,CAAC;IAqD/D;;;;;;;OAOG;IACG,+BAA+B,CAAC,EACpC,UAAU,EACV,MAAM,GACP,EAAE,WAAW,CAAC,+BAA+B,CAAC,GAAG,OAAO,CAAC,2BAA2B,CAAC;IAkCtF;;;;;;;OAOG;IACG,0BAA0B,CA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AM,EAAE,EAAE,WAAW,CAAC,iBAAiB,CAAC,GAAG,OAAO,CAAC,2BAA2B,CAAC;IAkDrH;;;;;;;OAOG;IACG,WAAW,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,EAAE,WAAW,CAAC,WAAW,CAAC,GAAG,OAAO,CAAC,2BAA2B,CAAC;IAuHzG;;;;;;;OAOG;IACG,YAAY,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,EAAE,WAAW,CAAC,YAAY,CAAC,GAAG,OAAO,CAAC,2BAA2B,CAAC;IAyF3G;;;;;;;OAOG;IACG,gBAAgB,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,EAAE,WAAW,CAAC,gBAAgB,CAAC,GAAG,OAAO,CAAC,2BAA2B,CAAC;CAqGpH;AAED,eAAO,MAAM,KAAK,cAAqB,CAAC"}
|
|
@@ -643,7 +643,7 @@ class Transactions {
|
|
|
643
643
|
const userPda = (0, functions_1.generateUserPda)(params.userWallet, farm);
|
|
644
644
|
const position = (0, functions_1.generateOrcaPositionPDA)(params.positionMint);
|
|
645
645
|
const positionTokenAccount = (0, functions_1.generateAta)(userPda, params.positionMint);
|
|
646
|
-
const
|
|
646
|
+
const extensionIx = yield anchor_1.Anchor.instance().iyfExtension.methods
|
|
647
647
|
.orcaOpenPosition(params.tickLowerIndex, params.tickUpperIndex)
|
|
648
648
|
.accounts({
|
|
649
649
|
farm,
|
|
@@ -661,8 +661,8 @@ class Transactions {
|
|
|
661
661
|
systemProgram: web3.SystemProgram.programId,
|
|
662
662
|
})
|
|
663
663
|
.instruction();
|
|
664
|
-
const
|
|
665
|
-
.iyfExtensionExecute(
|
|
664
|
+
const orcaIx = yield anchor_1.Anchor.instance().iyfMain.methods
|
|
665
|
+
.iyfExtensionExecute(extensionIx.data)
|
|
666
666
|
.accounts({
|
|
667
667
|
farm,
|
|
668
668
|
userPda,
|
|
@@ -671,18 +671,19 @@ class Transactions {
|
|
|
671
671
|
iyfExtensionProgram: addresses_1.IYF_EXTENSION,
|
|
672
672
|
})
|
|
673
673
|
.remainingAccounts([
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
674
|
+
extensionIx.keys[4],
|
|
675
|
+
extensionIx.keys[5],
|
|
676
|
+
extensionIx.keys[6],
|
|
677
|
+
extensionIx.keys[7],
|
|
678
|
+
extensionIx.keys[8],
|
|
679
|
+
extensionIx.keys[9],
|
|
680
|
+
extensionIx.keys[10],
|
|
681
|
+
extensionIx.keys[11],
|
|
682
|
+
extensionIx.keys[12],
|
|
683
683
|
])
|
|
684
684
|
.instruction();
|
|
685
|
-
|
|
685
|
+
orcaIx.keys[2].isSigner = true; // authority must be signer.
|
|
686
|
+
const mainInstructions = [orcaIx];
|
|
686
687
|
return (0, functions_1.createTransactionMeta)({
|
|
687
688
|
payer: params.userWallet,
|
|
688
689
|
description: "Create new Orca Position",
|
|
@@ -705,7 +706,7 @@ class Transactions {
|
|
|
705
706
|
const userPda = (0, functions_1.generateUserPda)(params.userWallet, farm);
|
|
706
707
|
const position = (0, functions_1.generateOrcaPositionPDA)(params.positionMint);
|
|
707
708
|
const positionTokenAccount = (0, functions_1.generateAta)(userPda, params.positionMint);
|
|
708
|
-
const
|
|
709
|
+
const extensionIx = yield anchor_1.Anchor.instance().iyfExtension.methods
|
|
709
710
|
.orcaClosePosition()
|
|
710
711
|
.accounts({
|
|
711
712
|
farm,
|
|
@@ -720,8 +721,8 @@ class Transactions {
|
|
|
720
721
|
associatedTokenProgram: addresses_1.ASSOCIATED_TOKEN_PROGRAM,
|
|
721
722
|
})
|
|
722
723
|
.instruction();
|
|
723
|
-
const
|
|
724
|
-
.iyfExtensionExecute(
|
|
724
|
+
const orcaIx = yield anchor_1.Anchor.instance().iyfMain.methods
|
|
725
|
+
.iyfExtensionExecute(extensionIx.data)
|
|
725
726
|
.accounts({
|
|
726
727
|
farm,
|
|
727
728
|
userPda,
|
|
@@ -730,15 +731,16 @@ class Transactions {
|
|
|
730
731
|
iyfExtensionProgram: addresses_1.IYF_EXTENSION,
|
|
731
732
|
})
|
|
732
733
|
.remainingAccounts([
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
734
|
+
extensionIx.keys[4],
|
|
735
|
+
extensionIx.keys[5],
|
|
736
|
+
extensionIx.keys[6],
|
|
737
|
+
extensionIx.keys[7],
|
|
738
|
+
extensionIx.keys[8],
|
|
739
|
+
extensionIx.keys[9],
|
|
739
740
|
])
|
|
740
741
|
.instruction();
|
|
741
|
-
|
|
742
|
+
orcaIx.keys[2].isSigner = true; // authority must be signer.
|
|
743
|
+
const mainInstructions = [orcaIx];
|
|
742
744
|
return (0, functions_1.createTransactionMeta)({
|
|
743
745
|
payer: params.userWallet,
|
|
744
746
|
description: "Close Orca Position",
|
|
@@ -777,7 +779,7 @@ class Transactions {
|
|
|
777
779
|
resultMap.map((result, index) => {
|
|
778
780
|
const tokenKey = result.tokenKey;
|
|
779
781
|
const token = tokenSeeds[index];
|
|
780
|
-
if (!result.exists) {
|
|
782
|
+
if (!result.exists && `${token.mint}` !== 'So11111111111111111111111111111111111111112') {
|
|
781
783
|
throw new Error(`Token: ${tokenKey} owned by ${token.owner} does not exist. Mint: ${token.mint}`);
|
|
782
784
|
}
|
|
783
785
|
});
|
|
@@ -787,6 +789,11 @@ class Transactions {
|
|
|
787
789
|
const { publicKey: tickArrayUpper } = (0, orca_1.getTickArrayFromTickIndex)(positionData.tickUpperIndex, whirlpoolData.tickSpacing, whirlpool, addresses_1.ORCA_WHIRLPOOL_PROGRAM);
|
|
788
790
|
const ownerFeeA = (0, functions_1.generateAta)(addresses_1.SITE_FEE_OWNER, mintA);
|
|
789
791
|
const ownerFeeB = (0, functions_1.generateAta)(addresses_1.SITE_FEE_OWNER, mintB);
|
|
792
|
+
// Step 1: Init wSOL token account for user wallet (if X or Y token is wSOL)
|
|
793
|
+
const wrapSolIx = (0, functions_1.wrapSolIfMintIsWsol)(params.userWallet, params.userWallet, [
|
|
794
|
+
{ mint: mintA, amount: params.totalXAmount },
|
|
795
|
+
{ mint: mintB, amount: params.totalYAmount },
|
|
796
|
+
]);
|
|
790
797
|
const depositIx = yield (0, hawksight_1.depositMultipleToken)({
|
|
791
798
|
payer: params.userWallet,
|
|
792
799
|
deposit: [
|
|
@@ -800,7 +807,7 @@ class Transactions {
|
|
|
800
807
|
},
|
|
801
808
|
]
|
|
802
809
|
});
|
|
803
|
-
const
|
|
810
|
+
const extensionIx = yield anchor_1.Anchor.instance().iyfExtension.methods
|
|
804
811
|
.orcaDeposit()
|
|
805
812
|
.accounts({
|
|
806
813
|
farm,
|
|
@@ -824,8 +831,8 @@ class Transactions {
|
|
|
824
831
|
associatedTokenProgram: addresses_1.ASSOCIATED_TOKEN_PROGRAM,
|
|
825
832
|
})
|
|
826
833
|
.instruction();
|
|
827
|
-
const
|
|
828
|
-
.iyfExtensionExecute(
|
|
834
|
+
const orcaIx = yield anchor_1.Anchor.instance().iyfMain.methods
|
|
835
|
+
.iyfExtensionExecute(extensionIx.data)
|
|
829
836
|
.accounts({
|
|
830
837
|
farm,
|
|
831
838
|
userPda,
|
|
@@ -834,21 +841,21 @@ class Transactions {
|
|
|
834
841
|
iyfExtensionProgram: addresses_1.IYF_EXTENSION,
|
|
835
842
|
})
|
|
836
843
|
.remainingAccounts([
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
844
|
+
extensionIx.keys[4],
|
|
845
|
+
extensionIx.keys[5],
|
|
846
|
+
extensionIx.keys[6],
|
|
847
|
+
extensionIx.keys[7],
|
|
848
|
+
extensionIx.keys[8],
|
|
849
|
+
extensionIx.keys[9],
|
|
850
|
+
extensionIx.keys[10],
|
|
851
|
+
extensionIx.keys[11],
|
|
852
|
+
extensionIx.keys[12],
|
|
853
|
+
extensionIx.keys[13],
|
|
854
|
+
extensionIx.keys[14],
|
|
855
|
+
extensionIx.keys[15],
|
|
856
|
+
extensionIx.keys[16],
|
|
857
|
+
extensionIx.keys[17],
|
|
858
|
+
extensionIx.keys[18],
|
|
852
859
|
])
|
|
853
860
|
.instruction();
|
|
854
861
|
const clearRemainingTokensIxs = yield (0, hawksight_1.withdrawMultipleToken)({
|
|
@@ -858,7 +865,8 @@ class Transactions {
|
|
|
858
865
|
{ mint: mintB },
|
|
859
866
|
],
|
|
860
867
|
});
|
|
861
|
-
|
|
868
|
+
orcaIx.keys[2].isSigner = true; // authority must be signer.
|
|
869
|
+
const mainInstructions = [...wrapSolIx, depositIx, orcaIx, clearRemainingTokensIxs];
|
|
862
870
|
return (0, functions_1.createTransactionMeta)({
|
|
863
871
|
payer: params.userWallet,
|
|
864
872
|
description: `Deposit to Orca Position: ${position}`,
|
|
@@ -895,7 +903,7 @@ class Transactions {
|
|
|
895
903
|
const { publicKey: tickArrayUpper } = (0, orca_1.getTickArrayFromTickIndex)(positionData.tickUpperIndex, whirlpoolData.tickSpacing, whirlpool, addresses_1.ORCA_WHIRLPOOL_PROGRAM);
|
|
896
904
|
const ownerFeeA = (0, functions_1.generateAta)(addresses_1.SITE_FEE_OWNER, mintA);
|
|
897
905
|
const ownerFeeB = (0, functions_1.generateAta)(addresses_1.SITE_FEE_OWNER, mintB);
|
|
898
|
-
const
|
|
906
|
+
const extensionIx = yield anchor_1.Anchor.instance().iyfExtension.methods
|
|
899
907
|
.orcaWithdraw(params.liquidityAmount)
|
|
900
908
|
.accounts({
|
|
901
909
|
farm,
|
|
@@ -919,8 +927,8 @@ class Transactions {
|
|
|
919
927
|
associatedTokenProgram: addresses_1.ASSOCIATED_TOKEN_PROGRAM,
|
|
920
928
|
})
|
|
921
929
|
.instruction();
|
|
922
|
-
const
|
|
923
|
-
.iyfExtensionExecute(
|
|
930
|
+
const orcaIx = yield anchor_1.Anchor.instance().iyfMain.methods
|
|
931
|
+
.iyfExtensionExecute(extensionIx.data)
|
|
924
932
|
.accounts({
|
|
925
933
|
farm,
|
|
926
934
|
userPda,
|
|
@@ -929,21 +937,21 @@ class Transactions {
|
|
|
929
937
|
iyfExtensionProgram: addresses_1.IYF_EXTENSION,
|
|
930
938
|
})
|
|
931
939
|
.remainingAccounts([
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
940
|
+
extensionIx.keys[4],
|
|
941
|
+
extensionIx.keys[5],
|
|
942
|
+
extensionIx.keys[6],
|
|
943
|
+
extensionIx.keys[7],
|
|
944
|
+
extensionIx.keys[8],
|
|
945
|
+
extensionIx.keys[9],
|
|
946
|
+
extensionIx.keys[10],
|
|
947
|
+
extensionIx.keys[11],
|
|
948
|
+
extensionIx.keys[12],
|
|
949
|
+
extensionIx.keys[13],
|
|
950
|
+
extensionIx.keys[14],
|
|
951
|
+
extensionIx.keys[15],
|
|
952
|
+
extensionIx.keys[16],
|
|
953
|
+
extensionIx.keys[17],
|
|
954
|
+
extensionIx.keys[18],
|
|
947
955
|
])
|
|
948
956
|
.instruction();
|
|
949
957
|
const withdrawFromPda = yield (0, hawksight_1.withdrawMultipleToken)({
|
|
@@ -953,7 +961,8 @@ class Transactions {
|
|
|
953
961
|
{ mint: mintB },
|
|
954
962
|
],
|
|
955
963
|
});
|
|
956
|
-
|
|
964
|
+
orcaIx.keys[2].isSigner = true; // authority must be signer.
|
|
965
|
+
const mainInstructions = [orcaIx, withdrawFromPda];
|
|
957
966
|
return (0, functions_1.createTransactionMeta)({
|
|
958
967
|
payer: params.userWallet,
|
|
959
968
|
description: `Withdraw deposits from Orca Position: ${position}`,
|
|
@@ -1002,7 +1011,7 @@ class Transactions {
|
|
|
1002
1011
|
}
|
|
1003
1012
|
}
|
|
1004
1013
|
whirlpoolData.rewardInfos[0].mint;
|
|
1005
|
-
const
|
|
1014
|
+
const extensionIx = yield anchor_1.Anchor.instance().iyfExtension.methods
|
|
1006
1015
|
.orcaClaimRewards()
|
|
1007
1016
|
.accounts({
|
|
1008
1017
|
farm,
|
|
@@ -1027,8 +1036,8 @@ class Transactions {
|
|
|
1027
1036
|
})
|
|
1028
1037
|
.remainingAccounts(remainingAccounts)
|
|
1029
1038
|
.instruction();
|
|
1030
|
-
const
|
|
1031
|
-
.iyfExtensionExecute(
|
|
1039
|
+
const orcaIx = yield anchor_1.Anchor.instance().iyfMain.methods
|
|
1040
|
+
.iyfExtensionExecute(extensionIx.data)
|
|
1032
1041
|
.accounts({
|
|
1033
1042
|
farm,
|
|
1034
1043
|
userPda,
|
|
@@ -1037,21 +1046,21 @@ class Transactions {
|
|
|
1037
1046
|
iyfExtensionProgram: addresses_1.IYF_EXTENSION,
|
|
1038
1047
|
})
|
|
1039
1048
|
.remainingAccounts([
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1049
|
+
extensionIx.keys[4],
|
|
1050
|
+
extensionIx.keys[5],
|
|
1051
|
+
extensionIx.keys[6],
|
|
1052
|
+
extensionIx.keys[7],
|
|
1053
|
+
extensionIx.keys[8],
|
|
1054
|
+
extensionIx.keys[9],
|
|
1055
|
+
extensionIx.keys[10],
|
|
1056
|
+
extensionIx.keys[11],
|
|
1057
|
+
extensionIx.keys[12],
|
|
1058
|
+
extensionIx.keys[13],
|
|
1059
|
+
extensionIx.keys[14],
|
|
1060
|
+
extensionIx.keys[15],
|
|
1061
|
+
extensionIx.keys[16],
|
|
1062
|
+
extensionIx.keys[17],
|
|
1063
|
+
extensionIx.keys[18],
|
|
1055
1064
|
])
|
|
1056
1065
|
.instruction();
|
|
1057
1066
|
const withdrawFromPda = yield (0, hawksight_1.withdrawMultipleToken)({
|
|
@@ -1061,7 +1070,8 @@ class Transactions {
|
|
|
1061
1070
|
{ mint: mintB },
|
|
1062
1071
|
],
|
|
1063
1072
|
});
|
|
1064
|
-
|
|
1073
|
+
orcaIx.keys[2].isSigner = true; // authority must be signer.
|
|
1074
|
+
const mainInstructions = [orcaIx, withdrawFromPda];
|
|
1065
1075
|
return (0, functions_1.createTransactionMeta)({
|
|
1066
1076
|
payer: params.userWallet,
|
|
1067
1077
|
description: `Claim rewards from Orca Position: ${position}`,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="@meteora-ag/dlmm/node_modules/@solana/web3.js" />
|
|
2
2
|
import * as web3 from "@solana/web3.js";
|
|
3
3
|
import * as _client from "@hawksightco/swagger-client";
|
|
4
|
-
import { ResponseWithStatus, TransactionMetadata } from "../types";
|
|
4
|
+
import { ResponseWithStatus, TransactionMetadata, OrcaWithdraw, OrcaDeposit, OrcaClosePosition, OrcaOpenPosition, OrcaClaimRewards } from "../types";
|
|
5
5
|
import { Client } from "./Client";
|
|
6
6
|
import { GeneralUtility } from "./GeneralUtility";
|
|
7
7
|
/**
|
|
@@ -80,7 +80,7 @@ export declare class TxGenerator {
|
|
|
80
80
|
* @param params Parameters required
|
|
81
81
|
* @returns A ResponseWithStatus containing either TransactionMetadataResponse or TransactionMetadata.
|
|
82
82
|
*/
|
|
83
|
-
orcaOpenPosition(connection: web3.Connection, payer: string, params:
|
|
83
|
+
orcaOpenPosition(connection: web3.Connection, payer: string, params: OrcaOpenPosition): Promise<ResponseWithStatus<TransactionMetadata>>;
|
|
84
84
|
/**
|
|
85
85
|
* Creates orca instruction that closes position
|
|
86
86
|
*
|
|
@@ -89,7 +89,7 @@ export declare class TxGenerator {
|
|
|
89
89
|
* @param params Parameters required
|
|
90
90
|
* @returns A ResponseWithStatus containing either TransactionMetadataResponse or TransactionMetadata.
|
|
91
91
|
*/
|
|
92
|
-
orcaClosePosition(connection: web3.Connection, payer: string, params:
|
|
92
|
+
orcaClosePosition(connection: web3.Connection, payer: string, params: OrcaClosePosition): Promise<ResponseWithStatus<TransactionMetadata>>;
|
|
93
93
|
/**
|
|
94
94
|
* Creates orca instruction that deposits to a position
|
|
95
95
|
*
|
|
@@ -98,7 +98,7 @@ export declare class TxGenerator {
|
|
|
98
98
|
* @param params Parameters required
|
|
99
99
|
* @returns A ResponseWithStatus containing either TransactionMetadataResponse or TransactionMetadata.
|
|
100
100
|
*/
|
|
101
|
-
orcaDeposit(connection: web3.Connection, payer: string, params:
|
|
101
|
+
orcaDeposit(connection: web3.Connection, payer: string, params: OrcaDeposit): Promise<ResponseWithStatus<TransactionMetadata>>;
|
|
102
102
|
/**
|
|
103
103
|
* Creates orca instruction that withdraws from a position
|
|
104
104
|
*
|
|
@@ -107,7 +107,7 @@ export declare class TxGenerator {
|
|
|
107
107
|
* @param params Parameters required
|
|
108
108
|
* @returns A ResponseWithStatus containing either TransactionMetadataResponse or TransactionMetadata.
|
|
109
109
|
*/
|
|
110
|
-
orcaWithdraw(connection: web3.Connection, payer: string, params:
|
|
110
|
+
orcaWithdraw(connection: web3.Connection, payer: string, params: OrcaWithdraw): Promise<ResponseWithStatus<TransactionMetadata>>;
|
|
111
111
|
/**
|
|
112
112
|
* Creates orca instruction that claims fees and rewards
|
|
113
113
|
*
|
|
@@ -116,6 +116,6 @@ export declare class TxGenerator {
|
|
|
116
116
|
* @param params Parameters required
|
|
117
117
|
* @returns A ResponseWithStatus containing either TransactionMetadataResponse or TransactionMetadata.
|
|
118
118
|
*/
|
|
119
|
-
orcaClaimRewards(connection: web3.Connection, payer: string, params:
|
|
119
|
+
orcaClaimRewards(connection: web3.Connection, payer: string, params: OrcaClaimRewards): Promise<ResponseWithStatus<TransactionMetadata>>;
|
|
120
120
|
}
|
|
121
121
|
//# sourceMappingURL=TxGenerator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TxGenerator.d.ts","sourceRoot":"","sources":["../../../src/classes/TxGenerator.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AACxC,OAAO,KAAK,OAAO,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAkE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"TxGenerator.d.ts","sourceRoot":"","sources":["../../../src/classes/TxGenerator.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AACxC,OAAO,KAAK,OAAO,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAkE,YAAY,EAAE,WAAW,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AACrN,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAKlD;;;;GAIG;AACH,qBAAa,WAAW;IAQpB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,SAAS,CAAC,QAAQ,CAAC,cAAc,EAAE,cAAc;IAPnD;;;;OAIG;gBAEgB,MAAM,EAAE,MAAM,EACZ,cAAc,EAAE,cAAc;IAGnD;;;;;;;OAOG;IACG,+BAA+B,CAAC,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,8BAA8B,GAAG,OAAO,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,CAAC;IAqCnL;;;;;;;OAOG;IACG,cAAc,CAAC,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC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E,MAAM,EAAE,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,CAAC;IAkCpI;;;;;;;OAOG;IACG,YAAY,CAAC,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,CAAC;IAiCtI;;;;;;;OAOG;IACG,gBAAgB,CAAC,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,CAAC;CA+B/I"}
|
|
@@ -325,11 +325,11 @@ class TxGenerator {
|
|
|
325
325
|
const result = yield Transactions_1.txgen.orcaOpenPosition({
|
|
326
326
|
connection,
|
|
327
327
|
params: {
|
|
328
|
-
userWallet:
|
|
329
|
-
positionMint:
|
|
330
|
-
whirlpool:
|
|
331
|
-
tickLowerIndex:
|
|
332
|
-
tickUpperIndex:
|
|
328
|
+
userWallet: params.userWallet,
|
|
329
|
+
positionMint: params.positionMint,
|
|
330
|
+
whirlpool: params.whirlpool,
|
|
331
|
+
tickLowerIndex: params.tickLowerIndex,
|
|
332
|
+
tickUpperIndex: params.tickUpperIndex,
|
|
333
333
|
}
|
|
334
334
|
});
|
|
335
335
|
return {
|
|
@@ -365,8 +365,8 @@ class TxGenerator {
|
|
|
365
365
|
const result = yield Transactions_1.txgen.orcaClosePosition({
|
|
366
366
|
connection,
|
|
367
367
|
params: {
|
|
368
|
-
userWallet:
|
|
369
|
-
positionMint:
|
|
368
|
+
userWallet: params.userWallet,
|
|
369
|
+
positionMint: params.positionMint,
|
|
370
370
|
}
|
|
371
371
|
});
|
|
372
372
|
return {
|
|
@@ -402,10 +402,10 @@ class TxGenerator {
|
|
|
402
402
|
const result = yield Transactions_1.txgen.orcaDeposit({
|
|
403
403
|
connection,
|
|
404
404
|
params: {
|
|
405
|
-
userWallet:
|
|
406
|
-
positionMint:
|
|
407
|
-
totalXAmount:
|
|
408
|
-
totalYAmount:
|
|
405
|
+
userWallet: params.userWallet,
|
|
406
|
+
positionMint: params.positionMint,
|
|
407
|
+
totalXAmount: params.totalXAmount,
|
|
408
|
+
totalYAmount: params.totalYAmount,
|
|
409
409
|
}
|
|
410
410
|
});
|
|
411
411
|
return {
|
|
@@ -441,9 +441,9 @@ class TxGenerator {
|
|
|
441
441
|
const result = yield Transactions_1.txgen.orcaWithdraw({
|
|
442
442
|
connection,
|
|
443
443
|
params: {
|
|
444
|
-
userWallet:
|
|
445
|
-
positionMint:
|
|
446
|
-
liquidityAmount:
|
|
444
|
+
userWallet: params.userWallet,
|
|
445
|
+
positionMint: params.positionMint,
|
|
446
|
+
liquidityAmount: params.liquidityAmount,
|
|
447
447
|
}
|
|
448
448
|
});
|
|
449
449
|
return {
|
|
@@ -479,8 +479,8 @@ class TxGenerator {
|
|
|
479
479
|
const result = yield Transactions_1.txgen.orcaClaimRewards({
|
|
480
480
|
connection,
|
|
481
481
|
params: {
|
|
482
|
-
userWallet:
|
|
483
|
-
positionMint:
|
|
482
|
+
userWallet: params.userWallet,
|
|
483
|
+
positionMint: params.positionMint,
|
|
484
484
|
}
|
|
485
485
|
});
|
|
486
486
|
return {
|
package/dist/src/meteora.js
CHANGED
|
@@ -566,7 +566,7 @@ class RemoveLiquidityBuilder {
|
|
|
566
566
|
replaceClaimFeeTokenToSTA() {
|
|
567
567
|
const index = this.mainIxs.findIndex(mainIx => {
|
|
568
568
|
const dataWithoutIyfExtensionExecute = mainIx.data.subarray(12);
|
|
569
|
-
(0, functions_1.sighashMatch)(dataWithoutIyfExtensionExecute, "MeteoraDlmmClaimFeeAutomation");
|
|
569
|
+
return (0, functions_1.sighashMatch)(dataWithoutIyfExtensionExecute, "MeteoraDlmmClaimFeeAutomation");
|
|
570
570
|
});
|
|
571
571
|
if (index === -1) {
|
|
572
572
|
console.warn(`Warn: claim fee instruction not found! This should not happen if \`shouldClaimAndClose\` is set to true.`);
|
|
@@ -586,7 +586,7 @@ class RemoveLiquidityBuilder {
|
|
|
586
586
|
replaceClaimRewardToSTA() {
|
|
587
587
|
const index = this.mainIxs.findIndex(mainIx => {
|
|
588
588
|
const dataWithoutIyfExtensionExecute = mainIx.data.subarray(12);
|
|
589
|
-
(0, functions_1.sighashMatch)(dataWithoutIyfExtensionExecute, "MeteoraDlmmClaimRewardAutomation");
|
|
589
|
+
return (0, functions_1.sighashMatch)(dataWithoutIyfExtensionExecute, "MeteoraDlmmClaimRewardAutomation");
|
|
590
590
|
});
|
|
591
591
|
if (index === -1) {
|
|
592
592
|
console.warn(`Warn: Reward instruction not found! This may happen if pool has no rewards`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hawksightco/hawk-sdk",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.3",
|
|
4
4
|
"description": "Hawksight v2 SDK",
|
|
5
5
|
"main": "dist/src/index.js",
|
|
6
6
|
"repository": "https://github.com/ghabxph/hawk-api-client.git",
|
|
@@ -13,9 +13,11 @@
|
|
|
13
13
|
"devDependencies": {
|
|
14
14
|
"@types/bn.js": "^5.1.5",
|
|
15
15
|
"@types/bs58": "^4.0.4",
|
|
16
|
+
"@types/dotenv": "^8.2.0",
|
|
16
17
|
"@types/jest": "^29.5.12",
|
|
17
18
|
"@types/lodash": "^4.17.7",
|
|
18
19
|
"@types/node": "^20.11.5",
|
|
20
|
+
"dotenv": "^16.4.5",
|
|
19
21
|
"jest": "^29.7.0",
|
|
20
22
|
"ts-jest": "^29.1.2",
|
|
21
23
|
"typescript": "^5.4.5"
|