@crypticdot/defituna-client 3.5.4 → 3.5.6

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/index.js CHANGED
@@ -73,13 +73,13 @@ function decodeLendingPosition(encodedAccount) {
73
73
  getLendingPositionDecoder()
74
74
  );
75
75
  }
76
- async function fetchLendingPosition(rpc, address4, config) {
77
- const maybeAccount = await fetchMaybeLendingPosition(rpc, address4, config);
76
+ async function fetchLendingPosition(rpc, address8, config) {
77
+ const maybeAccount = await fetchMaybeLendingPosition(rpc, address8, config);
78
78
  assertAccountExists(maybeAccount);
79
79
  return maybeAccount;
80
80
  }
81
- async function fetchMaybeLendingPosition(rpc, address4, config) {
82
- const maybeAccount = await fetchEncodedAccount(rpc, address4, config);
81
+ async function fetchMaybeLendingPosition(rpc, address8, config) {
82
+ const maybeAccount = await fetchEncodedAccount(rpc, address8, config);
83
83
  return decodeLendingPosition(maybeAccount);
84
84
  }
85
85
  async function fetchAllLendingPosition(rpc, addresses, config) {
@@ -359,13 +359,13 @@ function decodeMarket(encodedAccount) {
359
359
  getMarketDecoder()
360
360
  );
361
361
  }
362
- async function fetchMarket(rpc, address4, config) {
363
- const maybeAccount = await fetchMaybeMarket(rpc, address4, config);
362
+ async function fetchMarket(rpc, address8, config) {
363
+ const maybeAccount = await fetchMaybeMarket(rpc, address8, config);
364
364
  assertAccountExists2(maybeAccount);
365
365
  return maybeAccount;
366
366
  }
367
- async function fetchMaybeMarket(rpc, address4, config) {
368
- const maybeAccount = await fetchEncodedAccount2(rpc, address4, config);
367
+ async function fetchMaybeMarket(rpc, address8, config) {
368
+ const maybeAccount = await fetchEncodedAccount2(rpc, address8, config);
369
369
  return decodeMarket(maybeAccount);
370
370
  }
371
371
  async function fetchAllMarket(rpc, addresses, config) {
@@ -476,13 +476,13 @@ function decodeTunaConfig(encodedAccount) {
476
476
  getTunaConfigDecoder()
477
477
  );
478
478
  }
479
- async function fetchTunaConfig(rpc, address4, config) {
480
- const maybeAccount = await fetchMaybeTunaConfig(rpc, address4, config);
479
+ async function fetchTunaConfig(rpc, address8, config) {
480
+ const maybeAccount = await fetchMaybeTunaConfig(rpc, address8, config);
481
481
  assertAccountExists3(maybeAccount);
482
482
  return maybeAccount;
483
483
  }
484
- async function fetchMaybeTunaConfig(rpc, address4, config) {
485
- const maybeAccount = await fetchEncodedAccount3(rpc, address4, config);
484
+ async function fetchMaybeTunaConfig(rpc, address8, config) {
485
+ const maybeAccount = await fetchEncodedAccount3(rpc, address8, config);
486
486
  return decodeTunaConfig(maybeAccount);
487
487
  }
488
488
  async function fetchAllTunaConfig(rpc, addresses, config) {
@@ -625,13 +625,13 @@ function decodeTunaLpPosition(encodedAccount) {
625
625
  getTunaLpPositionDecoder()
626
626
  );
627
627
  }
628
- async function fetchTunaLpPosition(rpc, address4, config) {
629
- const maybeAccount = await fetchMaybeTunaLpPosition(rpc, address4, config);
628
+ async function fetchTunaLpPosition(rpc, address8, config) {
629
+ const maybeAccount = await fetchMaybeTunaLpPosition(rpc, address8, config);
630
630
  assertAccountExists4(maybeAccount);
631
631
  return maybeAccount;
632
632
  }
633
- async function fetchMaybeTunaLpPosition(rpc, address4, config) {
634
- const maybeAccount = await fetchEncodedAccount4(rpc, address4, config);
633
+ async function fetchMaybeTunaLpPosition(rpc, address8, config) {
634
+ const maybeAccount = await fetchEncodedAccount4(rpc, address8, config);
635
635
  return decodeTunaLpPosition(maybeAccount);
636
636
  }
637
637
  async function fetchAllTunaLpPosition(rpc, addresses, config) {
@@ -753,13 +753,13 @@ function decodeTunaSpotPosition(encodedAccount) {
753
753
  getTunaSpotPositionDecoder()
754
754
  );
755
755
  }
756
- async function fetchTunaSpotPosition(rpc, address4, config) {
757
- const maybeAccount = await fetchMaybeTunaSpotPosition(rpc, address4, config);
756
+ async function fetchTunaSpotPosition(rpc, address8, config) {
757
+ const maybeAccount = await fetchMaybeTunaSpotPosition(rpc, address8, config);
758
758
  assertAccountExists5(maybeAccount);
759
759
  return maybeAccount;
760
760
  }
761
- async function fetchMaybeTunaSpotPosition(rpc, address4, config) {
762
- const maybeAccount = await fetchEncodedAccount5(rpc, address4, config);
761
+ async function fetchMaybeTunaSpotPosition(rpc, address8, config) {
762
+ const maybeAccount = await fetchEncodedAccount5(rpc, address8, config);
763
763
  return decodeTunaSpotPosition(maybeAccount);
764
764
  }
765
765
  async function fetchAllTunaSpotPosition(rpc, addresses, config) {
@@ -870,13 +870,13 @@ function decodeVault(encodedAccount) {
870
870
  getVaultDecoder()
871
871
  );
872
872
  }
873
- async function fetchVault(rpc, address4, config) {
874
- const maybeAccount = await fetchMaybeVault(rpc, address4, config);
873
+ async function fetchVault(rpc, address8, config) {
874
+ const maybeAccount = await fetchMaybeVault(rpc, address8, config);
875
875
  assertAccountExists6(maybeAccount);
876
876
  return maybeAccount;
877
877
  }
878
- async function fetchMaybeVault(rpc, address4, config) {
879
- const maybeAccount = await fetchEncodedAccount6(rpc, address4, config);
878
+ async function fetchMaybeVault(rpc, address8, config) {
879
+ const maybeAccount = await fetchEncodedAccount6(rpc, address8, config);
880
880
  return decodeVault(maybeAccount);
881
881
  }
882
882
  async function fetchAllVault(rpc, addresses, config) {
@@ -9805,47 +9805,47 @@ async function fetchDecodedProgramAccounts(rpc, programAddress, filters, decoder
9805
9805
  }
9806
9806
 
9807
9807
  // src/gpa/tunaLpPosition.ts
9808
- function tunaLpPositionAuthorityFilter(address4) {
9808
+ function tunaLpPositionAuthorityFilter(address8) {
9809
9809
  return {
9810
9810
  memcmp: {
9811
9811
  offset: 11n,
9812
- bytes: getBase58Decoder().decode(getAddressEncoder19().encode(address4)),
9812
+ bytes: getBase58Decoder().decode(getAddressEncoder19().encode(address8)),
9813
9813
  encoding: "base58"
9814
9814
  }
9815
9815
  };
9816
9816
  }
9817
- function tunaLpPositionPoolFilter(address4) {
9817
+ function tunaLpPositionPoolFilter(address8) {
9818
9818
  return {
9819
9819
  memcmp: {
9820
9820
  offset: 43n,
9821
- bytes: getBase58Decoder().decode(getAddressEncoder19().encode(address4)),
9821
+ bytes: getBase58Decoder().decode(getAddressEncoder19().encode(address8)),
9822
9822
  encoding: "base58"
9823
9823
  }
9824
9824
  };
9825
9825
  }
9826
- function tunaLpPositionMintAFilter(address4) {
9826
+ function tunaLpPositionMintAFilter(address8) {
9827
9827
  return {
9828
9828
  memcmp: {
9829
9829
  offset: 75n,
9830
- bytes: getBase58Decoder().decode(getAddressEncoder19().encode(address4)),
9830
+ bytes: getBase58Decoder().decode(getAddressEncoder19().encode(address8)),
9831
9831
  encoding: "base58"
9832
9832
  }
9833
9833
  };
9834
9834
  }
9835
- function tunaLpPositionMintBFilter(address4) {
9835
+ function tunaLpPositionMintBFilter(address8) {
9836
9836
  return {
9837
9837
  memcmp: {
9838
9838
  offset: 107n,
9839
- bytes: getBase58Decoder().decode(getAddressEncoder19().encode(address4)),
9839
+ bytes: getBase58Decoder().decode(getAddressEncoder19().encode(address8)),
9840
9840
  encoding: "base58"
9841
9841
  }
9842
9842
  };
9843
9843
  }
9844
- function tunaLpPositionMintFilter(address4) {
9844
+ function tunaLpPositionMintFilter(address8) {
9845
9845
  return {
9846
9846
  memcmp: {
9847
9847
  offset: 139n,
9848
- bytes: getBase58Decoder().decode(getAddressEncoder19().encode(address4)),
9848
+ bytes: getBase58Decoder().decode(getAddressEncoder19().encode(address8)),
9849
9849
  encoding: "base58"
9850
9850
  }
9851
9851
  };
@@ -9881,38 +9881,38 @@ import {
9881
9881
  getAddressEncoder as getAddressEncoder20,
9882
9882
  getBase58Decoder as getBase58Decoder2
9883
9883
  } from "@solana/kit";
9884
- function tunaSpotPositionAuthorityFilter(address4) {
9884
+ function tunaSpotPositionAuthorityFilter(address8) {
9885
9885
  return {
9886
9886
  memcmp: {
9887
9887
  offset: 11n,
9888
- bytes: getBase58Decoder2().decode(getAddressEncoder20().encode(address4)),
9888
+ bytes: getBase58Decoder2().decode(getAddressEncoder20().encode(address8)),
9889
9889
  encoding: "base58"
9890
9890
  }
9891
9891
  };
9892
9892
  }
9893
- function tunaSpotPositionPoolFilter(address4) {
9893
+ function tunaSpotPositionPoolFilter(address8) {
9894
9894
  return {
9895
9895
  memcmp: {
9896
9896
  offset: 43n,
9897
- bytes: getBase58Decoder2().decode(getAddressEncoder20().encode(address4)),
9897
+ bytes: getBase58Decoder2().decode(getAddressEncoder20().encode(address8)),
9898
9898
  encoding: "base58"
9899
9899
  }
9900
9900
  };
9901
9901
  }
9902
- function tunaSpotPositionMintAFilter(address4) {
9902
+ function tunaSpotPositionMintAFilter(address8) {
9903
9903
  return {
9904
9904
  memcmp: {
9905
9905
  offset: 75n,
9906
- bytes: getBase58Decoder2().decode(getAddressEncoder20().encode(address4)),
9906
+ bytes: getBase58Decoder2().decode(getAddressEncoder20().encode(address8)),
9907
9907
  encoding: "base58"
9908
9908
  }
9909
9909
  };
9910
9910
  }
9911
- function tunaSpotPositionMintBFilter(address4) {
9911
+ function tunaSpotPositionMintBFilter(address8) {
9912
9912
  return {
9913
9913
  memcmp: {
9914
9914
  offset: 107n,
9915
- bytes: getBase58Decoder2().decode(getAddressEncoder20().encode(address4)),
9915
+ bytes: getBase58Decoder2().decode(getAddressEncoder20().encode(address8)),
9916
9916
  encoding: "base58"
9917
9917
  }
9918
9918
  };
@@ -9939,29 +9939,29 @@ import {
9939
9939
  getAddressEncoder as getAddressEncoder21,
9940
9940
  getBase58Decoder as getBase58Decoder3
9941
9941
  } from "@solana/kit";
9942
- function lendingPositionAuthorityFilter(address4) {
9942
+ function lendingPositionAuthorityFilter(address8) {
9943
9943
  return {
9944
9944
  memcmp: {
9945
9945
  offset: 11n,
9946
- bytes: getBase58Decoder3().decode(getAddressEncoder21().encode(address4)),
9946
+ bytes: getBase58Decoder3().decode(getAddressEncoder21().encode(address8)),
9947
9947
  encoding: "base58"
9948
9948
  }
9949
9949
  };
9950
9950
  }
9951
- function lendingPositionMintFilter(address4) {
9951
+ function lendingPositionMintFilter(address8) {
9952
9952
  return {
9953
9953
  memcmp: {
9954
9954
  offset: 43n,
9955
- bytes: getBase58Decoder3().decode(getAddressEncoder21().encode(address4)),
9955
+ bytes: getBase58Decoder3().decode(getAddressEncoder21().encode(address8)),
9956
9956
  encoding: "base58"
9957
9957
  }
9958
9958
  };
9959
9959
  }
9960
- function lendingPositionVaultFilter(address4) {
9960
+ function lendingPositionVaultFilter(address8) {
9961
9961
  return {
9962
9962
  memcmp: {
9963
9963
  offset: 91n,
9964
- bytes: getBase58Decoder3().decode(getAddressEncoder21().encode(address4)),
9964
+ bytes: getBase58Decoder3().decode(getAddressEncoder21().encode(address8)),
9965
9965
  encoding: "base58"
9966
9966
  }
9967
9967
  };
@@ -13587,6 +13587,10 @@ async function liquidateTunaSpotPositionOrcaInstruction(authority, tunaPosition,
13587
13587
 
13588
13588
  // src/txbuilder/openTunaLpPositionOrca.ts
13589
13589
  import { fetchMaybeWhirlpool as fetchMaybeWhirlpool6, getPositionAddress as getPositionAddress13, WHIRLPOOL_PROGRAM_ADDRESS as WHIRLPOOL_PROGRAM_ADDRESS9 } from "@orca-so/whirlpools-client";
13590
+ import {
13591
+ AccountRole as AccountRole15,
13592
+ address as address3
13593
+ } from "@solana/kit";
13590
13594
  import {
13591
13595
  ASSOCIATED_TOKEN_PROGRAM_ADDRESS,
13592
13596
  fetchAllMaybeMint as fetchAllMaybeMint15,
@@ -13659,85 +13663,94 @@ async function openTunaLpPositionOrcaInstruction(rpc, authority, positionMint, w
13659
13663
  ...args
13660
13664
  });
13661
13665
  }
13662
- function getOpenTunaLpPositionOrcaInstructionWithEphemeralSigner(input, config) {
13663
- const programAddress = config?.programAddress ?? TUNA_PROGRAM_ADDRESS;
13664
- const originalAccounts = {
13665
- authority: { value: input.authority ?? null, isWritable: true },
13666
- mintA: { value: input.mintA ?? null, isWritable: false },
13667
- mintB: { value: input.mintB ?? null, isWritable: false },
13668
- market: { value: input.market ?? null, isWritable: false },
13669
- tunaPosition: { value: input.tunaPosition ?? null, isWritable: true },
13670
- tunaPositionMint: {
13671
- value: input.tunaPositionMint ?? null,
13672
- isWritable: true
13673
- },
13674
- tunaPositionAta: { value: input.tunaPositionAta ?? null, isWritable: true },
13675
- tunaPositionAtaA: {
13676
- value: input.tunaPositionAtaA ?? null,
13677
- isWritable: true
13678
- },
13679
- tunaPositionAtaB: {
13680
- value: input.tunaPositionAtaB ?? null,
13681
- isWritable: true
13682
- },
13683
- whirlpoolProgram: {
13684
- value: input.whirlpoolProgram ?? null,
13685
- isWritable: false
13686
- },
13687
- whirlpool: { value: input.whirlpool ?? null, isWritable: false },
13688
- orcaPosition: { value: input.orcaPosition ?? null, isWritable: true },
13689
- metadataUpdateAuth: {
13690
- value: input.metadataUpdateAuth ?? null,
13691
- isWritable: false
13692
- },
13693
- tokenProgramA: { value: input.tokenProgramA ?? null, isWritable: false },
13694
- tokenProgramB: { value: input.tokenProgramB ?? null, isWritable: false },
13695
- token2022Program: {
13696
- value: input.token2022Program ?? null,
13697
- isWritable: false
13698
- },
13699
- systemProgram: { value: input.systemProgram ?? null, isWritable: false },
13700
- associatedTokenProgram: {
13701
- value: input.associatedTokenProgram ?? null,
13702
- isWritable: false
13703
- }
13704
- };
13705
- const accounts = originalAccounts;
13706
- const args = { ...input };
13707
- if (!accounts.systemProgram.value) {
13708
- accounts.systemProgram.value = "11111111111111111111111111111111";
13709
- }
13710
- const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
13711
- const instruction = {
13666
+ function getOpenTunaLpPositionOrcaInstructionWithEphemeralSigner(input) {
13667
+ return {
13712
13668
  accounts: [
13713
- getAccountMeta(accounts.authority),
13714
- getAccountMeta(accounts.mintA),
13715
- getAccountMeta(accounts.mintB),
13716
- getAccountMeta(accounts.market),
13717
- getAccountMeta(accounts.tunaPosition),
13718
- getAccountMeta(accounts.tunaPositionMint),
13719
- getAccountMeta(accounts.tunaPositionAta),
13720
- getAccountMeta(accounts.tunaPositionAtaA),
13721
- getAccountMeta(accounts.tunaPositionAtaB),
13722
- getAccountMeta(accounts.whirlpoolProgram),
13723
- getAccountMeta(accounts.whirlpool),
13724
- getAccountMeta(accounts.orcaPosition),
13725
- getAccountMeta(accounts.metadataUpdateAuth),
13726
- getAccountMeta(accounts.tokenProgramA),
13727
- getAccountMeta(accounts.tokenProgramB),
13728
- getAccountMeta(accounts.token2022Program),
13729
- getAccountMeta(accounts.systemProgram),
13730
- getAccountMeta(accounts.associatedTokenProgram)
13669
+ {
13670
+ address: input.authority.address,
13671
+ role: AccountRole15.WRITABLE_SIGNER
13672
+ },
13673
+ {
13674
+ address: input.mintA,
13675
+ role: AccountRole15.READONLY
13676
+ },
13677
+ {
13678
+ address: input.mintB,
13679
+ role: AccountRole15.READONLY
13680
+ },
13681
+ {
13682
+ address: input.tokenProgramA,
13683
+ role: AccountRole15.READONLY
13684
+ },
13685
+ {
13686
+ address: input.tokenProgramB,
13687
+ role: AccountRole15.READONLY
13688
+ },
13689
+ {
13690
+ address: input.market,
13691
+ role: AccountRole15.READONLY
13692
+ },
13693
+ {
13694
+ address: input.tunaPosition,
13695
+ role: AccountRole15.WRITABLE
13696
+ },
13697
+ {
13698
+ address: input.tunaPositionMint,
13699
+ role: AccountRole15.WRITABLE_SIGNER
13700
+ },
13701
+ {
13702
+ address: input.tunaPositionAta,
13703
+ role: AccountRole15.WRITABLE
13704
+ },
13705
+ {
13706
+ address: input.tunaPositionAtaA,
13707
+ role: AccountRole15.WRITABLE
13708
+ },
13709
+ {
13710
+ address: input.tunaPositionAtaB,
13711
+ role: AccountRole15.WRITABLE
13712
+ },
13713
+ {
13714
+ address: input.whirlpoolProgram,
13715
+ role: AccountRole15.READONLY
13716
+ },
13717
+ {
13718
+ address: input.whirlpool,
13719
+ role: AccountRole15.READONLY
13720
+ },
13721
+ {
13722
+ address: input.orcaPosition,
13723
+ role: AccountRole15.WRITABLE
13724
+ },
13725
+ {
13726
+ address: input.metadataUpdateAuth,
13727
+ role: AccountRole15.READONLY
13728
+ },
13729
+ {
13730
+ address: input.token2022Program,
13731
+ role: AccountRole15.READONLY
13732
+ },
13733
+ {
13734
+ address: input.systemProgram ?? address3("11111111111111111111111111111111"),
13735
+ role: AccountRole15.READONLY
13736
+ },
13737
+ {
13738
+ address: input.associatedTokenProgram,
13739
+ role: AccountRole15.READONLY
13740
+ }
13731
13741
  ],
13732
- programAddress,
13733
- data: getOpenTunaLpPositionOrcaInstructionDataEncoder().encode(args)
13742
+ programAddress: TUNA_PROGRAM_ADDRESS,
13743
+ data: getOpenTunaLpPositionOrcaInstructionDataEncoder().encode(input)
13734
13744
  };
13735
- return instruction;
13736
13745
  }
13737
13746
 
13738
13747
  // src/txbuilder/openTunaLpPositionFusion.ts
13739
13748
  import { fetchMaybeFusionPool as fetchMaybeFusionPool6, FUSIONAMM_PROGRAM_ADDRESS as FUSIONAMM_PROGRAM_ADDRESS9, getPositionAddress as getPositionAddress14 } from "@crypticdot/fusionamm-client";
13740
13749
  import { FP_NFT_UPDATE_AUTH } from "@crypticdot/fusionamm-client";
13750
+ import {
13751
+ AccountRole as AccountRole16,
13752
+ address as address4
13753
+ } from "@solana/kit";
13741
13754
  import {
13742
13755
  ASSOCIATED_TOKEN_PROGRAM_ADDRESS as ASSOCIATED_TOKEN_PROGRAM_ADDRESS2,
13743
13756
  fetchAllMaybeMint as fetchAllMaybeMint16,
@@ -13810,82 +13823,87 @@ async function openTunaLpPositionFusionInstruction(rpc, authority, positionMint,
13810
13823
  ...args
13811
13824
  });
13812
13825
  }
13813
- function getOpenTunaLpPositionFusionInstructionWithEphemeralSigner(input, config) {
13814
- const programAddress = config?.programAddress ?? TUNA_PROGRAM_ADDRESS;
13815
- const originalAccounts = {
13816
- authority: { value: input.authority ?? null, isWritable: true },
13817
- mintA: { value: input.mintA ?? null, isWritable: false },
13818
- mintB: { value: input.mintB ?? null, isWritable: false },
13819
- tokenProgramA: { value: input.tokenProgramA ?? null, isWritable: false },
13820
- tokenProgramB: { value: input.tokenProgramB ?? null, isWritable: false },
13821
- market: { value: input.market ?? null, isWritable: false },
13822
- tunaPosition: { value: input.tunaPosition ?? null, isWritable: true },
13823
- tunaPositionMint: {
13824
- value: input.tunaPositionMint ?? null,
13825
- isWritable: true
13826
- },
13827
- tunaPositionAta: { value: input.tunaPositionAta ?? null, isWritable: true },
13828
- tunaPositionAtaA: {
13829
- value: input.tunaPositionAtaA ?? null,
13830
- isWritable: true
13831
- },
13832
- tunaPositionAtaB: {
13833
- value: input.tunaPositionAtaB ?? null,
13834
- isWritable: true
13835
- },
13836
- fusionammProgram: {
13837
- value: input.fusionammProgram ?? null,
13838
- isWritable: false
13839
- },
13840
- fusionPool: { value: input.fusionPool ?? null, isWritable: false },
13841
- fusionPosition: { value: input.fusionPosition ?? null, isWritable: true },
13842
- metadataUpdateAuth: {
13843
- value: input.metadataUpdateAuth ?? null,
13844
- isWritable: false
13845
- },
13846
- token2022Program: {
13847
- value: input.token2022Program ?? null,
13848
- isWritable: false
13849
- },
13850
- systemProgram: { value: input.systemProgram ?? null, isWritable: false },
13851
- associatedTokenProgram: {
13852
- value: input.associatedTokenProgram ?? null,
13853
- isWritable: false
13854
- }
13855
- };
13856
- const accounts = originalAccounts;
13857
- const args = { ...input };
13858
- if (!accounts.systemProgram.value) {
13859
- accounts.systemProgram.value = "11111111111111111111111111111111";
13860
- }
13861
- const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
13862
- const instruction = {
13826
+ function getOpenTunaLpPositionFusionInstructionWithEphemeralSigner(input) {
13827
+ return {
13863
13828
  accounts: [
13864
- getAccountMeta(accounts.authority),
13865
- getAccountMeta(accounts.mintA),
13866
- getAccountMeta(accounts.mintB),
13867
- getAccountMeta(accounts.tokenProgramA),
13868
- getAccountMeta(accounts.tokenProgramB),
13869
- getAccountMeta(accounts.market),
13870
- getAccountMeta(accounts.tunaPosition),
13871
- getAccountMeta(accounts.tunaPositionMint),
13872
- getAccountMeta(accounts.tunaPositionAta),
13873
- getAccountMeta(accounts.tunaPositionAtaA),
13874
- getAccountMeta(accounts.tunaPositionAtaB),
13875
- getAccountMeta(accounts.fusionammProgram),
13876
- getAccountMeta(accounts.fusionPool),
13877
- getAccountMeta(accounts.fusionPosition),
13878
- getAccountMeta(accounts.metadataUpdateAuth),
13879
- getAccountMeta(accounts.token2022Program),
13880
- getAccountMeta(accounts.systemProgram),
13881
- getAccountMeta(accounts.associatedTokenProgram)
13829
+ {
13830
+ address: input.authority.address,
13831
+ role: AccountRole16.WRITABLE_SIGNER
13832
+ },
13833
+ {
13834
+ address: input.mintA,
13835
+ role: AccountRole16.READONLY
13836
+ },
13837
+ {
13838
+ address: input.mintB,
13839
+ role: AccountRole16.READONLY
13840
+ },
13841
+ {
13842
+ address: input.tokenProgramA,
13843
+ role: AccountRole16.READONLY
13844
+ },
13845
+ {
13846
+ address: input.tokenProgramB,
13847
+ role: AccountRole16.READONLY
13848
+ },
13849
+ {
13850
+ address: input.market,
13851
+ role: AccountRole16.READONLY
13852
+ },
13853
+ {
13854
+ address: input.tunaPosition,
13855
+ role: AccountRole16.WRITABLE
13856
+ },
13857
+ {
13858
+ address: input.tunaPositionMint,
13859
+ role: AccountRole16.WRITABLE_SIGNER
13860
+ },
13861
+ {
13862
+ address: input.tunaPositionAta,
13863
+ role: AccountRole16.WRITABLE
13864
+ },
13865
+ {
13866
+ address: input.tunaPositionAtaA,
13867
+ role: AccountRole16.WRITABLE
13868
+ },
13869
+ {
13870
+ address: input.tunaPositionAtaB,
13871
+ role: AccountRole16.WRITABLE
13872
+ },
13873
+ {
13874
+ address: input.fusionammProgram,
13875
+ role: AccountRole16.READONLY
13876
+ },
13877
+ {
13878
+ address: input.fusionPool,
13879
+ role: AccountRole16.READONLY
13880
+ },
13881
+ {
13882
+ address: input.fusionPosition,
13883
+ role: AccountRole16.WRITABLE
13884
+ },
13885
+ {
13886
+ address: input.metadataUpdateAuth,
13887
+ role: AccountRole16.READONLY
13888
+ },
13889
+ {
13890
+ address: input.token2022Program,
13891
+ role: AccountRole16.READONLY
13892
+ },
13893
+ {
13894
+ address: input.systemProgram ?? address4("11111111111111111111111111111111"),
13895
+ role: AccountRole16.READONLY
13896
+ },
13897
+ {
13898
+ address: input.associatedTokenProgram,
13899
+ role: AccountRole16.READONLY
13900
+ }
13882
13901
  ],
13883
- programAddress,
13902
+ programAddress: TUNA_PROGRAM_ADDRESS,
13884
13903
  data: getOpenTunaLpPositionFusionInstructionDataEncoder().encode(
13885
- args
13904
+ input
13886
13905
  )
13887
13906
  };
13888
- return instruction;
13889
13907
  }
13890
13908
 
13891
13909
  // src/txbuilder/openAndIncreaseTunaLpPositionOrca.ts
@@ -13901,7 +13919,8 @@ import {
13901
13919
  } from "@orca-so/whirlpools-client";
13902
13920
  import { getTickArrayStartTickIndex as getTickArrayStartTickIndex6 } from "@orca-so/whirlpools-core";
13903
13921
  import {
13904
- AccountRole as AccountRole15,
13922
+ AccountRole as AccountRole17,
13923
+ address as address5,
13905
13924
  lamports
13906
13925
  } from "@solana/kit";
13907
13926
  import { fetchSysvarRent } from "@solana/sysvars";
@@ -14078,16 +14097,16 @@ async function openAndIncreaseTunaLpPositionOrcaInstruction(authority, positionM
14078
14097
  const lowerTickArrayAddress = await OrcaUtils.getTickArrayAddressFromTickIndex(whirlpool, args.tickLowerIndex);
14079
14098
  const upperTickArrayAddress = await OrcaUtils.getTickArrayAddressFromTickIndex(whirlpool, args.tickUpperIndex);
14080
14099
  const remainingAccounts = [
14081
- { address: swapTickArrays[0], role: AccountRole15.WRITABLE },
14082
- { address: swapTickArrays[1], role: AccountRole15.WRITABLE },
14083
- { address: swapTickArrays[2], role: AccountRole15.WRITABLE },
14084
- { address: swapTickArrays[3], role: AccountRole15.WRITABLE },
14085
- { address: swapTickArrays[4], role: AccountRole15.WRITABLE },
14086
- { address: lowerTickArrayAddress, role: AccountRole15.WRITABLE },
14087
- { address: upperTickArrayAddress, role: AccountRole15.WRITABLE },
14088
- { address: whirlpool.data.tokenVaultA, role: AccountRole15.WRITABLE },
14089
- { address: whirlpool.data.tokenVaultB, role: AccountRole15.WRITABLE },
14090
- { address: orcaOracleAddress, role: AccountRole15.WRITABLE }
14100
+ { address: swapTickArrays[0], role: AccountRole17.WRITABLE },
14101
+ { address: swapTickArrays[1], role: AccountRole17.WRITABLE },
14102
+ { address: swapTickArrays[2], role: AccountRole17.WRITABLE },
14103
+ { address: swapTickArrays[3], role: AccountRole17.WRITABLE },
14104
+ { address: swapTickArrays[4], role: AccountRole17.WRITABLE },
14105
+ { address: lowerTickArrayAddress, role: AccountRole17.WRITABLE },
14106
+ { address: upperTickArrayAddress, role: AccountRole17.WRITABLE },
14107
+ { address: whirlpool.data.tokenVaultA, role: AccountRole17.WRITABLE },
14108
+ { address: whirlpool.data.tokenVaultB, role: AccountRole17.WRITABLE },
14109
+ { address: orcaOracleAddress, role: AccountRole17.WRITABLE }
14091
14110
  ];
14092
14111
  const remainingAccountsInfo = {
14093
14112
  slices: [
@@ -14164,127 +14183,138 @@ async function openAndIncreaseTunaLpPositionOrcaInstruction(authority, positionM
14164
14183
  ...args,
14165
14184
  remainingAccountsInfo
14166
14185
  });
14167
- ix.accounts.push(...remainingAccounts);
14168
- return ix;
14169
- }
14170
- function getOpenAndIncreaseTunaLpPositionOrcaInstructionWithEphemeralSigner(input, config) {
14171
- const programAddress = config?.programAddress ?? TUNA_PROGRAM_ADDRESS;
14172
- const originalAccounts = {
14173
- authority: { value: input.authority ?? null, isWritable: true },
14174
- tunaConfig: { value: input.tunaConfig ?? null, isWritable: false },
14175
- mintA: { value: input.mintA ?? null, isWritable: false },
14176
- mintB: { value: input.mintB ?? null, isWritable: false },
14177
- market: { value: input.market ?? null, isWritable: true },
14178
- vaultA: { value: input.vaultA ?? null, isWritable: true },
14179
- vaultB: { value: input.vaultB ?? null, isWritable: true },
14180
- vaultAAta: { value: input.vaultAAta ?? null, isWritable: true },
14181
- vaultBAta: { value: input.vaultBAta ?? null, isWritable: true },
14182
- tunaPosition: { value: input.tunaPosition ?? null, isWritable: true },
14183
- tunaPositionMint: {
14184
- value: input.tunaPositionMint ?? null,
14185
- isWritable: true
14186
- },
14187
- tunaPositionAta: { value: input.tunaPositionAta ?? null, isWritable: true },
14188
- tunaPositionAtaA: {
14189
- value: input.tunaPositionAtaA ?? null,
14190
- isWritable: true
14191
- },
14192
- tunaPositionAtaB: {
14193
- value: input.tunaPositionAtaB ?? null,
14194
- isWritable: true
14195
- },
14196
- tunaPositionOwnerAtaA: {
14197
- value: input.tunaPositionOwnerAtaA ?? null,
14198
- isWritable: true
14199
- },
14200
- tunaPositionOwnerAtaB: {
14201
- value: input.tunaPositionOwnerAtaB ?? null,
14202
- isWritable: true
14203
- },
14204
- feeRecipientAtaA: {
14205
- value: input.feeRecipientAtaA ?? null,
14206
- isWritable: true
14207
- },
14208
- feeRecipientAtaB: {
14209
- value: input.feeRecipientAtaB ?? null,
14210
- isWritable: true
14211
- },
14212
- pythOraclePriceFeedA: {
14213
- value: input.pythOraclePriceFeedA ?? null,
14214
- isWritable: false
14215
- },
14216
- pythOraclePriceFeedB: {
14217
- value: input.pythOraclePriceFeedB ?? null,
14218
- isWritable: false
14219
- },
14220
- whirlpoolProgram: {
14221
- value: input.whirlpoolProgram ?? null,
14222
- isWritable: false
14223
- },
14224
- whirlpool: { value: input.whirlpool ?? null, isWritable: true },
14225
- orcaPosition: { value: input.orcaPosition ?? null, isWritable: true },
14226
- tokenProgramA: { value: input.tokenProgramA ?? null, isWritable: false },
14227
- tokenProgramB: { value: input.tokenProgramB ?? null, isWritable: false },
14228
- metadataUpdateAuth: {
14229
- value: input.metadataUpdateAuth ?? null,
14230
- isWritable: false
14231
- },
14232
- memoProgram: { value: input.memoProgram ?? null, isWritable: false },
14233
- token2022Program: {
14234
- value: input.token2022Program ?? null,
14235
- isWritable: false
14236
- },
14237
- systemProgram: { value: input.systemProgram ?? null, isWritable: false },
14238
- associatedTokenProgram: {
14239
- value: input.associatedTokenProgram ?? null,
14240
- isWritable: false
14241
- }
14242
- };
14243
- const accounts = originalAccounts;
14244
- const args = { ...input };
14245
- if (!accounts.systemProgram.value) {
14246
- accounts.systemProgram.value = "11111111111111111111111111111111";
14247
- }
14248
- const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
14249
- const instruction = {
14250
- accounts: [
14251
- getAccountMeta(accounts.authority),
14252
- getAccountMeta(accounts.tunaConfig),
14253
- getAccountMeta(accounts.mintA),
14254
- getAccountMeta(accounts.mintB),
14255
- getAccountMeta(accounts.market),
14256
- getAccountMeta(accounts.vaultA),
14257
- getAccountMeta(accounts.vaultB),
14258
- getAccountMeta(accounts.vaultAAta),
14259
- getAccountMeta(accounts.vaultBAta),
14260
- getAccountMeta(accounts.tunaPosition),
14261
- getAccountMeta(accounts.tunaPositionMint),
14262
- getAccountMeta(accounts.tunaPositionAta),
14263
- getAccountMeta(accounts.tunaPositionAtaA),
14264
- getAccountMeta(accounts.tunaPositionAtaB),
14265
- getAccountMeta(accounts.tunaPositionOwnerAtaA),
14266
- getAccountMeta(accounts.tunaPositionOwnerAtaB),
14267
- getAccountMeta(accounts.feeRecipientAtaA),
14268
- getAccountMeta(accounts.feeRecipientAtaB),
14269
- getAccountMeta(accounts.pythOraclePriceFeedA),
14270
- getAccountMeta(accounts.pythOraclePriceFeedB),
14271
- getAccountMeta(accounts.whirlpoolProgram),
14272
- getAccountMeta(accounts.whirlpool),
14273
- getAccountMeta(accounts.orcaPosition),
14274
- getAccountMeta(accounts.tokenProgramA),
14275
- getAccountMeta(accounts.tokenProgramB),
14276
- getAccountMeta(accounts.metadataUpdateAuth),
14277
- getAccountMeta(accounts.memoProgram),
14278
- getAccountMeta(accounts.token2022Program),
14279
- getAccountMeta(accounts.systemProgram),
14280
- getAccountMeta(accounts.associatedTokenProgram)
14186
+ ix.accounts.push(...remainingAccounts);
14187
+ return ix;
14188
+ }
14189
+ function getOpenAndIncreaseTunaLpPositionOrcaInstructionWithEphemeralSigner(input) {
14190
+ return {
14191
+ accounts: [
14192
+ {
14193
+ address: input.authority.address,
14194
+ role: AccountRole17.WRITABLE_SIGNER
14195
+ },
14196
+ {
14197
+ address: input.tunaConfig,
14198
+ role: AccountRole17.READONLY
14199
+ },
14200
+ {
14201
+ address: input.mintA,
14202
+ role: AccountRole17.READONLY
14203
+ },
14204
+ {
14205
+ address: input.mintB,
14206
+ role: AccountRole17.READONLY
14207
+ },
14208
+ {
14209
+ address: input.market,
14210
+ role: AccountRole17.WRITABLE
14211
+ },
14212
+ {
14213
+ address: input.vaultA,
14214
+ role: AccountRole17.WRITABLE
14215
+ },
14216
+ {
14217
+ address: input.vaultB,
14218
+ role: AccountRole17.WRITABLE
14219
+ },
14220
+ {
14221
+ address: input.vaultAAta,
14222
+ role: AccountRole17.WRITABLE
14223
+ },
14224
+ {
14225
+ address: input.vaultBAta,
14226
+ role: AccountRole17.WRITABLE
14227
+ },
14228
+ {
14229
+ address: input.tunaPosition,
14230
+ role: AccountRole17.WRITABLE
14231
+ },
14232
+ {
14233
+ address: input.tunaPositionMint,
14234
+ role: AccountRole17.WRITABLE
14235
+ },
14236
+ {
14237
+ address: input.tunaPositionAta,
14238
+ role: AccountRole17.WRITABLE
14239
+ },
14240
+ {
14241
+ address: input.tunaPositionAtaA,
14242
+ role: AccountRole17.WRITABLE
14243
+ },
14244
+ {
14245
+ address: input.tunaPositionAtaB,
14246
+ role: AccountRole17.WRITABLE
14247
+ },
14248
+ {
14249
+ address: input.tunaPositionOwnerAtaA,
14250
+ role: AccountRole17.WRITABLE
14251
+ },
14252
+ {
14253
+ address: input.tunaPositionOwnerAtaB,
14254
+ role: AccountRole17.WRITABLE
14255
+ },
14256
+ {
14257
+ address: input.feeRecipientAtaA,
14258
+ role: AccountRole17.WRITABLE
14259
+ },
14260
+ {
14261
+ address: input.feeRecipientAtaB,
14262
+ role: AccountRole17.WRITABLE
14263
+ },
14264
+ {
14265
+ address: input.pythOraclePriceFeedA,
14266
+ role: AccountRole17.READONLY
14267
+ },
14268
+ {
14269
+ address: input.pythOraclePriceFeedB,
14270
+ role: AccountRole17.READONLY
14271
+ },
14272
+ {
14273
+ address: input.whirlpoolProgram,
14274
+ role: AccountRole17.READONLY
14275
+ },
14276
+ {
14277
+ address: input.whirlpool,
14278
+ role: AccountRole17.WRITABLE
14279
+ },
14280
+ {
14281
+ address: input.orcaPosition,
14282
+ role: AccountRole17.WRITABLE
14283
+ },
14284
+ {
14285
+ address: input.tokenProgramA,
14286
+ role: AccountRole17.READONLY
14287
+ },
14288
+ {
14289
+ address: input.tokenProgramB,
14290
+ role: AccountRole17.READONLY
14291
+ },
14292
+ {
14293
+ address: input.metadataUpdateAuth,
14294
+ role: AccountRole17.READONLY
14295
+ },
14296
+ {
14297
+ address: input.memoProgram,
14298
+ role: AccountRole17.READONLY
14299
+ },
14300
+ {
14301
+ address: input.token2022Program,
14302
+ role: AccountRole17.READONLY
14303
+ },
14304
+ {
14305
+ address: input.systemProgram ?? address5("11111111111111111111111111111111"),
14306
+ role: AccountRole17.READONLY
14307
+ },
14308
+ {
14309
+ address: input.associatedTokenProgram,
14310
+ role: AccountRole17.READONLY
14311
+ }
14281
14312
  ],
14282
- programAddress,
14313
+ programAddress: TUNA_PROGRAM_ADDRESS,
14283
14314
  data: getOpenAndIncreaseTunaLpPositionOrcaInstructionDataEncoder().encode(
14284
- args
14315
+ input
14285
14316
  )
14286
14317
  };
14287
- return instruction;
14288
14318
  }
14289
14319
 
14290
14320
  // src/txbuilder/openAndIncreaseTunaLpPositionFusion.ts
@@ -14300,7 +14330,8 @@ import {
14300
14330
  } from "@crypticdot/fusionamm-client";
14301
14331
  import { getTickArrayStartTickIndex as getTickArrayStartTickIndex7 } from "@crypticdot/fusionamm-core";
14302
14332
  import {
14303
- AccountRole as AccountRole16,
14333
+ AccountRole as AccountRole18,
14334
+ address as address6,
14304
14335
  lamports as lamports2
14305
14336
  } from "@solana/kit";
14306
14337
  import { fetchSysvarRent as fetchSysvarRent2 } from "@solana/sysvars";
@@ -14463,15 +14494,15 @@ async function openAndIncreaseTunaLpPositionFusionInstruction(authority, positio
14463
14494
  const lowerTickArrayAddress = await FusionUtils.getTickArrayAddressFromTickIndex(fusionPool, args.tickLowerIndex);
14464
14495
  const upperTickArrayAddress = await FusionUtils.getTickArrayAddressFromTickIndex(fusionPool, args.tickUpperIndex);
14465
14496
  const remainingAccounts = [
14466
- { address: swapTickArrays[0], role: AccountRole16.WRITABLE },
14467
- { address: swapTickArrays[1], role: AccountRole16.WRITABLE },
14468
- { address: swapTickArrays[2], role: AccountRole16.WRITABLE },
14469
- { address: swapTickArrays[3], role: AccountRole16.WRITABLE },
14470
- { address: swapTickArrays[4], role: AccountRole16.WRITABLE },
14471
- { address: lowerTickArrayAddress, role: AccountRole16.WRITABLE },
14472
- { address: upperTickArrayAddress, role: AccountRole16.WRITABLE },
14473
- { address: fusionPool.data.tokenVaultA, role: AccountRole16.WRITABLE },
14474
- { address: fusionPool.data.tokenVaultB, role: AccountRole16.WRITABLE }
14497
+ { address: swapTickArrays[0], role: AccountRole18.WRITABLE },
14498
+ { address: swapTickArrays[1], role: AccountRole18.WRITABLE },
14499
+ { address: swapTickArrays[2], role: AccountRole18.WRITABLE },
14500
+ { address: swapTickArrays[3], role: AccountRole18.WRITABLE },
14501
+ { address: swapTickArrays[4], role: AccountRole18.WRITABLE },
14502
+ { address: lowerTickArrayAddress, role: AccountRole18.WRITABLE },
14503
+ { address: upperTickArrayAddress, role: AccountRole18.WRITABLE },
14504
+ { address: fusionPool.data.tokenVaultA, role: AccountRole18.WRITABLE },
14505
+ { address: fusionPool.data.tokenVaultB, role: AccountRole18.WRITABLE }
14475
14506
  ];
14476
14507
  const remainingAccountsInfo = {
14477
14508
  slices: [
@@ -14550,124 +14581,135 @@ async function openAndIncreaseTunaLpPositionFusionInstruction(authority, positio
14550
14581
  ix.accounts.push(...remainingAccounts);
14551
14582
  return ix;
14552
14583
  }
14553
- function getOpenAndIncreaseTunaLpPositionFusionInstructionWithEphemeralSigner(input, config) {
14554
- const programAddress = config?.programAddress ?? TUNA_PROGRAM_ADDRESS;
14555
- const originalAccounts = {
14556
- authority: { value: input.authority ?? null, isWritable: true },
14557
- tunaConfig: { value: input.tunaConfig ?? null, isWritable: false },
14558
- mintA: { value: input.mintA ?? null, isWritable: false },
14559
- mintB: { value: input.mintB ?? null, isWritable: false },
14560
- tokenProgramA: { value: input.tokenProgramA ?? null, isWritable: false },
14561
- tokenProgramB: { value: input.tokenProgramB ?? null, isWritable: false },
14562
- market: { value: input.market ?? null, isWritable: true },
14563
- vaultA: { value: input.vaultA ?? null, isWritable: true },
14564
- vaultB: { value: input.vaultB ?? null, isWritable: true },
14565
- vaultAAta: { value: input.vaultAAta ?? null, isWritable: true },
14566
- vaultBAta: { value: input.vaultBAta ?? null, isWritable: true },
14567
- tunaPosition: { value: input.tunaPosition ?? null, isWritable: true },
14568
- tunaPositionMint: {
14569
- value: input.tunaPositionMint ?? null,
14570
- isWritable: true
14571
- },
14572
- tunaPositionAta: { value: input.tunaPositionAta ?? null, isWritable: true },
14573
- tunaPositionAtaA: {
14574
- value: input.tunaPositionAtaA ?? null,
14575
- isWritable: true
14576
- },
14577
- tunaPositionAtaB: {
14578
- value: input.tunaPositionAtaB ?? null,
14579
- isWritable: true
14580
- },
14581
- tunaPositionOwnerAtaA: {
14582
- value: input.tunaPositionOwnerAtaA ?? null,
14583
- isWritable: true
14584
- },
14585
- tunaPositionOwnerAtaB: {
14586
- value: input.tunaPositionOwnerAtaB ?? null,
14587
- isWritable: true
14588
- },
14589
- feeRecipientAtaA: {
14590
- value: input.feeRecipientAtaA ?? null,
14591
- isWritable: true
14592
- },
14593
- feeRecipientAtaB: {
14594
- value: input.feeRecipientAtaB ?? null,
14595
- isWritable: true
14596
- },
14597
- pythOraclePriceFeedA: {
14598
- value: input.pythOraclePriceFeedA ?? null,
14599
- isWritable: false
14600
- },
14601
- pythOraclePriceFeedB: {
14602
- value: input.pythOraclePriceFeedB ?? null,
14603
- isWritable: false
14604
- },
14605
- fusionammProgram: {
14606
- value: input.fusionammProgram ?? null,
14607
- isWritable: false
14608
- },
14609
- fusionPool: { value: input.fusionPool ?? null, isWritable: true },
14610
- fusionPosition: { value: input.fusionPosition ?? null, isWritable: true },
14611
- metadataUpdateAuth: {
14612
- value: input.metadataUpdateAuth ?? null,
14613
- isWritable: false
14614
- },
14615
- memoProgram: { value: input.memoProgram ?? null, isWritable: false },
14616
- token2022Program: {
14617
- value: input.token2022Program ?? null,
14618
- isWritable: false
14619
- },
14620
- systemProgram: { value: input.systemProgram ?? null, isWritable: false },
14621
- associatedTokenProgram: {
14622
- value: input.associatedTokenProgram ?? null,
14623
- isWritable: false
14624
- }
14625
- };
14626
- const accounts = originalAccounts;
14627
- const args = { ...input };
14628
- if (!accounts.systemProgram.value) {
14629
- accounts.systemProgram.value = "11111111111111111111111111111111";
14630
- }
14631
- const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
14632
- const instruction = {
14584
+ function getOpenAndIncreaseTunaLpPositionFusionInstructionWithEphemeralSigner(input) {
14585
+ return {
14633
14586
  accounts: [
14634
- getAccountMeta(accounts.authority),
14635
- getAccountMeta(accounts.tunaConfig),
14636
- getAccountMeta(accounts.mintA),
14637
- getAccountMeta(accounts.mintB),
14638
- getAccountMeta(accounts.tokenProgramA),
14639
- getAccountMeta(accounts.tokenProgramB),
14640
- getAccountMeta(accounts.market),
14641
- getAccountMeta(accounts.vaultA),
14642
- getAccountMeta(accounts.vaultB),
14643
- getAccountMeta(accounts.vaultAAta),
14644
- getAccountMeta(accounts.vaultBAta),
14645
- getAccountMeta(accounts.tunaPosition),
14646
- getAccountMeta(accounts.tunaPositionMint),
14647
- getAccountMeta(accounts.tunaPositionAta),
14648
- getAccountMeta(accounts.tunaPositionAtaA),
14649
- getAccountMeta(accounts.tunaPositionAtaB),
14650
- getAccountMeta(accounts.tunaPositionOwnerAtaA),
14651
- getAccountMeta(accounts.tunaPositionOwnerAtaB),
14652
- getAccountMeta(accounts.feeRecipientAtaA),
14653
- getAccountMeta(accounts.feeRecipientAtaB),
14654
- getAccountMeta(accounts.pythOraclePriceFeedA),
14655
- getAccountMeta(accounts.pythOraclePriceFeedB),
14656
- getAccountMeta(accounts.fusionammProgram),
14657
- getAccountMeta(accounts.fusionPool),
14658
- getAccountMeta(accounts.fusionPosition),
14659
- getAccountMeta(accounts.metadataUpdateAuth),
14660
- getAccountMeta(accounts.memoProgram),
14661
- getAccountMeta(accounts.token2022Program),
14662
- getAccountMeta(accounts.systemProgram),
14663
- getAccountMeta(accounts.associatedTokenProgram)
14587
+ {
14588
+ address: input.authority.address,
14589
+ role: AccountRole18.WRITABLE_SIGNER
14590
+ },
14591
+ {
14592
+ address: input.tunaConfig,
14593
+ role: AccountRole18.READONLY
14594
+ },
14595
+ {
14596
+ address: input.mintA,
14597
+ role: AccountRole18.READONLY
14598
+ },
14599
+ {
14600
+ address: input.mintB,
14601
+ role: AccountRole18.READONLY
14602
+ },
14603
+ {
14604
+ address: input.tokenProgramA,
14605
+ role: AccountRole18.READONLY
14606
+ },
14607
+ {
14608
+ address: input.tokenProgramB,
14609
+ role: AccountRole18.READONLY
14610
+ },
14611
+ {
14612
+ address: input.market,
14613
+ role: AccountRole18.WRITABLE
14614
+ },
14615
+ {
14616
+ address: input.vaultA,
14617
+ role: AccountRole18.WRITABLE
14618
+ },
14619
+ {
14620
+ address: input.vaultB,
14621
+ role: AccountRole18.WRITABLE
14622
+ },
14623
+ {
14624
+ address: input.vaultAAta,
14625
+ role: AccountRole18.WRITABLE
14626
+ },
14627
+ {
14628
+ address: input.vaultBAta,
14629
+ role: AccountRole18.WRITABLE
14630
+ },
14631
+ {
14632
+ address: input.tunaPosition,
14633
+ role: AccountRole18.WRITABLE
14634
+ },
14635
+ {
14636
+ address: input.tunaPositionMint,
14637
+ role: AccountRole18.WRITABLE
14638
+ },
14639
+ {
14640
+ address: input.tunaPositionAta,
14641
+ role: AccountRole18.WRITABLE
14642
+ },
14643
+ {
14644
+ address: input.tunaPositionAtaA,
14645
+ role: AccountRole18.WRITABLE
14646
+ },
14647
+ {
14648
+ address: input.tunaPositionAtaB,
14649
+ role: AccountRole18.WRITABLE
14650
+ },
14651
+ {
14652
+ address: input.tunaPositionOwnerAtaA,
14653
+ role: AccountRole18.WRITABLE
14654
+ },
14655
+ {
14656
+ address: input.tunaPositionOwnerAtaB,
14657
+ role: AccountRole18.WRITABLE
14658
+ },
14659
+ {
14660
+ address: input.feeRecipientAtaA,
14661
+ role: AccountRole18.WRITABLE
14662
+ },
14663
+ {
14664
+ address: input.feeRecipientAtaB,
14665
+ role: AccountRole18.WRITABLE
14666
+ },
14667
+ {
14668
+ address: input.pythOraclePriceFeedA,
14669
+ role: AccountRole18.READONLY
14670
+ },
14671
+ {
14672
+ address: input.pythOraclePriceFeedB,
14673
+ role: AccountRole18.READONLY
14674
+ },
14675
+ {
14676
+ address: input.fusionammProgram,
14677
+ role: AccountRole18.READONLY
14678
+ },
14679
+ {
14680
+ address: input.fusionPool,
14681
+ role: AccountRole18.WRITABLE
14682
+ },
14683
+ {
14684
+ address: input.fusionPosition,
14685
+ role: AccountRole18.WRITABLE
14686
+ },
14687
+ {
14688
+ address: input.metadataUpdateAuth,
14689
+ role: AccountRole18.READONLY
14690
+ },
14691
+ {
14692
+ address: input.memoProgram,
14693
+ role: AccountRole18.READONLY
14694
+ },
14695
+ {
14696
+ address: input.token2022Program,
14697
+ role: AccountRole18.READONLY
14698
+ },
14699
+ {
14700
+ address: input.systemProgram ?? address6("11111111111111111111111111111111"),
14701
+ role: AccountRole18.READONLY
14702
+ },
14703
+ {
14704
+ address: input.associatedTokenProgram,
14705
+ role: AccountRole18.READONLY
14706
+ }
14664
14707
  ],
14665
- programAddress,
14708
+ programAddress: TUNA_PROGRAM_ADDRESS,
14666
14709
  data: getOpenAndIncreaseTunaLpPositionFusionInstructionDataEncoder().encode(
14667
- args
14710
+ input
14668
14711
  )
14669
14712
  };
14670
- return instruction;
14671
14713
  }
14672
14714
 
14673
14715
  // src/txbuilder/openTunaSpotPosition.ts
@@ -14739,7 +14781,7 @@ import {
14739
14781
  } from "@orca-so/whirlpools-client";
14740
14782
  import { collectRewardsQuote as collectRewardsQuote2, getTickArrayStartTickIndex as getTickArrayStartTickIndex8, getTickIndexInArray as getTickIndexInArray2 } from "@orca-so/whirlpools-core";
14741
14783
  import {
14742
- AccountRole as AccountRole17,
14784
+ AccountRole as AccountRole19,
14743
14785
  assertAccountsExist as assertAccountsExist9
14744
14786
  } from "@solana/kit";
14745
14787
  import { MEMO_PROGRAM_ADDRESS as MEMO_PROGRAM_ADDRESS18 } from "@solana-program/memo";
@@ -14879,16 +14921,16 @@ async function decreaseTunaLpPositionOrcaInstruction(authority, tunaPosition, mi
14879
14921
  tunaPosition.data.tickUpperIndex
14880
14922
  );
14881
14923
  const remainingAccounts = [
14882
- { address: swapTickArrays[0], role: AccountRole17.WRITABLE },
14883
- { address: swapTickArrays[1], role: AccountRole17.WRITABLE },
14884
- { address: swapTickArrays[2], role: AccountRole17.WRITABLE },
14885
- { address: swapTickArrays[3], role: AccountRole17.WRITABLE },
14886
- { address: swapTickArrays[4], role: AccountRole17.WRITABLE },
14887
- { address: lowerTickArrayAddress, role: AccountRole17.WRITABLE },
14888
- { address: upperTickArrayAddress, role: AccountRole17.WRITABLE },
14889
- { address: whirlpool.data.tokenVaultA, role: AccountRole17.WRITABLE },
14890
- { address: whirlpool.data.tokenVaultB, role: AccountRole17.WRITABLE },
14891
- { address: orcaOracleAddress, role: AccountRole17.WRITABLE }
14924
+ { address: swapTickArrays[0], role: AccountRole19.WRITABLE },
14925
+ { address: swapTickArrays[1], role: AccountRole19.WRITABLE },
14926
+ { address: swapTickArrays[2], role: AccountRole19.WRITABLE },
14927
+ { address: swapTickArrays[3], role: AccountRole19.WRITABLE },
14928
+ { address: swapTickArrays[4], role: AccountRole19.WRITABLE },
14929
+ { address: lowerTickArrayAddress, role: AccountRole19.WRITABLE },
14930
+ { address: upperTickArrayAddress, role: AccountRole19.WRITABLE },
14931
+ { address: whirlpool.data.tokenVaultA, role: AccountRole19.WRITABLE },
14932
+ { address: whirlpool.data.tokenVaultB, role: AccountRole19.WRITABLE },
14933
+ { address: orcaOracleAddress, role: AccountRole19.WRITABLE }
14892
14934
  ];
14893
14935
  for (const rewardIndex of rewardIndicesToClaim) {
14894
14936
  const rewardInfo = whirlpool.data.rewardInfos[rewardIndex];
@@ -14899,10 +14941,10 @@ async function decreaseTunaLpPositionOrcaInstruction(authority, tunaPosition, mi
14899
14941
  mint: rewardMint.address,
14900
14942
  tokenProgram: rewardMint.programAddress
14901
14943
  });
14902
- remainingAccounts.push({ address: rewardMint.address, role: AccountRole17.READONLY });
14903
- remainingAccounts.push({ address: rewardMint.programAddress, role: AccountRole17.READONLY });
14904
- remainingAccounts.push({ address: ownerAta[0], role: AccountRole17.WRITABLE });
14905
- remainingAccounts.push({ address: rewardInfo.vault, role: AccountRole17.WRITABLE });
14944
+ remainingAccounts.push({ address: rewardMint.address, role: AccountRole19.READONLY });
14945
+ remainingAccounts.push({ address: rewardMint.programAddress, role: AccountRole19.READONLY });
14946
+ remainingAccounts.push({ address: ownerAta[0], role: AccountRole19.WRITABLE });
14947
+ remainingAccounts.push({ address: rewardInfo.vault, role: AccountRole19.WRITABLE });
14906
14948
  }
14907
14949
  const remainingAccountsInfo = {
14908
14950
  slices: [
@@ -14955,7 +14997,7 @@ import {
14955
14997
  getPositionAddress as getPositionAddress18
14956
14998
  } from "@crypticdot/fusionamm-client";
14957
14999
  import {
14958
- AccountRole as AccountRole18
15000
+ AccountRole as AccountRole20
14959
15001
  } from "@solana/kit";
14960
15002
  import { MEMO_PROGRAM_ADDRESS as MEMO_PROGRAM_ADDRESS19 } from "@solana-program/memo";
14961
15003
  import {
@@ -15060,15 +15102,15 @@ async function decreaseTunaLpPositionFusionInstruction(authority, tunaPosition,
15060
15102
  tunaPosition.data.tickUpperIndex
15061
15103
  );
15062
15104
  const remainingAccounts = [
15063
- { address: swapTickArrays[0], role: AccountRole18.WRITABLE },
15064
- { address: swapTickArrays[1], role: AccountRole18.WRITABLE },
15065
- { address: swapTickArrays[2], role: AccountRole18.WRITABLE },
15066
- { address: swapTickArrays[3], role: AccountRole18.WRITABLE },
15067
- { address: swapTickArrays[4], role: AccountRole18.WRITABLE },
15068
- { address: lowerTickArrayAddress, role: AccountRole18.WRITABLE },
15069
- { address: upperTickArrayAddress, role: AccountRole18.WRITABLE },
15070
- { address: fusionPool.data.tokenVaultA, role: AccountRole18.WRITABLE },
15071
- { address: fusionPool.data.tokenVaultB, role: AccountRole18.WRITABLE }
15105
+ { address: swapTickArrays[0], role: AccountRole20.WRITABLE },
15106
+ { address: swapTickArrays[1], role: AccountRole20.WRITABLE },
15107
+ { address: swapTickArrays[2], role: AccountRole20.WRITABLE },
15108
+ { address: swapTickArrays[3], role: AccountRole20.WRITABLE },
15109
+ { address: swapTickArrays[4], role: AccountRole20.WRITABLE },
15110
+ { address: lowerTickArrayAddress, role: AccountRole20.WRITABLE },
15111
+ { address: upperTickArrayAddress, role: AccountRole20.WRITABLE },
15112
+ { address: fusionPool.data.tokenVaultA, role: AccountRole20.WRITABLE },
15113
+ { address: fusionPool.data.tokenVaultB, role: AccountRole20.WRITABLE }
15072
15114
  ];
15073
15115
  const remainingAccountsInfo = {
15074
15116
  slices: [
@@ -15281,7 +15323,7 @@ async function withdrawInstruction(authority, mint, vault, funds, shares) {
15281
15323
  import { fetchFusionPool as fetchFusionPool3, FP_NFT_UPDATE_AUTH as FP_NFT_UPDATE_AUTH3, FUSIONAMM_PROGRAM_ADDRESS as FUSIONAMM_PROGRAM_ADDRESS13 } from "@crypticdot/fusionamm-client";
15282
15324
  import { fetchWhirlpool as fetchWhirlpool3, getOracleAddress as getOracleAddress8, WHIRLPOOL_PROGRAM_ADDRESS as WHIRLPOOL_PROGRAM_ADDRESS13 } from "@orca-so/whirlpools-client";
15283
15325
  import {
15284
- address as address3
15326
+ address as address7
15285
15327
  } from "@solana/kit";
15286
15328
  import { fetchAddressLookupTable, getExtendLookupTableInstruction as getExtendLookupTableInstruction2 } from "@solana-program/address-lookup-table";
15287
15329
  import { MEMO_PROGRAM_ADDRESS as MEMO_PROGRAM_ADDRESS22 } from "@solana-program/memo";
@@ -15327,7 +15369,7 @@ async function getAddressesForMarketLookupTable(rpc, poolAddress, marketMaker) {
15327
15369
  }))[0];
15328
15370
  const addresses = [
15329
15371
  SYSTEM_PROGRAM_ADDRESS,
15330
- address3("SysvarRent111111111111111111111111111111111"),
15372
+ address7("SysvarRent111111111111111111111111111111111"),
15331
15373
  ASSOCIATED_TOKEN_PROGRAM_ADDRESS6,
15332
15374
  TOKEN_PROGRAM_ADDRESS2,
15333
15375
  TOKEN_2022_PROGRAM_ADDRESS19,
@@ -15496,7 +15538,7 @@ import {
15496
15538
  WHIRLPOOL_PROGRAM_ADDRESS as WHIRLPOOL_PROGRAM_ADDRESS14
15497
15539
  } from "@orca-so/whirlpools-client";
15498
15540
  import {
15499
- AccountRole as AccountRole19,
15541
+ AccountRole as AccountRole21,
15500
15542
  lamports as lamports3
15501
15543
  } from "@solana/kit";
15502
15544
  import { fetchSysvarRent as fetchSysvarRent3 } from "@solana/sysvars";
@@ -15629,18 +15671,18 @@ async function rebalanceTunaLpPositionOrcaInstruction(authority, tunaPosition, t
15629
15671
  );
15630
15672
  const secondaryTickArrays = await OrcaUtils.getTickArraysForRebalancedPosition(whirlpool, tunaPosition);
15631
15673
  const remainingAccounts = [
15632
- { address: swapTickArrays[0], role: AccountRole19.WRITABLE },
15633
- { address: swapTickArrays[1], role: AccountRole19.WRITABLE },
15634
- { address: swapTickArrays[2], role: AccountRole19.WRITABLE },
15635
- { address: swapTickArrays[3], role: AccountRole19.WRITABLE },
15636
- { address: swapTickArrays[4], role: AccountRole19.WRITABLE },
15637
- { address: lowerTickArrayAddress, role: AccountRole19.WRITABLE },
15638
- { address: upperTickArrayAddress, role: AccountRole19.WRITABLE },
15639
- { address: secondaryTickArrays.lowerTickArrayAddress, role: AccountRole19.WRITABLE },
15640
- { address: secondaryTickArrays.upperTickArrayAddress, role: AccountRole19.WRITABLE },
15641
- { address: whirlpool.data.tokenVaultA, role: AccountRole19.WRITABLE },
15642
- { address: whirlpool.data.tokenVaultB, role: AccountRole19.WRITABLE },
15643
- { address: orcaOracleAddress, role: AccountRole19.WRITABLE }
15674
+ { address: swapTickArrays[0], role: AccountRole21.WRITABLE },
15675
+ { address: swapTickArrays[1], role: AccountRole21.WRITABLE },
15676
+ { address: swapTickArrays[2], role: AccountRole21.WRITABLE },
15677
+ { address: swapTickArrays[3], role: AccountRole21.WRITABLE },
15678
+ { address: swapTickArrays[4], role: AccountRole21.WRITABLE },
15679
+ { address: lowerTickArrayAddress, role: AccountRole21.WRITABLE },
15680
+ { address: upperTickArrayAddress, role: AccountRole21.WRITABLE },
15681
+ { address: secondaryTickArrays.lowerTickArrayAddress, role: AccountRole21.WRITABLE },
15682
+ { address: secondaryTickArrays.upperTickArrayAddress, role: AccountRole21.WRITABLE },
15683
+ { address: whirlpool.data.tokenVaultA, role: AccountRole21.WRITABLE },
15684
+ { address: whirlpool.data.tokenVaultB, role: AccountRole21.WRITABLE },
15685
+ { address: orcaOracleAddress, role: AccountRole21.WRITABLE }
15644
15686
  ];
15645
15687
  const remainingAccountsInfo = {
15646
15688
  slices: [
@@ -15692,7 +15734,7 @@ import {
15692
15734
  getTickArraySize as getTickArraySize2
15693
15735
  } from "@crypticdot/fusionamm-client";
15694
15736
  import {
15695
- AccountRole as AccountRole20,
15737
+ AccountRole as AccountRole22,
15696
15738
  lamports as lamports4
15697
15739
  } from "@solana/kit";
15698
15740
  import { fetchSysvarRent as fetchSysvarRent4 } from "@solana/sysvars";
@@ -15820,17 +15862,17 @@ async function rebalanceTunaLpPositionFusionInstruction(authority, tunaPosition,
15820
15862
  );
15821
15863
  const secondaryTickArrays = await FusionUtils.getTickArraysForRebalancedPosition(fusionPool, tunaPosition);
15822
15864
  const remainingAccounts = [
15823
- { address: swapTickArrays[0], role: AccountRole20.WRITABLE },
15824
- { address: swapTickArrays[1], role: AccountRole20.WRITABLE },
15825
- { address: swapTickArrays[2], role: AccountRole20.WRITABLE },
15826
- { address: swapTickArrays[3], role: AccountRole20.WRITABLE },
15827
- { address: swapTickArrays[4], role: AccountRole20.WRITABLE },
15828
- { address: lowerTickArrayAddress, role: AccountRole20.WRITABLE },
15829
- { address: upperTickArrayAddress, role: AccountRole20.WRITABLE },
15830
- { address: secondaryTickArrays.lowerTickArrayAddress, role: AccountRole20.WRITABLE },
15831
- { address: secondaryTickArrays.upperTickArrayAddress, role: AccountRole20.WRITABLE },
15832
- { address: fusionPool.data.tokenVaultA, role: AccountRole20.WRITABLE },
15833
- { address: fusionPool.data.tokenVaultB, role: AccountRole20.WRITABLE }
15865
+ { address: swapTickArrays[0], role: AccountRole22.WRITABLE },
15866
+ { address: swapTickArrays[1], role: AccountRole22.WRITABLE },
15867
+ { address: swapTickArrays[2], role: AccountRole22.WRITABLE },
15868
+ { address: swapTickArrays[3], role: AccountRole22.WRITABLE },
15869
+ { address: swapTickArrays[4], role: AccountRole22.WRITABLE },
15870
+ { address: lowerTickArrayAddress, role: AccountRole22.WRITABLE },
15871
+ { address: upperTickArrayAddress, role: AccountRole22.WRITABLE },
15872
+ { address: secondaryTickArrays.lowerTickArrayAddress, role: AccountRole22.WRITABLE },
15873
+ { address: secondaryTickArrays.upperTickArrayAddress, role: AccountRole22.WRITABLE },
15874
+ { address: fusionPool.data.tokenVaultA, role: AccountRole22.WRITABLE },
15875
+ { address: fusionPool.data.tokenVaultB, role: AccountRole22.WRITABLE }
15834
15876
  ];
15835
15877
  const remainingAccountsInfo = {
15836
15878
  slices: [