@hawksightco/hawk-sdk 1.0.3 → 1.0.5

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.
@@ -165,7 +165,7 @@ class CreateTxMetadata {
165
165
  alts.push(_alt);
166
166
  }
167
167
  else {
168
- alts.push(yield this.loadSingleAlt(alt));
168
+ alts.push(yield this.loadSingleAlt(alt, connection));
169
169
  }
170
170
  }
171
171
  if (jupAlts.status === 200) {
@@ -175,7 +175,7 @@ class CreateTxMetadata {
175
175
  alts.push(_alt);
176
176
  }
177
177
  else {
178
- alts.push(yield this.loadSingleAlt(alt));
178
+ alts.push(yield this.loadSingleAlt(alt, connection));
179
179
  }
180
180
  }
181
181
  }
@@ -6,6 +6,7 @@ import { TxGeneratorAutomations } from "./TxGeneratorAutomations";
6
6
  import { Client } from "./Client";
7
7
  import { GeneralUtility } from "./GeneralUtility";
8
8
  import { Search } from "./Search";
9
+ import { HawkApiOptions } from "../types";
9
10
  /**
10
11
  * HawkAPI is a central gateway class that aggregates access to various functional modules
11
12
  * for interacting with HawkSight's blockchain APIs. This class initializes and exposes modules
@@ -17,6 +18,7 @@ import { Search } from "./Search";
17
18
  */
18
19
  export declare class HawkAPI {
19
20
  protected readonly url: string;
21
+ protected readonly options?: HawkApiOptions | undefined;
20
22
  /** Swagger Client Instance. */
21
23
  private readonly client;
22
24
  /** Health module to check system health and API connectivity. */
@@ -38,7 +40,7 @@ export declare class HawkAPI {
38
40
  * Initializes a new instance of the HawkAPI class with a specified API URL.
39
41
  * @param url The base URL for the HawkSight API services, defaulted to "https://api2.hawksight.co" if not specified.
40
42
  */
41
- constructor(url?: string);
43
+ constructor(url?: string, options?: HawkApiOptions | undefined);
42
44
  /**
43
45
  * Override transaction generator
44
46
  *
@@ -1 +1 @@
1
- {"version":3,"file":"HawkAPI.d.ts","sourceRoot":"","sources":["../../../src/classes/HawkAPI.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM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param url The base URL for the HawkSight API services, defaulted to "https://api2.hawksight.co" if not specified.
27
27
  */
28
- constructor(url = "https://api2.hawksight.co") {
28
+ constructor(url = "https://api2.hawksight.co", options) {
29
29
  this.url = url;
30
+ this.options = options;
30
31
  const client = new Client_1.Client(url);
31
32
  this.client = client;
32
33
  this.health = new Health_1.Health(client);
@@ -37,9 +38,13 @@ class HawkAPI {
37
38
  this.txGeneratorAutomation = new TxGeneratorAutomations_1.TxGeneratorAutomations(client, this.generalUtility);
38
39
  this.search = new Search_1.Search(url);
39
40
  // Load create tx metadata module
40
- CreateTxMetadata_1.CreateTxMetadata.instance().load();
41
+ if (this.options === undefined || !this.options.disableTxMetadataLoad) {
42
+ CreateTxMetadata_1.CreateTxMetadata.instance().load();
43
+ }
41
44
  // Load search module
42
- this.search.load();
45
+ if (this.options === undefined || !this.options.disableTokenLoad) {
46
+ this.search.load();
47
+ }
43
48
  }
44
49
  /**
45
50
  * Override transaction generator
@@ -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;I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O;IAIpC;;;;;;;;;;OAUG;IACG,gBAAgB,CACpB,UAAU,EAAE,IAAI,CAAC,UAAU,EAC3B,gBAAgB,EAAE,MAAM,EACxB,aAAa,EAAE,IAAI,EACnB,gBAAgB,EAAE,MAAM,GACvB,OAAO,CAAC,IAAI,CAAC,sBAAsB,EAAE,CAAC;IAEzC;;;;;;;;;;;;;OAaG;IACG,gBAAgB,CACpB,UAAU,EAAE,IAAI,CAAC,UAAU,EAC3B,gBAAgB,EAAE,MAAM,EACxB,aAAa,EAAE,KAAK,EACpB,aAAa,EAAE,MAAM,CAAC,aAAa,EACnC,cAAc,CAAC,EAAE,MAAM,GACtB,OAAO,CAAC,IAAI,CAAC,sBAAsB,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(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,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;AA0BlB,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,CAAC,EAC/B,UAAU,EACV,MAAM,GACP,EAAE,WAAW,CAAC,0BAA0B,CAAC,GAAG,OAAO,CAAC,2BAA2B,CAAC;IAwBj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iB,CAAC,EAAE,UAAU,EAAE,MAAM,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"}
@@ -634,7 +634,7 @@ class Transactions {
634
634
  const userPda = (0, functions_1.generateUserPda)(params.userWallet, farm);
635
635
  const position = (0, functions_1.generateOrcaPositionPDA)(params.positionMint);
636
636
  const positionTokenAccount = (0, functions_1.generateAta)(userPda, params.positionMint);
637
- const orcaOpenPositionIx = yield anchor_1.Anchor.instance().iyfExtension.methods
637
+ const extensionIx = yield anchor_1.Anchor.instance().iyfExtension.methods
638
638
  .orcaOpenPosition(params.tickLowerIndex, params.tickUpperIndex)
639
639
  .accounts({
640
640
  farm,
@@ -652,8 +652,8 @@ class Transactions {
652
652
  systemProgram: web3.SystemProgram.programId,
653
653
  })
654
654
  .instruction();
655
- const orcaOpenPositionIxViaMain = yield anchor_1.Anchor.instance().iyfMain.methods
656
- .iyfExtensionExecute(orcaOpenPositionIx.data)
655
+ const orcaIx = yield anchor_1.Anchor.instance().iyfMain.methods
656
+ .iyfExtensionExecute(extensionIx.data)
657
657
  .accounts({
658
658
  farm,
659
659
  userPda,
@@ -662,18 +662,19 @@ class Transactions {
662
662
  iyfExtensionProgram: addresses_1.IYF_EXTENSION,
663
663
  })
664
664
  .remainingAccounts([
665
- orcaOpenPositionIx.keys[4],
666
- orcaOpenPositionIx.keys[5],
667
- orcaOpenPositionIx.keys[6],
668
- orcaOpenPositionIx.keys[7],
669
- orcaOpenPositionIx.keys[8],
670
- orcaOpenPositionIx.keys[9],
671
- orcaOpenPositionIx.keys[10],
672
- orcaOpenPositionIx.keys[11],
673
- orcaOpenPositionIx.keys[12],
665
+ extensionIx.keys[4],
666
+ extensionIx.keys[5],
667
+ extensionIx.keys[6],
668
+ extensionIx.keys[7],
669
+ extensionIx.keys[8],
670
+ extensionIx.keys[9],
671
+ extensionIx.keys[10],
672
+ extensionIx.keys[11],
673
+ extensionIx.keys[12],
674
674
  ])
675
675
  .instruction();
676
- const mainInstructions = [orcaOpenPositionIxViaMain];
676
+ orcaIx.keys[2].isSigner = true; // authority must be signer.
677
+ const mainInstructions = [orcaIx];
677
678
  return (0, functions_1.createTransactionMeta)({
678
679
  payer: params.userWallet,
679
680
  description: "Create new Orca Position",
@@ -696,7 +697,7 @@ class Transactions {
696
697
  const userPda = (0, functions_1.generateUserPda)(params.userWallet, farm);
697
698
  const position = (0, functions_1.generateOrcaPositionPDA)(params.positionMint);
698
699
  const positionTokenAccount = (0, functions_1.generateAta)(userPda, params.positionMint);
699
- const orcaOpenPositionIx = yield anchor_1.Anchor.instance().iyfExtension.methods
700
+ const extensionIx = yield anchor_1.Anchor.instance().iyfExtension.methods
700
701
  .orcaClosePosition()
701
702
  .accounts({
702
703
  farm,
@@ -711,8 +712,8 @@ class Transactions {
711
712
  associatedTokenProgram: addresses_1.ASSOCIATED_TOKEN_PROGRAM,
712
713
  })
713
714
  .instruction();
714
- const orcaOpenPositionIxViaMain = yield anchor_1.Anchor.instance().iyfMain.methods
715
- .iyfExtensionExecute(orcaOpenPositionIx.data)
715
+ const orcaIx = yield anchor_1.Anchor.instance().iyfMain.methods
716
+ .iyfExtensionExecute(extensionIx.data)
716
717
  .accounts({
717
718
  farm,
718
719
  userPda,
@@ -721,15 +722,16 @@ class Transactions {
721
722
  iyfExtensionProgram: addresses_1.IYF_EXTENSION,
722
723
  })
723
724
  .remainingAccounts([
724
- orcaOpenPositionIx.keys[4],
725
- orcaOpenPositionIx.keys[5],
726
- orcaOpenPositionIx.keys[6],
727
- orcaOpenPositionIx.keys[7],
728
- orcaOpenPositionIx.keys[8],
729
- orcaOpenPositionIx.keys[9],
725
+ extensionIx.keys[4],
726
+ extensionIx.keys[5],
727
+ extensionIx.keys[6],
728
+ extensionIx.keys[7],
729
+ extensionIx.keys[8],
730
+ extensionIx.keys[9],
730
731
  ])
731
732
  .instruction();
732
- const mainInstructions = [orcaOpenPositionIxViaMain];
733
+ orcaIx.keys[2].isSigner = true; // authority must be signer.
734
+ const mainInstructions = [orcaIx];
733
735
  return (0, functions_1.createTransactionMeta)({
734
736
  payer: params.userWallet,
735
737
  description: "Close Orca Position",
@@ -768,7 +770,7 @@ class Transactions {
768
770
  resultMap.map((result, index) => {
769
771
  const tokenKey = result.tokenKey;
770
772
  const token = tokenSeeds[index];
771
- if (!result.exists) {
773
+ if (!result.exists && `${token.mint}` !== 'So11111111111111111111111111111111111111112') {
772
774
  throw new Error(`Token: ${tokenKey} owned by ${token.owner} does not exist. Mint: ${token.mint}`);
773
775
  }
774
776
  });
@@ -778,6 +780,11 @@ class Transactions {
778
780
  const { publicKey: tickArrayUpper } = (0, orca_1.getTickArrayFromTickIndex)(positionData.tickUpperIndex, whirlpoolData.tickSpacing, whirlpool, addresses_1.ORCA_WHIRLPOOL_PROGRAM);
779
781
  const ownerFeeA = (0, functions_1.generateAta)(addresses_1.SITE_FEE_OWNER, mintA);
780
782
  const ownerFeeB = (0, functions_1.generateAta)(addresses_1.SITE_FEE_OWNER, mintB);
783
+ // Step 1: Init wSOL token account for user wallet (if X or Y token is wSOL)
784
+ const wrapSolIx = (0, functions_1.wrapSolIfMintIsWsol)(params.userWallet, params.userWallet, [
785
+ { mint: mintA, amount: params.totalXAmount },
786
+ { mint: mintB, amount: params.totalYAmount },
787
+ ]);
781
788
  const depositIx = yield (0, hawksight_1.depositMultipleToken)({
782
789
  payer: params.userWallet,
783
790
  deposit: [
@@ -791,7 +798,7 @@ class Transactions {
791
798
  },
792
799
  ]
793
800
  });
794
- const orcaOpenPositionIx = yield anchor_1.Anchor.instance().iyfExtension.methods
801
+ const extensionIx = yield anchor_1.Anchor.instance().iyfExtension.methods
795
802
  .orcaDeposit()
796
803
  .accounts({
797
804
  farm,
@@ -815,8 +822,8 @@ class Transactions {
815
822
  associatedTokenProgram: addresses_1.ASSOCIATED_TOKEN_PROGRAM,
816
823
  })
817
824
  .instruction();
818
- const orcaOpenPositionIxViaMain = yield anchor_1.Anchor.instance().iyfMain.methods
819
- .iyfExtensionExecute(orcaOpenPositionIx.data)
825
+ const orcaIx = yield anchor_1.Anchor.instance().iyfMain.methods
826
+ .iyfExtensionExecute(extensionIx.data)
820
827
  .accounts({
821
828
  farm,
822
829
  userPda,
@@ -825,21 +832,21 @@ class Transactions {
825
832
  iyfExtensionProgram: addresses_1.IYF_EXTENSION,
826
833
  })
827
834
  .remainingAccounts([
828
- orcaOpenPositionIx.keys[4],
829
- orcaOpenPositionIx.keys[5],
830
- orcaOpenPositionIx.keys[6],
831
- orcaOpenPositionIx.keys[7],
832
- orcaOpenPositionIx.keys[8],
833
- orcaOpenPositionIx.keys[9],
834
- orcaOpenPositionIx.keys[10],
835
- orcaOpenPositionIx.keys[11],
836
- orcaOpenPositionIx.keys[12],
837
- orcaOpenPositionIx.keys[13],
838
- orcaOpenPositionIx.keys[14],
839
- orcaOpenPositionIx.keys[15],
840
- orcaOpenPositionIx.keys[16],
841
- orcaOpenPositionIx.keys[17],
842
- orcaOpenPositionIx.keys[18],
835
+ extensionIx.keys[4],
836
+ extensionIx.keys[5],
837
+ extensionIx.keys[6],
838
+ extensionIx.keys[7],
839
+ extensionIx.keys[8],
840
+ extensionIx.keys[9],
841
+ extensionIx.keys[10],
842
+ extensionIx.keys[11],
843
+ extensionIx.keys[12],
844
+ extensionIx.keys[13],
845
+ extensionIx.keys[14],
846
+ extensionIx.keys[15],
847
+ extensionIx.keys[16],
848
+ extensionIx.keys[17],
849
+ extensionIx.keys[18],
843
850
  ])
844
851
  .instruction();
845
852
  const clearRemainingTokensIxs = yield (0, hawksight_1.withdrawMultipleToken)({
@@ -849,7 +856,8 @@ class Transactions {
849
856
  { mint: mintB },
850
857
  ],
851
858
  });
852
- const mainInstructions = [depositIx, orcaOpenPositionIxViaMain, clearRemainingTokensIxs];
859
+ orcaIx.keys[2].isSigner = true; // authority must be signer.
860
+ const mainInstructions = [...wrapSolIx, depositIx, orcaIx, clearRemainingTokensIxs];
853
861
  return (0, functions_1.createTransactionMeta)({
854
862
  payer: params.userWallet,
855
863
  description: `Deposit to Orca Position: ${position}`,
@@ -886,7 +894,7 @@ class Transactions {
886
894
  const { publicKey: tickArrayUpper } = (0, orca_1.getTickArrayFromTickIndex)(positionData.tickUpperIndex, whirlpoolData.tickSpacing, whirlpool, addresses_1.ORCA_WHIRLPOOL_PROGRAM);
887
895
  const ownerFeeA = (0, functions_1.generateAta)(addresses_1.SITE_FEE_OWNER, mintA);
888
896
  const ownerFeeB = (0, functions_1.generateAta)(addresses_1.SITE_FEE_OWNER, mintB);
889
- const orcaOpenPositionIx = yield anchor_1.Anchor.instance().iyfExtension.methods
897
+ const extensionIx = yield anchor_1.Anchor.instance().iyfExtension.methods
890
898
  .orcaWithdraw(params.liquidityAmount)
891
899
  .accounts({
892
900
  farm,
@@ -910,8 +918,8 @@ class Transactions {
910
918
  associatedTokenProgram: addresses_1.ASSOCIATED_TOKEN_PROGRAM,
911
919
  })
912
920
  .instruction();
913
- const orcaOpenPositionIxViaMain = yield anchor_1.Anchor.instance().iyfMain.methods
914
- .iyfExtensionExecute(orcaOpenPositionIx.data)
921
+ const orcaIx = yield anchor_1.Anchor.instance().iyfMain.methods
922
+ .iyfExtensionExecute(extensionIx.data)
915
923
  .accounts({
916
924
  farm,
917
925
  userPda,
@@ -920,21 +928,21 @@ class Transactions {
920
928
  iyfExtensionProgram: addresses_1.IYF_EXTENSION,
921
929
  })
922
930
  .remainingAccounts([
923
- orcaOpenPositionIx.keys[4],
924
- orcaOpenPositionIx.keys[5],
925
- orcaOpenPositionIx.keys[6],
926
- orcaOpenPositionIx.keys[7],
927
- orcaOpenPositionIx.keys[8],
928
- orcaOpenPositionIx.keys[9],
929
- orcaOpenPositionIx.keys[10],
930
- orcaOpenPositionIx.keys[11],
931
- orcaOpenPositionIx.keys[12],
932
- orcaOpenPositionIx.keys[13],
933
- orcaOpenPositionIx.keys[14],
934
- orcaOpenPositionIx.keys[15],
935
- orcaOpenPositionIx.keys[16],
936
- orcaOpenPositionIx.keys[17],
937
- orcaOpenPositionIx.keys[18],
931
+ extensionIx.keys[4],
932
+ extensionIx.keys[5],
933
+ extensionIx.keys[6],
934
+ extensionIx.keys[7],
935
+ extensionIx.keys[8],
936
+ extensionIx.keys[9],
937
+ extensionIx.keys[10],
938
+ extensionIx.keys[11],
939
+ extensionIx.keys[12],
940
+ extensionIx.keys[13],
941
+ extensionIx.keys[14],
942
+ extensionIx.keys[15],
943
+ extensionIx.keys[16],
944
+ extensionIx.keys[17],
945
+ extensionIx.keys[18],
938
946
  ])
939
947
  .instruction();
940
948
  const withdrawFromPda = yield (0, hawksight_1.withdrawMultipleToken)({
@@ -944,7 +952,8 @@ class Transactions {
944
952
  { mint: mintB },
945
953
  ],
946
954
  });
947
- const mainInstructions = [orcaOpenPositionIxViaMain, withdrawFromPda];
955
+ orcaIx.keys[2].isSigner = true; // authority must be signer.
956
+ const mainInstructions = [orcaIx, withdrawFromPda];
948
957
  return (0, functions_1.createTransactionMeta)({
949
958
  payer: params.userWallet,
950
959
  description: `Withdraw deposits from Orca Position: ${position}`,
@@ -993,7 +1002,7 @@ class Transactions {
993
1002
  }
994
1003
  }
995
1004
  whirlpoolData.rewardInfos[0].mint;
996
- const orcaOpenPositionIx = yield anchor_1.Anchor.instance().iyfExtension.methods
1005
+ const extensionIx = yield anchor_1.Anchor.instance().iyfExtension.methods
997
1006
  .orcaClaimRewards()
998
1007
  .accounts({
999
1008
  farm,
@@ -1018,8 +1027,8 @@ class Transactions {
1018
1027
  })
1019
1028
  .remainingAccounts(remainingAccounts)
1020
1029
  .instruction();
1021
- const orcaOpenPositionIxViaMain = yield anchor_1.Anchor.instance().iyfMain.methods
1022
- .iyfExtensionExecute(orcaOpenPositionIx.data)
1030
+ const orcaIx = yield anchor_1.Anchor.instance().iyfMain.methods
1031
+ .iyfExtensionExecute(extensionIx.data)
1023
1032
  .accounts({
1024
1033
  farm,
1025
1034
  userPda,
@@ -1028,21 +1037,21 @@ class Transactions {
1028
1037
  iyfExtensionProgram: addresses_1.IYF_EXTENSION,
1029
1038
  })
1030
1039
  .remainingAccounts([
1031
- orcaOpenPositionIx.keys[4],
1032
- orcaOpenPositionIx.keys[5],
1033
- orcaOpenPositionIx.keys[6],
1034
- orcaOpenPositionIx.keys[7],
1035
- orcaOpenPositionIx.keys[8],
1036
- orcaOpenPositionIx.keys[9],
1037
- orcaOpenPositionIx.keys[10],
1038
- orcaOpenPositionIx.keys[11],
1039
- orcaOpenPositionIx.keys[12],
1040
- orcaOpenPositionIx.keys[13],
1041
- orcaOpenPositionIx.keys[14],
1042
- orcaOpenPositionIx.keys[15],
1043
- orcaOpenPositionIx.keys[16],
1044
- orcaOpenPositionIx.keys[17],
1045
- orcaOpenPositionIx.keys[18],
1040
+ extensionIx.keys[4],
1041
+ extensionIx.keys[5],
1042
+ extensionIx.keys[6],
1043
+ extensionIx.keys[7],
1044
+ extensionIx.keys[8],
1045
+ extensionIx.keys[9],
1046
+ extensionIx.keys[10],
1047
+ extensionIx.keys[11],
1048
+ extensionIx.keys[12],
1049
+ extensionIx.keys[13],
1050
+ extensionIx.keys[14],
1051
+ extensionIx.keys[15],
1052
+ extensionIx.keys[16],
1053
+ extensionIx.keys[17],
1054
+ extensionIx.keys[18],
1046
1055
  ])
1047
1056
  .instruction();
1048
1057
  const withdrawFromPda = yield (0, hawksight_1.withdrawMultipleToken)({
@@ -1052,7 +1061,8 @@ class Transactions {
1052
1061
  { mint: mintB },
1053
1062
  ],
1054
1063
  });
1055
- const mainInstructions = [orcaOpenPositionIxViaMain, withdrawFromPda];
1064
+ orcaIx.keys[2].isSigner = true; // authority must be signer.
1065
+ const mainInstructions = [orcaIx, withdrawFromPda];
1056
1066
  return (0, functions_1.createTransactionMeta)({
1057
1067
  payer: params.userWallet,
1058
1068
  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,mBA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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 {