@crypticdot/defituna-client 3.5.5 → 3.5.7
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.cjs +476 -449
- package/dist/index.d.cts +3 -9
- package/dist/index.d.ts +3 -9
- package/dist/index.js +473 -441
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -73,13 +73,13 @@ function decodeLendingPosition(encodedAccount) {
|
|
|
73
73
|
getLendingPositionDecoder()
|
|
74
74
|
);
|
|
75
75
|
}
|
|
76
|
-
async function fetchLendingPosition(rpc,
|
|
77
|
-
const maybeAccount = await fetchMaybeLendingPosition(rpc,
|
|
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,
|
|
82
|
-
const maybeAccount = await fetchEncodedAccount(rpc,
|
|
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,
|
|
363
|
-
const maybeAccount = await fetchMaybeMarket(rpc,
|
|
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,
|
|
368
|
-
const maybeAccount = await fetchEncodedAccount2(rpc,
|
|
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,
|
|
480
|
-
const maybeAccount = await fetchMaybeTunaConfig(rpc,
|
|
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,
|
|
485
|
-
const maybeAccount = await fetchEncodedAccount3(rpc,
|
|
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,
|
|
629
|
-
const maybeAccount = await fetchMaybeTunaLpPosition(rpc,
|
|
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,
|
|
634
|
-
const maybeAccount = await fetchEncodedAccount4(rpc,
|
|
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,
|
|
757
|
-
const maybeAccount = await fetchMaybeTunaSpotPosition(rpc,
|
|
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,
|
|
762
|
-
const maybeAccount = await fetchEncodedAccount5(rpc,
|
|
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,
|
|
874
|
-
const maybeAccount = await fetchMaybeVault(rpc,
|
|
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,
|
|
879
|
-
const maybeAccount = await fetchEncodedAccount6(rpc,
|
|
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(
|
|
9808
|
+
function tunaLpPositionAuthorityFilter(address8) {
|
|
9809
9809
|
return {
|
|
9810
9810
|
memcmp: {
|
|
9811
9811
|
offset: 11n,
|
|
9812
|
-
bytes: getBase58Decoder().decode(getAddressEncoder19().encode(
|
|
9812
|
+
bytes: getBase58Decoder().decode(getAddressEncoder19().encode(address8)),
|
|
9813
9813
|
encoding: "base58"
|
|
9814
9814
|
}
|
|
9815
9815
|
};
|
|
9816
9816
|
}
|
|
9817
|
-
function tunaLpPositionPoolFilter(
|
|
9817
|
+
function tunaLpPositionPoolFilter(address8) {
|
|
9818
9818
|
return {
|
|
9819
9819
|
memcmp: {
|
|
9820
9820
|
offset: 43n,
|
|
9821
|
-
bytes: getBase58Decoder().decode(getAddressEncoder19().encode(
|
|
9821
|
+
bytes: getBase58Decoder().decode(getAddressEncoder19().encode(address8)),
|
|
9822
9822
|
encoding: "base58"
|
|
9823
9823
|
}
|
|
9824
9824
|
};
|
|
9825
9825
|
}
|
|
9826
|
-
function tunaLpPositionMintAFilter(
|
|
9826
|
+
function tunaLpPositionMintAFilter(address8) {
|
|
9827
9827
|
return {
|
|
9828
9828
|
memcmp: {
|
|
9829
9829
|
offset: 75n,
|
|
9830
|
-
bytes: getBase58Decoder().decode(getAddressEncoder19().encode(
|
|
9830
|
+
bytes: getBase58Decoder().decode(getAddressEncoder19().encode(address8)),
|
|
9831
9831
|
encoding: "base58"
|
|
9832
9832
|
}
|
|
9833
9833
|
};
|
|
9834
9834
|
}
|
|
9835
|
-
function tunaLpPositionMintBFilter(
|
|
9835
|
+
function tunaLpPositionMintBFilter(address8) {
|
|
9836
9836
|
return {
|
|
9837
9837
|
memcmp: {
|
|
9838
9838
|
offset: 107n,
|
|
9839
|
-
bytes: getBase58Decoder().decode(getAddressEncoder19().encode(
|
|
9839
|
+
bytes: getBase58Decoder().decode(getAddressEncoder19().encode(address8)),
|
|
9840
9840
|
encoding: "base58"
|
|
9841
9841
|
}
|
|
9842
9842
|
};
|
|
9843
9843
|
}
|
|
9844
|
-
function tunaLpPositionMintFilter(
|
|
9844
|
+
function tunaLpPositionMintFilter(address8) {
|
|
9845
9845
|
return {
|
|
9846
9846
|
memcmp: {
|
|
9847
9847
|
offset: 139n,
|
|
9848
|
-
bytes: getBase58Decoder().decode(getAddressEncoder19().encode(
|
|
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(
|
|
9884
|
+
function tunaSpotPositionAuthorityFilter(address8) {
|
|
9885
9885
|
return {
|
|
9886
9886
|
memcmp: {
|
|
9887
9887
|
offset: 11n,
|
|
9888
|
-
bytes: getBase58Decoder2().decode(getAddressEncoder20().encode(
|
|
9888
|
+
bytes: getBase58Decoder2().decode(getAddressEncoder20().encode(address8)),
|
|
9889
9889
|
encoding: "base58"
|
|
9890
9890
|
}
|
|
9891
9891
|
};
|
|
9892
9892
|
}
|
|
9893
|
-
function tunaSpotPositionPoolFilter(
|
|
9893
|
+
function tunaSpotPositionPoolFilter(address8) {
|
|
9894
9894
|
return {
|
|
9895
9895
|
memcmp: {
|
|
9896
9896
|
offset: 43n,
|
|
9897
|
-
bytes: getBase58Decoder2().decode(getAddressEncoder20().encode(
|
|
9897
|
+
bytes: getBase58Decoder2().decode(getAddressEncoder20().encode(address8)),
|
|
9898
9898
|
encoding: "base58"
|
|
9899
9899
|
}
|
|
9900
9900
|
};
|
|
9901
9901
|
}
|
|
9902
|
-
function tunaSpotPositionMintAFilter(
|
|
9902
|
+
function tunaSpotPositionMintAFilter(address8) {
|
|
9903
9903
|
return {
|
|
9904
9904
|
memcmp: {
|
|
9905
9905
|
offset: 75n,
|
|
9906
|
-
bytes: getBase58Decoder2().decode(getAddressEncoder20().encode(
|
|
9906
|
+
bytes: getBase58Decoder2().decode(getAddressEncoder20().encode(address8)),
|
|
9907
9907
|
encoding: "base58"
|
|
9908
9908
|
}
|
|
9909
9909
|
};
|
|
9910
9910
|
}
|
|
9911
|
-
function tunaSpotPositionMintBFilter(
|
|
9911
|
+
function tunaSpotPositionMintBFilter(address8) {
|
|
9912
9912
|
return {
|
|
9913
9913
|
memcmp: {
|
|
9914
9914
|
offset: 107n,
|
|
9915
|
-
bytes: getBase58Decoder2().decode(getAddressEncoder20().encode(
|
|
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(
|
|
9942
|
+
function lendingPositionAuthorityFilter(address8) {
|
|
9943
9943
|
return {
|
|
9944
9944
|
memcmp: {
|
|
9945
9945
|
offset: 11n,
|
|
9946
|
-
bytes: getBase58Decoder3().decode(getAddressEncoder21().encode(
|
|
9946
|
+
bytes: getBase58Decoder3().decode(getAddressEncoder21().encode(address8)),
|
|
9947
9947
|
encoding: "base58"
|
|
9948
9948
|
}
|
|
9949
9949
|
};
|
|
9950
9950
|
}
|
|
9951
|
-
function lendingPositionMintFilter(
|
|
9951
|
+
function lendingPositionMintFilter(address8) {
|
|
9952
9952
|
return {
|
|
9953
9953
|
memcmp: {
|
|
9954
9954
|
offset: 43n,
|
|
9955
|
-
bytes: getBase58Decoder3().decode(getAddressEncoder21().encode(
|
|
9955
|
+
bytes: getBase58Decoder3().decode(getAddressEncoder21().encode(address8)),
|
|
9956
9956
|
encoding: "base58"
|
|
9957
9957
|
}
|
|
9958
9958
|
};
|
|
9959
9959
|
}
|
|
9960
|
-
function lendingPositionVaultFilter(
|
|
9960
|
+
function lendingPositionVaultFilter(address8) {
|
|
9961
9961
|
return {
|
|
9962
9962
|
memcmp: {
|
|
9963
9963
|
offset: 91n,
|
|
9964
|
-
bytes: getBase58Decoder3().decode(getAddressEncoder21().encode(
|
|
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,88 +13663,93 @@ async function openTunaLpPositionOrcaInstruction(rpc, authority, positionMint, w
|
|
|
13659
13663
|
...args
|
|
13660
13664
|
});
|
|
13661
13665
|
}
|
|
13662
|
-
function getOpenTunaLpPositionOrcaInstructionWithEphemeralSigner(input
|
|
13663
|
-
|
|
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
|
-
|
|
13714
|
-
|
|
13715
|
-
|
|
13716
|
-
|
|
13717
|
-
|
|
13718
|
-
|
|
13719
|
-
|
|
13720
|
-
|
|
13721
|
-
|
|
13722
|
-
|
|
13723
|
-
|
|
13724
|
-
|
|
13725
|
-
|
|
13726
|
-
|
|
13727
|
-
|
|
13728
|
-
|
|
13729
|
-
|
|
13730
|
-
|
|
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(
|
|
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";
|
|
13741
13750
|
import {
|
|
13742
|
-
AccountRole as
|
|
13743
|
-
address as
|
|
13751
|
+
AccountRole as AccountRole16,
|
|
13752
|
+
address as address4
|
|
13744
13753
|
} from "@solana/kit";
|
|
13745
13754
|
import {
|
|
13746
13755
|
ASSOCIATED_TOKEN_PROGRAM_ADDRESS as ASSOCIATED_TOKEN_PROGRAM_ADDRESS2,
|
|
@@ -13815,79 +13824,79 @@ async function openTunaLpPositionFusionInstruction(rpc, authority, positionMint,
|
|
|
13815
13824
|
});
|
|
13816
13825
|
}
|
|
13817
13826
|
function getOpenTunaLpPositionFusionInstructionWithEphemeralSigner(input) {
|
|
13818
|
-
|
|
13827
|
+
return {
|
|
13819
13828
|
accounts: [
|
|
13820
13829
|
{
|
|
13821
13830
|
address: input.authority.address,
|
|
13822
|
-
role:
|
|
13831
|
+
role: AccountRole16.WRITABLE_SIGNER
|
|
13823
13832
|
},
|
|
13824
13833
|
{
|
|
13825
13834
|
address: input.mintA,
|
|
13826
|
-
role:
|
|
13835
|
+
role: AccountRole16.READONLY
|
|
13827
13836
|
},
|
|
13828
13837
|
{
|
|
13829
13838
|
address: input.mintB,
|
|
13830
|
-
role:
|
|
13839
|
+
role: AccountRole16.READONLY
|
|
13831
13840
|
},
|
|
13832
13841
|
{
|
|
13833
13842
|
address: input.tokenProgramA,
|
|
13834
|
-
role:
|
|
13843
|
+
role: AccountRole16.READONLY
|
|
13835
13844
|
},
|
|
13836
13845
|
{
|
|
13837
13846
|
address: input.tokenProgramB,
|
|
13838
|
-
role:
|
|
13847
|
+
role: AccountRole16.READONLY
|
|
13839
13848
|
},
|
|
13840
13849
|
{
|
|
13841
13850
|
address: input.market,
|
|
13842
|
-
role:
|
|
13851
|
+
role: AccountRole16.READONLY
|
|
13843
13852
|
},
|
|
13844
13853
|
{
|
|
13845
13854
|
address: input.tunaPosition,
|
|
13846
|
-
role:
|
|
13855
|
+
role: AccountRole16.WRITABLE
|
|
13847
13856
|
},
|
|
13848
13857
|
{
|
|
13849
13858
|
address: input.tunaPositionMint,
|
|
13850
|
-
role:
|
|
13859
|
+
role: AccountRole16.WRITABLE_SIGNER
|
|
13851
13860
|
},
|
|
13852
13861
|
{
|
|
13853
13862
|
address: input.tunaPositionAta,
|
|
13854
|
-
role:
|
|
13863
|
+
role: AccountRole16.WRITABLE
|
|
13855
13864
|
},
|
|
13856
13865
|
{
|
|
13857
13866
|
address: input.tunaPositionAtaA,
|
|
13858
|
-
role:
|
|
13867
|
+
role: AccountRole16.WRITABLE
|
|
13859
13868
|
},
|
|
13860
13869
|
{
|
|
13861
13870
|
address: input.tunaPositionAtaB,
|
|
13862
|
-
role:
|
|
13871
|
+
role: AccountRole16.WRITABLE
|
|
13863
13872
|
},
|
|
13864
13873
|
{
|
|
13865
13874
|
address: input.fusionammProgram,
|
|
13866
|
-
role:
|
|
13875
|
+
role: AccountRole16.READONLY
|
|
13867
13876
|
},
|
|
13868
13877
|
{
|
|
13869
13878
|
address: input.fusionPool,
|
|
13870
|
-
role:
|
|
13879
|
+
role: AccountRole16.READONLY
|
|
13871
13880
|
},
|
|
13872
13881
|
{
|
|
13873
13882
|
address: input.fusionPosition,
|
|
13874
|
-
role:
|
|
13883
|
+
role: AccountRole16.WRITABLE
|
|
13875
13884
|
},
|
|
13876
13885
|
{
|
|
13877
13886
|
address: input.metadataUpdateAuth,
|
|
13878
|
-
role:
|
|
13887
|
+
role: AccountRole16.READONLY
|
|
13879
13888
|
},
|
|
13880
13889
|
{
|
|
13881
13890
|
address: input.token2022Program,
|
|
13882
|
-
role:
|
|
13891
|
+
role: AccountRole16.READONLY
|
|
13883
13892
|
},
|
|
13884
13893
|
{
|
|
13885
|
-
address: input.systemProgram ??
|
|
13886
|
-
role:
|
|
13894
|
+
address: input.systemProgram ?? address4("11111111111111111111111111111111"),
|
|
13895
|
+
role: AccountRole16.READONLY
|
|
13887
13896
|
},
|
|
13888
13897
|
{
|
|
13889
13898
|
address: input.associatedTokenProgram,
|
|
13890
|
-
role:
|
|
13899
|
+
role: AccountRole16.READONLY
|
|
13891
13900
|
}
|
|
13892
13901
|
],
|
|
13893
13902
|
programAddress: TUNA_PROGRAM_ADDRESS,
|
|
@@ -13895,7 +13904,6 @@ function getOpenTunaLpPositionFusionInstructionWithEphemeralSigner(input) {
|
|
|
13895
13904
|
input
|
|
13896
13905
|
)
|
|
13897
13906
|
};
|
|
13898
|
-
return instruction;
|
|
13899
13907
|
}
|
|
13900
13908
|
|
|
13901
13909
|
// src/txbuilder/openAndIncreaseTunaLpPositionOrca.ts
|
|
@@ -13911,7 +13919,8 @@ import {
|
|
|
13911
13919
|
} from "@orca-so/whirlpools-client";
|
|
13912
13920
|
import { getTickArrayStartTickIndex as getTickArrayStartTickIndex6 } from "@orca-so/whirlpools-core";
|
|
13913
13921
|
import {
|
|
13914
|
-
AccountRole as
|
|
13922
|
+
AccountRole as AccountRole17,
|
|
13923
|
+
address as address5,
|
|
13915
13924
|
lamports
|
|
13916
13925
|
} from "@solana/kit";
|
|
13917
13926
|
import { fetchSysvarRent } from "@solana/sysvars";
|
|
@@ -14088,16 +14097,16 @@ async function openAndIncreaseTunaLpPositionOrcaInstruction(authority, positionM
|
|
|
14088
14097
|
const lowerTickArrayAddress = await OrcaUtils.getTickArrayAddressFromTickIndex(whirlpool, args.tickLowerIndex);
|
|
14089
14098
|
const upperTickArrayAddress = await OrcaUtils.getTickArrayAddressFromTickIndex(whirlpool, args.tickUpperIndex);
|
|
14090
14099
|
const remainingAccounts = [
|
|
14091
|
-
{ address: swapTickArrays[0], role:
|
|
14092
|
-
{ address: swapTickArrays[1], role:
|
|
14093
|
-
{ address: swapTickArrays[2], role:
|
|
14094
|
-
{ address: swapTickArrays[3], role:
|
|
14095
|
-
{ address: swapTickArrays[4], role:
|
|
14096
|
-
{ address: lowerTickArrayAddress, role:
|
|
14097
|
-
{ address: upperTickArrayAddress, role:
|
|
14098
|
-
{ address: whirlpool.data.tokenVaultA, role:
|
|
14099
|
-
{ address: whirlpool.data.tokenVaultB, role:
|
|
14100
|
-
{ address: orcaOracleAddress, role:
|
|
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 }
|
|
14101
14110
|
];
|
|
14102
14111
|
const remainingAccountsInfo = {
|
|
14103
14112
|
slices: [
|
|
@@ -14177,124 +14186,135 @@ async function openAndIncreaseTunaLpPositionOrcaInstruction(authority, positionM
|
|
|
14177
14186
|
ix.accounts.push(...remainingAccounts);
|
|
14178
14187
|
return ix;
|
|
14179
14188
|
}
|
|
14180
|
-
function getOpenAndIncreaseTunaLpPositionOrcaInstructionWithEphemeralSigner(input
|
|
14181
|
-
|
|
14182
|
-
const originalAccounts = {
|
|
14183
|
-
authority: { value: input.authority ?? null, isWritable: true },
|
|
14184
|
-
tunaConfig: { value: input.tunaConfig ?? null, isWritable: false },
|
|
14185
|
-
mintA: { value: input.mintA ?? null, isWritable: false },
|
|
14186
|
-
mintB: { value: input.mintB ?? null, isWritable: false },
|
|
14187
|
-
market: { value: input.market ?? null, isWritable: true },
|
|
14188
|
-
vaultA: { value: input.vaultA ?? null, isWritable: true },
|
|
14189
|
-
vaultB: { value: input.vaultB ?? null, isWritable: true },
|
|
14190
|
-
vaultAAta: { value: input.vaultAAta ?? null, isWritable: true },
|
|
14191
|
-
vaultBAta: { value: input.vaultBAta ?? null, isWritable: true },
|
|
14192
|
-
tunaPosition: { value: input.tunaPosition ?? null, isWritable: true },
|
|
14193
|
-
tunaPositionMint: {
|
|
14194
|
-
value: input.tunaPositionMint ?? null,
|
|
14195
|
-
isWritable: true
|
|
14196
|
-
},
|
|
14197
|
-
tunaPositionAta: { value: input.tunaPositionAta ?? null, isWritable: true },
|
|
14198
|
-
tunaPositionAtaA: {
|
|
14199
|
-
value: input.tunaPositionAtaA ?? null,
|
|
14200
|
-
isWritable: true
|
|
14201
|
-
},
|
|
14202
|
-
tunaPositionAtaB: {
|
|
14203
|
-
value: input.tunaPositionAtaB ?? null,
|
|
14204
|
-
isWritable: true
|
|
14205
|
-
},
|
|
14206
|
-
tunaPositionOwnerAtaA: {
|
|
14207
|
-
value: input.tunaPositionOwnerAtaA ?? null,
|
|
14208
|
-
isWritable: true
|
|
14209
|
-
},
|
|
14210
|
-
tunaPositionOwnerAtaB: {
|
|
14211
|
-
value: input.tunaPositionOwnerAtaB ?? null,
|
|
14212
|
-
isWritable: true
|
|
14213
|
-
},
|
|
14214
|
-
feeRecipientAtaA: {
|
|
14215
|
-
value: input.feeRecipientAtaA ?? null,
|
|
14216
|
-
isWritable: true
|
|
14217
|
-
},
|
|
14218
|
-
feeRecipientAtaB: {
|
|
14219
|
-
value: input.feeRecipientAtaB ?? null,
|
|
14220
|
-
isWritable: true
|
|
14221
|
-
},
|
|
14222
|
-
pythOraclePriceFeedA: {
|
|
14223
|
-
value: input.pythOraclePriceFeedA ?? null,
|
|
14224
|
-
isWritable: false
|
|
14225
|
-
},
|
|
14226
|
-
pythOraclePriceFeedB: {
|
|
14227
|
-
value: input.pythOraclePriceFeedB ?? null,
|
|
14228
|
-
isWritable: false
|
|
14229
|
-
},
|
|
14230
|
-
whirlpoolProgram: {
|
|
14231
|
-
value: input.whirlpoolProgram ?? null,
|
|
14232
|
-
isWritable: false
|
|
14233
|
-
},
|
|
14234
|
-
whirlpool: { value: input.whirlpool ?? null, isWritable: true },
|
|
14235
|
-
orcaPosition: { value: input.orcaPosition ?? null, isWritable: true },
|
|
14236
|
-
tokenProgramA: { value: input.tokenProgramA ?? null, isWritable: false },
|
|
14237
|
-
tokenProgramB: { value: input.tokenProgramB ?? null, isWritable: false },
|
|
14238
|
-
metadataUpdateAuth: {
|
|
14239
|
-
value: input.metadataUpdateAuth ?? null,
|
|
14240
|
-
isWritable: false
|
|
14241
|
-
},
|
|
14242
|
-
memoProgram: { value: input.memoProgram ?? null, isWritable: false },
|
|
14243
|
-
token2022Program: {
|
|
14244
|
-
value: input.token2022Program ?? null,
|
|
14245
|
-
isWritable: false
|
|
14246
|
-
},
|
|
14247
|
-
systemProgram: { value: input.systemProgram ?? null, isWritable: false },
|
|
14248
|
-
associatedTokenProgram: {
|
|
14249
|
-
value: input.associatedTokenProgram ?? null,
|
|
14250
|
-
isWritable: false
|
|
14251
|
-
}
|
|
14252
|
-
};
|
|
14253
|
-
const accounts = originalAccounts;
|
|
14254
|
-
const args = { ...input };
|
|
14255
|
-
if (!accounts.systemProgram.value) {
|
|
14256
|
-
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
14257
|
-
}
|
|
14258
|
-
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
14259
|
-
const instruction = {
|
|
14189
|
+
function getOpenAndIncreaseTunaLpPositionOrcaInstructionWithEphemeralSigner(input) {
|
|
14190
|
+
return {
|
|
14260
14191
|
accounts: [
|
|
14261
|
-
|
|
14262
|
-
|
|
14263
|
-
|
|
14264
|
-
|
|
14265
|
-
|
|
14266
|
-
|
|
14267
|
-
|
|
14268
|
-
|
|
14269
|
-
|
|
14270
|
-
|
|
14271
|
-
|
|
14272
|
-
|
|
14273
|
-
|
|
14274
|
-
|
|
14275
|
-
|
|
14276
|
-
|
|
14277
|
-
|
|
14278
|
-
|
|
14279
|
-
|
|
14280
|
-
|
|
14281
|
-
|
|
14282
|
-
|
|
14283
|
-
|
|
14284
|
-
|
|
14285
|
-
|
|
14286
|
-
|
|
14287
|
-
|
|
14288
|
-
|
|
14289
|
-
|
|
14290
|
-
|
|
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
|
+
}
|
|
14291
14312
|
],
|
|
14292
|
-
programAddress,
|
|
14313
|
+
programAddress: TUNA_PROGRAM_ADDRESS,
|
|
14293
14314
|
data: getOpenAndIncreaseTunaLpPositionOrcaInstructionDataEncoder().encode(
|
|
14294
|
-
|
|
14315
|
+
input
|
|
14295
14316
|
)
|
|
14296
14317
|
};
|
|
14297
|
-
return instruction;
|
|
14298
14318
|
}
|
|
14299
14319
|
|
|
14300
14320
|
// src/txbuilder/openAndIncreaseTunaLpPositionFusion.ts
|
|
@@ -14310,7 +14330,8 @@ import {
|
|
|
14310
14330
|
} from "@crypticdot/fusionamm-client";
|
|
14311
14331
|
import { getTickArrayStartTickIndex as getTickArrayStartTickIndex7 } from "@crypticdot/fusionamm-core";
|
|
14312
14332
|
import {
|
|
14313
|
-
AccountRole as
|
|
14333
|
+
AccountRole as AccountRole18,
|
|
14334
|
+
address as address6,
|
|
14314
14335
|
lamports as lamports2
|
|
14315
14336
|
} from "@solana/kit";
|
|
14316
14337
|
import { fetchSysvarRent as fetchSysvarRent2 } from "@solana/sysvars";
|
|
@@ -14473,15 +14494,15 @@ async function openAndIncreaseTunaLpPositionFusionInstruction(authority, positio
|
|
|
14473
14494
|
const lowerTickArrayAddress = await FusionUtils.getTickArrayAddressFromTickIndex(fusionPool, args.tickLowerIndex);
|
|
14474
14495
|
const upperTickArrayAddress = await FusionUtils.getTickArrayAddressFromTickIndex(fusionPool, args.tickUpperIndex);
|
|
14475
14496
|
const remainingAccounts = [
|
|
14476
|
-
{ address: swapTickArrays[0], role:
|
|
14477
|
-
{ address: swapTickArrays[1], role:
|
|
14478
|
-
{ address: swapTickArrays[2], role:
|
|
14479
|
-
{ address: swapTickArrays[3], role:
|
|
14480
|
-
{ address: swapTickArrays[4], role:
|
|
14481
|
-
{ address: lowerTickArrayAddress, role:
|
|
14482
|
-
{ address: upperTickArrayAddress, role:
|
|
14483
|
-
{ address: fusionPool.data.tokenVaultA, role:
|
|
14484
|
-
{ address: fusionPool.data.tokenVaultB, role:
|
|
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 }
|
|
14485
14506
|
];
|
|
14486
14507
|
const remainingAccountsInfo = {
|
|
14487
14508
|
slices: [
|
|
@@ -14560,124 +14581,135 @@ async function openAndIncreaseTunaLpPositionFusionInstruction(authority, positio
|
|
|
14560
14581
|
ix.accounts.push(...remainingAccounts);
|
|
14561
14582
|
return ix;
|
|
14562
14583
|
}
|
|
14563
|
-
function getOpenAndIncreaseTunaLpPositionFusionInstructionWithEphemeralSigner(input
|
|
14564
|
-
|
|
14565
|
-
const originalAccounts = {
|
|
14566
|
-
authority: { value: input.authority ?? null, isWritable: true },
|
|
14567
|
-
tunaConfig: { value: input.tunaConfig ?? null, isWritable: false },
|
|
14568
|
-
mintA: { value: input.mintA ?? null, isWritable: false },
|
|
14569
|
-
mintB: { value: input.mintB ?? null, isWritable: false },
|
|
14570
|
-
tokenProgramA: { value: input.tokenProgramA ?? null, isWritable: false },
|
|
14571
|
-
tokenProgramB: { value: input.tokenProgramB ?? null, isWritable: false },
|
|
14572
|
-
market: { value: input.market ?? null, isWritable: true },
|
|
14573
|
-
vaultA: { value: input.vaultA ?? null, isWritable: true },
|
|
14574
|
-
vaultB: { value: input.vaultB ?? null, isWritable: true },
|
|
14575
|
-
vaultAAta: { value: input.vaultAAta ?? null, isWritable: true },
|
|
14576
|
-
vaultBAta: { value: input.vaultBAta ?? null, isWritable: true },
|
|
14577
|
-
tunaPosition: { value: input.tunaPosition ?? null, isWritable: true },
|
|
14578
|
-
tunaPositionMint: {
|
|
14579
|
-
value: input.tunaPositionMint ?? null,
|
|
14580
|
-
isWritable: true
|
|
14581
|
-
},
|
|
14582
|
-
tunaPositionAta: { value: input.tunaPositionAta ?? null, isWritable: true },
|
|
14583
|
-
tunaPositionAtaA: {
|
|
14584
|
-
value: input.tunaPositionAtaA ?? null,
|
|
14585
|
-
isWritable: true
|
|
14586
|
-
},
|
|
14587
|
-
tunaPositionAtaB: {
|
|
14588
|
-
value: input.tunaPositionAtaB ?? null,
|
|
14589
|
-
isWritable: true
|
|
14590
|
-
},
|
|
14591
|
-
tunaPositionOwnerAtaA: {
|
|
14592
|
-
value: input.tunaPositionOwnerAtaA ?? null,
|
|
14593
|
-
isWritable: true
|
|
14594
|
-
},
|
|
14595
|
-
tunaPositionOwnerAtaB: {
|
|
14596
|
-
value: input.tunaPositionOwnerAtaB ?? null,
|
|
14597
|
-
isWritable: true
|
|
14598
|
-
},
|
|
14599
|
-
feeRecipientAtaA: {
|
|
14600
|
-
value: input.feeRecipientAtaA ?? null,
|
|
14601
|
-
isWritable: true
|
|
14602
|
-
},
|
|
14603
|
-
feeRecipientAtaB: {
|
|
14604
|
-
value: input.feeRecipientAtaB ?? null,
|
|
14605
|
-
isWritable: true
|
|
14606
|
-
},
|
|
14607
|
-
pythOraclePriceFeedA: {
|
|
14608
|
-
value: input.pythOraclePriceFeedA ?? null,
|
|
14609
|
-
isWritable: false
|
|
14610
|
-
},
|
|
14611
|
-
pythOraclePriceFeedB: {
|
|
14612
|
-
value: input.pythOraclePriceFeedB ?? null,
|
|
14613
|
-
isWritable: false
|
|
14614
|
-
},
|
|
14615
|
-
fusionammProgram: {
|
|
14616
|
-
value: input.fusionammProgram ?? null,
|
|
14617
|
-
isWritable: false
|
|
14618
|
-
},
|
|
14619
|
-
fusionPool: { value: input.fusionPool ?? null, isWritable: true },
|
|
14620
|
-
fusionPosition: { value: input.fusionPosition ?? null, isWritable: true },
|
|
14621
|
-
metadataUpdateAuth: {
|
|
14622
|
-
value: input.metadataUpdateAuth ?? null,
|
|
14623
|
-
isWritable: false
|
|
14624
|
-
},
|
|
14625
|
-
memoProgram: { value: input.memoProgram ?? null, isWritable: false },
|
|
14626
|
-
token2022Program: {
|
|
14627
|
-
value: input.token2022Program ?? null,
|
|
14628
|
-
isWritable: false
|
|
14629
|
-
},
|
|
14630
|
-
systemProgram: { value: input.systemProgram ?? null, isWritable: false },
|
|
14631
|
-
associatedTokenProgram: {
|
|
14632
|
-
value: input.associatedTokenProgram ?? null,
|
|
14633
|
-
isWritable: false
|
|
14634
|
-
}
|
|
14635
|
-
};
|
|
14636
|
-
const accounts = originalAccounts;
|
|
14637
|
-
const args = { ...input };
|
|
14638
|
-
if (!accounts.systemProgram.value) {
|
|
14639
|
-
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
14640
|
-
}
|
|
14641
|
-
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
14642
|
-
const instruction = {
|
|
14584
|
+
function getOpenAndIncreaseTunaLpPositionFusionInstructionWithEphemeralSigner(input) {
|
|
14585
|
+
return {
|
|
14643
14586
|
accounts: [
|
|
14644
|
-
|
|
14645
|
-
|
|
14646
|
-
|
|
14647
|
-
|
|
14648
|
-
|
|
14649
|
-
|
|
14650
|
-
|
|
14651
|
-
|
|
14652
|
-
|
|
14653
|
-
|
|
14654
|
-
|
|
14655
|
-
|
|
14656
|
-
|
|
14657
|
-
|
|
14658
|
-
|
|
14659
|
-
|
|
14660
|
-
|
|
14661
|
-
|
|
14662
|
-
|
|
14663
|
-
|
|
14664
|
-
|
|
14665
|
-
|
|
14666
|
-
|
|
14667
|
-
|
|
14668
|
-
|
|
14669
|
-
|
|
14670
|
-
|
|
14671
|
-
|
|
14672
|
-
|
|
14673
|
-
|
|
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
|
+
}
|
|
14674
14707
|
],
|
|
14675
|
-
programAddress,
|
|
14708
|
+
programAddress: TUNA_PROGRAM_ADDRESS,
|
|
14676
14709
|
data: getOpenAndIncreaseTunaLpPositionFusionInstructionDataEncoder().encode(
|
|
14677
|
-
|
|
14710
|
+
input
|
|
14678
14711
|
)
|
|
14679
14712
|
};
|
|
14680
|
-
return instruction;
|
|
14681
14713
|
}
|
|
14682
14714
|
|
|
14683
14715
|
// src/txbuilder/openTunaSpotPosition.ts
|
|
@@ -14749,7 +14781,7 @@ import {
|
|
|
14749
14781
|
} from "@orca-so/whirlpools-client";
|
|
14750
14782
|
import { collectRewardsQuote as collectRewardsQuote2, getTickArrayStartTickIndex as getTickArrayStartTickIndex8, getTickIndexInArray as getTickIndexInArray2 } from "@orca-so/whirlpools-core";
|
|
14751
14783
|
import {
|
|
14752
|
-
AccountRole as
|
|
14784
|
+
AccountRole as AccountRole19,
|
|
14753
14785
|
assertAccountsExist as assertAccountsExist9
|
|
14754
14786
|
} from "@solana/kit";
|
|
14755
14787
|
import { MEMO_PROGRAM_ADDRESS as MEMO_PROGRAM_ADDRESS18 } from "@solana-program/memo";
|
|
@@ -14889,16 +14921,16 @@ async function decreaseTunaLpPositionOrcaInstruction(authority, tunaPosition, mi
|
|
|
14889
14921
|
tunaPosition.data.tickUpperIndex
|
|
14890
14922
|
);
|
|
14891
14923
|
const remainingAccounts = [
|
|
14892
|
-
{ address: swapTickArrays[0], role:
|
|
14893
|
-
{ address: swapTickArrays[1], role:
|
|
14894
|
-
{ address: swapTickArrays[2], role:
|
|
14895
|
-
{ address: swapTickArrays[3], role:
|
|
14896
|
-
{ address: swapTickArrays[4], role:
|
|
14897
|
-
{ address: lowerTickArrayAddress, role:
|
|
14898
|
-
{ address: upperTickArrayAddress, role:
|
|
14899
|
-
{ address: whirlpool.data.tokenVaultA, role:
|
|
14900
|
-
{ address: whirlpool.data.tokenVaultB, role:
|
|
14901
|
-
{ address: orcaOracleAddress, role:
|
|
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 }
|
|
14902
14934
|
];
|
|
14903
14935
|
for (const rewardIndex of rewardIndicesToClaim) {
|
|
14904
14936
|
const rewardInfo = whirlpool.data.rewardInfos[rewardIndex];
|
|
@@ -14909,10 +14941,10 @@ async function decreaseTunaLpPositionOrcaInstruction(authority, tunaPosition, mi
|
|
|
14909
14941
|
mint: rewardMint.address,
|
|
14910
14942
|
tokenProgram: rewardMint.programAddress
|
|
14911
14943
|
});
|
|
14912
|
-
remainingAccounts.push({ address: rewardMint.address, role:
|
|
14913
|
-
remainingAccounts.push({ address: rewardMint.programAddress, role:
|
|
14914
|
-
remainingAccounts.push({ address: ownerAta[0], role:
|
|
14915
|
-
remainingAccounts.push({ address: rewardInfo.vault, role:
|
|
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 });
|
|
14916
14948
|
}
|
|
14917
14949
|
const remainingAccountsInfo = {
|
|
14918
14950
|
slices: [
|
|
@@ -14965,7 +14997,7 @@ import {
|
|
|
14965
14997
|
getPositionAddress as getPositionAddress18
|
|
14966
14998
|
} from "@crypticdot/fusionamm-client";
|
|
14967
14999
|
import {
|
|
14968
|
-
AccountRole as
|
|
15000
|
+
AccountRole as AccountRole20
|
|
14969
15001
|
} from "@solana/kit";
|
|
14970
15002
|
import { MEMO_PROGRAM_ADDRESS as MEMO_PROGRAM_ADDRESS19 } from "@solana-program/memo";
|
|
14971
15003
|
import {
|
|
@@ -15070,15 +15102,15 @@ async function decreaseTunaLpPositionFusionInstruction(authority, tunaPosition,
|
|
|
15070
15102
|
tunaPosition.data.tickUpperIndex
|
|
15071
15103
|
);
|
|
15072
15104
|
const remainingAccounts = [
|
|
15073
|
-
{ address: swapTickArrays[0], role:
|
|
15074
|
-
{ address: swapTickArrays[1], role:
|
|
15075
|
-
{ address: swapTickArrays[2], role:
|
|
15076
|
-
{ address: swapTickArrays[3], role:
|
|
15077
|
-
{ address: swapTickArrays[4], role:
|
|
15078
|
-
{ address: lowerTickArrayAddress, role:
|
|
15079
|
-
{ address: upperTickArrayAddress, role:
|
|
15080
|
-
{ address: fusionPool.data.tokenVaultA, role:
|
|
15081
|
-
{ address: fusionPool.data.tokenVaultB, role:
|
|
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 }
|
|
15082
15114
|
];
|
|
15083
15115
|
const remainingAccountsInfo = {
|
|
15084
15116
|
slices: [
|
|
@@ -15291,7 +15323,7 @@ async function withdrawInstruction(authority, mint, vault, funds, shares) {
|
|
|
15291
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";
|
|
15292
15324
|
import { fetchWhirlpool as fetchWhirlpool3, getOracleAddress as getOracleAddress8, WHIRLPOOL_PROGRAM_ADDRESS as WHIRLPOOL_PROGRAM_ADDRESS13 } from "@orca-so/whirlpools-client";
|
|
15293
15325
|
import {
|
|
15294
|
-
address as
|
|
15326
|
+
address as address7
|
|
15295
15327
|
} from "@solana/kit";
|
|
15296
15328
|
import { fetchAddressLookupTable, getExtendLookupTableInstruction as getExtendLookupTableInstruction2 } from "@solana-program/address-lookup-table";
|
|
15297
15329
|
import { MEMO_PROGRAM_ADDRESS as MEMO_PROGRAM_ADDRESS22 } from "@solana-program/memo";
|
|
@@ -15337,7 +15369,7 @@ async function getAddressesForMarketLookupTable(rpc, poolAddress, marketMaker) {
|
|
|
15337
15369
|
}))[0];
|
|
15338
15370
|
const addresses = [
|
|
15339
15371
|
SYSTEM_PROGRAM_ADDRESS,
|
|
15340
|
-
|
|
15372
|
+
address7("SysvarRent111111111111111111111111111111111"),
|
|
15341
15373
|
ASSOCIATED_TOKEN_PROGRAM_ADDRESS6,
|
|
15342
15374
|
TOKEN_PROGRAM_ADDRESS2,
|
|
15343
15375
|
TOKEN_2022_PROGRAM_ADDRESS19,
|
|
@@ -15506,7 +15538,7 @@ import {
|
|
|
15506
15538
|
WHIRLPOOL_PROGRAM_ADDRESS as WHIRLPOOL_PROGRAM_ADDRESS14
|
|
15507
15539
|
} from "@orca-so/whirlpools-client";
|
|
15508
15540
|
import {
|
|
15509
|
-
AccountRole as
|
|
15541
|
+
AccountRole as AccountRole21,
|
|
15510
15542
|
lamports as lamports3
|
|
15511
15543
|
} from "@solana/kit";
|
|
15512
15544
|
import { fetchSysvarRent as fetchSysvarRent3 } from "@solana/sysvars";
|
|
@@ -15639,18 +15671,18 @@ async function rebalanceTunaLpPositionOrcaInstruction(authority, tunaPosition, t
|
|
|
15639
15671
|
);
|
|
15640
15672
|
const secondaryTickArrays = await OrcaUtils.getTickArraysForRebalancedPosition(whirlpool, tunaPosition);
|
|
15641
15673
|
const remainingAccounts = [
|
|
15642
|
-
{ address: swapTickArrays[0], role:
|
|
15643
|
-
{ address: swapTickArrays[1], role:
|
|
15644
|
-
{ address: swapTickArrays[2], role:
|
|
15645
|
-
{ address: swapTickArrays[3], role:
|
|
15646
|
-
{ address: swapTickArrays[4], role:
|
|
15647
|
-
{ address: lowerTickArrayAddress, role:
|
|
15648
|
-
{ address: upperTickArrayAddress, role:
|
|
15649
|
-
{ address: secondaryTickArrays.lowerTickArrayAddress, role:
|
|
15650
|
-
{ address: secondaryTickArrays.upperTickArrayAddress, role:
|
|
15651
|
-
{ address: whirlpool.data.tokenVaultA, role:
|
|
15652
|
-
{ address: whirlpool.data.tokenVaultB, role:
|
|
15653
|
-
{ address: orcaOracleAddress, role:
|
|
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 }
|
|
15654
15686
|
];
|
|
15655
15687
|
const remainingAccountsInfo = {
|
|
15656
15688
|
slices: [
|
|
@@ -15702,7 +15734,7 @@ import {
|
|
|
15702
15734
|
getTickArraySize as getTickArraySize2
|
|
15703
15735
|
} from "@crypticdot/fusionamm-client";
|
|
15704
15736
|
import {
|
|
15705
|
-
AccountRole as
|
|
15737
|
+
AccountRole as AccountRole22,
|
|
15706
15738
|
lamports as lamports4
|
|
15707
15739
|
} from "@solana/kit";
|
|
15708
15740
|
import { fetchSysvarRent as fetchSysvarRent4 } from "@solana/sysvars";
|
|
@@ -15830,17 +15862,17 @@ async function rebalanceTunaLpPositionFusionInstruction(authority, tunaPosition,
|
|
|
15830
15862
|
);
|
|
15831
15863
|
const secondaryTickArrays = await FusionUtils.getTickArraysForRebalancedPosition(fusionPool, tunaPosition);
|
|
15832
15864
|
const remainingAccounts = [
|
|
15833
|
-
{ address: swapTickArrays[0], role:
|
|
15834
|
-
{ address: swapTickArrays[1], role:
|
|
15835
|
-
{ address: swapTickArrays[2], role:
|
|
15836
|
-
{ address: swapTickArrays[3], role:
|
|
15837
|
-
{ address: swapTickArrays[4], role:
|
|
15838
|
-
{ address: lowerTickArrayAddress, role:
|
|
15839
|
-
{ address: upperTickArrayAddress, role:
|
|
15840
|
-
{ address: secondaryTickArrays.lowerTickArrayAddress, role:
|
|
15841
|
-
{ address: secondaryTickArrays.upperTickArrayAddress, role:
|
|
15842
|
-
{ address: fusionPool.data.tokenVaultA, role:
|
|
15843
|
-
{ address: fusionPool.data.tokenVaultB, role:
|
|
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 }
|
|
15844
15876
|
];
|
|
15845
15877
|
const remainingAccountsInfo = {
|
|
15846
15878
|
slices: [
|