@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.cjs
CHANGED
|
@@ -773,13 +773,13 @@ function decodeLendingPosition(encodedAccount) {
|
|
|
773
773
|
getLendingPositionDecoder()
|
|
774
774
|
);
|
|
775
775
|
}
|
|
776
|
-
async function fetchLendingPosition(rpc,
|
|
777
|
-
const maybeAccount = await fetchMaybeLendingPosition(rpc,
|
|
776
|
+
async function fetchLendingPosition(rpc, address5, config) {
|
|
777
|
+
const maybeAccount = await fetchMaybeLendingPosition(rpc, address5, config);
|
|
778
778
|
(0, import_kit.assertAccountExists)(maybeAccount);
|
|
779
779
|
return maybeAccount;
|
|
780
780
|
}
|
|
781
|
-
async function fetchMaybeLendingPosition(rpc,
|
|
782
|
-
const maybeAccount = await (0, import_kit.fetchEncodedAccount)(rpc,
|
|
781
|
+
async function fetchMaybeLendingPosition(rpc, address5, config) {
|
|
782
|
+
const maybeAccount = await (0, import_kit.fetchEncodedAccount)(rpc, address5, config);
|
|
783
783
|
return decodeLendingPosition(maybeAccount);
|
|
784
784
|
}
|
|
785
785
|
async function fetchAllLendingPosition(rpc, addresses, config) {
|
|
@@ -1007,13 +1007,13 @@ function decodeMarket(encodedAccount) {
|
|
|
1007
1007
|
getMarketDecoder()
|
|
1008
1008
|
);
|
|
1009
1009
|
}
|
|
1010
|
-
async function fetchMarket(rpc,
|
|
1011
|
-
const maybeAccount = await fetchMaybeMarket(rpc,
|
|
1010
|
+
async function fetchMarket(rpc, address5, config) {
|
|
1011
|
+
const maybeAccount = await fetchMaybeMarket(rpc, address5, config);
|
|
1012
1012
|
(0, import_kit8.assertAccountExists)(maybeAccount);
|
|
1013
1013
|
return maybeAccount;
|
|
1014
1014
|
}
|
|
1015
|
-
async function fetchMaybeMarket(rpc,
|
|
1016
|
-
const maybeAccount = await (0, import_kit8.fetchEncodedAccount)(rpc,
|
|
1015
|
+
async function fetchMaybeMarket(rpc, address5, config) {
|
|
1016
|
+
const maybeAccount = await (0, import_kit8.fetchEncodedAccount)(rpc, address5, config);
|
|
1017
1017
|
return decodeMarket(maybeAccount);
|
|
1018
1018
|
}
|
|
1019
1019
|
async function fetchAllMarket(rpc, addresses, config) {
|
|
@@ -1100,13 +1100,13 @@ function decodeTunaConfig(encodedAccount) {
|
|
|
1100
1100
|
getTunaConfigDecoder()
|
|
1101
1101
|
);
|
|
1102
1102
|
}
|
|
1103
|
-
async function fetchTunaConfig(rpc,
|
|
1104
|
-
const maybeAccount = await fetchMaybeTunaConfig(rpc,
|
|
1103
|
+
async function fetchTunaConfig(rpc, address5, config) {
|
|
1104
|
+
const maybeAccount = await fetchMaybeTunaConfig(rpc, address5, config);
|
|
1105
1105
|
(0, import_kit9.assertAccountExists)(maybeAccount);
|
|
1106
1106
|
return maybeAccount;
|
|
1107
1107
|
}
|
|
1108
|
-
async function fetchMaybeTunaConfig(rpc,
|
|
1109
|
-
const maybeAccount = await (0, import_kit9.fetchEncodedAccount)(rpc,
|
|
1108
|
+
async function fetchMaybeTunaConfig(rpc, address5, config) {
|
|
1109
|
+
const maybeAccount = await (0, import_kit9.fetchEncodedAccount)(rpc, address5, config);
|
|
1110
1110
|
return decodeTunaConfig(maybeAccount);
|
|
1111
1111
|
}
|
|
1112
1112
|
async function fetchAllTunaConfig(rpc, addresses, config) {
|
|
@@ -1221,13 +1221,13 @@ function decodeTunaLpPosition(encodedAccount) {
|
|
|
1221
1221
|
getTunaLpPositionDecoder()
|
|
1222
1222
|
);
|
|
1223
1223
|
}
|
|
1224
|
-
async function fetchTunaLpPosition(rpc,
|
|
1225
|
-
const maybeAccount = await fetchMaybeTunaLpPosition(rpc,
|
|
1224
|
+
async function fetchTunaLpPosition(rpc, address5, config) {
|
|
1225
|
+
const maybeAccount = await fetchMaybeTunaLpPosition(rpc, address5, config);
|
|
1226
1226
|
(0, import_kit10.assertAccountExists)(maybeAccount);
|
|
1227
1227
|
return maybeAccount;
|
|
1228
1228
|
}
|
|
1229
|
-
async function fetchMaybeTunaLpPosition(rpc,
|
|
1230
|
-
const maybeAccount = await (0, import_kit10.fetchEncodedAccount)(rpc,
|
|
1229
|
+
async function fetchMaybeTunaLpPosition(rpc, address5, config) {
|
|
1230
|
+
const maybeAccount = await (0, import_kit10.fetchEncodedAccount)(rpc, address5, config);
|
|
1231
1231
|
return decodeTunaLpPosition(maybeAccount);
|
|
1232
1232
|
}
|
|
1233
1233
|
async function fetchAllTunaLpPosition(rpc, addresses, config) {
|
|
@@ -1325,13 +1325,13 @@ function decodeTunaSpotPosition(encodedAccount) {
|
|
|
1325
1325
|
getTunaSpotPositionDecoder()
|
|
1326
1326
|
);
|
|
1327
1327
|
}
|
|
1328
|
-
async function fetchTunaSpotPosition(rpc,
|
|
1329
|
-
const maybeAccount = await fetchMaybeTunaSpotPosition(rpc,
|
|
1328
|
+
async function fetchTunaSpotPosition(rpc, address5, config) {
|
|
1329
|
+
const maybeAccount = await fetchMaybeTunaSpotPosition(rpc, address5, config);
|
|
1330
1330
|
(0, import_kit11.assertAccountExists)(maybeAccount);
|
|
1331
1331
|
return maybeAccount;
|
|
1332
1332
|
}
|
|
1333
|
-
async function fetchMaybeTunaSpotPosition(rpc,
|
|
1334
|
-
const maybeAccount = await (0, import_kit11.fetchEncodedAccount)(rpc,
|
|
1333
|
+
async function fetchMaybeTunaSpotPosition(rpc, address5, config) {
|
|
1334
|
+
const maybeAccount = await (0, import_kit11.fetchEncodedAccount)(rpc, address5, config);
|
|
1335
1335
|
return decodeTunaSpotPosition(maybeAccount);
|
|
1336
1336
|
}
|
|
1337
1337
|
async function fetchAllTunaSpotPosition(rpc, addresses, config) {
|
|
@@ -1420,13 +1420,13 @@ function decodeVault(encodedAccount) {
|
|
|
1420
1420
|
getVaultDecoder()
|
|
1421
1421
|
);
|
|
1422
1422
|
}
|
|
1423
|
-
async function fetchVault(rpc,
|
|
1424
|
-
const maybeAccount = await fetchMaybeVault(rpc,
|
|
1423
|
+
async function fetchVault(rpc, address5, config) {
|
|
1424
|
+
const maybeAccount = await fetchMaybeVault(rpc, address5, config);
|
|
1425
1425
|
(0, import_kit12.assertAccountExists)(maybeAccount);
|
|
1426
1426
|
return maybeAccount;
|
|
1427
1427
|
}
|
|
1428
|
-
async function fetchMaybeVault(rpc,
|
|
1429
|
-
const maybeAccount = await (0, import_kit12.fetchEncodedAccount)(rpc,
|
|
1428
|
+
async function fetchMaybeVault(rpc, address5, config) {
|
|
1429
|
+
const maybeAccount = await (0, import_kit12.fetchEncodedAccount)(rpc, address5, config);
|
|
1430
1430
|
return decodeVault(maybeAccount);
|
|
1431
1431
|
}
|
|
1432
1432
|
async function fetchAllVault(rpc, addresses, config) {
|
|
@@ -9672,47 +9672,47 @@ async function fetchDecodedProgramAccounts(rpc, programAddress, filters, decoder
|
|
|
9672
9672
|
}
|
|
9673
9673
|
|
|
9674
9674
|
// src/gpa/tunaLpPosition.ts
|
|
9675
|
-
function tunaLpPositionAuthorityFilter(
|
|
9675
|
+
function tunaLpPositionAuthorityFilter(address5) {
|
|
9676
9676
|
return {
|
|
9677
9677
|
memcmp: {
|
|
9678
9678
|
offset: 11n,
|
|
9679
|
-
bytes: (0, import_kit76.getBase58Decoder)().decode((0, import_kit76.getAddressEncoder)().encode(
|
|
9679
|
+
bytes: (0, import_kit76.getBase58Decoder)().decode((0, import_kit76.getAddressEncoder)().encode(address5)),
|
|
9680
9680
|
encoding: "base58"
|
|
9681
9681
|
}
|
|
9682
9682
|
};
|
|
9683
9683
|
}
|
|
9684
|
-
function tunaLpPositionPoolFilter(
|
|
9684
|
+
function tunaLpPositionPoolFilter(address5) {
|
|
9685
9685
|
return {
|
|
9686
9686
|
memcmp: {
|
|
9687
9687
|
offset: 43n,
|
|
9688
|
-
bytes: (0, import_kit76.getBase58Decoder)().decode((0, import_kit76.getAddressEncoder)().encode(
|
|
9688
|
+
bytes: (0, import_kit76.getBase58Decoder)().decode((0, import_kit76.getAddressEncoder)().encode(address5)),
|
|
9689
9689
|
encoding: "base58"
|
|
9690
9690
|
}
|
|
9691
9691
|
};
|
|
9692
9692
|
}
|
|
9693
|
-
function tunaLpPositionMintAFilter(
|
|
9693
|
+
function tunaLpPositionMintAFilter(address5) {
|
|
9694
9694
|
return {
|
|
9695
9695
|
memcmp: {
|
|
9696
9696
|
offset: 75n,
|
|
9697
|
-
bytes: (0, import_kit76.getBase58Decoder)().decode((0, import_kit76.getAddressEncoder)().encode(
|
|
9697
|
+
bytes: (0, import_kit76.getBase58Decoder)().decode((0, import_kit76.getAddressEncoder)().encode(address5)),
|
|
9698
9698
|
encoding: "base58"
|
|
9699
9699
|
}
|
|
9700
9700
|
};
|
|
9701
9701
|
}
|
|
9702
|
-
function tunaLpPositionMintBFilter(
|
|
9702
|
+
function tunaLpPositionMintBFilter(address5) {
|
|
9703
9703
|
return {
|
|
9704
9704
|
memcmp: {
|
|
9705
9705
|
offset: 107n,
|
|
9706
|
-
bytes: (0, import_kit76.getBase58Decoder)().decode((0, import_kit76.getAddressEncoder)().encode(
|
|
9706
|
+
bytes: (0, import_kit76.getBase58Decoder)().decode((0, import_kit76.getAddressEncoder)().encode(address5)),
|
|
9707
9707
|
encoding: "base58"
|
|
9708
9708
|
}
|
|
9709
9709
|
};
|
|
9710
9710
|
}
|
|
9711
|
-
function tunaLpPositionMintFilter(
|
|
9711
|
+
function tunaLpPositionMintFilter(address5) {
|
|
9712
9712
|
return {
|
|
9713
9713
|
memcmp: {
|
|
9714
9714
|
offset: 139n,
|
|
9715
|
-
bytes: (0, import_kit76.getBase58Decoder)().decode((0, import_kit76.getAddressEncoder)().encode(
|
|
9715
|
+
bytes: (0, import_kit76.getBase58Decoder)().decode((0, import_kit76.getAddressEncoder)().encode(address5)),
|
|
9716
9716
|
encoding: "base58"
|
|
9717
9717
|
}
|
|
9718
9718
|
};
|
|
@@ -9745,38 +9745,38 @@ async function fetchAllTunaLpPositionWithFilter(rpc, ...filters) {
|
|
|
9745
9745
|
|
|
9746
9746
|
// src/gpa/tunaSpotPosition.ts
|
|
9747
9747
|
var import_kit77 = require("@solana/kit");
|
|
9748
|
-
function tunaSpotPositionAuthorityFilter(
|
|
9748
|
+
function tunaSpotPositionAuthorityFilter(address5) {
|
|
9749
9749
|
return {
|
|
9750
9750
|
memcmp: {
|
|
9751
9751
|
offset: 11n,
|
|
9752
|
-
bytes: (0, import_kit77.getBase58Decoder)().decode((0, import_kit77.getAddressEncoder)().encode(
|
|
9752
|
+
bytes: (0, import_kit77.getBase58Decoder)().decode((0, import_kit77.getAddressEncoder)().encode(address5)),
|
|
9753
9753
|
encoding: "base58"
|
|
9754
9754
|
}
|
|
9755
9755
|
};
|
|
9756
9756
|
}
|
|
9757
|
-
function tunaSpotPositionPoolFilter(
|
|
9757
|
+
function tunaSpotPositionPoolFilter(address5) {
|
|
9758
9758
|
return {
|
|
9759
9759
|
memcmp: {
|
|
9760
9760
|
offset: 43n,
|
|
9761
|
-
bytes: (0, import_kit77.getBase58Decoder)().decode((0, import_kit77.getAddressEncoder)().encode(
|
|
9761
|
+
bytes: (0, import_kit77.getBase58Decoder)().decode((0, import_kit77.getAddressEncoder)().encode(address5)),
|
|
9762
9762
|
encoding: "base58"
|
|
9763
9763
|
}
|
|
9764
9764
|
};
|
|
9765
9765
|
}
|
|
9766
|
-
function tunaSpotPositionMintAFilter(
|
|
9766
|
+
function tunaSpotPositionMintAFilter(address5) {
|
|
9767
9767
|
return {
|
|
9768
9768
|
memcmp: {
|
|
9769
9769
|
offset: 75n,
|
|
9770
|
-
bytes: (0, import_kit77.getBase58Decoder)().decode((0, import_kit77.getAddressEncoder)().encode(
|
|
9770
|
+
bytes: (0, import_kit77.getBase58Decoder)().decode((0, import_kit77.getAddressEncoder)().encode(address5)),
|
|
9771
9771
|
encoding: "base58"
|
|
9772
9772
|
}
|
|
9773
9773
|
};
|
|
9774
9774
|
}
|
|
9775
|
-
function tunaSpotPositionMintBFilter(
|
|
9775
|
+
function tunaSpotPositionMintBFilter(address5) {
|
|
9776
9776
|
return {
|
|
9777
9777
|
memcmp: {
|
|
9778
9778
|
offset: 107n,
|
|
9779
|
-
bytes: (0, import_kit77.getBase58Decoder)().decode((0, import_kit77.getAddressEncoder)().encode(
|
|
9779
|
+
bytes: (0, import_kit77.getBase58Decoder)().decode((0, import_kit77.getAddressEncoder)().encode(address5)),
|
|
9780
9780
|
encoding: "base58"
|
|
9781
9781
|
}
|
|
9782
9782
|
};
|
|
@@ -9800,29 +9800,29 @@ async function fetchAllTunaSpotPositionWithFilter(rpc, ...filters) {
|
|
|
9800
9800
|
|
|
9801
9801
|
// src/gpa/lendingPosition.ts
|
|
9802
9802
|
var import_kit78 = require("@solana/kit");
|
|
9803
|
-
function lendingPositionAuthorityFilter(
|
|
9803
|
+
function lendingPositionAuthorityFilter(address5) {
|
|
9804
9804
|
return {
|
|
9805
9805
|
memcmp: {
|
|
9806
9806
|
offset: 11n,
|
|
9807
|
-
bytes: (0, import_kit78.getBase58Decoder)().decode((0, import_kit78.getAddressEncoder)().encode(
|
|
9807
|
+
bytes: (0, import_kit78.getBase58Decoder)().decode((0, import_kit78.getAddressEncoder)().encode(address5)),
|
|
9808
9808
|
encoding: "base58"
|
|
9809
9809
|
}
|
|
9810
9810
|
};
|
|
9811
9811
|
}
|
|
9812
|
-
function lendingPositionMintFilter(
|
|
9812
|
+
function lendingPositionMintFilter(address5) {
|
|
9813
9813
|
return {
|
|
9814
9814
|
memcmp: {
|
|
9815
9815
|
offset: 43n,
|
|
9816
|
-
bytes: (0, import_kit78.getBase58Decoder)().decode((0, import_kit78.getAddressEncoder)().encode(
|
|
9816
|
+
bytes: (0, import_kit78.getBase58Decoder)().decode((0, import_kit78.getAddressEncoder)().encode(address5)),
|
|
9817
9817
|
encoding: "base58"
|
|
9818
9818
|
}
|
|
9819
9819
|
};
|
|
9820
9820
|
}
|
|
9821
|
-
function lendingPositionVaultFilter(
|
|
9821
|
+
function lendingPositionVaultFilter(address5) {
|
|
9822
9822
|
return {
|
|
9823
9823
|
memcmp: {
|
|
9824
9824
|
offset: 91n,
|
|
9825
|
-
bytes: (0, import_kit78.getBase58Decoder)().decode((0, import_kit78.getAddressEncoder)().encode(
|
|
9825
|
+
bytes: (0, import_kit78.getBase58Decoder)().decode((0, import_kit78.getAddressEncoder)().encode(address5)),
|
|
9826
9826
|
encoding: "base58"
|
|
9827
9827
|
}
|
|
9828
9828
|
};
|
|
@@ -13120,6 +13120,7 @@ function getOpenTunaLpPositionOrcaInstructionWithEphemeralSigner(input, config)
|
|
|
13120
13120
|
// src/txbuilder/openTunaLpPositionFusion.ts
|
|
13121
13121
|
var import_fusionamm_client11 = require("@crypticdot/fusionamm-client");
|
|
13122
13122
|
var import_fusionamm_client12 = require("@crypticdot/fusionamm-client");
|
|
13123
|
+
var import_kit128 = require("@solana/kit");
|
|
13123
13124
|
var import_token_202225 = require("@solana-program/token-2022");
|
|
13124
13125
|
var import_assert16 = __toESM(require("assert"), 1);
|
|
13125
13126
|
async function openTunaLpPositionFusionInstruction(rpc, authority, positionMint, fusionPoolAddress, args) {
|
|
@@ -13187,79 +13188,85 @@ async function openTunaLpPositionFusionInstruction(rpc, authority, positionMint,
|
|
|
13187
13188
|
...args
|
|
13188
13189
|
});
|
|
13189
13190
|
}
|
|
13190
|
-
function getOpenTunaLpPositionFusionInstructionWithEphemeralSigner(input
|
|
13191
|
-
const programAddress = config?.programAddress ?? TUNA_PROGRAM_ADDRESS;
|
|
13192
|
-
const originalAccounts = {
|
|
13193
|
-
authority: { value: input.authority ?? null, isWritable: true },
|
|
13194
|
-
mintA: { value: input.mintA ?? null, isWritable: false },
|
|
13195
|
-
mintB: { value: input.mintB ?? null, isWritable: false },
|
|
13196
|
-
tokenProgramA: { value: input.tokenProgramA ?? null, isWritable: false },
|
|
13197
|
-
tokenProgramB: { value: input.tokenProgramB ?? null, isWritable: false },
|
|
13198
|
-
market: { value: input.market ?? null, isWritable: false },
|
|
13199
|
-
tunaPosition: { value: input.tunaPosition ?? null, isWritable: true },
|
|
13200
|
-
tunaPositionMint: {
|
|
13201
|
-
value: input.tunaPositionMint ?? null,
|
|
13202
|
-
isWritable: true
|
|
13203
|
-
},
|
|
13204
|
-
tunaPositionAta: { value: input.tunaPositionAta ?? null, isWritable: true },
|
|
13205
|
-
tunaPositionAtaA: {
|
|
13206
|
-
value: input.tunaPositionAtaA ?? null,
|
|
13207
|
-
isWritable: true
|
|
13208
|
-
},
|
|
13209
|
-
tunaPositionAtaB: {
|
|
13210
|
-
value: input.tunaPositionAtaB ?? null,
|
|
13211
|
-
isWritable: true
|
|
13212
|
-
},
|
|
13213
|
-
fusionammProgram: {
|
|
13214
|
-
value: input.fusionammProgram ?? null,
|
|
13215
|
-
isWritable: false
|
|
13216
|
-
},
|
|
13217
|
-
fusionPool: { value: input.fusionPool ?? null, isWritable: false },
|
|
13218
|
-
fusionPosition: { value: input.fusionPosition ?? null, isWritable: true },
|
|
13219
|
-
metadataUpdateAuth: {
|
|
13220
|
-
value: input.metadataUpdateAuth ?? null,
|
|
13221
|
-
isWritable: false
|
|
13222
|
-
},
|
|
13223
|
-
token2022Program: {
|
|
13224
|
-
value: input.token2022Program ?? null,
|
|
13225
|
-
isWritable: false
|
|
13226
|
-
},
|
|
13227
|
-
systemProgram: { value: input.systemProgram ?? null, isWritable: false },
|
|
13228
|
-
associatedTokenProgram: {
|
|
13229
|
-
value: input.associatedTokenProgram ?? null,
|
|
13230
|
-
isWritable: false
|
|
13231
|
-
}
|
|
13232
|
-
};
|
|
13233
|
-
const accounts = originalAccounts;
|
|
13234
|
-
const args = { ...input };
|
|
13235
|
-
if (!accounts.systemProgram.value) {
|
|
13236
|
-
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
13237
|
-
}
|
|
13238
|
-
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
13191
|
+
function getOpenTunaLpPositionFusionInstructionWithEphemeralSigner(input) {
|
|
13239
13192
|
const instruction = {
|
|
13240
13193
|
accounts: [
|
|
13241
|
-
|
|
13242
|
-
|
|
13243
|
-
|
|
13244
|
-
|
|
13245
|
-
|
|
13246
|
-
|
|
13247
|
-
|
|
13248
|
-
|
|
13249
|
-
|
|
13250
|
-
|
|
13251
|
-
|
|
13252
|
-
|
|
13253
|
-
|
|
13254
|
-
|
|
13255
|
-
|
|
13256
|
-
|
|
13257
|
-
|
|
13258
|
-
|
|
13194
|
+
{
|
|
13195
|
+
address: input.authority.address,
|
|
13196
|
+
role: import_kit128.AccountRole.WRITABLE_SIGNER
|
|
13197
|
+
},
|
|
13198
|
+
{
|
|
13199
|
+
address: input.mintA,
|
|
13200
|
+
role: import_kit128.AccountRole.READONLY
|
|
13201
|
+
},
|
|
13202
|
+
{
|
|
13203
|
+
address: input.mintB,
|
|
13204
|
+
role: import_kit128.AccountRole.READONLY
|
|
13205
|
+
},
|
|
13206
|
+
{
|
|
13207
|
+
address: input.tokenProgramA,
|
|
13208
|
+
role: import_kit128.AccountRole.READONLY
|
|
13209
|
+
},
|
|
13210
|
+
{
|
|
13211
|
+
address: input.tokenProgramB,
|
|
13212
|
+
role: import_kit128.AccountRole.READONLY
|
|
13213
|
+
},
|
|
13214
|
+
{
|
|
13215
|
+
address: input.market,
|
|
13216
|
+
role: import_kit128.AccountRole.READONLY
|
|
13217
|
+
},
|
|
13218
|
+
{
|
|
13219
|
+
address: input.tunaPosition,
|
|
13220
|
+
role: import_kit128.AccountRole.WRITABLE
|
|
13221
|
+
},
|
|
13222
|
+
{
|
|
13223
|
+
address: input.tunaPositionMint,
|
|
13224
|
+
role: import_kit128.AccountRole.WRITABLE_SIGNER
|
|
13225
|
+
},
|
|
13226
|
+
{
|
|
13227
|
+
address: input.tunaPositionAta,
|
|
13228
|
+
role: import_kit128.AccountRole.WRITABLE
|
|
13229
|
+
},
|
|
13230
|
+
{
|
|
13231
|
+
address: input.tunaPositionAtaA,
|
|
13232
|
+
role: import_kit128.AccountRole.WRITABLE
|
|
13233
|
+
},
|
|
13234
|
+
{
|
|
13235
|
+
address: input.tunaPositionAtaB,
|
|
13236
|
+
role: import_kit128.AccountRole.WRITABLE
|
|
13237
|
+
},
|
|
13238
|
+
{
|
|
13239
|
+
address: input.fusionammProgram,
|
|
13240
|
+
role: import_kit128.AccountRole.READONLY
|
|
13241
|
+
},
|
|
13242
|
+
{
|
|
13243
|
+
address: input.fusionPool,
|
|
13244
|
+
role: import_kit128.AccountRole.READONLY
|
|
13245
|
+
},
|
|
13246
|
+
{
|
|
13247
|
+
address: input.fusionPosition,
|
|
13248
|
+
role: import_kit128.AccountRole.WRITABLE
|
|
13249
|
+
},
|
|
13250
|
+
{
|
|
13251
|
+
address: input.metadataUpdateAuth,
|
|
13252
|
+
role: import_kit128.AccountRole.READONLY
|
|
13253
|
+
},
|
|
13254
|
+
{
|
|
13255
|
+
address: input.token2022Program,
|
|
13256
|
+
role: import_kit128.AccountRole.READONLY
|
|
13257
|
+
},
|
|
13258
|
+
{
|
|
13259
|
+
address: input.systemProgram ?? (0, import_kit128.address)("11111111111111111111111111111111"),
|
|
13260
|
+
role: import_kit128.AccountRole.READONLY
|
|
13261
|
+
},
|
|
13262
|
+
{
|
|
13263
|
+
address: input.associatedTokenProgram,
|
|
13264
|
+
role: import_kit128.AccountRole.READONLY
|
|
13265
|
+
}
|
|
13259
13266
|
],
|
|
13260
|
-
programAddress,
|
|
13267
|
+
programAddress: TUNA_PROGRAM_ADDRESS,
|
|
13261
13268
|
data: getOpenTunaLpPositionFusionInstructionDataEncoder().encode(
|
|
13262
|
-
|
|
13269
|
+
input
|
|
13263
13270
|
)
|
|
13264
13271
|
};
|
|
13265
13272
|
return instruction;
|
|
@@ -13268,7 +13275,7 @@ function getOpenTunaLpPositionFusionInstructionWithEphemeralSigner(input, config
|
|
|
13268
13275
|
// src/txbuilder/openAndIncreaseTunaLpPositionOrca.ts
|
|
13269
13276
|
var import_whirlpools_client12 = require("@orca-so/whirlpools-client");
|
|
13270
13277
|
var import_whirlpools_core4 = require("@orca-so/whirlpools-core");
|
|
13271
|
-
var
|
|
13278
|
+
var import_kit129 = require("@solana/kit");
|
|
13272
13279
|
var import_sysvars = require("@solana/sysvars");
|
|
13273
13280
|
var import_memo16 = require("@solana-program/memo");
|
|
13274
13281
|
var import_token_202226 = require("@solana-program/token-2022");
|
|
@@ -13380,7 +13387,7 @@ async function openAndIncreaseTunaLpPositionOrcaInstructions(rpc, authority, pos
|
|
|
13380
13387
|
cleanupInstructions.push(...createUserAtaBInstructions.cleanup);
|
|
13381
13388
|
return {
|
|
13382
13389
|
instructions,
|
|
13383
|
-
initializationCost: (0,
|
|
13390
|
+
initializationCost: (0, import_kit129.lamports)(nonRefundableRent)
|
|
13384
13391
|
};
|
|
13385
13392
|
}
|
|
13386
13393
|
async function openAndIncreaseTunaLpPositionOrcaInstruction(authority, positionMint, tunaConfig, mintA, mintB, vaultA, vaultB, whirlpool, args) {
|
|
@@ -13438,16 +13445,16 @@ async function openAndIncreaseTunaLpPositionOrcaInstruction(authority, positionM
|
|
|
13438
13445
|
const lowerTickArrayAddress = await OrcaUtils.getTickArrayAddressFromTickIndex(whirlpool, args.tickLowerIndex);
|
|
13439
13446
|
const upperTickArrayAddress = await OrcaUtils.getTickArrayAddressFromTickIndex(whirlpool, args.tickUpperIndex);
|
|
13440
13447
|
const remainingAccounts = [
|
|
13441
|
-
{ address: swapTickArrays[0], role:
|
|
13442
|
-
{ address: swapTickArrays[1], role:
|
|
13443
|
-
{ address: swapTickArrays[2], role:
|
|
13444
|
-
{ address: swapTickArrays[3], role:
|
|
13445
|
-
{ address: swapTickArrays[4], role:
|
|
13446
|
-
{ address: lowerTickArrayAddress, role:
|
|
13447
|
-
{ address: upperTickArrayAddress, role:
|
|
13448
|
-
{ address: whirlpool.data.tokenVaultA, role:
|
|
13449
|
-
{ address: whirlpool.data.tokenVaultB, role:
|
|
13450
|
-
{ address: orcaOracleAddress, role:
|
|
13448
|
+
{ address: swapTickArrays[0], role: import_kit129.AccountRole.WRITABLE },
|
|
13449
|
+
{ address: swapTickArrays[1], role: import_kit129.AccountRole.WRITABLE },
|
|
13450
|
+
{ address: swapTickArrays[2], role: import_kit129.AccountRole.WRITABLE },
|
|
13451
|
+
{ address: swapTickArrays[3], role: import_kit129.AccountRole.WRITABLE },
|
|
13452
|
+
{ address: swapTickArrays[4], role: import_kit129.AccountRole.WRITABLE },
|
|
13453
|
+
{ address: lowerTickArrayAddress, role: import_kit129.AccountRole.WRITABLE },
|
|
13454
|
+
{ address: upperTickArrayAddress, role: import_kit129.AccountRole.WRITABLE },
|
|
13455
|
+
{ address: whirlpool.data.tokenVaultA, role: import_kit129.AccountRole.WRITABLE },
|
|
13456
|
+
{ address: whirlpool.data.tokenVaultB, role: import_kit129.AccountRole.WRITABLE },
|
|
13457
|
+
{ address: orcaOracleAddress, role: import_kit129.AccountRole.WRITABLE }
|
|
13451
13458
|
];
|
|
13452
13459
|
const remainingAccountsInfo = {
|
|
13453
13460
|
slices: [
|
|
@@ -13650,7 +13657,7 @@ function getOpenAndIncreaseTunaLpPositionOrcaInstructionWithEphemeralSigner(inpu
|
|
|
13650
13657
|
// src/txbuilder/openAndIncreaseTunaLpPositionFusion.ts
|
|
13651
13658
|
var import_fusionamm_client13 = require("@crypticdot/fusionamm-client");
|
|
13652
13659
|
var import_fusionamm_core4 = require("@crypticdot/fusionamm-core");
|
|
13653
|
-
var
|
|
13660
|
+
var import_kit130 = require("@solana/kit");
|
|
13654
13661
|
var import_sysvars2 = require("@solana/sysvars");
|
|
13655
13662
|
var import_memo17 = require("@solana-program/memo");
|
|
13656
13663
|
var import_token_202227 = require("@solana-program/token-2022");
|
|
@@ -13749,7 +13756,7 @@ async function openAndIncreaseTunaLpPositionFusionInstructions(rpc, authority, p
|
|
|
13749
13756
|
cleanupInstructions.push(...createUserAtaBInstructions.cleanup);
|
|
13750
13757
|
return {
|
|
13751
13758
|
instructions,
|
|
13752
|
-
initializationCost: (0,
|
|
13759
|
+
initializationCost: (0, import_kit130.lamports)(nonRefundableRent)
|
|
13753
13760
|
};
|
|
13754
13761
|
}
|
|
13755
13762
|
async function openAndIncreaseTunaLpPositionFusionInstruction(authority, positionMint, tunaConfig, mintA, mintB, vaultA, vaultB, fusionPool, args) {
|
|
@@ -13806,15 +13813,15 @@ async function openAndIncreaseTunaLpPositionFusionInstruction(authority, positio
|
|
|
13806
13813
|
const lowerTickArrayAddress = await FusionUtils.getTickArrayAddressFromTickIndex(fusionPool, args.tickLowerIndex);
|
|
13807
13814
|
const upperTickArrayAddress = await FusionUtils.getTickArrayAddressFromTickIndex(fusionPool, args.tickUpperIndex);
|
|
13808
13815
|
const remainingAccounts = [
|
|
13809
|
-
{ address: swapTickArrays[0], role:
|
|
13810
|
-
{ address: swapTickArrays[1], role:
|
|
13811
|
-
{ address: swapTickArrays[2], role:
|
|
13812
|
-
{ address: swapTickArrays[3], role:
|
|
13813
|
-
{ address: swapTickArrays[4], role:
|
|
13814
|
-
{ address: lowerTickArrayAddress, role:
|
|
13815
|
-
{ address: upperTickArrayAddress, role:
|
|
13816
|
-
{ address: fusionPool.data.tokenVaultA, role:
|
|
13817
|
-
{ address: fusionPool.data.tokenVaultB, role:
|
|
13816
|
+
{ address: swapTickArrays[0], role: import_kit130.AccountRole.WRITABLE },
|
|
13817
|
+
{ address: swapTickArrays[1], role: import_kit130.AccountRole.WRITABLE },
|
|
13818
|
+
{ address: swapTickArrays[2], role: import_kit130.AccountRole.WRITABLE },
|
|
13819
|
+
{ address: swapTickArrays[3], role: import_kit130.AccountRole.WRITABLE },
|
|
13820
|
+
{ address: swapTickArrays[4], role: import_kit130.AccountRole.WRITABLE },
|
|
13821
|
+
{ address: lowerTickArrayAddress, role: import_kit130.AccountRole.WRITABLE },
|
|
13822
|
+
{ address: upperTickArrayAddress, role: import_kit130.AccountRole.WRITABLE },
|
|
13823
|
+
{ address: fusionPool.data.tokenVaultA, role: import_kit130.AccountRole.WRITABLE },
|
|
13824
|
+
{ address: fusionPool.data.tokenVaultB, role: import_kit130.AccountRole.WRITABLE }
|
|
13818
13825
|
];
|
|
13819
13826
|
const remainingAccountsInfo = {
|
|
13820
13827
|
slices: [
|
|
@@ -14016,17 +14023,17 @@ function getOpenAndIncreaseTunaLpPositionFusionInstructionWithEphemeralSigner(in
|
|
|
14016
14023
|
// src/txbuilder/openTunaSpotPosition.ts
|
|
14017
14024
|
var import_fusionamm_client14 = require("@crypticdot/fusionamm-client");
|
|
14018
14025
|
var import_whirlpools_client13 = require("@orca-so/whirlpools-client");
|
|
14019
|
-
var
|
|
14026
|
+
var import_kit131 = require("@solana/kit");
|
|
14020
14027
|
var import_token_202228 = require("@solana-program/token-2022");
|
|
14021
14028
|
var import_assert19 = __toESM(require("assert"), 1);
|
|
14022
14029
|
async function openTunaSpotPositionInstructions(rpc, authority, poolAddress, args) {
|
|
14023
|
-
const poolAccount = await (0,
|
|
14030
|
+
const poolAccount = await (0, import_kit131.fetchEncodedAccount)(rpc, poolAddress);
|
|
14024
14031
|
(0, import_assert19.default)(poolAccount.exists, "Pool account not found");
|
|
14025
14032
|
let pool;
|
|
14026
14033
|
if (poolAccount.programAddress == import_fusionamm_client14.FUSIONAMM_PROGRAM_ADDRESS) {
|
|
14027
|
-
pool = (0,
|
|
14034
|
+
pool = (0, import_kit131.decodeAccount)(poolAccount, (0, import_fusionamm_client14.getFusionPoolDecoder)());
|
|
14028
14035
|
} else if (poolAccount.programAddress == import_whirlpools_client13.WHIRLPOOL_PROGRAM_ADDRESS) {
|
|
14029
|
-
pool = (0,
|
|
14036
|
+
pool = (0, import_kit131.decodeAccount)(poolAccount, (0, import_whirlpools_client13.getWhirlpoolDecoder)());
|
|
14030
14037
|
} else {
|
|
14031
14038
|
throw new Error("Incorrect Fusion or Orca pool account");
|
|
14032
14039
|
}
|
|
@@ -14066,7 +14073,7 @@ async function openTunaSpotPositionInstruction(authority, mintA, mintB, poolAddr
|
|
|
14066
14073
|
// src/txbuilder/decreaseTunaLpPositionOrca.ts
|
|
14067
14074
|
var import_whirlpools_client14 = require("@orca-so/whirlpools-client");
|
|
14068
14075
|
var import_whirlpools_core5 = require("@orca-so/whirlpools-core");
|
|
14069
|
-
var
|
|
14076
|
+
var import_kit132 = require("@solana/kit");
|
|
14070
14077
|
var import_memo18 = require("@solana-program/memo");
|
|
14071
14078
|
var import_token_202229 = require("@solana-program/token-2022");
|
|
14072
14079
|
var import_assert20 = __toESM(require("assert"), 1);
|
|
@@ -14088,7 +14095,7 @@ async function decreaseTunaLpPositionOrcaInstructions(rpc, authority, positionMi
|
|
|
14088
14095
|
const allMints = [mintA, mintB, ...rewardMints];
|
|
14089
14096
|
(0, import_assert20.default)(mintA.exists, "Token A account not found");
|
|
14090
14097
|
(0, import_assert20.default)(mintB.exists, "Token B account not found");
|
|
14091
|
-
(0,
|
|
14098
|
+
(0, import_kit132.assertAccountsExist)(rewardMints);
|
|
14092
14099
|
const lowerTickArrayStartIndex = (0, import_whirlpools_core5.getTickArrayStartTickIndex)(
|
|
14093
14100
|
tunaPosition.data.tickLowerIndex,
|
|
14094
14101
|
whirlpool.data.tickSpacing
|
|
@@ -14200,16 +14207,16 @@ async function decreaseTunaLpPositionOrcaInstruction(authority, tunaPosition, mi
|
|
|
14200
14207
|
tunaPosition.data.tickUpperIndex
|
|
14201
14208
|
);
|
|
14202
14209
|
const remainingAccounts = [
|
|
14203
|
-
{ address: swapTickArrays[0], role:
|
|
14204
|
-
{ address: swapTickArrays[1], role:
|
|
14205
|
-
{ address: swapTickArrays[2], role:
|
|
14206
|
-
{ address: swapTickArrays[3], role:
|
|
14207
|
-
{ address: swapTickArrays[4], role:
|
|
14208
|
-
{ address: lowerTickArrayAddress, role:
|
|
14209
|
-
{ address: upperTickArrayAddress, role:
|
|
14210
|
-
{ address: whirlpool.data.tokenVaultA, role:
|
|
14211
|
-
{ address: whirlpool.data.tokenVaultB, role:
|
|
14212
|
-
{ address: orcaOracleAddress, role:
|
|
14210
|
+
{ address: swapTickArrays[0], role: import_kit132.AccountRole.WRITABLE },
|
|
14211
|
+
{ address: swapTickArrays[1], role: import_kit132.AccountRole.WRITABLE },
|
|
14212
|
+
{ address: swapTickArrays[2], role: import_kit132.AccountRole.WRITABLE },
|
|
14213
|
+
{ address: swapTickArrays[3], role: import_kit132.AccountRole.WRITABLE },
|
|
14214
|
+
{ address: swapTickArrays[4], role: import_kit132.AccountRole.WRITABLE },
|
|
14215
|
+
{ address: lowerTickArrayAddress, role: import_kit132.AccountRole.WRITABLE },
|
|
14216
|
+
{ address: upperTickArrayAddress, role: import_kit132.AccountRole.WRITABLE },
|
|
14217
|
+
{ address: whirlpool.data.tokenVaultA, role: import_kit132.AccountRole.WRITABLE },
|
|
14218
|
+
{ address: whirlpool.data.tokenVaultB, role: import_kit132.AccountRole.WRITABLE },
|
|
14219
|
+
{ address: orcaOracleAddress, role: import_kit132.AccountRole.WRITABLE }
|
|
14213
14220
|
];
|
|
14214
14221
|
for (const rewardIndex of rewardIndicesToClaim) {
|
|
14215
14222
|
const rewardInfo = whirlpool.data.rewardInfos[rewardIndex];
|
|
@@ -14220,10 +14227,10 @@ async function decreaseTunaLpPositionOrcaInstruction(authority, tunaPosition, mi
|
|
|
14220
14227
|
mint: rewardMint.address,
|
|
14221
14228
|
tokenProgram: rewardMint.programAddress
|
|
14222
14229
|
});
|
|
14223
|
-
remainingAccounts.push({ address: rewardMint.address, role:
|
|
14224
|
-
remainingAccounts.push({ address: rewardMint.programAddress, role:
|
|
14225
|
-
remainingAccounts.push({ address: ownerAta[0], role:
|
|
14226
|
-
remainingAccounts.push({ address: rewardInfo.vault, role:
|
|
14230
|
+
remainingAccounts.push({ address: rewardMint.address, role: import_kit132.AccountRole.READONLY });
|
|
14231
|
+
remainingAccounts.push({ address: rewardMint.programAddress, role: import_kit132.AccountRole.READONLY });
|
|
14232
|
+
remainingAccounts.push({ address: ownerAta[0], role: import_kit132.AccountRole.WRITABLE });
|
|
14233
|
+
remainingAccounts.push({ address: rewardInfo.vault, role: import_kit132.AccountRole.WRITABLE });
|
|
14227
14234
|
}
|
|
14228
14235
|
const remainingAccountsInfo = {
|
|
14229
14236
|
slices: [
|
|
@@ -14271,7 +14278,7 @@ async function decreaseTunaLpPositionOrcaInstruction(authority, tunaPosition, mi
|
|
|
14271
14278
|
|
|
14272
14279
|
// src/txbuilder/decreaseTunaLpPositionFusion.ts
|
|
14273
14280
|
var import_fusionamm_client15 = require("@crypticdot/fusionamm-client");
|
|
14274
|
-
var
|
|
14281
|
+
var import_kit133 = require("@solana/kit");
|
|
14275
14282
|
var import_memo19 = require("@solana-program/memo");
|
|
14276
14283
|
var import_token_202230 = require("@solana-program/token-2022");
|
|
14277
14284
|
var import_assert21 = __toESM(require("assert"), 1);
|
|
@@ -14371,15 +14378,15 @@ async function decreaseTunaLpPositionFusionInstruction(authority, tunaPosition,
|
|
|
14371
14378
|
tunaPosition.data.tickUpperIndex
|
|
14372
14379
|
);
|
|
14373
14380
|
const remainingAccounts = [
|
|
14374
|
-
{ address: swapTickArrays[0], role:
|
|
14375
|
-
{ address: swapTickArrays[1], role:
|
|
14376
|
-
{ address: swapTickArrays[2], role:
|
|
14377
|
-
{ address: swapTickArrays[3], role:
|
|
14378
|
-
{ address: swapTickArrays[4], role:
|
|
14379
|
-
{ address: lowerTickArrayAddress, role:
|
|
14380
|
-
{ address: upperTickArrayAddress, role:
|
|
14381
|
-
{ address: fusionPool.data.tokenVaultA, role:
|
|
14382
|
-
{ address: fusionPool.data.tokenVaultB, role:
|
|
14381
|
+
{ address: swapTickArrays[0], role: import_kit133.AccountRole.WRITABLE },
|
|
14382
|
+
{ address: swapTickArrays[1], role: import_kit133.AccountRole.WRITABLE },
|
|
14383
|
+
{ address: swapTickArrays[2], role: import_kit133.AccountRole.WRITABLE },
|
|
14384
|
+
{ address: swapTickArrays[3], role: import_kit133.AccountRole.WRITABLE },
|
|
14385
|
+
{ address: swapTickArrays[4], role: import_kit133.AccountRole.WRITABLE },
|
|
14386
|
+
{ address: lowerTickArrayAddress, role: import_kit133.AccountRole.WRITABLE },
|
|
14387
|
+
{ address: upperTickArrayAddress, role: import_kit133.AccountRole.WRITABLE },
|
|
14388
|
+
{ address: fusionPool.data.tokenVaultA, role: import_kit133.AccountRole.WRITABLE },
|
|
14389
|
+
{ address: fusionPool.data.tokenVaultB, role: import_kit133.AccountRole.WRITABLE }
|
|
14383
14390
|
];
|
|
14384
14391
|
const remainingAccountsInfo = {
|
|
14385
14392
|
slices: [
|
|
@@ -14591,7 +14598,7 @@ async function withdrawInstruction(authority, mint, vault, funds, shares) {
|
|
|
14591
14598
|
// src/txbuilder/createMarketLookupTable.ts
|
|
14592
14599
|
var import_fusionamm_client16 = require("@crypticdot/fusionamm-client");
|
|
14593
14600
|
var import_whirlpools_client15 = require("@orca-so/whirlpools-client");
|
|
14594
|
-
var
|
|
14601
|
+
var import_kit134 = require("@solana/kit");
|
|
14595
14602
|
var import_address_lookup_table2 = require("@solana-program/address-lookup-table");
|
|
14596
14603
|
var import_memo22 = require("@solana-program/memo");
|
|
14597
14604
|
var import_system2 = require("@solana-program/system");
|
|
@@ -14631,7 +14638,7 @@ async function getAddressesForMarketLookupTable(rpc, poolAddress, marketMaker) {
|
|
|
14631
14638
|
}))[0];
|
|
14632
14639
|
const addresses = [
|
|
14633
14640
|
import_system2.SYSTEM_PROGRAM_ADDRESS,
|
|
14634
|
-
(0,
|
|
14641
|
+
(0, import_kit134.address)("SysvarRent111111111111111111111111111111111"),
|
|
14635
14642
|
import_token_202234.ASSOCIATED_TOKEN_PROGRAM_ADDRESS,
|
|
14636
14643
|
import_token2.TOKEN_PROGRAM_ADDRESS,
|
|
14637
14644
|
import_token_202234.TOKEN_2022_PROGRAM_ADDRESS,
|
|
@@ -14791,7 +14798,7 @@ async function repayTunaLpPositionDebtInstruction(authority, positionMint, mintA
|
|
|
14791
14798
|
|
|
14792
14799
|
// src/txbuilder/rebalanceTunaLpPositionOrca.ts
|
|
14793
14800
|
var import_whirlpools_client16 = require("@orca-so/whirlpools-client");
|
|
14794
|
-
var
|
|
14801
|
+
var import_kit135 = require("@solana/kit");
|
|
14795
14802
|
var import_sysvars3 = require("@solana/sysvars");
|
|
14796
14803
|
var import_memo24 = require("@solana-program/memo");
|
|
14797
14804
|
var import_token_202236 = require("@solana-program/token-2022");
|
|
@@ -14874,7 +14881,7 @@ async function rebalanceTunaLpPositionOrcaInstructions(rpc, authority, positionM
|
|
|
14874
14881
|
cleanupInstructions.push(...internalCleanupInstructions);
|
|
14875
14882
|
return {
|
|
14876
14883
|
instructions,
|
|
14877
|
-
initializationCost: (0,
|
|
14884
|
+
initializationCost: (0, import_kit135.lamports)(nonRefundableRent)
|
|
14878
14885
|
};
|
|
14879
14886
|
}
|
|
14880
14887
|
async function rebalanceTunaLpPositionOrcaInstruction(authority, tunaPosition, tunaConfig, mintA, mintB, vaultA, vaultB, whirlpool) {
|
|
@@ -14918,18 +14925,18 @@ async function rebalanceTunaLpPositionOrcaInstruction(authority, tunaPosition, t
|
|
|
14918
14925
|
);
|
|
14919
14926
|
const secondaryTickArrays = await OrcaUtils.getTickArraysForRebalancedPosition(whirlpool, tunaPosition);
|
|
14920
14927
|
const remainingAccounts = [
|
|
14921
|
-
{ address: swapTickArrays[0], role:
|
|
14922
|
-
{ address: swapTickArrays[1], role:
|
|
14923
|
-
{ address: swapTickArrays[2], role:
|
|
14924
|
-
{ address: swapTickArrays[3], role:
|
|
14925
|
-
{ address: swapTickArrays[4], role:
|
|
14926
|
-
{ address: lowerTickArrayAddress, role:
|
|
14927
|
-
{ address: upperTickArrayAddress, role:
|
|
14928
|
-
{ address: secondaryTickArrays.lowerTickArrayAddress, role:
|
|
14929
|
-
{ address: secondaryTickArrays.upperTickArrayAddress, role:
|
|
14930
|
-
{ address: whirlpool.data.tokenVaultA, role:
|
|
14931
|
-
{ address: whirlpool.data.tokenVaultB, role:
|
|
14932
|
-
{ address: orcaOracleAddress, role:
|
|
14928
|
+
{ address: swapTickArrays[0], role: import_kit135.AccountRole.WRITABLE },
|
|
14929
|
+
{ address: swapTickArrays[1], role: import_kit135.AccountRole.WRITABLE },
|
|
14930
|
+
{ address: swapTickArrays[2], role: import_kit135.AccountRole.WRITABLE },
|
|
14931
|
+
{ address: swapTickArrays[3], role: import_kit135.AccountRole.WRITABLE },
|
|
14932
|
+
{ address: swapTickArrays[4], role: import_kit135.AccountRole.WRITABLE },
|
|
14933
|
+
{ address: lowerTickArrayAddress, role: import_kit135.AccountRole.WRITABLE },
|
|
14934
|
+
{ address: upperTickArrayAddress, role: import_kit135.AccountRole.WRITABLE },
|
|
14935
|
+
{ address: secondaryTickArrays.lowerTickArrayAddress, role: import_kit135.AccountRole.WRITABLE },
|
|
14936
|
+
{ address: secondaryTickArrays.upperTickArrayAddress, role: import_kit135.AccountRole.WRITABLE },
|
|
14937
|
+
{ address: whirlpool.data.tokenVaultA, role: import_kit135.AccountRole.WRITABLE },
|
|
14938
|
+
{ address: whirlpool.data.tokenVaultB, role: import_kit135.AccountRole.WRITABLE },
|
|
14939
|
+
{ address: orcaOracleAddress, role: import_kit135.AccountRole.WRITABLE }
|
|
14933
14940
|
];
|
|
14934
14941
|
const remainingAccountsInfo = {
|
|
14935
14942
|
slices: [
|
|
@@ -14973,7 +14980,7 @@ async function rebalanceTunaLpPositionOrcaInstruction(authority, tunaPosition, t
|
|
|
14973
14980
|
|
|
14974
14981
|
// src/txbuilder/rebalanceTunaLpPositionFusion.ts
|
|
14975
14982
|
var import_fusionamm_client17 = require("@crypticdot/fusionamm-client");
|
|
14976
|
-
var
|
|
14983
|
+
var import_kit136 = require("@solana/kit");
|
|
14977
14984
|
var import_sysvars4 = require("@solana/sysvars");
|
|
14978
14985
|
var import_memo25 = require("@solana-program/memo");
|
|
14979
14986
|
var import_token_202237 = require("@solana-program/token-2022");
|
|
@@ -15052,7 +15059,7 @@ async function rebalanceTunaLpPositionFusionInstructions(rpc, authority, positio
|
|
|
15052
15059
|
instructions.push(ix);
|
|
15053
15060
|
return {
|
|
15054
15061
|
instructions,
|
|
15055
|
-
initializationCost: (0,
|
|
15062
|
+
initializationCost: (0, import_kit136.lamports)(nonRefundableRent)
|
|
15056
15063
|
};
|
|
15057
15064
|
}
|
|
15058
15065
|
async function rebalanceTunaLpPositionFusionInstruction(authority, tunaPosition, tunaConfig, mintA, mintB, vaultA, vaultB, fusionPool) {
|
|
@@ -15095,17 +15102,17 @@ async function rebalanceTunaLpPositionFusionInstruction(authority, tunaPosition,
|
|
|
15095
15102
|
);
|
|
15096
15103
|
const secondaryTickArrays = await FusionUtils.getTickArraysForRebalancedPosition(fusionPool, tunaPosition);
|
|
15097
15104
|
const remainingAccounts = [
|
|
15098
|
-
{ address: swapTickArrays[0], role:
|
|
15099
|
-
{ address: swapTickArrays[1], role:
|
|
15100
|
-
{ address: swapTickArrays[2], role:
|
|
15101
|
-
{ address: swapTickArrays[3], role:
|
|
15102
|
-
{ address: swapTickArrays[4], role:
|
|
15103
|
-
{ address: lowerTickArrayAddress, role:
|
|
15104
|
-
{ address: upperTickArrayAddress, role:
|
|
15105
|
-
{ address: secondaryTickArrays.lowerTickArrayAddress, role:
|
|
15106
|
-
{ address: secondaryTickArrays.upperTickArrayAddress, role:
|
|
15107
|
-
{ address: fusionPool.data.tokenVaultA, role:
|
|
15108
|
-
{ address: fusionPool.data.tokenVaultB, role:
|
|
15105
|
+
{ address: swapTickArrays[0], role: import_kit136.AccountRole.WRITABLE },
|
|
15106
|
+
{ address: swapTickArrays[1], role: import_kit136.AccountRole.WRITABLE },
|
|
15107
|
+
{ address: swapTickArrays[2], role: import_kit136.AccountRole.WRITABLE },
|
|
15108
|
+
{ address: swapTickArrays[3], role: import_kit136.AccountRole.WRITABLE },
|
|
15109
|
+
{ address: swapTickArrays[4], role: import_kit136.AccountRole.WRITABLE },
|
|
15110
|
+
{ address: lowerTickArrayAddress, role: import_kit136.AccountRole.WRITABLE },
|
|
15111
|
+
{ address: upperTickArrayAddress, role: import_kit136.AccountRole.WRITABLE },
|
|
15112
|
+
{ address: secondaryTickArrays.lowerTickArrayAddress, role: import_kit136.AccountRole.WRITABLE },
|
|
15113
|
+
{ address: secondaryTickArrays.upperTickArrayAddress, role: import_kit136.AccountRole.WRITABLE },
|
|
15114
|
+
{ address: fusionPool.data.tokenVaultA, role: import_kit136.AccountRole.WRITABLE },
|
|
15115
|
+
{ address: fusionPool.data.tokenVaultB, role: import_kit136.AccountRole.WRITABLE }
|
|
15109
15116
|
];
|
|
15110
15117
|
const remainingAccountsInfo = {
|
|
15111
15118
|
slices: [
|