@crypticdot/defituna-client 3.5.4 → 3.5.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +206 -199
- package/dist/index.d.cts +1 -3
- package/dist/index.d.ts +1 -3
- package/dist/index.js +200 -190
- 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, address5, config) {
|
|
77
|
+
const maybeAccount = await fetchMaybeLendingPosition(rpc, address5, 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, address5, config) {
|
|
82
|
+
const maybeAccount = await fetchEncodedAccount(rpc, address5, 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, address5, config) {
|
|
363
|
+
const maybeAccount = await fetchMaybeMarket(rpc, address5, 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, address5, config) {
|
|
368
|
+
const maybeAccount = await fetchEncodedAccount2(rpc, address5, 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, address5, config) {
|
|
480
|
+
const maybeAccount = await fetchMaybeTunaConfig(rpc, address5, 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, address5, config) {
|
|
485
|
+
const maybeAccount = await fetchEncodedAccount3(rpc, address5, 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, address5, config) {
|
|
629
|
+
const maybeAccount = await fetchMaybeTunaLpPosition(rpc, address5, 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, address5, config) {
|
|
634
|
+
const maybeAccount = await fetchEncodedAccount4(rpc, address5, 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, address5, config) {
|
|
757
|
+
const maybeAccount = await fetchMaybeTunaSpotPosition(rpc, address5, 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, address5, config) {
|
|
762
|
+
const maybeAccount = await fetchEncodedAccount5(rpc, address5, 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, address5, config) {
|
|
874
|
+
const maybeAccount = await fetchMaybeVault(rpc, address5, 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, address5, config) {
|
|
879
|
+
const maybeAccount = await fetchEncodedAccount6(rpc, address5, 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(address5) {
|
|
9809
9809
|
return {
|
|
9810
9810
|
memcmp: {
|
|
9811
9811
|
offset: 11n,
|
|
9812
|
-
bytes: getBase58Decoder().decode(getAddressEncoder19().encode(
|
|
9812
|
+
bytes: getBase58Decoder().decode(getAddressEncoder19().encode(address5)),
|
|
9813
9813
|
encoding: "base58"
|
|
9814
9814
|
}
|
|
9815
9815
|
};
|
|
9816
9816
|
}
|
|
9817
|
-
function tunaLpPositionPoolFilter(
|
|
9817
|
+
function tunaLpPositionPoolFilter(address5) {
|
|
9818
9818
|
return {
|
|
9819
9819
|
memcmp: {
|
|
9820
9820
|
offset: 43n,
|
|
9821
|
-
bytes: getBase58Decoder().decode(getAddressEncoder19().encode(
|
|
9821
|
+
bytes: getBase58Decoder().decode(getAddressEncoder19().encode(address5)),
|
|
9822
9822
|
encoding: "base58"
|
|
9823
9823
|
}
|
|
9824
9824
|
};
|
|
9825
9825
|
}
|
|
9826
|
-
function tunaLpPositionMintAFilter(
|
|
9826
|
+
function tunaLpPositionMintAFilter(address5) {
|
|
9827
9827
|
return {
|
|
9828
9828
|
memcmp: {
|
|
9829
9829
|
offset: 75n,
|
|
9830
|
-
bytes: getBase58Decoder().decode(getAddressEncoder19().encode(
|
|
9830
|
+
bytes: getBase58Decoder().decode(getAddressEncoder19().encode(address5)),
|
|
9831
9831
|
encoding: "base58"
|
|
9832
9832
|
}
|
|
9833
9833
|
};
|
|
9834
9834
|
}
|
|
9835
|
-
function tunaLpPositionMintBFilter(
|
|
9835
|
+
function tunaLpPositionMintBFilter(address5) {
|
|
9836
9836
|
return {
|
|
9837
9837
|
memcmp: {
|
|
9838
9838
|
offset: 107n,
|
|
9839
|
-
bytes: getBase58Decoder().decode(getAddressEncoder19().encode(
|
|
9839
|
+
bytes: getBase58Decoder().decode(getAddressEncoder19().encode(address5)),
|
|
9840
9840
|
encoding: "base58"
|
|
9841
9841
|
}
|
|
9842
9842
|
};
|
|
9843
9843
|
}
|
|
9844
|
-
function tunaLpPositionMintFilter(
|
|
9844
|
+
function tunaLpPositionMintFilter(address5) {
|
|
9845
9845
|
return {
|
|
9846
9846
|
memcmp: {
|
|
9847
9847
|
offset: 139n,
|
|
9848
|
-
bytes: getBase58Decoder().decode(getAddressEncoder19().encode(
|
|
9848
|
+
bytes: getBase58Decoder().decode(getAddressEncoder19().encode(address5)),
|
|
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(address5) {
|
|
9885
9885
|
return {
|
|
9886
9886
|
memcmp: {
|
|
9887
9887
|
offset: 11n,
|
|
9888
|
-
bytes: getBase58Decoder2().decode(getAddressEncoder20().encode(
|
|
9888
|
+
bytes: getBase58Decoder2().decode(getAddressEncoder20().encode(address5)),
|
|
9889
9889
|
encoding: "base58"
|
|
9890
9890
|
}
|
|
9891
9891
|
};
|
|
9892
9892
|
}
|
|
9893
|
-
function tunaSpotPositionPoolFilter(
|
|
9893
|
+
function tunaSpotPositionPoolFilter(address5) {
|
|
9894
9894
|
return {
|
|
9895
9895
|
memcmp: {
|
|
9896
9896
|
offset: 43n,
|
|
9897
|
-
bytes: getBase58Decoder2().decode(getAddressEncoder20().encode(
|
|
9897
|
+
bytes: getBase58Decoder2().decode(getAddressEncoder20().encode(address5)),
|
|
9898
9898
|
encoding: "base58"
|
|
9899
9899
|
}
|
|
9900
9900
|
};
|
|
9901
9901
|
}
|
|
9902
|
-
function tunaSpotPositionMintAFilter(
|
|
9902
|
+
function tunaSpotPositionMintAFilter(address5) {
|
|
9903
9903
|
return {
|
|
9904
9904
|
memcmp: {
|
|
9905
9905
|
offset: 75n,
|
|
9906
|
-
bytes: getBase58Decoder2().decode(getAddressEncoder20().encode(
|
|
9906
|
+
bytes: getBase58Decoder2().decode(getAddressEncoder20().encode(address5)),
|
|
9907
9907
|
encoding: "base58"
|
|
9908
9908
|
}
|
|
9909
9909
|
};
|
|
9910
9910
|
}
|
|
9911
|
-
function tunaSpotPositionMintBFilter(
|
|
9911
|
+
function tunaSpotPositionMintBFilter(address5) {
|
|
9912
9912
|
return {
|
|
9913
9913
|
memcmp: {
|
|
9914
9914
|
offset: 107n,
|
|
9915
|
-
bytes: getBase58Decoder2().decode(getAddressEncoder20().encode(
|
|
9915
|
+
bytes: getBase58Decoder2().decode(getAddressEncoder20().encode(address5)),
|
|
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(address5) {
|
|
9943
9943
|
return {
|
|
9944
9944
|
memcmp: {
|
|
9945
9945
|
offset: 11n,
|
|
9946
|
-
bytes: getBase58Decoder3().decode(getAddressEncoder21().encode(
|
|
9946
|
+
bytes: getBase58Decoder3().decode(getAddressEncoder21().encode(address5)),
|
|
9947
9947
|
encoding: "base58"
|
|
9948
9948
|
}
|
|
9949
9949
|
};
|
|
9950
9950
|
}
|
|
9951
|
-
function lendingPositionMintFilter(
|
|
9951
|
+
function lendingPositionMintFilter(address5) {
|
|
9952
9952
|
return {
|
|
9953
9953
|
memcmp: {
|
|
9954
9954
|
offset: 43n,
|
|
9955
|
-
bytes: getBase58Decoder3().decode(getAddressEncoder21().encode(
|
|
9955
|
+
bytes: getBase58Decoder3().decode(getAddressEncoder21().encode(address5)),
|
|
9956
9956
|
encoding: "base58"
|
|
9957
9957
|
}
|
|
9958
9958
|
};
|
|
9959
9959
|
}
|
|
9960
|
-
function lendingPositionVaultFilter(
|
|
9960
|
+
function lendingPositionVaultFilter(address5) {
|
|
9961
9961
|
return {
|
|
9962
9962
|
memcmp: {
|
|
9963
9963
|
offset: 91n,
|
|
9964
|
-
bytes: getBase58Decoder3().decode(getAddressEncoder21().encode(
|
|
9964
|
+
bytes: getBase58Decoder3().decode(getAddressEncoder21().encode(address5)),
|
|
9965
9965
|
encoding: "base58"
|
|
9966
9966
|
}
|
|
9967
9967
|
};
|
|
@@ -13738,6 +13738,10 @@ function getOpenTunaLpPositionOrcaInstructionWithEphemeralSigner(input, config)
|
|
|
13738
13738
|
// src/txbuilder/openTunaLpPositionFusion.ts
|
|
13739
13739
|
import { fetchMaybeFusionPool as fetchMaybeFusionPool6, FUSIONAMM_PROGRAM_ADDRESS as FUSIONAMM_PROGRAM_ADDRESS9, getPositionAddress as getPositionAddress14 } from "@crypticdot/fusionamm-client";
|
|
13740
13740
|
import { FP_NFT_UPDATE_AUTH } from "@crypticdot/fusionamm-client";
|
|
13741
|
+
import {
|
|
13742
|
+
AccountRole as AccountRole15,
|
|
13743
|
+
address as address3
|
|
13744
|
+
} from "@solana/kit";
|
|
13741
13745
|
import {
|
|
13742
13746
|
ASSOCIATED_TOKEN_PROGRAM_ADDRESS as ASSOCIATED_TOKEN_PROGRAM_ADDRESS2,
|
|
13743
13747
|
fetchAllMaybeMint as fetchAllMaybeMint16,
|
|
@@ -13810,79 +13814,85 @@ async function openTunaLpPositionFusionInstruction(rpc, authority, positionMint,
|
|
|
13810
13814
|
...args
|
|
13811
13815
|
});
|
|
13812
13816
|
}
|
|
13813
|
-
function getOpenTunaLpPositionFusionInstructionWithEphemeralSigner(input
|
|
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");
|
|
13817
|
+
function getOpenTunaLpPositionFusionInstructionWithEphemeralSigner(input) {
|
|
13862
13818
|
const instruction = {
|
|
13863
13819
|
accounts: [
|
|
13864
|
-
|
|
13865
|
-
|
|
13866
|
-
|
|
13867
|
-
|
|
13868
|
-
|
|
13869
|
-
|
|
13870
|
-
|
|
13871
|
-
|
|
13872
|
-
|
|
13873
|
-
|
|
13874
|
-
|
|
13875
|
-
|
|
13876
|
-
|
|
13877
|
-
|
|
13878
|
-
|
|
13879
|
-
|
|
13880
|
-
|
|
13881
|
-
|
|
13820
|
+
{
|
|
13821
|
+
address: input.authority.address,
|
|
13822
|
+
role: AccountRole15.WRITABLE_SIGNER
|
|
13823
|
+
},
|
|
13824
|
+
{
|
|
13825
|
+
address: input.mintA,
|
|
13826
|
+
role: AccountRole15.READONLY
|
|
13827
|
+
},
|
|
13828
|
+
{
|
|
13829
|
+
address: input.mintB,
|
|
13830
|
+
role: AccountRole15.READONLY
|
|
13831
|
+
},
|
|
13832
|
+
{
|
|
13833
|
+
address: input.tokenProgramA,
|
|
13834
|
+
role: AccountRole15.READONLY
|
|
13835
|
+
},
|
|
13836
|
+
{
|
|
13837
|
+
address: input.tokenProgramB,
|
|
13838
|
+
role: AccountRole15.READONLY
|
|
13839
|
+
},
|
|
13840
|
+
{
|
|
13841
|
+
address: input.market,
|
|
13842
|
+
role: AccountRole15.READONLY
|
|
13843
|
+
},
|
|
13844
|
+
{
|
|
13845
|
+
address: input.tunaPosition,
|
|
13846
|
+
role: AccountRole15.WRITABLE
|
|
13847
|
+
},
|
|
13848
|
+
{
|
|
13849
|
+
address: input.tunaPositionMint,
|
|
13850
|
+
role: AccountRole15.WRITABLE_SIGNER
|
|
13851
|
+
},
|
|
13852
|
+
{
|
|
13853
|
+
address: input.tunaPositionAta,
|
|
13854
|
+
role: AccountRole15.WRITABLE
|
|
13855
|
+
},
|
|
13856
|
+
{
|
|
13857
|
+
address: input.tunaPositionAtaA,
|
|
13858
|
+
role: AccountRole15.WRITABLE
|
|
13859
|
+
},
|
|
13860
|
+
{
|
|
13861
|
+
address: input.tunaPositionAtaB,
|
|
13862
|
+
role: AccountRole15.WRITABLE
|
|
13863
|
+
},
|
|
13864
|
+
{
|
|
13865
|
+
address: input.fusionammProgram,
|
|
13866
|
+
role: AccountRole15.READONLY
|
|
13867
|
+
},
|
|
13868
|
+
{
|
|
13869
|
+
address: input.fusionPool,
|
|
13870
|
+
role: AccountRole15.READONLY
|
|
13871
|
+
},
|
|
13872
|
+
{
|
|
13873
|
+
address: input.fusionPosition,
|
|
13874
|
+
role: AccountRole15.WRITABLE
|
|
13875
|
+
},
|
|
13876
|
+
{
|
|
13877
|
+
address: input.metadataUpdateAuth,
|
|
13878
|
+
role: AccountRole15.READONLY
|
|
13879
|
+
},
|
|
13880
|
+
{
|
|
13881
|
+
address: input.token2022Program,
|
|
13882
|
+
role: AccountRole15.READONLY
|
|
13883
|
+
},
|
|
13884
|
+
{
|
|
13885
|
+
address: input.systemProgram ?? address3("11111111111111111111111111111111"),
|
|
13886
|
+
role: AccountRole15.READONLY
|
|
13887
|
+
},
|
|
13888
|
+
{
|
|
13889
|
+
address: input.associatedTokenProgram,
|
|
13890
|
+
role: AccountRole15.READONLY
|
|
13891
|
+
}
|
|
13882
13892
|
],
|
|
13883
|
-
programAddress,
|
|
13893
|
+
programAddress: TUNA_PROGRAM_ADDRESS,
|
|
13884
13894
|
data: getOpenTunaLpPositionFusionInstructionDataEncoder().encode(
|
|
13885
|
-
|
|
13895
|
+
input
|
|
13886
13896
|
)
|
|
13887
13897
|
};
|
|
13888
13898
|
return instruction;
|
|
@@ -13901,7 +13911,7 @@ import {
|
|
|
13901
13911
|
} from "@orca-so/whirlpools-client";
|
|
13902
13912
|
import { getTickArrayStartTickIndex as getTickArrayStartTickIndex6 } from "@orca-so/whirlpools-core";
|
|
13903
13913
|
import {
|
|
13904
|
-
AccountRole as
|
|
13914
|
+
AccountRole as AccountRole16,
|
|
13905
13915
|
lamports
|
|
13906
13916
|
} from "@solana/kit";
|
|
13907
13917
|
import { fetchSysvarRent } from "@solana/sysvars";
|
|
@@ -14078,16 +14088,16 @@ async function openAndIncreaseTunaLpPositionOrcaInstruction(authority, positionM
|
|
|
14078
14088
|
const lowerTickArrayAddress = await OrcaUtils.getTickArrayAddressFromTickIndex(whirlpool, args.tickLowerIndex);
|
|
14079
14089
|
const upperTickArrayAddress = await OrcaUtils.getTickArrayAddressFromTickIndex(whirlpool, args.tickUpperIndex);
|
|
14080
14090
|
const remainingAccounts = [
|
|
14081
|
-
{ address: swapTickArrays[0], role:
|
|
14082
|
-
{ address: swapTickArrays[1], role:
|
|
14083
|
-
{ address: swapTickArrays[2], role:
|
|
14084
|
-
{ address: swapTickArrays[3], role:
|
|
14085
|
-
{ address: swapTickArrays[4], role:
|
|
14086
|
-
{ address: lowerTickArrayAddress, role:
|
|
14087
|
-
{ address: upperTickArrayAddress, role:
|
|
14088
|
-
{ address: whirlpool.data.tokenVaultA, role:
|
|
14089
|
-
{ address: whirlpool.data.tokenVaultB, role:
|
|
14090
|
-
{ address: orcaOracleAddress, role:
|
|
14091
|
+
{ address: swapTickArrays[0], role: AccountRole16.WRITABLE },
|
|
14092
|
+
{ address: swapTickArrays[1], role: AccountRole16.WRITABLE },
|
|
14093
|
+
{ address: swapTickArrays[2], role: AccountRole16.WRITABLE },
|
|
14094
|
+
{ address: swapTickArrays[3], role: AccountRole16.WRITABLE },
|
|
14095
|
+
{ address: swapTickArrays[4], role: AccountRole16.WRITABLE },
|
|
14096
|
+
{ address: lowerTickArrayAddress, role: AccountRole16.WRITABLE },
|
|
14097
|
+
{ address: upperTickArrayAddress, role: AccountRole16.WRITABLE },
|
|
14098
|
+
{ address: whirlpool.data.tokenVaultA, role: AccountRole16.WRITABLE },
|
|
14099
|
+
{ address: whirlpool.data.tokenVaultB, role: AccountRole16.WRITABLE },
|
|
14100
|
+
{ address: orcaOracleAddress, role: AccountRole16.WRITABLE }
|
|
14091
14101
|
];
|
|
14092
14102
|
const remainingAccountsInfo = {
|
|
14093
14103
|
slices: [
|
|
@@ -14300,7 +14310,7 @@ import {
|
|
|
14300
14310
|
} from "@crypticdot/fusionamm-client";
|
|
14301
14311
|
import { getTickArrayStartTickIndex as getTickArrayStartTickIndex7 } from "@crypticdot/fusionamm-core";
|
|
14302
14312
|
import {
|
|
14303
|
-
AccountRole as
|
|
14313
|
+
AccountRole as AccountRole17,
|
|
14304
14314
|
lamports as lamports2
|
|
14305
14315
|
} from "@solana/kit";
|
|
14306
14316
|
import { fetchSysvarRent as fetchSysvarRent2 } from "@solana/sysvars";
|
|
@@ -14463,15 +14473,15 @@ async function openAndIncreaseTunaLpPositionFusionInstruction(authority, positio
|
|
|
14463
14473
|
const lowerTickArrayAddress = await FusionUtils.getTickArrayAddressFromTickIndex(fusionPool, args.tickLowerIndex);
|
|
14464
14474
|
const upperTickArrayAddress = await FusionUtils.getTickArrayAddressFromTickIndex(fusionPool, args.tickUpperIndex);
|
|
14465
14475
|
const remainingAccounts = [
|
|
14466
|
-
{ address: swapTickArrays[0], role:
|
|
14467
|
-
{ address: swapTickArrays[1], role:
|
|
14468
|
-
{ address: swapTickArrays[2], role:
|
|
14469
|
-
{ address: swapTickArrays[3], role:
|
|
14470
|
-
{ address: swapTickArrays[4], role:
|
|
14471
|
-
{ address: lowerTickArrayAddress, role:
|
|
14472
|
-
{ address: upperTickArrayAddress, role:
|
|
14473
|
-
{ address: fusionPool.data.tokenVaultA, role:
|
|
14474
|
-
{ address: fusionPool.data.tokenVaultB, role:
|
|
14476
|
+
{ address: swapTickArrays[0], role: AccountRole17.WRITABLE },
|
|
14477
|
+
{ address: swapTickArrays[1], role: AccountRole17.WRITABLE },
|
|
14478
|
+
{ address: swapTickArrays[2], role: AccountRole17.WRITABLE },
|
|
14479
|
+
{ address: swapTickArrays[3], role: AccountRole17.WRITABLE },
|
|
14480
|
+
{ address: swapTickArrays[4], role: AccountRole17.WRITABLE },
|
|
14481
|
+
{ address: lowerTickArrayAddress, role: AccountRole17.WRITABLE },
|
|
14482
|
+
{ address: upperTickArrayAddress, role: AccountRole17.WRITABLE },
|
|
14483
|
+
{ address: fusionPool.data.tokenVaultA, role: AccountRole17.WRITABLE },
|
|
14484
|
+
{ address: fusionPool.data.tokenVaultB, role: AccountRole17.WRITABLE }
|
|
14475
14485
|
];
|
|
14476
14486
|
const remainingAccountsInfo = {
|
|
14477
14487
|
slices: [
|
|
@@ -14739,7 +14749,7 @@ import {
|
|
|
14739
14749
|
} from "@orca-so/whirlpools-client";
|
|
14740
14750
|
import { collectRewardsQuote as collectRewardsQuote2, getTickArrayStartTickIndex as getTickArrayStartTickIndex8, getTickIndexInArray as getTickIndexInArray2 } from "@orca-so/whirlpools-core";
|
|
14741
14751
|
import {
|
|
14742
|
-
AccountRole as
|
|
14752
|
+
AccountRole as AccountRole18,
|
|
14743
14753
|
assertAccountsExist as assertAccountsExist9
|
|
14744
14754
|
} from "@solana/kit";
|
|
14745
14755
|
import { MEMO_PROGRAM_ADDRESS as MEMO_PROGRAM_ADDRESS18 } from "@solana-program/memo";
|
|
@@ -14879,16 +14889,16 @@ async function decreaseTunaLpPositionOrcaInstruction(authority, tunaPosition, mi
|
|
|
14879
14889
|
tunaPosition.data.tickUpperIndex
|
|
14880
14890
|
);
|
|
14881
14891
|
const remainingAccounts = [
|
|
14882
|
-
{ address: swapTickArrays[0], role:
|
|
14883
|
-
{ address: swapTickArrays[1], role:
|
|
14884
|
-
{ address: swapTickArrays[2], role:
|
|
14885
|
-
{ address: swapTickArrays[3], role:
|
|
14886
|
-
{ address: swapTickArrays[4], role:
|
|
14887
|
-
{ address: lowerTickArrayAddress, role:
|
|
14888
|
-
{ address: upperTickArrayAddress, role:
|
|
14889
|
-
{ address: whirlpool.data.tokenVaultA, role:
|
|
14890
|
-
{ address: whirlpool.data.tokenVaultB, role:
|
|
14891
|
-
{ address: orcaOracleAddress, role:
|
|
14892
|
+
{ address: swapTickArrays[0], role: AccountRole18.WRITABLE },
|
|
14893
|
+
{ address: swapTickArrays[1], role: AccountRole18.WRITABLE },
|
|
14894
|
+
{ address: swapTickArrays[2], role: AccountRole18.WRITABLE },
|
|
14895
|
+
{ address: swapTickArrays[3], role: AccountRole18.WRITABLE },
|
|
14896
|
+
{ address: swapTickArrays[4], role: AccountRole18.WRITABLE },
|
|
14897
|
+
{ address: lowerTickArrayAddress, role: AccountRole18.WRITABLE },
|
|
14898
|
+
{ address: upperTickArrayAddress, role: AccountRole18.WRITABLE },
|
|
14899
|
+
{ address: whirlpool.data.tokenVaultA, role: AccountRole18.WRITABLE },
|
|
14900
|
+
{ address: whirlpool.data.tokenVaultB, role: AccountRole18.WRITABLE },
|
|
14901
|
+
{ address: orcaOracleAddress, role: AccountRole18.WRITABLE }
|
|
14892
14902
|
];
|
|
14893
14903
|
for (const rewardIndex of rewardIndicesToClaim) {
|
|
14894
14904
|
const rewardInfo = whirlpool.data.rewardInfos[rewardIndex];
|
|
@@ -14899,10 +14909,10 @@ async function decreaseTunaLpPositionOrcaInstruction(authority, tunaPosition, mi
|
|
|
14899
14909
|
mint: rewardMint.address,
|
|
14900
14910
|
tokenProgram: rewardMint.programAddress
|
|
14901
14911
|
});
|
|
14902
|
-
remainingAccounts.push({ address: rewardMint.address, role:
|
|
14903
|
-
remainingAccounts.push({ address: rewardMint.programAddress, role:
|
|
14904
|
-
remainingAccounts.push({ address: ownerAta[0], role:
|
|
14905
|
-
remainingAccounts.push({ address: rewardInfo.vault, role:
|
|
14912
|
+
remainingAccounts.push({ address: rewardMint.address, role: AccountRole18.READONLY });
|
|
14913
|
+
remainingAccounts.push({ address: rewardMint.programAddress, role: AccountRole18.READONLY });
|
|
14914
|
+
remainingAccounts.push({ address: ownerAta[0], role: AccountRole18.WRITABLE });
|
|
14915
|
+
remainingAccounts.push({ address: rewardInfo.vault, role: AccountRole18.WRITABLE });
|
|
14906
14916
|
}
|
|
14907
14917
|
const remainingAccountsInfo = {
|
|
14908
14918
|
slices: [
|
|
@@ -14955,7 +14965,7 @@ import {
|
|
|
14955
14965
|
getPositionAddress as getPositionAddress18
|
|
14956
14966
|
} from "@crypticdot/fusionamm-client";
|
|
14957
14967
|
import {
|
|
14958
|
-
AccountRole as
|
|
14968
|
+
AccountRole as AccountRole19
|
|
14959
14969
|
} from "@solana/kit";
|
|
14960
14970
|
import { MEMO_PROGRAM_ADDRESS as MEMO_PROGRAM_ADDRESS19 } from "@solana-program/memo";
|
|
14961
14971
|
import {
|
|
@@ -15060,15 +15070,15 @@ async function decreaseTunaLpPositionFusionInstruction(authority, tunaPosition,
|
|
|
15060
15070
|
tunaPosition.data.tickUpperIndex
|
|
15061
15071
|
);
|
|
15062
15072
|
const remainingAccounts = [
|
|
15063
|
-
{ address: swapTickArrays[0], role:
|
|
15064
|
-
{ address: swapTickArrays[1], role:
|
|
15065
|
-
{ address: swapTickArrays[2], role:
|
|
15066
|
-
{ address: swapTickArrays[3], role:
|
|
15067
|
-
{ address: swapTickArrays[4], role:
|
|
15068
|
-
{ address: lowerTickArrayAddress, role:
|
|
15069
|
-
{ address: upperTickArrayAddress, role:
|
|
15070
|
-
{ address: fusionPool.data.tokenVaultA, role:
|
|
15071
|
-
{ address: fusionPool.data.tokenVaultB, role:
|
|
15073
|
+
{ address: swapTickArrays[0], role: AccountRole19.WRITABLE },
|
|
15074
|
+
{ address: swapTickArrays[1], role: AccountRole19.WRITABLE },
|
|
15075
|
+
{ address: swapTickArrays[2], role: AccountRole19.WRITABLE },
|
|
15076
|
+
{ address: swapTickArrays[3], role: AccountRole19.WRITABLE },
|
|
15077
|
+
{ address: swapTickArrays[4], role: AccountRole19.WRITABLE },
|
|
15078
|
+
{ address: lowerTickArrayAddress, role: AccountRole19.WRITABLE },
|
|
15079
|
+
{ address: upperTickArrayAddress, role: AccountRole19.WRITABLE },
|
|
15080
|
+
{ address: fusionPool.data.tokenVaultA, role: AccountRole19.WRITABLE },
|
|
15081
|
+
{ address: fusionPool.data.tokenVaultB, role: AccountRole19.WRITABLE }
|
|
15072
15082
|
];
|
|
15073
15083
|
const remainingAccountsInfo = {
|
|
15074
15084
|
slices: [
|
|
@@ -15281,7 +15291,7 @@ async function withdrawInstruction(authority, mint, vault, funds, shares) {
|
|
|
15281
15291
|
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
15292
|
import { fetchWhirlpool as fetchWhirlpool3, getOracleAddress as getOracleAddress8, WHIRLPOOL_PROGRAM_ADDRESS as WHIRLPOOL_PROGRAM_ADDRESS13 } from "@orca-so/whirlpools-client";
|
|
15283
15293
|
import {
|
|
15284
|
-
address as
|
|
15294
|
+
address as address4
|
|
15285
15295
|
} from "@solana/kit";
|
|
15286
15296
|
import { fetchAddressLookupTable, getExtendLookupTableInstruction as getExtendLookupTableInstruction2 } from "@solana-program/address-lookup-table";
|
|
15287
15297
|
import { MEMO_PROGRAM_ADDRESS as MEMO_PROGRAM_ADDRESS22 } from "@solana-program/memo";
|
|
@@ -15327,7 +15337,7 @@ async function getAddressesForMarketLookupTable(rpc, poolAddress, marketMaker) {
|
|
|
15327
15337
|
}))[0];
|
|
15328
15338
|
const addresses = [
|
|
15329
15339
|
SYSTEM_PROGRAM_ADDRESS,
|
|
15330
|
-
|
|
15340
|
+
address4("SysvarRent111111111111111111111111111111111"),
|
|
15331
15341
|
ASSOCIATED_TOKEN_PROGRAM_ADDRESS6,
|
|
15332
15342
|
TOKEN_PROGRAM_ADDRESS2,
|
|
15333
15343
|
TOKEN_2022_PROGRAM_ADDRESS19,
|
|
@@ -15496,7 +15506,7 @@ import {
|
|
|
15496
15506
|
WHIRLPOOL_PROGRAM_ADDRESS as WHIRLPOOL_PROGRAM_ADDRESS14
|
|
15497
15507
|
} from "@orca-so/whirlpools-client";
|
|
15498
15508
|
import {
|
|
15499
|
-
AccountRole as
|
|
15509
|
+
AccountRole as AccountRole20,
|
|
15500
15510
|
lamports as lamports3
|
|
15501
15511
|
} from "@solana/kit";
|
|
15502
15512
|
import { fetchSysvarRent as fetchSysvarRent3 } from "@solana/sysvars";
|
|
@@ -15629,18 +15639,18 @@ async function rebalanceTunaLpPositionOrcaInstruction(authority, tunaPosition, t
|
|
|
15629
15639
|
);
|
|
15630
15640
|
const secondaryTickArrays = await OrcaUtils.getTickArraysForRebalancedPosition(whirlpool, tunaPosition);
|
|
15631
15641
|
const remainingAccounts = [
|
|
15632
|
-
{ address: swapTickArrays[0], role:
|
|
15633
|
-
{ address: swapTickArrays[1], role:
|
|
15634
|
-
{ address: swapTickArrays[2], role:
|
|
15635
|
-
{ address: swapTickArrays[3], role:
|
|
15636
|
-
{ address: swapTickArrays[4], role:
|
|
15637
|
-
{ address: lowerTickArrayAddress, role:
|
|
15638
|
-
{ address: upperTickArrayAddress, role:
|
|
15639
|
-
{ address: secondaryTickArrays.lowerTickArrayAddress, role:
|
|
15640
|
-
{ address: secondaryTickArrays.upperTickArrayAddress, role:
|
|
15641
|
-
{ address: whirlpool.data.tokenVaultA, role:
|
|
15642
|
-
{ address: whirlpool.data.tokenVaultB, role:
|
|
15643
|
-
{ address: orcaOracleAddress, role:
|
|
15642
|
+
{ address: swapTickArrays[0], role: AccountRole20.WRITABLE },
|
|
15643
|
+
{ address: swapTickArrays[1], role: AccountRole20.WRITABLE },
|
|
15644
|
+
{ address: swapTickArrays[2], role: AccountRole20.WRITABLE },
|
|
15645
|
+
{ address: swapTickArrays[3], role: AccountRole20.WRITABLE },
|
|
15646
|
+
{ address: swapTickArrays[4], role: AccountRole20.WRITABLE },
|
|
15647
|
+
{ address: lowerTickArrayAddress, role: AccountRole20.WRITABLE },
|
|
15648
|
+
{ address: upperTickArrayAddress, role: AccountRole20.WRITABLE },
|
|
15649
|
+
{ address: secondaryTickArrays.lowerTickArrayAddress, role: AccountRole20.WRITABLE },
|
|
15650
|
+
{ address: secondaryTickArrays.upperTickArrayAddress, role: AccountRole20.WRITABLE },
|
|
15651
|
+
{ address: whirlpool.data.tokenVaultA, role: AccountRole20.WRITABLE },
|
|
15652
|
+
{ address: whirlpool.data.tokenVaultB, role: AccountRole20.WRITABLE },
|
|
15653
|
+
{ address: orcaOracleAddress, role: AccountRole20.WRITABLE }
|
|
15644
15654
|
];
|
|
15645
15655
|
const remainingAccountsInfo = {
|
|
15646
15656
|
slices: [
|
|
@@ -15692,7 +15702,7 @@ import {
|
|
|
15692
15702
|
getTickArraySize as getTickArraySize2
|
|
15693
15703
|
} from "@crypticdot/fusionamm-client";
|
|
15694
15704
|
import {
|
|
15695
|
-
AccountRole as
|
|
15705
|
+
AccountRole as AccountRole21,
|
|
15696
15706
|
lamports as lamports4
|
|
15697
15707
|
} from "@solana/kit";
|
|
15698
15708
|
import { fetchSysvarRent as fetchSysvarRent4 } from "@solana/sysvars";
|
|
@@ -15820,17 +15830,17 @@ async function rebalanceTunaLpPositionFusionInstruction(authority, tunaPosition,
|
|
|
15820
15830
|
);
|
|
15821
15831
|
const secondaryTickArrays = await FusionUtils.getTickArraysForRebalancedPosition(fusionPool, tunaPosition);
|
|
15822
15832
|
const remainingAccounts = [
|
|
15823
|
-
{ address: swapTickArrays[0], role:
|
|
15824
|
-
{ address: swapTickArrays[1], role:
|
|
15825
|
-
{ address: swapTickArrays[2], role:
|
|
15826
|
-
{ address: swapTickArrays[3], role:
|
|
15827
|
-
{ address: swapTickArrays[4], role:
|
|
15828
|
-
{ address: lowerTickArrayAddress, role:
|
|
15829
|
-
{ address: upperTickArrayAddress, role:
|
|
15830
|
-
{ address: secondaryTickArrays.lowerTickArrayAddress, role:
|
|
15831
|
-
{ address: secondaryTickArrays.upperTickArrayAddress, role:
|
|
15832
|
-
{ address: fusionPool.data.tokenVaultA, role:
|
|
15833
|
-
{ address: fusionPool.data.tokenVaultB, role:
|
|
15833
|
+
{ address: swapTickArrays[0], role: AccountRole21.WRITABLE },
|
|
15834
|
+
{ address: swapTickArrays[1], role: AccountRole21.WRITABLE },
|
|
15835
|
+
{ address: swapTickArrays[2], role: AccountRole21.WRITABLE },
|
|
15836
|
+
{ address: swapTickArrays[3], role: AccountRole21.WRITABLE },
|
|
15837
|
+
{ address: swapTickArrays[4], role: AccountRole21.WRITABLE },
|
|
15838
|
+
{ address: lowerTickArrayAddress, role: AccountRole21.WRITABLE },
|
|
15839
|
+
{ address: upperTickArrayAddress, role: AccountRole21.WRITABLE },
|
|
15840
|
+
{ address: secondaryTickArrays.lowerTickArrayAddress, role: AccountRole21.WRITABLE },
|
|
15841
|
+
{ address: secondaryTickArrays.upperTickArrayAddress, role: AccountRole21.WRITABLE },
|
|
15842
|
+
{ address: fusionPool.data.tokenVaultA, role: AccountRole21.WRITABLE },
|
|
15843
|
+
{ address: fusionPool.data.tokenVaultB, role: AccountRole21.WRITABLE }
|
|
15834
15844
|
];
|
|
15835
15845
|
const remainingAccountsInfo = {
|
|
15836
15846
|
slices: [
|