@hawksightco/hawk-sdk 1.1.1 → 1.1.2

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.
@@ -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;IAlDxB,2FAA2F;IAC3F,OAAO,CAAC,UAAU,CAA0B;IAC5C,IAAI,SAAS,IAAI,IAAI,CAAC,kBAAkB,CAEvC;IAED,+DAA+D;IAC/D,OAAO,CAAC,qBAAqB,CAA4B;IACzD,IAAI,oBAAoB,IAAI,IAAI,CAAC,oBAAoB,CAEpD;IAED,+EAA+E;IAC/E,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAElD,oFAAoF;IACpF,OAAO,CAAC,oBAAoB,CAAc;IAC1C,IAAI,mBAAmB,IAAI,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AYG;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(connection) {
257
- return __awaiter(this, void 0, void 0, function* () {
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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AG,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 orcaOpenPositionIx = yield anchor_1.Anchor.instance().iyfExtension.methods
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 orcaOpenPositionIxViaMain = yield anchor_1.Anchor.instance().iyfMain.methods
665
- .iyfExtensionExecute(orcaOpenPositionIx.data)
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
- orcaOpenPositionIx.keys[4],
675
- orcaOpenPositionIx.keys[5],
676
- orcaOpenPositionIx.keys[6],
677
- orcaOpenPositionIx.keys[7],
678
- orcaOpenPositionIx.keys[8],
679
- orcaOpenPositionIx.keys[9],
680
- orcaOpenPositionIx.keys[10],
681
- orcaOpenPositionIx.keys[11],
682
- orcaOpenPositionIx.keys[12],
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
- const mainInstructions = [orcaOpenPositionIxViaMain];
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 orcaOpenPositionIx = yield anchor_1.Anchor.instance().iyfExtension.methods
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 orcaOpenPositionIxViaMain = yield anchor_1.Anchor.instance().iyfMain.methods
724
- .iyfExtensionExecute(orcaOpenPositionIx.data)
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
- orcaOpenPositionIx.keys[4],
734
- orcaOpenPositionIx.keys[5],
735
- orcaOpenPositionIx.keys[6],
736
- orcaOpenPositionIx.keys[7],
737
- orcaOpenPositionIx.keys[8],
738
- orcaOpenPositionIx.keys[9],
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
- const mainInstructions = [orcaOpenPositionIxViaMain];
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 orcaOpenPositionIx = yield anchor_1.Anchor.instance().iyfExtension.methods
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 orcaOpenPositionIxViaMain = yield anchor_1.Anchor.instance().iyfMain.methods
828
- .iyfExtensionExecute(orcaOpenPositionIx.data)
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
- orcaOpenPositionIx.keys[4],
838
- orcaOpenPositionIx.keys[5],
839
- orcaOpenPositionIx.keys[6],
840
- orcaOpenPositionIx.keys[7],
841
- orcaOpenPositionIx.keys[8],
842
- orcaOpenPositionIx.keys[9],
843
- orcaOpenPositionIx.keys[10],
844
- orcaOpenPositionIx.keys[11],
845
- orcaOpenPositionIx.keys[12],
846
- orcaOpenPositionIx.keys[13],
847
- orcaOpenPositionIx.keys[14],
848
- orcaOpenPositionIx.keys[15],
849
- orcaOpenPositionIx.keys[16],
850
- orcaOpenPositionIx.keys[17],
851
- orcaOpenPositionIx.keys[18],
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
- const mainInstructions = [depositIx, orcaOpenPositionIxViaMain, clearRemainingTokensIxs];
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 orcaOpenPositionIx = yield anchor_1.Anchor.instance().iyfExtension.methods
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 orcaOpenPositionIxViaMain = yield anchor_1.Anchor.instance().iyfMain.methods
923
- .iyfExtensionExecute(orcaOpenPositionIx.data)
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
- orcaOpenPositionIx.keys[4],
933
- orcaOpenPositionIx.keys[5],
934
- orcaOpenPositionIx.keys[6],
935
- orcaOpenPositionIx.keys[7],
936
- orcaOpenPositionIx.keys[8],
937
- orcaOpenPositionIx.keys[9],
938
- orcaOpenPositionIx.keys[10],
939
- orcaOpenPositionIx.keys[11],
940
- orcaOpenPositionIx.keys[12],
941
- orcaOpenPositionIx.keys[13],
942
- orcaOpenPositionIx.keys[14],
943
- orcaOpenPositionIx.keys[15],
944
- orcaOpenPositionIx.keys[16],
945
- orcaOpenPositionIx.keys[17],
946
- orcaOpenPositionIx.keys[18],
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
- const mainInstructions = [orcaOpenPositionIxViaMain, withdrawFromPda];
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 orcaOpenPositionIx = yield anchor_1.Anchor.instance().iyfExtension.methods
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 orcaOpenPositionIxViaMain = yield anchor_1.Anchor.instance().iyfMain.methods
1031
- .iyfExtensionExecute(orcaOpenPositionIx.data)
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
- orcaOpenPositionIx.keys[4],
1041
- orcaOpenPositionIx.keys[5],
1042
- orcaOpenPositionIx.keys[6],
1043
- orcaOpenPositionIx.keys[7],
1044
- orcaOpenPositionIx.keys[8],
1045
- orcaOpenPositionIx.keys[9],
1046
- orcaOpenPositionIx.keys[10],
1047
- orcaOpenPositionIx.keys[11],
1048
- orcaOpenPositionIx.keys[12],
1049
- orcaOpenPositionIx.keys[13],
1050
- orcaOpenPositionIx.keys[14],
1051
- orcaOpenPositionIx.keys[15],
1052
- orcaOpenPositionIx.keys[16],
1053
- orcaOpenPositionIx.keys[17],
1054
- orcaOpenPositionIx.keys[18],
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
- const mainInstructions = [orcaOpenPositionIxViaMain, withdrawFromPda];
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: _client.TxOpenPositionBody): Promise<ResponseWithStatus<TransactionMetadata>>;
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: _client.TxClosePositionBody1): Promise<ResponseWithStatus<TransactionMetadata>>;
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: _client.TxDepositBody1): Promise<ResponseWithStatus<TransactionMetadata>>;
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: _client.TxWithdrawBody1): Promise<ResponseWithStatus<TransactionMetadata>>;
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: _client.TxClaimRewardsBody): Promise<ResponseWithStatus<TransactionMetadata>>;
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;AACnI,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,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AE,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,CAAC;IAmC9I;;;;;;;OAOG;IACG,iBAAiB,CAAC,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,CAAC;IAgChJ;;;;;;;OAOG;IACG,WAAW,CAAC,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,KAAK,EAAE,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: new web3.PublicKey(params.userWallet),
329
- positionMint: new web3.PublicKey(params.positionMint),
330
- whirlpool: new web3.PublicKey(params.whirlpool),
331
- tickLowerIndex: parseInt(params.tickLowerIndex),
332
- tickUpperIndex: parseInt(params.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: new web3.PublicKey(params.userWallet),
369
- positionMint: new web3.PublicKey(params.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: new web3.PublicKey(params.userWallet),
406
- positionMint: new web3.PublicKey(params.positionMint),
407
- totalXAmount: new bn_js_1.BN(params.totalXAmount),
408
- totalYAmount: new bn_js_1.BN(params.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: new web3.PublicKey(params.userWallet),
445
- positionMint: new web3.PublicKey(params.positionMint),
446
- liquidityAmount: new bn_js_1.BN(params.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: new web3.PublicKey(params.userWallet),
483
- positionMint: new web3.PublicKey(params.positionMint),
482
+ userWallet: params.userWallet,
483
+ positionMint: params.positionMint,
484
484
  }
485
485
  });
486
486
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hawksightco/hawk-sdk",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
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"