@crypticdot/defituna-client 3.0.2 → 3.0.3
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.d.mts +87 -16
- package/dist/index.d.ts +87 -16
- package/dist/index.js +738 -552
- package/dist/index.mjs +491 -303
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -91,6 +91,7 @@ __export(index_exports, {
|
|
|
91
91
|
REBALANCE_TUNA_LP_POSITION_ORCA_DISCRIMINATOR: () => REBALANCE_TUNA_LP_POSITION_ORCA_DISCRIMINATOR,
|
|
92
92
|
REPAY_BAD_DEBT_DISCRIMINATOR: () => REPAY_BAD_DEBT_DISCRIMINATOR,
|
|
93
93
|
REPAY_TUNA_LP_POSITION_DEBT_DISCRIMINATOR: () => REPAY_TUNA_LP_POSITION_DEBT_DISCRIMINATOR,
|
|
94
|
+
RESET_TUNA_SPOT_POSITION_DISCRIMINATOR: () => RESET_TUNA_SPOT_POSITION_DISCRIMINATOR,
|
|
94
95
|
SET_ADMIN_AUTHORITY_DISCRIMINATOR: () => SET_ADMIN_AUTHORITY_DISCRIMINATOR,
|
|
95
96
|
SET_DEFAULT_MAX_PERCENTAGE_OF_LEFTOVERS_DISCRIMINATOR: () => SET_DEFAULT_MAX_PERCENTAGE_OF_LEFTOVERS_DISCRIMINATOR,
|
|
96
97
|
SET_DEFAULT_MAX_SWAP_SLIPPAGE_DISCRIMINATOR: () => SET_DEFAULT_MAX_SWAP_SLIPPAGE_DISCRIMINATOR,
|
|
@@ -478,6 +479,11 @@ __export(index_exports, {
|
|
|
478
479
|
getRepayTunaLpPositionDebtInstructionDataCodec: () => getRepayTunaLpPositionDebtInstructionDataCodec,
|
|
479
480
|
getRepayTunaLpPositionDebtInstructionDataDecoder: () => getRepayTunaLpPositionDebtInstructionDataDecoder,
|
|
480
481
|
getRepayTunaLpPositionDebtInstructionDataEncoder: () => getRepayTunaLpPositionDebtInstructionDataEncoder,
|
|
482
|
+
getResetTunaSpotPositionDiscriminatorBytes: () => getResetTunaSpotPositionDiscriminatorBytes,
|
|
483
|
+
getResetTunaSpotPositionInstruction: () => getResetTunaSpotPositionInstruction,
|
|
484
|
+
getResetTunaSpotPositionInstructionDataCodec: () => getResetTunaSpotPositionInstructionDataCodec,
|
|
485
|
+
getResetTunaSpotPositionInstructionDataDecoder: () => getResetTunaSpotPositionInstructionDataDecoder,
|
|
486
|
+
getResetTunaSpotPositionInstructionDataEncoder: () => getResetTunaSpotPositionInstructionDataEncoder,
|
|
481
487
|
getSetAdminAuthorityDiscriminatorBytes: () => getSetAdminAuthorityDiscriminatorBytes,
|
|
482
488
|
getSetAdminAuthorityInstruction: () => getSetAdminAuthorityInstruction,
|
|
483
489
|
getSetAdminAuthorityInstructionDataCodec: () => getSetAdminAuthorityInstructionDataCodec,
|
|
@@ -656,6 +662,7 @@ __export(index_exports, {
|
|
|
656
662
|
parseRebalanceTunaLpPositionOrcaInstruction: () => parseRebalanceTunaLpPositionOrcaInstruction,
|
|
657
663
|
parseRepayBadDebtInstruction: () => parseRepayBadDebtInstruction,
|
|
658
664
|
parseRepayTunaLpPositionDebtInstruction: () => parseRepayTunaLpPositionDebtInstruction,
|
|
665
|
+
parseResetTunaSpotPositionInstruction: () => parseResetTunaSpotPositionInstruction,
|
|
659
666
|
parseSetAdminAuthorityInstruction: () => parseSetAdminAuthorityInstruction,
|
|
660
667
|
parseSetDefaultMaxPercentageOfLeftoversInstruction: () => parseSetDefaultMaxPercentageOfLeftoversInstruction,
|
|
661
668
|
parseSetDefaultMaxSwapSlippageInstruction: () => parseSetDefaultMaxSwapSlippageInstruction,
|
|
@@ -678,7 +685,9 @@ __export(index_exports, {
|
|
|
678
685
|
repayBadDebtInstruction: () => repayBadDebtInstruction,
|
|
679
686
|
repayTunaLpPositionDebtInstruction: () => repayTunaLpPositionDebtInstruction,
|
|
680
687
|
repayTunaLpPositionDebtInstructions: () => repayTunaLpPositionDebtInstructions,
|
|
688
|
+
resetTunaSpotPositionInstruction: () => resetTunaSpotPositionInstruction,
|
|
681
689
|
setTunaLpPositionLimitOrdersInstruction: () => setTunaLpPositionLimitOrdersInstruction,
|
|
690
|
+
setTunaSpotPositionLimitOrdersInstruction: () => setTunaSpotPositionLimitOrdersInstruction,
|
|
682
691
|
tunaLpPositionAuthorityFilter: () => tunaLpPositionAuthorityFilter,
|
|
683
692
|
tunaLpPositionMarketMakerFilter: () => tunaLpPositionMarketMakerFilter,
|
|
684
693
|
tunaLpPositionMintAFilter: () => tunaLpPositionMintAFilter,
|
|
@@ -1522,21 +1531,22 @@ var TunaInstruction = /* @__PURE__ */ ((TunaInstruction2) => {
|
|
|
1522
1531
|
TunaInstruction2[TunaInstruction2["RebalanceTunaLpPositionOrca"] = 36] = "RebalanceTunaLpPositionOrca";
|
|
1523
1532
|
TunaInstruction2[TunaInstruction2["RepayBadDebt"] = 37] = "RepayBadDebt";
|
|
1524
1533
|
TunaInstruction2[TunaInstruction2["RepayTunaLpPositionDebt"] = 38] = "RepayTunaLpPositionDebt";
|
|
1525
|
-
TunaInstruction2[TunaInstruction2["
|
|
1526
|
-
TunaInstruction2[TunaInstruction2["
|
|
1527
|
-
TunaInstruction2[TunaInstruction2["
|
|
1528
|
-
TunaInstruction2[TunaInstruction2["
|
|
1529
|
-
TunaInstruction2[TunaInstruction2["
|
|
1530
|
-
TunaInstruction2[TunaInstruction2["
|
|
1531
|
-
TunaInstruction2[TunaInstruction2["
|
|
1532
|
-
TunaInstruction2[TunaInstruction2["
|
|
1533
|
-
TunaInstruction2[TunaInstruction2["
|
|
1534
|
-
TunaInstruction2[TunaInstruction2["
|
|
1535
|
-
TunaInstruction2[TunaInstruction2["
|
|
1536
|
-
TunaInstruction2[TunaInstruction2["
|
|
1537
|
-
TunaInstruction2[TunaInstruction2["
|
|
1538
|
-
TunaInstruction2[TunaInstruction2["
|
|
1539
|
-
TunaInstruction2[TunaInstruction2["
|
|
1534
|
+
TunaInstruction2[TunaInstruction2["ResetTunaSpotPosition"] = 39] = "ResetTunaSpotPosition";
|
|
1535
|
+
TunaInstruction2[TunaInstruction2["SetAdminAuthority"] = 40] = "SetAdminAuthority";
|
|
1536
|
+
TunaInstruction2[TunaInstruction2["SetDefaultMaxPercentageOfLeftovers"] = 41] = "SetDefaultMaxPercentageOfLeftovers";
|
|
1537
|
+
TunaInstruction2[TunaInstruction2["SetDefaultMaxSwapSlippage"] = 42] = "SetDefaultMaxSwapSlippage";
|
|
1538
|
+
TunaInstruction2[TunaInstruction2["SetDefaultOraclePriceDeviationThreshold"] = 43] = "SetDefaultOraclePriceDeviationThreshold";
|
|
1539
|
+
TunaInstruction2[TunaInstruction2["SetFeeRecipient"] = 44] = "SetFeeRecipient";
|
|
1540
|
+
TunaInstruction2[TunaInstruction2["SetLiquidatorAuthority"] = 45] = "SetLiquidatorAuthority";
|
|
1541
|
+
TunaInstruction2[TunaInstruction2["SetOwnerAuthority"] = 46] = "SetOwnerAuthority";
|
|
1542
|
+
TunaInstruction2[TunaInstruction2["SetSuspendedState"] = 47] = "SetSuspendedState";
|
|
1543
|
+
TunaInstruction2[TunaInstruction2["SetTunaLpPositionFlags"] = 48] = "SetTunaLpPositionFlags";
|
|
1544
|
+
TunaInstruction2[TunaInstruction2["SetTunaLpPositionLimitOrders"] = 49] = "SetTunaLpPositionLimitOrders";
|
|
1545
|
+
TunaInstruction2[TunaInstruction2["SetTunaLpPositionRebalanceThreshold"] = 50] = "SetTunaLpPositionRebalanceThreshold";
|
|
1546
|
+
TunaInstruction2[TunaInstruction2["SetTunaSpotPositionLimitOrders"] = 51] = "SetTunaSpotPositionLimitOrders";
|
|
1547
|
+
TunaInstruction2[TunaInstruction2["UpdateMarket"] = 52] = "UpdateMarket";
|
|
1548
|
+
TunaInstruction2[TunaInstruction2["UpdateVault"] = 53] = "UpdateVault";
|
|
1549
|
+
TunaInstruction2[TunaInstruction2["Withdraw"] = 54] = "Withdraw";
|
|
1540
1550
|
return TunaInstruction2;
|
|
1541
1551
|
})(TunaInstruction || {});
|
|
1542
1552
|
function identifyTunaInstruction(instruction) {
|
|
@@ -1892,6 +1902,15 @@ function identifyTunaInstruction(instruction) {
|
|
|
1892
1902
|
)) {
|
|
1893
1903
|
return 38 /* RepayTunaLpPositionDebt */;
|
|
1894
1904
|
}
|
|
1905
|
+
if ((0, import_kit13.containsBytes)(
|
|
1906
|
+
data,
|
|
1907
|
+
(0, import_kit13.fixEncoderSize)((0, import_kit13.getBytesEncoder)(), 8).encode(
|
|
1908
|
+
new Uint8Array([194, 68, 113, 71, 103, 77, 29, 127])
|
|
1909
|
+
),
|
|
1910
|
+
0
|
|
1911
|
+
)) {
|
|
1912
|
+
return 39 /* ResetTunaSpotPosition */;
|
|
1913
|
+
}
|
|
1895
1914
|
if ((0, import_kit13.containsBytes)(
|
|
1896
1915
|
data,
|
|
1897
1916
|
(0, import_kit13.fixEncoderSize)((0, import_kit13.getBytesEncoder)(), 8).encode(
|
|
@@ -1899,7 +1918,7 @@ function identifyTunaInstruction(instruction) {
|
|
|
1899
1918
|
),
|
|
1900
1919
|
0
|
|
1901
1920
|
)) {
|
|
1902
|
-
return
|
|
1921
|
+
return 40 /* SetAdminAuthority */;
|
|
1903
1922
|
}
|
|
1904
1923
|
if ((0, import_kit13.containsBytes)(
|
|
1905
1924
|
data,
|
|
@@ -1908,7 +1927,7 @@ function identifyTunaInstruction(instruction) {
|
|
|
1908
1927
|
),
|
|
1909
1928
|
0
|
|
1910
1929
|
)) {
|
|
1911
|
-
return
|
|
1930
|
+
return 41 /* SetDefaultMaxPercentageOfLeftovers */;
|
|
1912
1931
|
}
|
|
1913
1932
|
if ((0, import_kit13.containsBytes)(
|
|
1914
1933
|
data,
|
|
@@ -1917,7 +1936,7 @@ function identifyTunaInstruction(instruction) {
|
|
|
1917
1936
|
),
|
|
1918
1937
|
0
|
|
1919
1938
|
)) {
|
|
1920
|
-
return
|
|
1939
|
+
return 42 /* SetDefaultMaxSwapSlippage */;
|
|
1921
1940
|
}
|
|
1922
1941
|
if ((0, import_kit13.containsBytes)(
|
|
1923
1942
|
data,
|
|
@@ -1926,7 +1945,7 @@ function identifyTunaInstruction(instruction) {
|
|
|
1926
1945
|
),
|
|
1927
1946
|
0
|
|
1928
1947
|
)) {
|
|
1929
|
-
return
|
|
1948
|
+
return 43 /* SetDefaultOraclePriceDeviationThreshold */;
|
|
1930
1949
|
}
|
|
1931
1950
|
if ((0, import_kit13.containsBytes)(
|
|
1932
1951
|
data,
|
|
@@ -1935,7 +1954,7 @@ function identifyTunaInstruction(instruction) {
|
|
|
1935
1954
|
),
|
|
1936
1955
|
0
|
|
1937
1956
|
)) {
|
|
1938
|
-
return
|
|
1957
|
+
return 44 /* SetFeeRecipient */;
|
|
1939
1958
|
}
|
|
1940
1959
|
if ((0, import_kit13.containsBytes)(
|
|
1941
1960
|
data,
|
|
@@ -1944,7 +1963,7 @@ function identifyTunaInstruction(instruction) {
|
|
|
1944
1963
|
),
|
|
1945
1964
|
0
|
|
1946
1965
|
)) {
|
|
1947
|
-
return
|
|
1966
|
+
return 45 /* SetLiquidatorAuthority */;
|
|
1948
1967
|
}
|
|
1949
1968
|
if ((0, import_kit13.containsBytes)(
|
|
1950
1969
|
data,
|
|
@@ -1953,7 +1972,7 @@ function identifyTunaInstruction(instruction) {
|
|
|
1953
1972
|
),
|
|
1954
1973
|
0
|
|
1955
1974
|
)) {
|
|
1956
|
-
return
|
|
1975
|
+
return 46 /* SetOwnerAuthority */;
|
|
1957
1976
|
}
|
|
1958
1977
|
if ((0, import_kit13.containsBytes)(
|
|
1959
1978
|
data,
|
|
@@ -1962,7 +1981,7 @@ function identifyTunaInstruction(instruction) {
|
|
|
1962
1981
|
),
|
|
1963
1982
|
0
|
|
1964
1983
|
)) {
|
|
1965
|
-
return
|
|
1984
|
+
return 47 /* SetSuspendedState */;
|
|
1966
1985
|
}
|
|
1967
1986
|
if ((0, import_kit13.containsBytes)(
|
|
1968
1987
|
data,
|
|
@@ -1971,7 +1990,7 @@ function identifyTunaInstruction(instruction) {
|
|
|
1971
1990
|
),
|
|
1972
1991
|
0
|
|
1973
1992
|
)) {
|
|
1974
|
-
return
|
|
1993
|
+
return 48 /* SetTunaLpPositionFlags */;
|
|
1975
1994
|
}
|
|
1976
1995
|
if ((0, import_kit13.containsBytes)(
|
|
1977
1996
|
data,
|
|
@@ -1980,7 +1999,7 @@ function identifyTunaInstruction(instruction) {
|
|
|
1980
1999
|
),
|
|
1981
2000
|
0
|
|
1982
2001
|
)) {
|
|
1983
|
-
return
|
|
2002
|
+
return 49 /* SetTunaLpPositionLimitOrders */;
|
|
1984
2003
|
}
|
|
1985
2004
|
if ((0, import_kit13.containsBytes)(
|
|
1986
2005
|
data,
|
|
@@ -1989,7 +2008,7 @@ function identifyTunaInstruction(instruction) {
|
|
|
1989
2008
|
),
|
|
1990
2009
|
0
|
|
1991
2010
|
)) {
|
|
1992
|
-
return
|
|
2011
|
+
return 50 /* SetTunaLpPositionRebalanceThreshold */;
|
|
1993
2012
|
}
|
|
1994
2013
|
if ((0, import_kit13.containsBytes)(
|
|
1995
2014
|
data,
|
|
@@ -1998,7 +2017,7 @@ function identifyTunaInstruction(instruction) {
|
|
|
1998
2017
|
),
|
|
1999
2018
|
0
|
|
2000
2019
|
)) {
|
|
2001
|
-
return
|
|
2020
|
+
return 51 /* SetTunaSpotPositionLimitOrders */;
|
|
2002
2021
|
}
|
|
2003
2022
|
if ((0, import_kit13.containsBytes)(
|
|
2004
2023
|
data,
|
|
@@ -2007,7 +2026,7 @@ function identifyTunaInstruction(instruction) {
|
|
|
2007
2026
|
),
|
|
2008
2027
|
0
|
|
2009
2028
|
)) {
|
|
2010
|
-
return
|
|
2029
|
+
return 52 /* UpdateMarket */;
|
|
2011
2030
|
}
|
|
2012
2031
|
if ((0, import_kit13.containsBytes)(
|
|
2013
2032
|
data,
|
|
@@ -2016,7 +2035,7 @@ function identifyTunaInstruction(instruction) {
|
|
|
2016
2035
|
),
|
|
2017
2036
|
0
|
|
2018
2037
|
)) {
|
|
2019
|
-
return
|
|
2038
|
+
return 53 /* UpdateVault */;
|
|
2020
2039
|
}
|
|
2021
2040
|
if ((0, import_kit13.containsBytes)(
|
|
2022
2041
|
data,
|
|
@@ -2025,7 +2044,7 @@ function identifyTunaInstruction(instruction) {
|
|
|
2025
2044
|
),
|
|
2026
2045
|
0
|
|
2027
2046
|
)) {
|
|
2028
|
-
return
|
|
2047
|
+
return 54 /* Withdraw */;
|
|
2029
2048
|
}
|
|
2030
2049
|
throw new Error(
|
|
2031
2050
|
"The provided instruction could not be identified as a tuna instruction."
|
|
@@ -8326,8 +8345,116 @@ function parseRepayTunaLpPositionDebtInstruction(instruction) {
|
|
|
8326
8345
|
};
|
|
8327
8346
|
}
|
|
8328
8347
|
|
|
8329
|
-
// src/generated/instructions/
|
|
8348
|
+
// src/generated/instructions/resetTunaSpotPosition.ts
|
|
8330
8349
|
var import_kit55 = require("@solana/kit");
|
|
8350
|
+
var RESET_TUNA_SPOT_POSITION_DISCRIMINATOR = new Uint8Array([
|
|
8351
|
+
194,
|
|
8352
|
+
68,
|
|
8353
|
+
113,
|
|
8354
|
+
71,
|
|
8355
|
+
103,
|
|
8356
|
+
77,
|
|
8357
|
+
29,
|
|
8358
|
+
127
|
|
8359
|
+
]);
|
|
8360
|
+
function getResetTunaSpotPositionDiscriminatorBytes() {
|
|
8361
|
+
return (0, import_kit55.fixEncoderSize)((0, import_kit55.getBytesEncoder)(), 8).encode(
|
|
8362
|
+
RESET_TUNA_SPOT_POSITION_DISCRIMINATOR
|
|
8363
|
+
);
|
|
8364
|
+
}
|
|
8365
|
+
function getResetTunaSpotPositionInstructionDataEncoder() {
|
|
8366
|
+
return (0, import_kit55.transformEncoder)(
|
|
8367
|
+
(0, import_kit55.getStructEncoder)([
|
|
8368
|
+
["discriminator", (0, import_kit55.fixEncoderSize)((0, import_kit55.getBytesEncoder)(), 8)],
|
|
8369
|
+
["positionToken", getPoolTokenEncoder()],
|
|
8370
|
+
["collateralToken", getPoolTokenEncoder()],
|
|
8371
|
+
["lowerLimitOrderSqrtPrice", (0, import_kit55.getU128Encoder)()],
|
|
8372
|
+
["upperLimitOrderSqrtPrice", (0, import_kit55.getU128Encoder)()]
|
|
8373
|
+
]),
|
|
8374
|
+
(value) => ({
|
|
8375
|
+
...value,
|
|
8376
|
+
discriminator: RESET_TUNA_SPOT_POSITION_DISCRIMINATOR
|
|
8377
|
+
})
|
|
8378
|
+
);
|
|
8379
|
+
}
|
|
8380
|
+
function getResetTunaSpotPositionInstructionDataDecoder() {
|
|
8381
|
+
return (0, import_kit55.getStructDecoder)([
|
|
8382
|
+
["discriminator", (0, import_kit55.fixDecoderSize)((0, import_kit55.getBytesDecoder)(), 8)],
|
|
8383
|
+
["positionToken", getPoolTokenDecoder()],
|
|
8384
|
+
["collateralToken", getPoolTokenDecoder()],
|
|
8385
|
+
["lowerLimitOrderSqrtPrice", (0, import_kit55.getU128Decoder)()],
|
|
8386
|
+
["upperLimitOrderSqrtPrice", (0, import_kit55.getU128Decoder)()]
|
|
8387
|
+
]);
|
|
8388
|
+
}
|
|
8389
|
+
function getResetTunaSpotPositionInstructionDataCodec() {
|
|
8390
|
+
return (0, import_kit55.combineCodec)(
|
|
8391
|
+
getResetTunaSpotPositionInstructionDataEncoder(),
|
|
8392
|
+
getResetTunaSpotPositionInstructionDataDecoder()
|
|
8393
|
+
);
|
|
8394
|
+
}
|
|
8395
|
+
function getResetTunaSpotPositionInstruction(input, config) {
|
|
8396
|
+
const programAddress = config?.programAddress ?? TUNA_PROGRAM_ADDRESS;
|
|
8397
|
+
const originalAccounts = {
|
|
8398
|
+
authority: { value: input.authority ?? null, isWritable: false },
|
|
8399
|
+
mintA: { value: input.mintA ?? null, isWritable: false },
|
|
8400
|
+
mintB: { value: input.mintB ?? null, isWritable: false },
|
|
8401
|
+
tunaPosition: { value: input.tunaPosition ?? null, isWritable: true },
|
|
8402
|
+
tunaPositionAtaA: {
|
|
8403
|
+
value: input.tunaPositionAtaA ?? null,
|
|
8404
|
+
isWritable: true
|
|
8405
|
+
},
|
|
8406
|
+
tunaPositionAtaB: {
|
|
8407
|
+
value: input.tunaPositionAtaB ?? null,
|
|
8408
|
+
isWritable: true
|
|
8409
|
+
}
|
|
8410
|
+
};
|
|
8411
|
+
const accounts = originalAccounts;
|
|
8412
|
+
const args = { ...input };
|
|
8413
|
+
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
8414
|
+
const instruction = {
|
|
8415
|
+
accounts: [
|
|
8416
|
+
getAccountMeta(accounts.authority),
|
|
8417
|
+
getAccountMeta(accounts.mintA),
|
|
8418
|
+
getAccountMeta(accounts.mintB),
|
|
8419
|
+
getAccountMeta(accounts.tunaPosition),
|
|
8420
|
+
getAccountMeta(accounts.tunaPositionAtaA),
|
|
8421
|
+
getAccountMeta(accounts.tunaPositionAtaB)
|
|
8422
|
+
],
|
|
8423
|
+
programAddress,
|
|
8424
|
+
data: getResetTunaSpotPositionInstructionDataEncoder().encode(
|
|
8425
|
+
args
|
|
8426
|
+
)
|
|
8427
|
+
};
|
|
8428
|
+
return instruction;
|
|
8429
|
+
}
|
|
8430
|
+
function parseResetTunaSpotPositionInstruction(instruction) {
|
|
8431
|
+
if (instruction.accounts.length < 6) {
|
|
8432
|
+
throw new Error("Not enough accounts");
|
|
8433
|
+
}
|
|
8434
|
+
let accountIndex = 0;
|
|
8435
|
+
const getNextAccount = () => {
|
|
8436
|
+
const accountMeta = instruction.accounts[accountIndex];
|
|
8437
|
+
accountIndex += 1;
|
|
8438
|
+
return accountMeta;
|
|
8439
|
+
};
|
|
8440
|
+
return {
|
|
8441
|
+
programAddress: instruction.programAddress,
|
|
8442
|
+
accounts: {
|
|
8443
|
+
authority: getNextAccount(),
|
|
8444
|
+
mintA: getNextAccount(),
|
|
8445
|
+
mintB: getNextAccount(),
|
|
8446
|
+
tunaPosition: getNextAccount(),
|
|
8447
|
+
tunaPositionAtaA: getNextAccount(),
|
|
8448
|
+
tunaPositionAtaB: getNextAccount()
|
|
8449
|
+
},
|
|
8450
|
+
data: getResetTunaSpotPositionInstructionDataDecoder().decode(
|
|
8451
|
+
instruction.data
|
|
8452
|
+
)
|
|
8453
|
+
};
|
|
8454
|
+
}
|
|
8455
|
+
|
|
8456
|
+
// src/generated/instructions/setAdminAuthority.ts
|
|
8457
|
+
var import_kit56 = require("@solana/kit");
|
|
8331
8458
|
var SET_ADMIN_AUTHORITY_DISCRIMINATOR = new Uint8Array([
|
|
8332
8459
|
72,
|
|
8333
8460
|
49,
|
|
@@ -8339,27 +8466,27 @@ var SET_ADMIN_AUTHORITY_DISCRIMINATOR = new Uint8Array([
|
|
|
8339
8466
|
174
|
|
8340
8467
|
]);
|
|
8341
8468
|
function getSetAdminAuthorityDiscriminatorBytes() {
|
|
8342
|
-
return (0,
|
|
8469
|
+
return (0, import_kit56.fixEncoderSize)((0, import_kit56.getBytesEncoder)(), 8).encode(
|
|
8343
8470
|
SET_ADMIN_AUTHORITY_DISCRIMINATOR
|
|
8344
8471
|
);
|
|
8345
8472
|
}
|
|
8346
8473
|
function getSetAdminAuthorityInstructionDataEncoder() {
|
|
8347
|
-
return (0,
|
|
8348
|
-
(0,
|
|
8349
|
-
["discriminator", (0,
|
|
8350
|
-
["adminAuthority", (0,
|
|
8474
|
+
return (0, import_kit56.transformEncoder)(
|
|
8475
|
+
(0, import_kit56.getStructEncoder)([
|
|
8476
|
+
["discriminator", (0, import_kit56.fixEncoderSize)((0, import_kit56.getBytesEncoder)(), 8)],
|
|
8477
|
+
["adminAuthority", (0, import_kit56.getAddressEncoder)()]
|
|
8351
8478
|
]),
|
|
8352
8479
|
(value) => ({ ...value, discriminator: SET_ADMIN_AUTHORITY_DISCRIMINATOR })
|
|
8353
8480
|
);
|
|
8354
8481
|
}
|
|
8355
8482
|
function getSetAdminAuthorityInstructionDataDecoder() {
|
|
8356
|
-
return (0,
|
|
8357
|
-
["discriminator", (0,
|
|
8358
|
-
["adminAuthority", (0,
|
|
8483
|
+
return (0, import_kit56.getStructDecoder)([
|
|
8484
|
+
["discriminator", (0, import_kit56.fixDecoderSize)((0, import_kit56.getBytesDecoder)(), 8)],
|
|
8485
|
+
["adminAuthority", (0, import_kit56.getAddressDecoder)()]
|
|
8359
8486
|
]);
|
|
8360
8487
|
}
|
|
8361
8488
|
function getSetAdminAuthorityInstructionDataCodec() {
|
|
8362
|
-
return (0,
|
|
8489
|
+
return (0, import_kit56.combineCodec)(
|
|
8363
8490
|
getSetAdminAuthorityInstructionDataEncoder(),
|
|
8364
8491
|
getSetAdminAuthorityInstructionDataDecoder()
|
|
8365
8492
|
);
|
|
@@ -8406,18 +8533,18 @@ function parseSetAdminAuthorityInstruction(instruction) {
|
|
|
8406
8533
|
}
|
|
8407
8534
|
|
|
8408
8535
|
// src/generated/instructions/setDefaultMaxPercentageOfLeftovers.ts
|
|
8409
|
-
var
|
|
8536
|
+
var import_kit57 = require("@solana/kit");
|
|
8410
8537
|
var SET_DEFAULT_MAX_PERCENTAGE_OF_LEFTOVERS_DISCRIMINATOR = new Uint8Array([37, 179, 107, 65, 203, 141, 183, 27]);
|
|
8411
8538
|
function getSetDefaultMaxPercentageOfLeftoversDiscriminatorBytes() {
|
|
8412
|
-
return (0,
|
|
8539
|
+
return (0, import_kit57.fixEncoderSize)((0, import_kit57.getBytesEncoder)(), 8).encode(
|
|
8413
8540
|
SET_DEFAULT_MAX_PERCENTAGE_OF_LEFTOVERS_DISCRIMINATOR
|
|
8414
8541
|
);
|
|
8415
8542
|
}
|
|
8416
8543
|
function getSetDefaultMaxPercentageOfLeftoversInstructionDataEncoder() {
|
|
8417
|
-
return (0,
|
|
8418
|
-
(0,
|
|
8419
|
-
["discriminator", (0,
|
|
8420
|
-
["maxPercentageOfLeftovers", (0,
|
|
8544
|
+
return (0, import_kit57.transformEncoder)(
|
|
8545
|
+
(0, import_kit57.getStructEncoder)([
|
|
8546
|
+
["discriminator", (0, import_kit57.fixEncoderSize)((0, import_kit57.getBytesEncoder)(), 8)],
|
|
8547
|
+
["maxPercentageOfLeftovers", (0, import_kit57.getU32Encoder)()]
|
|
8421
8548
|
]),
|
|
8422
8549
|
(value) => ({
|
|
8423
8550
|
...value,
|
|
@@ -8426,13 +8553,13 @@ function getSetDefaultMaxPercentageOfLeftoversInstructionDataEncoder() {
|
|
|
8426
8553
|
);
|
|
8427
8554
|
}
|
|
8428
8555
|
function getSetDefaultMaxPercentageOfLeftoversInstructionDataDecoder() {
|
|
8429
|
-
return (0,
|
|
8430
|
-
["discriminator", (0,
|
|
8431
|
-
["maxPercentageOfLeftovers", (0,
|
|
8556
|
+
return (0, import_kit57.getStructDecoder)([
|
|
8557
|
+
["discriminator", (0, import_kit57.fixDecoderSize)((0, import_kit57.getBytesDecoder)(), 8)],
|
|
8558
|
+
["maxPercentageOfLeftovers", (0, import_kit57.getU32Decoder)()]
|
|
8432
8559
|
]);
|
|
8433
8560
|
}
|
|
8434
8561
|
function getSetDefaultMaxPercentageOfLeftoversInstructionDataCodec() {
|
|
8435
|
-
return (0,
|
|
8562
|
+
return (0, import_kit57.combineCodec)(
|
|
8436
8563
|
getSetDefaultMaxPercentageOfLeftoversInstructionDataEncoder(),
|
|
8437
8564
|
getSetDefaultMaxPercentageOfLeftoversInstructionDataDecoder()
|
|
8438
8565
|
);
|
|
@@ -8481,7 +8608,7 @@ function parseSetDefaultMaxPercentageOfLeftoversInstruction(instruction) {
|
|
|
8481
8608
|
}
|
|
8482
8609
|
|
|
8483
8610
|
// src/generated/instructions/setDefaultMaxSwapSlippage.ts
|
|
8484
|
-
var
|
|
8611
|
+
var import_kit58 = require("@solana/kit");
|
|
8485
8612
|
var SET_DEFAULT_MAX_SWAP_SLIPPAGE_DISCRIMINATOR = new Uint8Array([
|
|
8486
8613
|
122,
|
|
8487
8614
|
22,
|
|
@@ -8493,15 +8620,15 @@ var SET_DEFAULT_MAX_SWAP_SLIPPAGE_DISCRIMINATOR = new Uint8Array([
|
|
|
8493
8620
|
181
|
|
8494
8621
|
]);
|
|
8495
8622
|
function getSetDefaultMaxSwapSlippageDiscriminatorBytes() {
|
|
8496
|
-
return (0,
|
|
8623
|
+
return (0, import_kit58.fixEncoderSize)((0, import_kit58.getBytesEncoder)(), 8).encode(
|
|
8497
8624
|
SET_DEFAULT_MAX_SWAP_SLIPPAGE_DISCRIMINATOR
|
|
8498
8625
|
);
|
|
8499
8626
|
}
|
|
8500
8627
|
function getSetDefaultMaxSwapSlippageInstructionDataEncoder() {
|
|
8501
|
-
return (0,
|
|
8502
|
-
(0,
|
|
8503
|
-
["discriminator", (0,
|
|
8504
|
-
["maxSwapSlippage", (0,
|
|
8628
|
+
return (0, import_kit58.transformEncoder)(
|
|
8629
|
+
(0, import_kit58.getStructEncoder)([
|
|
8630
|
+
["discriminator", (0, import_kit58.fixEncoderSize)((0, import_kit58.getBytesEncoder)(), 8)],
|
|
8631
|
+
["maxSwapSlippage", (0, import_kit58.getU32Encoder)()]
|
|
8505
8632
|
]),
|
|
8506
8633
|
(value) => ({
|
|
8507
8634
|
...value,
|
|
@@ -8510,13 +8637,13 @@ function getSetDefaultMaxSwapSlippageInstructionDataEncoder() {
|
|
|
8510
8637
|
);
|
|
8511
8638
|
}
|
|
8512
8639
|
function getSetDefaultMaxSwapSlippageInstructionDataDecoder() {
|
|
8513
|
-
return (0,
|
|
8514
|
-
["discriminator", (0,
|
|
8515
|
-
["maxSwapSlippage", (0,
|
|
8640
|
+
return (0, import_kit58.getStructDecoder)([
|
|
8641
|
+
["discriminator", (0, import_kit58.fixDecoderSize)((0, import_kit58.getBytesDecoder)(), 8)],
|
|
8642
|
+
["maxSwapSlippage", (0, import_kit58.getU32Decoder)()]
|
|
8516
8643
|
]);
|
|
8517
8644
|
}
|
|
8518
8645
|
function getSetDefaultMaxSwapSlippageInstructionDataCodec() {
|
|
8519
|
-
return (0,
|
|
8646
|
+
return (0, import_kit58.combineCodec)(
|
|
8520
8647
|
getSetDefaultMaxSwapSlippageInstructionDataEncoder(),
|
|
8521
8648
|
getSetDefaultMaxSwapSlippageInstructionDataDecoder()
|
|
8522
8649
|
);
|
|
@@ -8565,18 +8692,18 @@ function parseSetDefaultMaxSwapSlippageInstruction(instruction) {
|
|
|
8565
8692
|
}
|
|
8566
8693
|
|
|
8567
8694
|
// src/generated/instructions/setDefaultOraclePriceDeviationThreshold.ts
|
|
8568
|
-
var
|
|
8695
|
+
var import_kit59 = require("@solana/kit");
|
|
8569
8696
|
var SET_DEFAULT_ORACLE_PRICE_DEVIATION_THRESHOLD_DISCRIMINATOR = new Uint8Array([142, 158, 143, 67, 206, 91, 139, 120]);
|
|
8570
8697
|
function getSetDefaultOraclePriceDeviationThresholdDiscriminatorBytes() {
|
|
8571
|
-
return (0,
|
|
8698
|
+
return (0, import_kit59.fixEncoderSize)((0, import_kit59.getBytesEncoder)(), 8).encode(
|
|
8572
8699
|
SET_DEFAULT_ORACLE_PRICE_DEVIATION_THRESHOLD_DISCRIMINATOR
|
|
8573
8700
|
);
|
|
8574
8701
|
}
|
|
8575
8702
|
function getSetDefaultOraclePriceDeviationThresholdInstructionDataEncoder() {
|
|
8576
|
-
return (0,
|
|
8577
|
-
(0,
|
|
8578
|
-
["discriminator", (0,
|
|
8579
|
-
["oraclePriceDeviationThreshold", (0,
|
|
8703
|
+
return (0, import_kit59.transformEncoder)(
|
|
8704
|
+
(0, import_kit59.getStructEncoder)([
|
|
8705
|
+
["discriminator", (0, import_kit59.fixEncoderSize)((0, import_kit59.getBytesEncoder)(), 8)],
|
|
8706
|
+
["oraclePriceDeviationThreshold", (0, import_kit59.getU32Encoder)()]
|
|
8580
8707
|
]),
|
|
8581
8708
|
(value) => ({
|
|
8582
8709
|
...value,
|
|
@@ -8585,13 +8712,13 @@ function getSetDefaultOraclePriceDeviationThresholdInstructionDataEncoder() {
|
|
|
8585
8712
|
);
|
|
8586
8713
|
}
|
|
8587
8714
|
function getSetDefaultOraclePriceDeviationThresholdInstructionDataDecoder() {
|
|
8588
|
-
return (0,
|
|
8589
|
-
["discriminator", (0,
|
|
8590
|
-
["oraclePriceDeviationThreshold", (0,
|
|
8715
|
+
return (0, import_kit59.getStructDecoder)([
|
|
8716
|
+
["discriminator", (0, import_kit59.fixDecoderSize)((0, import_kit59.getBytesDecoder)(), 8)],
|
|
8717
|
+
["oraclePriceDeviationThreshold", (0, import_kit59.getU32Decoder)()]
|
|
8591
8718
|
]);
|
|
8592
8719
|
}
|
|
8593
8720
|
function getSetDefaultOraclePriceDeviationThresholdInstructionDataCodec() {
|
|
8594
|
-
return (0,
|
|
8721
|
+
return (0, import_kit59.combineCodec)(
|
|
8595
8722
|
getSetDefaultOraclePriceDeviationThresholdInstructionDataEncoder(),
|
|
8596
8723
|
getSetDefaultOraclePriceDeviationThresholdInstructionDataDecoder()
|
|
8597
8724
|
);
|
|
@@ -8640,7 +8767,7 @@ function parseSetDefaultOraclePriceDeviationThresholdInstruction(instruction) {
|
|
|
8640
8767
|
}
|
|
8641
8768
|
|
|
8642
8769
|
// src/generated/instructions/setFeeRecipient.ts
|
|
8643
|
-
var
|
|
8770
|
+
var import_kit60 = require("@solana/kit");
|
|
8644
8771
|
var SET_FEE_RECIPIENT_DISCRIMINATOR = new Uint8Array([
|
|
8645
8772
|
227,
|
|
8646
8773
|
18,
|
|
@@ -8652,27 +8779,27 @@ var SET_FEE_RECIPIENT_DISCRIMINATOR = new Uint8Array([
|
|
|
8652
8779
|
66
|
|
8653
8780
|
]);
|
|
8654
8781
|
function getSetFeeRecipientDiscriminatorBytes() {
|
|
8655
|
-
return (0,
|
|
8782
|
+
return (0, import_kit60.fixEncoderSize)((0, import_kit60.getBytesEncoder)(), 8).encode(
|
|
8656
8783
|
SET_FEE_RECIPIENT_DISCRIMINATOR
|
|
8657
8784
|
);
|
|
8658
8785
|
}
|
|
8659
8786
|
function getSetFeeRecipientInstructionDataEncoder() {
|
|
8660
|
-
return (0,
|
|
8661
|
-
(0,
|
|
8662
|
-
["discriminator", (0,
|
|
8663
|
-
["feeRecipient", (0,
|
|
8787
|
+
return (0, import_kit60.transformEncoder)(
|
|
8788
|
+
(0, import_kit60.getStructEncoder)([
|
|
8789
|
+
["discriminator", (0, import_kit60.fixEncoderSize)((0, import_kit60.getBytesEncoder)(), 8)],
|
|
8790
|
+
["feeRecipient", (0, import_kit60.getAddressEncoder)()]
|
|
8664
8791
|
]),
|
|
8665
8792
|
(value) => ({ ...value, discriminator: SET_FEE_RECIPIENT_DISCRIMINATOR })
|
|
8666
8793
|
);
|
|
8667
8794
|
}
|
|
8668
8795
|
function getSetFeeRecipientInstructionDataDecoder() {
|
|
8669
|
-
return (0,
|
|
8670
|
-
["discriminator", (0,
|
|
8671
|
-
["feeRecipient", (0,
|
|
8796
|
+
return (0, import_kit60.getStructDecoder)([
|
|
8797
|
+
["discriminator", (0, import_kit60.fixDecoderSize)((0, import_kit60.getBytesDecoder)(), 8)],
|
|
8798
|
+
["feeRecipient", (0, import_kit60.getAddressDecoder)()]
|
|
8672
8799
|
]);
|
|
8673
8800
|
}
|
|
8674
8801
|
function getSetFeeRecipientInstructionDataCodec() {
|
|
8675
|
-
return (0,
|
|
8802
|
+
return (0, import_kit60.combineCodec)(
|
|
8676
8803
|
getSetFeeRecipientInstructionDataEncoder(),
|
|
8677
8804
|
getSetFeeRecipientInstructionDataDecoder()
|
|
8678
8805
|
);
|
|
@@ -8719,7 +8846,7 @@ function parseSetFeeRecipientInstruction(instruction) {
|
|
|
8719
8846
|
}
|
|
8720
8847
|
|
|
8721
8848
|
// src/generated/instructions/setLiquidatorAuthority.ts
|
|
8722
|
-
var
|
|
8849
|
+
var import_kit61 = require("@solana/kit");
|
|
8723
8850
|
var SET_LIQUIDATOR_AUTHORITY_DISCRIMINATOR = new Uint8Array([
|
|
8724
8851
|
246,
|
|
8725
8852
|
146,
|
|
@@ -8731,15 +8858,15 @@ var SET_LIQUIDATOR_AUTHORITY_DISCRIMINATOR = new Uint8Array([
|
|
|
8731
8858
|
143
|
|
8732
8859
|
]);
|
|
8733
8860
|
function getSetLiquidatorAuthorityDiscriminatorBytes() {
|
|
8734
|
-
return (0,
|
|
8861
|
+
return (0, import_kit61.fixEncoderSize)((0, import_kit61.getBytesEncoder)(), 8).encode(
|
|
8735
8862
|
SET_LIQUIDATOR_AUTHORITY_DISCRIMINATOR
|
|
8736
8863
|
);
|
|
8737
8864
|
}
|
|
8738
8865
|
function getSetLiquidatorAuthorityInstructionDataEncoder() {
|
|
8739
|
-
return (0,
|
|
8740
|
-
(0,
|
|
8741
|
-
["discriminator", (0,
|
|
8742
|
-
["liquidatorAuthority", (0,
|
|
8866
|
+
return (0, import_kit61.transformEncoder)(
|
|
8867
|
+
(0, import_kit61.getStructEncoder)([
|
|
8868
|
+
["discriminator", (0, import_kit61.fixEncoderSize)((0, import_kit61.getBytesEncoder)(), 8)],
|
|
8869
|
+
["liquidatorAuthority", (0, import_kit61.getAddressEncoder)()]
|
|
8743
8870
|
]),
|
|
8744
8871
|
(value) => ({
|
|
8745
8872
|
...value,
|
|
@@ -8748,13 +8875,13 @@ function getSetLiquidatorAuthorityInstructionDataEncoder() {
|
|
|
8748
8875
|
);
|
|
8749
8876
|
}
|
|
8750
8877
|
function getSetLiquidatorAuthorityInstructionDataDecoder() {
|
|
8751
|
-
return (0,
|
|
8752
|
-
["discriminator", (0,
|
|
8753
|
-
["liquidatorAuthority", (0,
|
|
8878
|
+
return (0, import_kit61.getStructDecoder)([
|
|
8879
|
+
["discriminator", (0, import_kit61.fixDecoderSize)((0, import_kit61.getBytesDecoder)(), 8)],
|
|
8880
|
+
["liquidatorAuthority", (0, import_kit61.getAddressDecoder)()]
|
|
8754
8881
|
]);
|
|
8755
8882
|
}
|
|
8756
8883
|
function getSetLiquidatorAuthorityInstructionDataCodec() {
|
|
8757
|
-
return (0,
|
|
8884
|
+
return (0, import_kit61.combineCodec)(
|
|
8758
8885
|
getSetLiquidatorAuthorityInstructionDataEncoder(),
|
|
8759
8886
|
getSetLiquidatorAuthorityInstructionDataDecoder()
|
|
8760
8887
|
);
|
|
@@ -8803,7 +8930,7 @@ function parseSetLiquidatorAuthorityInstruction(instruction) {
|
|
|
8803
8930
|
}
|
|
8804
8931
|
|
|
8805
8932
|
// src/generated/instructions/setOwnerAuthority.ts
|
|
8806
|
-
var
|
|
8933
|
+
var import_kit62 = require("@solana/kit");
|
|
8807
8934
|
var SET_OWNER_AUTHORITY_DISCRIMINATOR = new Uint8Array([
|
|
8808
8935
|
128,
|
|
8809
8936
|
171,
|
|
@@ -8815,27 +8942,27 @@ var SET_OWNER_AUTHORITY_DISCRIMINATOR = new Uint8Array([
|
|
|
8815
8942
|
117
|
|
8816
8943
|
]);
|
|
8817
8944
|
function getSetOwnerAuthorityDiscriminatorBytes() {
|
|
8818
|
-
return (0,
|
|
8945
|
+
return (0, import_kit62.fixEncoderSize)((0, import_kit62.getBytesEncoder)(), 8).encode(
|
|
8819
8946
|
SET_OWNER_AUTHORITY_DISCRIMINATOR
|
|
8820
8947
|
);
|
|
8821
8948
|
}
|
|
8822
8949
|
function getSetOwnerAuthorityInstructionDataEncoder() {
|
|
8823
|
-
return (0,
|
|
8824
|
-
(0,
|
|
8825
|
-
["discriminator", (0,
|
|
8826
|
-
["ownerAuthority", (0,
|
|
8950
|
+
return (0, import_kit62.transformEncoder)(
|
|
8951
|
+
(0, import_kit62.getStructEncoder)([
|
|
8952
|
+
["discriminator", (0, import_kit62.fixEncoderSize)((0, import_kit62.getBytesEncoder)(), 8)],
|
|
8953
|
+
["ownerAuthority", (0, import_kit62.getAddressEncoder)()]
|
|
8827
8954
|
]),
|
|
8828
8955
|
(value) => ({ ...value, discriminator: SET_OWNER_AUTHORITY_DISCRIMINATOR })
|
|
8829
8956
|
);
|
|
8830
8957
|
}
|
|
8831
8958
|
function getSetOwnerAuthorityInstructionDataDecoder() {
|
|
8832
|
-
return (0,
|
|
8833
|
-
["discriminator", (0,
|
|
8834
|
-
["ownerAuthority", (0,
|
|
8959
|
+
return (0, import_kit62.getStructDecoder)([
|
|
8960
|
+
["discriminator", (0, import_kit62.fixDecoderSize)((0, import_kit62.getBytesDecoder)(), 8)],
|
|
8961
|
+
["ownerAuthority", (0, import_kit62.getAddressDecoder)()]
|
|
8835
8962
|
]);
|
|
8836
8963
|
}
|
|
8837
8964
|
function getSetOwnerAuthorityInstructionDataCodec() {
|
|
8838
|
-
return (0,
|
|
8965
|
+
return (0, import_kit62.combineCodec)(
|
|
8839
8966
|
getSetOwnerAuthorityInstructionDataEncoder(),
|
|
8840
8967
|
getSetOwnerAuthorityInstructionDataDecoder()
|
|
8841
8968
|
);
|
|
@@ -8882,7 +9009,7 @@ function parseSetOwnerAuthorityInstruction(instruction) {
|
|
|
8882
9009
|
}
|
|
8883
9010
|
|
|
8884
9011
|
// src/generated/instructions/setSuspendedState.ts
|
|
8885
|
-
var
|
|
9012
|
+
var import_kit63 = require("@solana/kit");
|
|
8886
9013
|
var SET_SUSPENDED_STATE_DISCRIMINATOR = new Uint8Array([
|
|
8887
9014
|
145,
|
|
8888
9015
|
13,
|
|
@@ -8894,33 +9021,33 @@ var SET_SUSPENDED_STATE_DISCRIMINATOR = new Uint8Array([
|
|
|
8894
9021
|
32
|
|
8895
9022
|
]);
|
|
8896
9023
|
function getSetSuspendedStateDiscriminatorBytes() {
|
|
8897
|
-
return (0,
|
|
9024
|
+
return (0, import_kit63.fixEncoderSize)((0, import_kit63.getBytesEncoder)(), 8).encode(
|
|
8898
9025
|
SET_SUSPENDED_STATE_DISCRIMINATOR
|
|
8899
9026
|
);
|
|
8900
9027
|
}
|
|
8901
9028
|
function getSetSuspendedStateInstructionDataEncoder() {
|
|
8902
|
-
return (0,
|
|
8903
|
-
(0,
|
|
8904
|
-
["discriminator", (0,
|
|
8905
|
-
["suspendLendingDeposits", (0,
|
|
8906
|
-
["suspendLendingWithdrawals", (0,
|
|
8907
|
-
["suspendAddLiquidity", (0,
|
|
8908
|
-
["suspendRemoveLiquidity", (0,
|
|
9029
|
+
return (0, import_kit63.transformEncoder)(
|
|
9030
|
+
(0, import_kit63.getStructEncoder)([
|
|
9031
|
+
["discriminator", (0, import_kit63.fixEncoderSize)((0, import_kit63.getBytesEncoder)(), 8)],
|
|
9032
|
+
["suspendLendingDeposits", (0, import_kit63.getBooleanEncoder)()],
|
|
9033
|
+
["suspendLendingWithdrawals", (0, import_kit63.getBooleanEncoder)()],
|
|
9034
|
+
["suspendAddLiquidity", (0, import_kit63.getBooleanEncoder)()],
|
|
9035
|
+
["suspendRemoveLiquidity", (0, import_kit63.getBooleanEncoder)()]
|
|
8909
9036
|
]),
|
|
8910
9037
|
(value) => ({ ...value, discriminator: SET_SUSPENDED_STATE_DISCRIMINATOR })
|
|
8911
9038
|
);
|
|
8912
9039
|
}
|
|
8913
9040
|
function getSetSuspendedStateInstructionDataDecoder() {
|
|
8914
|
-
return (0,
|
|
8915
|
-
["discriminator", (0,
|
|
8916
|
-
["suspendLendingDeposits", (0,
|
|
8917
|
-
["suspendLendingWithdrawals", (0,
|
|
8918
|
-
["suspendAddLiquidity", (0,
|
|
8919
|
-
["suspendRemoveLiquidity", (0,
|
|
9041
|
+
return (0, import_kit63.getStructDecoder)([
|
|
9042
|
+
["discriminator", (0, import_kit63.fixDecoderSize)((0, import_kit63.getBytesDecoder)(), 8)],
|
|
9043
|
+
["suspendLendingDeposits", (0, import_kit63.getBooleanDecoder)()],
|
|
9044
|
+
["suspendLendingWithdrawals", (0, import_kit63.getBooleanDecoder)()],
|
|
9045
|
+
["suspendAddLiquidity", (0, import_kit63.getBooleanDecoder)()],
|
|
9046
|
+
["suspendRemoveLiquidity", (0, import_kit63.getBooleanDecoder)()]
|
|
8920
9047
|
]);
|
|
8921
9048
|
}
|
|
8922
9049
|
function getSetSuspendedStateInstructionDataCodec() {
|
|
8923
|
-
return (0,
|
|
9050
|
+
return (0, import_kit63.combineCodec)(
|
|
8924
9051
|
getSetSuspendedStateInstructionDataEncoder(),
|
|
8925
9052
|
getSetSuspendedStateInstructionDataDecoder()
|
|
8926
9053
|
);
|
|
@@ -8967,7 +9094,7 @@ function parseSetSuspendedStateInstruction(instruction) {
|
|
|
8967
9094
|
}
|
|
8968
9095
|
|
|
8969
9096
|
// src/generated/instructions/setTunaLpPositionFlags.ts
|
|
8970
|
-
var
|
|
9097
|
+
var import_kit64 = require("@solana/kit");
|
|
8971
9098
|
var SET_TUNA_LP_POSITION_FLAGS_DISCRIMINATOR = new Uint8Array([
|
|
8972
9099
|
110,
|
|
8973
9100
|
73,
|
|
@@ -8979,15 +9106,15 @@ var SET_TUNA_LP_POSITION_FLAGS_DISCRIMINATOR = new Uint8Array([
|
|
|
8979
9106
|
57
|
|
8980
9107
|
]);
|
|
8981
9108
|
function getSetTunaLpPositionFlagsDiscriminatorBytes() {
|
|
8982
|
-
return (0,
|
|
9109
|
+
return (0, import_kit64.fixEncoderSize)((0, import_kit64.getBytesEncoder)(), 8).encode(
|
|
8983
9110
|
SET_TUNA_LP_POSITION_FLAGS_DISCRIMINATOR
|
|
8984
9111
|
);
|
|
8985
9112
|
}
|
|
8986
9113
|
function getSetTunaLpPositionFlagsInstructionDataEncoder() {
|
|
8987
|
-
return (0,
|
|
8988
|
-
(0,
|
|
8989
|
-
["discriminator", (0,
|
|
8990
|
-
["flags", (0,
|
|
9114
|
+
return (0, import_kit64.transformEncoder)(
|
|
9115
|
+
(0, import_kit64.getStructEncoder)([
|
|
9116
|
+
["discriminator", (0, import_kit64.fixEncoderSize)((0, import_kit64.getBytesEncoder)(), 8)],
|
|
9117
|
+
["flags", (0, import_kit64.getU32Encoder)()]
|
|
8991
9118
|
]),
|
|
8992
9119
|
(value) => ({
|
|
8993
9120
|
...value,
|
|
@@ -8996,13 +9123,13 @@ function getSetTunaLpPositionFlagsInstructionDataEncoder() {
|
|
|
8996
9123
|
);
|
|
8997
9124
|
}
|
|
8998
9125
|
function getSetTunaLpPositionFlagsInstructionDataDecoder() {
|
|
8999
|
-
return (0,
|
|
9000
|
-
["discriminator", (0,
|
|
9001
|
-
["flags", (0,
|
|
9126
|
+
return (0, import_kit64.getStructDecoder)([
|
|
9127
|
+
["discriminator", (0, import_kit64.fixDecoderSize)((0, import_kit64.getBytesDecoder)(), 8)],
|
|
9128
|
+
["flags", (0, import_kit64.getU32Decoder)()]
|
|
9002
9129
|
]);
|
|
9003
9130
|
}
|
|
9004
9131
|
function getSetTunaLpPositionFlagsInstructionDataCodec() {
|
|
9005
|
-
return (0,
|
|
9132
|
+
return (0, import_kit64.combineCodec)(
|
|
9006
9133
|
getSetTunaLpPositionFlagsInstructionDataEncoder(),
|
|
9007
9134
|
getSetTunaLpPositionFlagsInstructionDataDecoder()
|
|
9008
9135
|
);
|
|
@@ -9051,7 +9178,7 @@ function parseSetTunaLpPositionFlagsInstruction(instruction) {
|
|
|
9051
9178
|
}
|
|
9052
9179
|
|
|
9053
9180
|
// src/generated/instructions/setTunaLpPositionLimitOrders.ts
|
|
9054
|
-
var
|
|
9181
|
+
var import_kit65 = require("@solana/kit");
|
|
9055
9182
|
var SET_TUNA_LP_POSITION_LIMIT_ORDERS_DISCRIMINATOR = new Uint8Array([
|
|
9056
9183
|
65,
|
|
9057
9184
|
128,
|
|
@@ -9063,17 +9190,17 @@ var SET_TUNA_LP_POSITION_LIMIT_ORDERS_DISCRIMINATOR = new Uint8Array([
|
|
|
9063
9190
|
255
|
|
9064
9191
|
]);
|
|
9065
9192
|
function getSetTunaLpPositionLimitOrdersDiscriminatorBytes() {
|
|
9066
|
-
return (0,
|
|
9193
|
+
return (0, import_kit65.fixEncoderSize)((0, import_kit65.getBytesEncoder)(), 8).encode(
|
|
9067
9194
|
SET_TUNA_LP_POSITION_LIMIT_ORDERS_DISCRIMINATOR
|
|
9068
9195
|
);
|
|
9069
9196
|
}
|
|
9070
9197
|
function getSetTunaLpPositionLimitOrdersInstructionDataEncoder() {
|
|
9071
|
-
return (0,
|
|
9072
|
-
(0,
|
|
9073
|
-
["discriminator", (0,
|
|
9074
|
-
["lowerLimitOrderSqrtPrice", (0,
|
|
9075
|
-
["upperLimitOrderSqrtPrice", (0,
|
|
9076
|
-
["swapToTokenOnLimitOrder", (0,
|
|
9198
|
+
return (0, import_kit65.transformEncoder)(
|
|
9199
|
+
(0, import_kit65.getStructEncoder)([
|
|
9200
|
+
["discriminator", (0, import_kit65.fixEncoderSize)((0, import_kit65.getBytesEncoder)(), 8)],
|
|
9201
|
+
["lowerLimitOrderSqrtPrice", (0, import_kit65.getU128Encoder)()],
|
|
9202
|
+
["upperLimitOrderSqrtPrice", (0, import_kit65.getU128Encoder)()],
|
|
9203
|
+
["swapToTokenOnLimitOrder", (0, import_kit65.getU8Encoder)()]
|
|
9077
9204
|
]),
|
|
9078
9205
|
(value) => ({
|
|
9079
9206
|
...value,
|
|
@@ -9082,15 +9209,15 @@ function getSetTunaLpPositionLimitOrdersInstructionDataEncoder() {
|
|
|
9082
9209
|
);
|
|
9083
9210
|
}
|
|
9084
9211
|
function getSetTunaLpPositionLimitOrdersInstructionDataDecoder() {
|
|
9085
|
-
return (0,
|
|
9086
|
-
["discriminator", (0,
|
|
9087
|
-
["lowerLimitOrderSqrtPrice", (0,
|
|
9088
|
-
["upperLimitOrderSqrtPrice", (0,
|
|
9089
|
-
["swapToTokenOnLimitOrder", (0,
|
|
9212
|
+
return (0, import_kit65.getStructDecoder)([
|
|
9213
|
+
["discriminator", (0, import_kit65.fixDecoderSize)((0, import_kit65.getBytesDecoder)(), 8)],
|
|
9214
|
+
["lowerLimitOrderSqrtPrice", (0, import_kit65.getU128Decoder)()],
|
|
9215
|
+
["upperLimitOrderSqrtPrice", (0, import_kit65.getU128Decoder)()],
|
|
9216
|
+
["swapToTokenOnLimitOrder", (0, import_kit65.getU8Decoder)()]
|
|
9090
9217
|
]);
|
|
9091
9218
|
}
|
|
9092
9219
|
function getSetTunaLpPositionLimitOrdersInstructionDataCodec() {
|
|
9093
|
-
return (0,
|
|
9220
|
+
return (0, import_kit65.combineCodec)(
|
|
9094
9221
|
getSetTunaLpPositionLimitOrdersInstructionDataEncoder(),
|
|
9095
9222
|
getSetTunaLpPositionLimitOrdersInstructionDataDecoder()
|
|
9096
9223
|
);
|
|
@@ -9139,18 +9266,18 @@ function parseSetTunaLpPositionLimitOrdersInstruction(instruction) {
|
|
|
9139
9266
|
}
|
|
9140
9267
|
|
|
9141
9268
|
// src/generated/instructions/setTunaLpPositionRebalanceThreshold.ts
|
|
9142
|
-
var
|
|
9269
|
+
var import_kit66 = require("@solana/kit");
|
|
9143
9270
|
var SET_TUNA_LP_POSITION_REBALANCE_THRESHOLD_DISCRIMINATOR = new Uint8Array([244, 174, 185, 58, 90, 150, 162, 51]);
|
|
9144
9271
|
function getSetTunaLpPositionRebalanceThresholdDiscriminatorBytes() {
|
|
9145
|
-
return (0,
|
|
9272
|
+
return (0, import_kit66.fixEncoderSize)((0, import_kit66.getBytesEncoder)(), 8).encode(
|
|
9146
9273
|
SET_TUNA_LP_POSITION_REBALANCE_THRESHOLD_DISCRIMINATOR
|
|
9147
9274
|
);
|
|
9148
9275
|
}
|
|
9149
9276
|
function getSetTunaLpPositionRebalanceThresholdInstructionDataEncoder() {
|
|
9150
|
-
return (0,
|
|
9151
|
-
(0,
|
|
9152
|
-
["discriminator", (0,
|
|
9153
|
-
["rebalanceThresholdTicks", (0,
|
|
9277
|
+
return (0, import_kit66.transformEncoder)(
|
|
9278
|
+
(0, import_kit66.getStructEncoder)([
|
|
9279
|
+
["discriminator", (0, import_kit66.fixEncoderSize)((0, import_kit66.getBytesEncoder)(), 8)],
|
|
9280
|
+
["rebalanceThresholdTicks", (0, import_kit66.getU32Encoder)()]
|
|
9154
9281
|
]),
|
|
9155
9282
|
(value) => ({
|
|
9156
9283
|
...value,
|
|
@@ -9159,13 +9286,13 @@ function getSetTunaLpPositionRebalanceThresholdInstructionDataEncoder() {
|
|
|
9159
9286
|
);
|
|
9160
9287
|
}
|
|
9161
9288
|
function getSetTunaLpPositionRebalanceThresholdInstructionDataDecoder() {
|
|
9162
|
-
return (0,
|
|
9163
|
-
["discriminator", (0,
|
|
9164
|
-
["rebalanceThresholdTicks", (0,
|
|
9289
|
+
return (0, import_kit66.getStructDecoder)([
|
|
9290
|
+
["discriminator", (0, import_kit66.fixDecoderSize)((0, import_kit66.getBytesDecoder)(), 8)],
|
|
9291
|
+
["rebalanceThresholdTicks", (0, import_kit66.getU32Decoder)()]
|
|
9165
9292
|
]);
|
|
9166
9293
|
}
|
|
9167
9294
|
function getSetTunaLpPositionRebalanceThresholdInstructionDataCodec() {
|
|
9168
|
-
return (0,
|
|
9295
|
+
return (0, import_kit66.combineCodec)(
|
|
9169
9296
|
getSetTunaLpPositionRebalanceThresholdInstructionDataEncoder(),
|
|
9170
9297
|
getSetTunaLpPositionRebalanceThresholdInstructionDataDecoder()
|
|
9171
9298
|
);
|
|
@@ -9214,21 +9341,21 @@ function parseSetTunaLpPositionRebalanceThresholdInstruction(instruction) {
|
|
|
9214
9341
|
}
|
|
9215
9342
|
|
|
9216
9343
|
// src/generated/instructions/setTunaSpotPositionLimitOrders.ts
|
|
9217
|
-
var
|
|
9344
|
+
var import_kit67 = require("@solana/kit");
|
|
9218
9345
|
var SET_TUNA_SPOT_POSITION_LIMIT_ORDERS_DISCRIMINATOR = new Uint8Array(
|
|
9219
9346
|
[10, 180, 19, 205, 169, 133, 52, 118]
|
|
9220
9347
|
);
|
|
9221
9348
|
function getSetTunaSpotPositionLimitOrdersDiscriminatorBytes() {
|
|
9222
|
-
return (0,
|
|
9349
|
+
return (0, import_kit67.fixEncoderSize)((0, import_kit67.getBytesEncoder)(), 8).encode(
|
|
9223
9350
|
SET_TUNA_SPOT_POSITION_LIMIT_ORDERS_DISCRIMINATOR
|
|
9224
9351
|
);
|
|
9225
9352
|
}
|
|
9226
9353
|
function getSetTunaSpotPositionLimitOrdersInstructionDataEncoder() {
|
|
9227
|
-
return (0,
|
|
9228
|
-
(0,
|
|
9229
|
-
["discriminator", (0,
|
|
9230
|
-
["lowerLimitOrderSqrtPrice", (0,
|
|
9231
|
-
["upperLimitOrderSqrtPrice", (0,
|
|
9354
|
+
return (0, import_kit67.transformEncoder)(
|
|
9355
|
+
(0, import_kit67.getStructEncoder)([
|
|
9356
|
+
["discriminator", (0, import_kit67.fixEncoderSize)((0, import_kit67.getBytesEncoder)(), 8)],
|
|
9357
|
+
["lowerLimitOrderSqrtPrice", (0, import_kit67.getU128Encoder)()],
|
|
9358
|
+
["upperLimitOrderSqrtPrice", (0, import_kit67.getU128Encoder)()]
|
|
9232
9359
|
]),
|
|
9233
9360
|
(value) => ({
|
|
9234
9361
|
...value,
|
|
@@ -9237,14 +9364,14 @@ function getSetTunaSpotPositionLimitOrdersInstructionDataEncoder() {
|
|
|
9237
9364
|
);
|
|
9238
9365
|
}
|
|
9239
9366
|
function getSetTunaSpotPositionLimitOrdersInstructionDataDecoder() {
|
|
9240
|
-
return (0,
|
|
9241
|
-
["discriminator", (0,
|
|
9242
|
-
["lowerLimitOrderSqrtPrice", (0,
|
|
9243
|
-
["upperLimitOrderSqrtPrice", (0,
|
|
9367
|
+
return (0, import_kit67.getStructDecoder)([
|
|
9368
|
+
["discriminator", (0, import_kit67.fixDecoderSize)((0, import_kit67.getBytesDecoder)(), 8)],
|
|
9369
|
+
["lowerLimitOrderSqrtPrice", (0, import_kit67.getU128Decoder)()],
|
|
9370
|
+
["upperLimitOrderSqrtPrice", (0, import_kit67.getU128Decoder)()]
|
|
9244
9371
|
]);
|
|
9245
9372
|
}
|
|
9246
9373
|
function getSetTunaSpotPositionLimitOrdersInstructionDataCodec() {
|
|
9247
|
-
return (0,
|
|
9374
|
+
return (0, import_kit67.combineCodec)(
|
|
9248
9375
|
getSetTunaSpotPositionLimitOrdersInstructionDataEncoder(),
|
|
9249
9376
|
getSetTunaSpotPositionLimitOrdersInstructionDataDecoder()
|
|
9250
9377
|
);
|
|
@@ -9293,7 +9420,7 @@ function parseSetTunaSpotPositionLimitOrdersInstruction(instruction) {
|
|
|
9293
9420
|
}
|
|
9294
9421
|
|
|
9295
9422
|
// src/generated/instructions/updateMarket.ts
|
|
9296
|
-
var
|
|
9423
|
+
var import_kit68 = require("@solana/kit");
|
|
9297
9424
|
var UPDATE_MARKET_DISCRIMINATOR = new Uint8Array([
|
|
9298
9425
|
153,
|
|
9299
9426
|
39,
|
|
@@ -9305,51 +9432,51 @@ var UPDATE_MARKET_DISCRIMINATOR = new Uint8Array([
|
|
|
9305
9432
|
217
|
|
9306
9433
|
]);
|
|
9307
9434
|
function getUpdateMarketDiscriminatorBytes() {
|
|
9308
|
-
return (0,
|
|
9435
|
+
return (0, import_kit68.fixEncoderSize)((0, import_kit68.getBytesEncoder)(), 8).encode(
|
|
9309
9436
|
UPDATE_MARKET_DISCRIMINATOR
|
|
9310
9437
|
);
|
|
9311
9438
|
}
|
|
9312
9439
|
function getUpdateMarketInstructionDataEncoder() {
|
|
9313
|
-
return (0,
|
|
9314
|
-
(0,
|
|
9315
|
-
["discriminator", (0,
|
|
9316
|
-
["addressLookupTable", (0,
|
|
9317
|
-
["maxLeverage", (0,
|
|
9318
|
-
["protocolFee", (0,
|
|
9319
|
-
["protocolFeeOnCollateral", (0,
|
|
9320
|
-
["liquidationFee", (0,
|
|
9321
|
-
["liquidationThreshold", (0,
|
|
9322
|
-
["limitOrderExecutionFee", (0,
|
|
9323
|
-
["oraclePriceDeviationThreshold", (0,
|
|
9324
|
-
["disabled", (0,
|
|
9325
|
-
["borrowLimitA", (0,
|
|
9326
|
-
["borrowLimitB", (0,
|
|
9327
|
-
["maxSwapSlippage", (0,
|
|
9328
|
-
["rebalanceProtocolFee", (0,
|
|
9440
|
+
return (0, import_kit68.transformEncoder)(
|
|
9441
|
+
(0, import_kit68.getStructEncoder)([
|
|
9442
|
+
["discriminator", (0, import_kit68.fixEncoderSize)((0, import_kit68.getBytesEncoder)(), 8)],
|
|
9443
|
+
["addressLookupTable", (0, import_kit68.getAddressEncoder)()],
|
|
9444
|
+
["maxLeverage", (0, import_kit68.getU32Encoder)()],
|
|
9445
|
+
["protocolFee", (0, import_kit68.getU16Encoder)()],
|
|
9446
|
+
["protocolFeeOnCollateral", (0, import_kit68.getU16Encoder)()],
|
|
9447
|
+
["liquidationFee", (0, import_kit68.getU32Encoder)()],
|
|
9448
|
+
["liquidationThreshold", (0, import_kit68.getU32Encoder)()],
|
|
9449
|
+
["limitOrderExecutionFee", (0, import_kit68.getU32Encoder)()],
|
|
9450
|
+
["oraclePriceDeviationThreshold", (0, import_kit68.getU32Encoder)()],
|
|
9451
|
+
["disabled", (0, import_kit68.getBooleanEncoder)()],
|
|
9452
|
+
["borrowLimitA", (0, import_kit68.getU64Encoder)()],
|
|
9453
|
+
["borrowLimitB", (0, import_kit68.getU64Encoder)()],
|
|
9454
|
+
["maxSwapSlippage", (0, import_kit68.getU32Encoder)()],
|
|
9455
|
+
["rebalanceProtocolFee", (0, import_kit68.getU32Encoder)()]
|
|
9329
9456
|
]),
|
|
9330
9457
|
(value) => ({ ...value, discriminator: UPDATE_MARKET_DISCRIMINATOR })
|
|
9331
9458
|
);
|
|
9332
9459
|
}
|
|
9333
9460
|
function getUpdateMarketInstructionDataDecoder() {
|
|
9334
|
-
return (0,
|
|
9335
|
-
["discriminator", (0,
|
|
9336
|
-
["addressLookupTable", (0,
|
|
9337
|
-
["maxLeverage", (0,
|
|
9338
|
-
["protocolFee", (0,
|
|
9339
|
-
["protocolFeeOnCollateral", (0,
|
|
9340
|
-
["liquidationFee", (0,
|
|
9341
|
-
["liquidationThreshold", (0,
|
|
9342
|
-
["limitOrderExecutionFee", (0,
|
|
9343
|
-
["oraclePriceDeviationThreshold", (0,
|
|
9344
|
-
["disabled", (0,
|
|
9345
|
-
["borrowLimitA", (0,
|
|
9346
|
-
["borrowLimitB", (0,
|
|
9347
|
-
["maxSwapSlippage", (0,
|
|
9348
|
-
["rebalanceProtocolFee", (0,
|
|
9461
|
+
return (0, import_kit68.getStructDecoder)([
|
|
9462
|
+
["discriminator", (0, import_kit68.fixDecoderSize)((0, import_kit68.getBytesDecoder)(), 8)],
|
|
9463
|
+
["addressLookupTable", (0, import_kit68.getAddressDecoder)()],
|
|
9464
|
+
["maxLeverage", (0, import_kit68.getU32Decoder)()],
|
|
9465
|
+
["protocolFee", (0, import_kit68.getU16Decoder)()],
|
|
9466
|
+
["protocolFeeOnCollateral", (0, import_kit68.getU16Decoder)()],
|
|
9467
|
+
["liquidationFee", (0, import_kit68.getU32Decoder)()],
|
|
9468
|
+
["liquidationThreshold", (0, import_kit68.getU32Decoder)()],
|
|
9469
|
+
["limitOrderExecutionFee", (0, import_kit68.getU32Decoder)()],
|
|
9470
|
+
["oraclePriceDeviationThreshold", (0, import_kit68.getU32Decoder)()],
|
|
9471
|
+
["disabled", (0, import_kit68.getBooleanDecoder)()],
|
|
9472
|
+
["borrowLimitA", (0, import_kit68.getU64Decoder)()],
|
|
9473
|
+
["borrowLimitB", (0, import_kit68.getU64Decoder)()],
|
|
9474
|
+
["maxSwapSlippage", (0, import_kit68.getU32Decoder)()],
|
|
9475
|
+
["rebalanceProtocolFee", (0, import_kit68.getU32Decoder)()]
|
|
9349
9476
|
]);
|
|
9350
9477
|
}
|
|
9351
9478
|
function getUpdateMarketInstructionDataCodec() {
|
|
9352
|
-
return (0,
|
|
9479
|
+
return (0, import_kit68.combineCodec)(
|
|
9353
9480
|
getUpdateMarketInstructionDataEncoder(),
|
|
9354
9481
|
getUpdateMarketInstructionDataDecoder()
|
|
9355
9482
|
);
|
|
@@ -9399,7 +9526,7 @@ function parseUpdateMarketInstruction(instruction) {
|
|
|
9399
9526
|
}
|
|
9400
9527
|
|
|
9401
9528
|
// src/generated/instructions/updateVault.ts
|
|
9402
|
-
var
|
|
9529
|
+
var import_kit69 = require("@solana/kit");
|
|
9403
9530
|
var UPDATE_VAULT_DISCRIMINATOR = new Uint8Array([
|
|
9404
9531
|
67,
|
|
9405
9532
|
229,
|
|
@@ -9411,33 +9538,33 @@ var UPDATE_VAULT_DISCRIMINATOR = new Uint8Array([
|
|
|
9411
9538
|
60
|
|
9412
9539
|
]);
|
|
9413
9540
|
function getUpdateVaultDiscriminatorBytes() {
|
|
9414
|
-
return (0,
|
|
9541
|
+
return (0, import_kit69.fixEncoderSize)((0, import_kit69.getBytesEncoder)(), 8).encode(
|
|
9415
9542
|
UPDATE_VAULT_DISCRIMINATOR
|
|
9416
9543
|
);
|
|
9417
9544
|
}
|
|
9418
9545
|
function getUpdateVaultInstructionDataEncoder() {
|
|
9419
|
-
return (0,
|
|
9420
|
-
(0,
|
|
9421
|
-
["discriminator", (0,
|
|
9422
|
-
["interestRate", (0,
|
|
9423
|
-
["supplyLimit", (0,
|
|
9424
|
-
["pythOraclePriceUpdate", (0,
|
|
9425
|
-
["pythOracleFeedId", (0,
|
|
9546
|
+
return (0, import_kit69.transformEncoder)(
|
|
9547
|
+
(0, import_kit69.getStructEncoder)([
|
|
9548
|
+
["discriminator", (0, import_kit69.fixEncoderSize)((0, import_kit69.getBytesEncoder)(), 8)],
|
|
9549
|
+
["interestRate", (0, import_kit69.getU64Encoder)()],
|
|
9550
|
+
["supplyLimit", (0, import_kit69.getU64Encoder)()],
|
|
9551
|
+
["pythOraclePriceUpdate", (0, import_kit69.getAddressEncoder)()],
|
|
9552
|
+
["pythOracleFeedId", (0, import_kit69.getAddressEncoder)()]
|
|
9426
9553
|
]),
|
|
9427
9554
|
(value) => ({ ...value, discriminator: UPDATE_VAULT_DISCRIMINATOR })
|
|
9428
9555
|
);
|
|
9429
9556
|
}
|
|
9430
9557
|
function getUpdateVaultInstructionDataDecoder() {
|
|
9431
|
-
return (0,
|
|
9432
|
-
["discriminator", (0,
|
|
9433
|
-
["interestRate", (0,
|
|
9434
|
-
["supplyLimit", (0,
|
|
9435
|
-
["pythOraclePriceUpdate", (0,
|
|
9436
|
-
["pythOracleFeedId", (0,
|
|
9558
|
+
return (0, import_kit69.getStructDecoder)([
|
|
9559
|
+
["discriminator", (0, import_kit69.fixDecoderSize)((0, import_kit69.getBytesDecoder)(), 8)],
|
|
9560
|
+
["interestRate", (0, import_kit69.getU64Decoder)()],
|
|
9561
|
+
["supplyLimit", (0, import_kit69.getU64Decoder)()],
|
|
9562
|
+
["pythOraclePriceUpdate", (0, import_kit69.getAddressDecoder)()],
|
|
9563
|
+
["pythOracleFeedId", (0, import_kit69.getAddressDecoder)()]
|
|
9437
9564
|
]);
|
|
9438
9565
|
}
|
|
9439
9566
|
function getUpdateVaultInstructionDataCodec() {
|
|
9440
|
-
return (0,
|
|
9567
|
+
return (0, import_kit69.combineCodec)(
|
|
9441
9568
|
getUpdateVaultInstructionDataEncoder(),
|
|
9442
9569
|
getUpdateVaultInstructionDataDecoder()
|
|
9443
9570
|
);
|
|
@@ -9487,7 +9614,7 @@ function parseUpdateVaultInstruction(instruction) {
|
|
|
9487
9614
|
}
|
|
9488
9615
|
|
|
9489
9616
|
// src/generated/instructions/withdraw.ts
|
|
9490
|
-
var
|
|
9617
|
+
var import_kit70 = require("@solana/kit");
|
|
9491
9618
|
var WITHDRAW_DISCRIMINATOR = new Uint8Array([
|
|
9492
9619
|
183,
|
|
9493
9620
|
18,
|
|
@@ -9499,27 +9626,27 @@ var WITHDRAW_DISCRIMINATOR = new Uint8Array([
|
|
|
9499
9626
|
34
|
|
9500
9627
|
]);
|
|
9501
9628
|
function getWithdrawDiscriminatorBytes() {
|
|
9502
|
-
return (0,
|
|
9629
|
+
return (0, import_kit70.fixEncoderSize)((0, import_kit70.getBytesEncoder)(), 8).encode(WITHDRAW_DISCRIMINATOR);
|
|
9503
9630
|
}
|
|
9504
9631
|
function getWithdrawInstructionDataEncoder() {
|
|
9505
|
-
return (0,
|
|
9506
|
-
(0,
|
|
9507
|
-
["discriminator", (0,
|
|
9508
|
-
["funds", (0,
|
|
9509
|
-
["shares", (0,
|
|
9632
|
+
return (0, import_kit70.transformEncoder)(
|
|
9633
|
+
(0, import_kit70.getStructEncoder)([
|
|
9634
|
+
["discriminator", (0, import_kit70.fixEncoderSize)((0, import_kit70.getBytesEncoder)(), 8)],
|
|
9635
|
+
["funds", (0, import_kit70.getU64Encoder)()],
|
|
9636
|
+
["shares", (0, import_kit70.getU64Encoder)()]
|
|
9510
9637
|
]),
|
|
9511
9638
|
(value) => ({ ...value, discriminator: WITHDRAW_DISCRIMINATOR })
|
|
9512
9639
|
);
|
|
9513
9640
|
}
|
|
9514
9641
|
function getWithdrawInstructionDataDecoder() {
|
|
9515
|
-
return (0,
|
|
9516
|
-
["discriminator", (0,
|
|
9517
|
-
["funds", (0,
|
|
9518
|
-
["shares", (0,
|
|
9642
|
+
return (0, import_kit70.getStructDecoder)([
|
|
9643
|
+
["discriminator", (0, import_kit70.fixDecoderSize)((0, import_kit70.getBytesDecoder)(), 8)],
|
|
9644
|
+
["funds", (0, import_kit70.getU64Decoder)()],
|
|
9645
|
+
["shares", (0, import_kit70.getU64Decoder)()]
|
|
9519
9646
|
]);
|
|
9520
9647
|
}
|
|
9521
9648
|
function getWithdrawInstructionDataCodec() {
|
|
9522
|
-
return (0,
|
|
9649
|
+
return (0, import_kit70.combineCodec)(
|
|
9523
9650
|
getWithdrawInstructionDataEncoder(),
|
|
9524
9651
|
getWithdrawInstructionDataDecoder()
|
|
9525
9652
|
);
|
|
@@ -9590,55 +9717,55 @@ function parseWithdrawInstruction(instruction) {
|
|
|
9590
9717
|
}
|
|
9591
9718
|
|
|
9592
9719
|
// src/pda.ts
|
|
9593
|
-
var
|
|
9720
|
+
var import_kit71 = require("@solana/kit");
|
|
9594
9721
|
async function getTunaConfigAddress() {
|
|
9595
|
-
return await (0,
|
|
9722
|
+
return await (0, import_kit71.getProgramDerivedAddress)({
|
|
9596
9723
|
programAddress: TUNA_PROGRAM_ADDRESS,
|
|
9597
9724
|
seeds: ["tuna_config"]
|
|
9598
9725
|
});
|
|
9599
9726
|
}
|
|
9600
9727
|
async function getMarketAddress(pool) {
|
|
9601
|
-
return await (0,
|
|
9728
|
+
return await (0, import_kit71.getProgramDerivedAddress)({
|
|
9602
9729
|
programAddress: TUNA_PROGRAM_ADDRESS,
|
|
9603
|
-
seeds: ["market", (0,
|
|
9730
|
+
seeds: ["market", (0, import_kit71.getAddressEncoder)().encode(pool)]
|
|
9604
9731
|
});
|
|
9605
9732
|
}
|
|
9606
9733
|
async function getLendingVaultAddress(mint) {
|
|
9607
|
-
return await (0,
|
|
9734
|
+
return await (0, import_kit71.getProgramDerivedAddress)({
|
|
9608
9735
|
programAddress: TUNA_PROGRAM_ADDRESS,
|
|
9609
|
-
seeds: ["vault", (0,
|
|
9736
|
+
seeds: ["vault", (0, import_kit71.getAddressEncoder)().encode(mint)]
|
|
9610
9737
|
});
|
|
9611
9738
|
}
|
|
9612
9739
|
async function getLendingPositionAddress(wallet, mint) {
|
|
9613
|
-
return await (0,
|
|
9740
|
+
return await (0, import_kit71.getProgramDerivedAddress)({
|
|
9614
9741
|
programAddress: TUNA_PROGRAM_ADDRESS,
|
|
9615
|
-
seeds: ["lending_position", (0,
|
|
9742
|
+
seeds: ["lending_position", (0, import_kit71.getAddressEncoder)().encode(wallet), (0, import_kit71.getAddressEncoder)().encode(mint)]
|
|
9616
9743
|
});
|
|
9617
9744
|
}
|
|
9618
9745
|
async function getTunaLpPositionAddress(positionMint) {
|
|
9619
|
-
return await (0,
|
|
9746
|
+
return await (0, import_kit71.getProgramDerivedAddress)({
|
|
9620
9747
|
programAddress: TUNA_PROGRAM_ADDRESS,
|
|
9621
|
-
seeds: ["tuna_position", (0,
|
|
9748
|
+
seeds: ["tuna_position", (0, import_kit71.getAddressEncoder)().encode(positionMint)]
|
|
9622
9749
|
});
|
|
9623
9750
|
}
|
|
9624
9751
|
async function getTunaSpotPositionAddress(positionMint) {
|
|
9625
|
-
return await (0,
|
|
9752
|
+
return await (0, import_kit71.getProgramDerivedAddress)({
|
|
9626
9753
|
programAddress: TUNA_PROGRAM_ADDRESS,
|
|
9627
|
-
seeds: ["tuna_spot_position", (0,
|
|
9754
|
+
seeds: ["tuna_spot_position", (0, import_kit71.getAddressEncoder)().encode(positionMint)]
|
|
9628
9755
|
});
|
|
9629
9756
|
}
|
|
9630
9757
|
|
|
9631
9758
|
// src/gpa/tunaLpPosition.ts
|
|
9632
|
-
var
|
|
9759
|
+
var import_kit73 = require("@solana/kit");
|
|
9633
9760
|
|
|
9634
9761
|
// src/gpa/utils.ts
|
|
9635
|
-
var
|
|
9762
|
+
var import_kit72 = require("@solana/kit");
|
|
9636
9763
|
async function fetchDecodedProgramAccounts(rpc, programAddress, filters, decoder) {
|
|
9637
9764
|
const accountInfos = await rpc.getProgramAccounts(programAddress, {
|
|
9638
9765
|
encoding: "base64",
|
|
9639
9766
|
filters
|
|
9640
9767
|
}).send();
|
|
9641
|
-
const encoder = (0,
|
|
9768
|
+
const encoder = (0, import_kit72.getBase64Encoder)();
|
|
9642
9769
|
const datas = accountInfos.map((x) => encoder.encode(x.account.data[0]));
|
|
9643
9770
|
const decoded = datas.map((x) => decoder.decode(x));
|
|
9644
9771
|
return decoded.map((data, i) => ({
|
|
@@ -9654,7 +9781,7 @@ function tunaLpPositionAuthorityFilter(address4) {
|
|
|
9654
9781
|
return {
|
|
9655
9782
|
memcmp: {
|
|
9656
9783
|
offset: 11n,
|
|
9657
|
-
bytes: (0,
|
|
9784
|
+
bytes: (0, import_kit73.getBase58Decoder)().decode((0, import_kit73.getAddressEncoder)().encode(address4)),
|
|
9658
9785
|
encoding: "base58"
|
|
9659
9786
|
}
|
|
9660
9787
|
};
|
|
@@ -9663,7 +9790,7 @@ function tunaLpPositionPoolFilter(address4) {
|
|
|
9663
9790
|
return {
|
|
9664
9791
|
memcmp: {
|
|
9665
9792
|
offset: 43n,
|
|
9666
|
-
bytes: (0,
|
|
9793
|
+
bytes: (0, import_kit73.getBase58Decoder)().decode((0, import_kit73.getAddressEncoder)().encode(address4)),
|
|
9667
9794
|
encoding: "base58"
|
|
9668
9795
|
}
|
|
9669
9796
|
};
|
|
@@ -9672,7 +9799,7 @@ function tunaLpPositionMintAFilter(address4) {
|
|
|
9672
9799
|
return {
|
|
9673
9800
|
memcmp: {
|
|
9674
9801
|
offset: 75n,
|
|
9675
|
-
bytes: (0,
|
|
9802
|
+
bytes: (0, import_kit73.getBase58Decoder)().decode((0, import_kit73.getAddressEncoder)().encode(address4)),
|
|
9676
9803
|
encoding: "base58"
|
|
9677
9804
|
}
|
|
9678
9805
|
};
|
|
@@ -9681,7 +9808,7 @@ function tunaLpPositionMintBFilter(address4) {
|
|
|
9681
9808
|
return {
|
|
9682
9809
|
memcmp: {
|
|
9683
9810
|
offset: 107n,
|
|
9684
|
-
bytes: (0,
|
|
9811
|
+
bytes: (0, import_kit73.getBase58Decoder)().decode((0, import_kit73.getAddressEncoder)().encode(address4)),
|
|
9685
9812
|
encoding: "base58"
|
|
9686
9813
|
}
|
|
9687
9814
|
};
|
|
@@ -9690,7 +9817,7 @@ function tunaLpPositionMintFilter(address4) {
|
|
|
9690
9817
|
return {
|
|
9691
9818
|
memcmp: {
|
|
9692
9819
|
offset: 139n,
|
|
9693
|
-
bytes: (0,
|
|
9820
|
+
bytes: (0, import_kit73.getBase58Decoder)().decode((0, import_kit73.getAddressEncoder)().encode(address4)),
|
|
9694
9821
|
encoding: "base58"
|
|
9695
9822
|
}
|
|
9696
9823
|
};
|
|
@@ -9699,13 +9826,13 @@ function tunaLpPositionMarketMakerFilter(marketMaker) {
|
|
|
9699
9826
|
return {
|
|
9700
9827
|
memcmp: {
|
|
9701
9828
|
offset: 277n,
|
|
9702
|
-
bytes: (0,
|
|
9829
|
+
bytes: (0, import_kit73.getBase58Decoder)().decode((0, import_kit73.getI8Encoder)().encode(marketMaker)),
|
|
9703
9830
|
encoding: "base58"
|
|
9704
9831
|
}
|
|
9705
9832
|
};
|
|
9706
9833
|
}
|
|
9707
9834
|
async function fetchAllTunaLpPositionWithFilter(rpc, ...filters) {
|
|
9708
|
-
const discriminator = (0,
|
|
9835
|
+
const discriminator = (0, import_kit73.getBase58Decoder)().decode(TUNA_LP_POSITION_DISCRIMINATOR);
|
|
9709
9836
|
const discriminatorFilter = {
|
|
9710
9837
|
memcmp: {
|
|
9711
9838
|
offset: 0n,
|
|
@@ -9722,12 +9849,12 @@ async function fetchAllTunaLpPositionWithFilter(rpc, ...filters) {
|
|
|
9722
9849
|
}
|
|
9723
9850
|
|
|
9724
9851
|
// src/gpa/tunaSpotPosition.ts
|
|
9725
|
-
var
|
|
9852
|
+
var import_kit74 = require("@solana/kit");
|
|
9726
9853
|
function tunaSpotPositionAuthorityFilter(address4) {
|
|
9727
9854
|
return {
|
|
9728
9855
|
memcmp: {
|
|
9729
9856
|
offset: 11n,
|
|
9730
|
-
bytes: (0,
|
|
9857
|
+
bytes: (0, import_kit74.getBase58Decoder)().decode((0, import_kit74.getAddressEncoder)().encode(address4)),
|
|
9731
9858
|
encoding: "base58"
|
|
9732
9859
|
}
|
|
9733
9860
|
};
|
|
@@ -9736,7 +9863,7 @@ function tunaSpotPositionPoolFilter(address4) {
|
|
|
9736
9863
|
return {
|
|
9737
9864
|
memcmp: {
|
|
9738
9865
|
offset: 43n,
|
|
9739
|
-
bytes: (0,
|
|
9866
|
+
bytes: (0, import_kit74.getBase58Decoder)().decode((0, import_kit74.getAddressEncoder)().encode(address4)),
|
|
9740
9867
|
encoding: "base58"
|
|
9741
9868
|
}
|
|
9742
9869
|
};
|
|
@@ -9745,7 +9872,7 @@ function tunaSpotPositionMintAFilter(address4) {
|
|
|
9745
9872
|
return {
|
|
9746
9873
|
memcmp: {
|
|
9747
9874
|
offset: 75n,
|
|
9748
|
-
bytes: (0,
|
|
9875
|
+
bytes: (0, import_kit74.getBase58Decoder)().decode((0, import_kit74.getAddressEncoder)().encode(address4)),
|
|
9749
9876
|
encoding: "base58"
|
|
9750
9877
|
}
|
|
9751
9878
|
};
|
|
@@ -9754,7 +9881,7 @@ function tunaSpotPositionMintBFilter(address4) {
|
|
|
9754
9881
|
return {
|
|
9755
9882
|
memcmp: {
|
|
9756
9883
|
offset: 107n,
|
|
9757
|
-
bytes: (0,
|
|
9884
|
+
bytes: (0, import_kit74.getBase58Decoder)().decode((0, import_kit74.getAddressEncoder)().encode(address4)),
|
|
9758
9885
|
encoding: "base58"
|
|
9759
9886
|
}
|
|
9760
9887
|
};
|
|
@@ -9763,13 +9890,13 @@ function tunaSpotPositionMintFilter(address4) {
|
|
|
9763
9890
|
return {
|
|
9764
9891
|
memcmp: {
|
|
9765
9892
|
offset: 139n,
|
|
9766
|
-
bytes: (0,
|
|
9893
|
+
bytes: (0, import_kit74.getBase58Decoder)().decode((0, import_kit74.getAddressEncoder)().encode(address4)),
|
|
9767
9894
|
encoding: "base58"
|
|
9768
9895
|
}
|
|
9769
9896
|
};
|
|
9770
9897
|
}
|
|
9771
9898
|
async function fetchAllTunaSpotPositionWithFilter(rpc, ...filters) {
|
|
9772
|
-
const discriminator = (0,
|
|
9899
|
+
const discriminator = (0, import_kit74.getBase58Decoder)().decode(TUNA_SPOT_POSITION_DISCRIMINATOR);
|
|
9773
9900
|
const discriminatorFilter = {
|
|
9774
9901
|
memcmp: {
|
|
9775
9902
|
offset: 0n,
|
|
@@ -9786,12 +9913,12 @@ async function fetchAllTunaSpotPositionWithFilter(rpc, ...filters) {
|
|
|
9786
9913
|
}
|
|
9787
9914
|
|
|
9788
9915
|
// src/gpa/lendingPosition.ts
|
|
9789
|
-
var
|
|
9916
|
+
var import_kit75 = require("@solana/kit");
|
|
9790
9917
|
function lendingPositionAuthorityFilter(address4) {
|
|
9791
9918
|
return {
|
|
9792
9919
|
memcmp: {
|
|
9793
9920
|
offset: 11n,
|
|
9794
|
-
bytes: (0,
|
|
9921
|
+
bytes: (0, import_kit75.getBase58Decoder)().decode((0, import_kit75.getAddressEncoder)().encode(address4)),
|
|
9795
9922
|
encoding: "base58"
|
|
9796
9923
|
}
|
|
9797
9924
|
};
|
|
@@ -9800,13 +9927,13 @@ function lendingPositionMintFilter(address4) {
|
|
|
9800
9927
|
return {
|
|
9801
9928
|
memcmp: {
|
|
9802
9929
|
offset: 43n,
|
|
9803
|
-
bytes: (0,
|
|
9930
|
+
bytes: (0, import_kit75.getBase58Decoder)().decode((0, import_kit75.getAddressEncoder)().encode(address4)),
|
|
9804
9931
|
encoding: "base58"
|
|
9805
9932
|
}
|
|
9806
9933
|
};
|
|
9807
9934
|
}
|
|
9808
9935
|
async function fetchAllLendingPositionWithFilter(rpc, ...filters) {
|
|
9809
|
-
const discriminator = (0,
|
|
9936
|
+
const discriminator = (0, import_kit75.getBase58Decoder)().decode(LENDING_POSITION_DISCRIMINATOR);
|
|
9810
9937
|
const discriminatorFilter = {
|
|
9811
9938
|
memcmp: {
|
|
9812
9939
|
offset: 0n,
|
|
@@ -9823,9 +9950,9 @@ async function fetchAllLendingPositionWithFilter(rpc, ...filters) {
|
|
|
9823
9950
|
}
|
|
9824
9951
|
|
|
9825
9952
|
// src/gpa/market.ts
|
|
9826
|
-
var
|
|
9953
|
+
var import_kit76 = require("@solana/kit");
|
|
9827
9954
|
async function fetchAllMarketWithFilter(rpc, ...filters) {
|
|
9828
|
-
const discriminator = (0,
|
|
9955
|
+
const discriminator = (0, import_kit76.getBase58Decoder)().decode(MARKET_DISCRIMINATOR);
|
|
9829
9956
|
const discriminatorFilter = {
|
|
9830
9957
|
memcmp: {
|
|
9831
9958
|
offset: 0n,
|
|
@@ -9918,11 +10045,11 @@ var FusionUtils = class {
|
|
|
9918
10045
|
};
|
|
9919
10046
|
|
|
9920
10047
|
// src/utils/token.ts
|
|
9921
|
-
var
|
|
10048
|
+
var import_kit77 = require("@solana/kit");
|
|
9922
10049
|
var import_system = require("@solana-program/system");
|
|
9923
10050
|
var import_token = require("@solana-program/token");
|
|
9924
10051
|
var import_token_2022 = require("@solana-program/token-2022");
|
|
9925
|
-
var NATIVE_MINT = (0,
|
|
10052
|
+
var NATIVE_MINT = (0, import_kit77.address)("So11111111111111111111111111111111111111112");
|
|
9926
10053
|
async function getCreateAtaInstruction(mint, owner, payer, tokenProgram = import_token.TOKEN_PROGRAM_ADDRESS) {
|
|
9927
10054
|
const ata = (await (0, import_token.findAssociatedTokenPda)({
|
|
9928
10055
|
mint,
|
|
@@ -9989,8 +10116,8 @@ async function createAddressLookupTableInstructions(authority, addresses, recent
|
|
|
9989
10116
|
var import_fusionamm_core3 = require("@crypticdot/fusionamm-core");
|
|
9990
10117
|
|
|
9991
10118
|
// src/consts.ts
|
|
9992
|
-
var
|
|
9993
|
-
var DEFAULT_ADDRESS = (0,
|
|
10119
|
+
var import_kit78 = require("@solana/kit");
|
|
10120
|
+
var DEFAULT_ADDRESS = (0, import_kit78.address)("11111111111111111111111111111111");
|
|
9994
10121
|
var HUNDRED_PERCENT = 1e6;
|
|
9995
10122
|
var LEVERAGE_ONE = HUNDRED_PERCENT;
|
|
9996
10123
|
var MAX_LEVERAGE = 11 * LEVERAGE_ONE;
|
|
@@ -10010,7 +10137,7 @@ var TUNA_POSITION_FLAGS_UPPER_LIMIT_ORDER_SWAP_TO_TOKEN_B = 1 << 3;
|
|
|
10010
10137
|
var TUNA_POSITION_FLAGS_AUTO_COMPOUND_YIELD = 1 << 4;
|
|
10011
10138
|
var TUNA_POSITION_FLAGS_AUTO_COMPOUND_YIELD_WITH_LEVERAGE = 1 << 5;
|
|
10012
10139
|
var TUNA_POSITION_FLAGS_ALLOW_REBALANCING = 1 << 6;
|
|
10013
|
-
var WP_NFT_UPDATE_AUTH = (0,
|
|
10140
|
+
var WP_NFT_UPDATE_AUTH = (0, import_kit78.address)("3axbTs2z5GBy6usVbNVoqEgZMng3vZvMnAoX29BFfwhr");
|
|
10014
10141
|
var MIN_SQRT_PRICE = 4295048016n;
|
|
10015
10142
|
var MAX_SQRT_PRICE = 79226673515401279992447579055n;
|
|
10016
10143
|
|
|
@@ -10122,7 +10249,7 @@ function calculateProtocolFee(collateralAmount, borrowAmount, protocolFeeRateOnC
|
|
|
10122
10249
|
// src/txbuilder/increaseTunaLpPositionOrca.ts
|
|
10123
10250
|
var import_whirlpools_client2 = require("@orca-so/whirlpools-client");
|
|
10124
10251
|
var import_whirlpools_core2 = require("@orca-so/whirlpools-core");
|
|
10125
|
-
var
|
|
10252
|
+
var import_kit79 = require("@solana/kit");
|
|
10126
10253
|
var import_memo = require("@solana-program/memo");
|
|
10127
10254
|
var import_token_20222 = require("@solana-program/token-2022");
|
|
10128
10255
|
var import_assert = __toESM(require("assert"));
|
|
@@ -10296,16 +10423,16 @@ async function increaseTunaLpPositionOrcaInstruction(authority, tunaPosition, tu
|
|
|
10296
10423
|
tunaPosition.data.tickUpperIndex
|
|
10297
10424
|
);
|
|
10298
10425
|
const remainingAccounts = [
|
|
10299
|
-
{ address: swapTickArrays[0], role:
|
|
10300
|
-
{ address: swapTickArrays[1], role:
|
|
10301
|
-
{ address: swapTickArrays[2], role:
|
|
10302
|
-
{ address: swapTickArrays[3], role:
|
|
10303
|
-
{ address: swapTickArrays[4], role:
|
|
10304
|
-
{ address: lowerTickArrayAddress, role:
|
|
10305
|
-
{ address: upperTickArrayAddress, role:
|
|
10306
|
-
{ address: whirlpool.data.tokenVaultA, role:
|
|
10307
|
-
{ address: whirlpool.data.tokenVaultB, role:
|
|
10308
|
-
{ address: orcaOracleAddress, role:
|
|
10426
|
+
{ address: swapTickArrays[0], role: import_kit79.AccountRole.WRITABLE },
|
|
10427
|
+
{ address: swapTickArrays[1], role: import_kit79.AccountRole.WRITABLE },
|
|
10428
|
+
{ address: swapTickArrays[2], role: import_kit79.AccountRole.WRITABLE },
|
|
10429
|
+
{ address: swapTickArrays[3], role: import_kit79.AccountRole.WRITABLE },
|
|
10430
|
+
{ address: swapTickArrays[4], role: import_kit79.AccountRole.WRITABLE },
|
|
10431
|
+
{ address: lowerTickArrayAddress, role: import_kit79.AccountRole.WRITABLE },
|
|
10432
|
+
{ address: upperTickArrayAddress, role: import_kit79.AccountRole.WRITABLE },
|
|
10433
|
+
{ address: whirlpool.data.tokenVaultA, role: import_kit79.AccountRole.WRITABLE },
|
|
10434
|
+
{ address: whirlpool.data.tokenVaultB, role: import_kit79.AccountRole.WRITABLE },
|
|
10435
|
+
{ address: orcaOracleAddress, role: import_kit79.AccountRole.WRITABLE }
|
|
10309
10436
|
];
|
|
10310
10437
|
const remainingAccountsInfo = {
|
|
10311
10438
|
slices: [
|
|
@@ -10353,7 +10480,7 @@ async function increaseTunaLpPositionOrcaInstruction(authority, tunaPosition, tu
|
|
|
10353
10480
|
// src/txbuilder/increaseTunaLpPositionFusion.ts
|
|
10354
10481
|
var import_fusionamm_client2 = require("@crypticdot/fusionamm-client");
|
|
10355
10482
|
var import_fusionamm_core4 = require("@crypticdot/fusionamm-core");
|
|
10356
|
-
var
|
|
10483
|
+
var import_kit80 = require("@solana/kit");
|
|
10357
10484
|
var import_memo2 = require("@solana-program/memo");
|
|
10358
10485
|
var import_token_20223 = require("@solana-program/token-2022");
|
|
10359
10486
|
var import_assert2 = __toESM(require("assert"));
|
|
@@ -10532,15 +10659,15 @@ async function increaseTunaLpPositionFusionInstruction(authority, tunaPosition,
|
|
|
10532
10659
|
tunaPosition.data.tickUpperIndex
|
|
10533
10660
|
);
|
|
10534
10661
|
const remainingAccounts = [
|
|
10535
|
-
{ address: swapTickArrays[0], role:
|
|
10536
|
-
{ address: swapTickArrays[1], role:
|
|
10537
|
-
{ address: swapTickArrays[2], role:
|
|
10538
|
-
{ address: swapTickArrays[3], role:
|
|
10539
|
-
{ address: swapTickArrays[4], role:
|
|
10540
|
-
{ address: lowerTickArrayAddress, role:
|
|
10541
|
-
{ address: upperTickArrayAddress, role:
|
|
10542
|
-
{ address: fusionPool.data.tokenVaultA, role:
|
|
10543
|
-
{ address: fusionPool.data.tokenVaultB, role:
|
|
10662
|
+
{ address: swapTickArrays[0], role: import_kit80.AccountRole.WRITABLE },
|
|
10663
|
+
{ address: swapTickArrays[1], role: import_kit80.AccountRole.WRITABLE },
|
|
10664
|
+
{ address: swapTickArrays[2], role: import_kit80.AccountRole.WRITABLE },
|
|
10665
|
+
{ address: swapTickArrays[3], role: import_kit80.AccountRole.WRITABLE },
|
|
10666
|
+
{ address: swapTickArrays[4], role: import_kit80.AccountRole.WRITABLE },
|
|
10667
|
+
{ address: lowerTickArrayAddress, role: import_kit80.AccountRole.WRITABLE },
|
|
10668
|
+
{ address: upperTickArrayAddress, role: import_kit80.AccountRole.WRITABLE },
|
|
10669
|
+
{ address: fusionPool.data.tokenVaultA, role: import_kit80.AccountRole.WRITABLE },
|
|
10670
|
+
{ address: fusionPool.data.tokenVaultB, role: import_kit80.AccountRole.WRITABLE }
|
|
10544
10671
|
];
|
|
10545
10672
|
const remainingAccountsInfo = {
|
|
10546
10673
|
slices: [
|
|
@@ -10678,7 +10805,7 @@ async function closeTunaLpPositionFusionInstruction(rpc, authority, positionMint
|
|
|
10678
10805
|
|
|
10679
10806
|
// src/txbuilder/collectAndCompoundFeesOrca.ts
|
|
10680
10807
|
var import_whirlpools_client4 = require("@orca-so/whirlpools-client");
|
|
10681
|
-
var
|
|
10808
|
+
var import_kit81 = require("@solana/kit");
|
|
10682
10809
|
var import_memo3 = require("@solana-program/memo");
|
|
10683
10810
|
var import_token_20226 = require("@solana-program/token-2022");
|
|
10684
10811
|
var import_assert5 = __toESM(require("assert"));
|
|
@@ -10776,16 +10903,16 @@ async function collectAndCompoundFeesOrcaInstruction(authority, tunaConfig, tuna
|
|
|
10776
10903
|
tunaPosition.data.tickUpperIndex
|
|
10777
10904
|
);
|
|
10778
10905
|
const remainingAccounts = [
|
|
10779
|
-
{ address: swapTickArrays[0], role:
|
|
10780
|
-
{ address: swapTickArrays[1], role:
|
|
10781
|
-
{ address: swapTickArrays[2], role:
|
|
10782
|
-
{ address: swapTickArrays[3], role:
|
|
10783
|
-
{ address: swapTickArrays[4], role:
|
|
10784
|
-
{ address: lowerTickArrayAddress, role:
|
|
10785
|
-
{ address: upperTickArrayAddress, role:
|
|
10786
|
-
{ address: whirlpool.data.tokenVaultA, role:
|
|
10787
|
-
{ address: whirlpool.data.tokenVaultB, role:
|
|
10788
|
-
{ address: orcaOracleAddress, role:
|
|
10906
|
+
{ address: swapTickArrays[0], role: import_kit81.AccountRole.WRITABLE },
|
|
10907
|
+
{ address: swapTickArrays[1], role: import_kit81.AccountRole.WRITABLE },
|
|
10908
|
+
{ address: swapTickArrays[2], role: import_kit81.AccountRole.WRITABLE },
|
|
10909
|
+
{ address: swapTickArrays[3], role: import_kit81.AccountRole.WRITABLE },
|
|
10910
|
+
{ address: swapTickArrays[4], role: import_kit81.AccountRole.WRITABLE },
|
|
10911
|
+
{ address: lowerTickArrayAddress, role: import_kit81.AccountRole.WRITABLE },
|
|
10912
|
+
{ address: upperTickArrayAddress, role: import_kit81.AccountRole.WRITABLE },
|
|
10913
|
+
{ address: whirlpool.data.tokenVaultA, role: import_kit81.AccountRole.WRITABLE },
|
|
10914
|
+
{ address: whirlpool.data.tokenVaultB, role: import_kit81.AccountRole.WRITABLE },
|
|
10915
|
+
{ address: orcaOracleAddress, role: import_kit81.AccountRole.WRITABLE }
|
|
10789
10916
|
];
|
|
10790
10917
|
const remainingAccountsInfo = {
|
|
10791
10918
|
slices: [
|
|
@@ -10830,7 +10957,7 @@ async function collectAndCompoundFeesOrcaInstruction(authority, tunaConfig, tuna
|
|
|
10830
10957
|
|
|
10831
10958
|
// src/txbuilder/collectAndCompoundFeesFusion.ts
|
|
10832
10959
|
var import_fusionamm_client4 = require("@crypticdot/fusionamm-client");
|
|
10833
|
-
var
|
|
10960
|
+
var import_kit82 = require("@solana/kit");
|
|
10834
10961
|
var import_memo4 = require("@solana-program/memo");
|
|
10835
10962
|
var import_token_20227 = require("@solana-program/token-2022");
|
|
10836
10963
|
var import_assert6 = __toESM(require("assert"));
|
|
@@ -10927,15 +11054,15 @@ async function collectAndCompoundFeesFusionInstruction(authority, tunaConfig, tu
|
|
|
10927
11054
|
tunaPosition.data.tickUpperIndex
|
|
10928
11055
|
);
|
|
10929
11056
|
const remainingAccounts = [
|
|
10930
|
-
{ address: swapTickArrays[0], role:
|
|
10931
|
-
{ address: swapTickArrays[1], role:
|
|
10932
|
-
{ address: swapTickArrays[2], role:
|
|
10933
|
-
{ address: swapTickArrays[3], role:
|
|
10934
|
-
{ address: swapTickArrays[4], role:
|
|
10935
|
-
{ address: lowerTickArrayAddress, role:
|
|
10936
|
-
{ address: upperTickArrayAddress, role:
|
|
10937
|
-
{ address: fusionPool.data.tokenVaultA, role:
|
|
10938
|
-
{ address: fusionPool.data.tokenVaultB, role:
|
|
11057
|
+
{ address: swapTickArrays[0], role: import_kit82.AccountRole.WRITABLE },
|
|
11058
|
+
{ address: swapTickArrays[1], role: import_kit82.AccountRole.WRITABLE },
|
|
11059
|
+
{ address: swapTickArrays[2], role: import_kit82.AccountRole.WRITABLE },
|
|
11060
|
+
{ address: swapTickArrays[3], role: import_kit82.AccountRole.WRITABLE },
|
|
11061
|
+
{ address: swapTickArrays[4], role: import_kit82.AccountRole.WRITABLE },
|
|
11062
|
+
{ address: lowerTickArrayAddress, role: import_kit82.AccountRole.WRITABLE },
|
|
11063
|
+
{ address: upperTickArrayAddress, role: import_kit82.AccountRole.WRITABLE },
|
|
11064
|
+
{ address: fusionPool.data.tokenVaultA, role: import_kit82.AccountRole.WRITABLE },
|
|
11065
|
+
{ address: fusionPool.data.tokenVaultB, role: import_kit82.AccountRole.WRITABLE }
|
|
10939
11066
|
];
|
|
10940
11067
|
const remainingAccountsInfo = {
|
|
10941
11068
|
slices: [
|
|
@@ -10979,7 +11106,7 @@ async function collectAndCompoundFeesFusionInstruction(authority, tunaConfig, tu
|
|
|
10979
11106
|
|
|
10980
11107
|
// src/txbuilder/collectFeesOrca.ts
|
|
10981
11108
|
var import_whirlpools_client5 = require("@orca-so/whirlpools-client");
|
|
10982
|
-
var
|
|
11109
|
+
var import_kit83 = require("@solana/kit");
|
|
10983
11110
|
var import_memo5 = require("@solana-program/memo");
|
|
10984
11111
|
var import_token_20228 = require("@solana-program/token-2022");
|
|
10985
11112
|
var import_assert7 = __toESM(require("assert"));
|
|
@@ -11055,10 +11182,10 @@ async function collectFeesOrcaInstruction(authority, tunaPosition, mintA, mintB,
|
|
|
11055
11182
|
tunaPosition.data.tickUpperIndex
|
|
11056
11183
|
);
|
|
11057
11184
|
const remainingAccounts = [
|
|
11058
|
-
{ address: lowerTickArrayAddress, role:
|
|
11059
|
-
{ address: upperTickArrayAddress, role:
|
|
11060
|
-
{ address: whirlpool.data.tokenVaultA, role:
|
|
11061
|
-
{ address: whirlpool.data.tokenVaultB, role:
|
|
11185
|
+
{ address: lowerTickArrayAddress, role: import_kit83.AccountRole.WRITABLE },
|
|
11186
|
+
{ address: upperTickArrayAddress, role: import_kit83.AccountRole.WRITABLE },
|
|
11187
|
+
{ address: whirlpool.data.tokenVaultA, role: import_kit83.AccountRole.WRITABLE },
|
|
11188
|
+
{ address: whirlpool.data.tokenVaultB, role: import_kit83.AccountRole.WRITABLE }
|
|
11062
11189
|
];
|
|
11063
11190
|
const remainingAccountsInfo = {
|
|
11064
11191
|
slices: [
|
|
@@ -11093,7 +11220,7 @@ async function collectFeesOrcaInstruction(authority, tunaPosition, mintA, mintB,
|
|
|
11093
11220
|
|
|
11094
11221
|
// src/txbuilder/collectFeesFusion.ts
|
|
11095
11222
|
var import_fusionamm_client5 = require("@crypticdot/fusionamm-client");
|
|
11096
|
-
var
|
|
11223
|
+
var import_kit84 = require("@solana/kit");
|
|
11097
11224
|
var import_memo6 = require("@solana-program/memo");
|
|
11098
11225
|
var import_token_20229 = require("@solana-program/token-2022");
|
|
11099
11226
|
var import_assert8 = __toESM(require("assert"));
|
|
@@ -11169,10 +11296,10 @@ async function collectFeesFusionInstruction(authority, tunaPosition, mintA, mint
|
|
|
11169
11296
|
tunaPosition.data.tickUpperIndex
|
|
11170
11297
|
);
|
|
11171
11298
|
const remainingAccounts = [
|
|
11172
|
-
{ address: lowerTickArrayAddress, role:
|
|
11173
|
-
{ address: upperTickArrayAddress, role:
|
|
11174
|
-
{ address: fusionPool.data.tokenVaultA, role:
|
|
11175
|
-
{ address: fusionPool.data.tokenVaultB, role:
|
|
11299
|
+
{ address: lowerTickArrayAddress, role: import_kit84.AccountRole.WRITABLE },
|
|
11300
|
+
{ address: upperTickArrayAddress, role: import_kit84.AccountRole.WRITABLE },
|
|
11301
|
+
{ address: fusionPool.data.tokenVaultA, role: import_kit84.AccountRole.WRITABLE },
|
|
11302
|
+
{ address: fusionPool.data.tokenVaultB, role: import_kit84.AccountRole.WRITABLE }
|
|
11176
11303
|
];
|
|
11177
11304
|
const remainingAccountsInfo = {
|
|
11178
11305
|
slices: [
|
|
@@ -11283,7 +11410,7 @@ async function openLendingPositionAndDepositInstructions(rpc, authority, mintAdd
|
|
|
11283
11410
|
// src/txbuilder/closeActiveTunaLpPositionOrca.ts
|
|
11284
11411
|
var import_whirlpools_client6 = require("@orca-so/whirlpools-client");
|
|
11285
11412
|
var import_whirlpools_core3 = require("@orca-so/whirlpools-core");
|
|
11286
|
-
var
|
|
11413
|
+
var import_kit85 = require("@solana/kit");
|
|
11287
11414
|
var import_token_202211 = require("@solana-program/token-2022");
|
|
11288
11415
|
var import_assert9 = __toESM(require("assert"));
|
|
11289
11416
|
async function closeActiveTunaLpPositionOrcaInstructions(rpc, authority, positionMint, args) {
|
|
@@ -11304,7 +11431,7 @@ async function closeActiveTunaLpPositionOrcaInstructions(rpc, authority, positio
|
|
|
11304
11431
|
const allMints = [mintA, mintB, ...rewardMints];
|
|
11305
11432
|
(0, import_assert9.default)(mintA.exists, "Token A account not found");
|
|
11306
11433
|
(0, import_assert9.default)(mintB.exists, "Token B account not found");
|
|
11307
|
-
(0,
|
|
11434
|
+
(0, import_kit85.assertAccountsExist)(rewardMints);
|
|
11308
11435
|
const lowerTickArrayStartIndex = (0, import_whirlpools_core3.getTickArrayStartTickIndex)(
|
|
11309
11436
|
tunaPosition.data.tickLowerIndex,
|
|
11310
11437
|
whirlpool.data.tickSpacing
|
|
@@ -11485,7 +11612,7 @@ async function closeActiveTunaLpPositionFusionInstructions(rpc, authority, posit
|
|
|
11485
11612
|
|
|
11486
11613
|
// src/txbuilder/closeActiveTunaSpotPositionFusion.ts
|
|
11487
11614
|
var import_fusionamm_client7 = require("@crypticdot/fusionamm-client");
|
|
11488
|
-
var
|
|
11615
|
+
var import_kit86 = require("@solana/kit");
|
|
11489
11616
|
var import_memo8 = require("@solana-program/memo");
|
|
11490
11617
|
var import_token_202213 = require("@solana-program/token-2022");
|
|
11491
11618
|
var import_assert11 = __toESM(require("assert"));
|
|
@@ -11562,13 +11689,13 @@ async function closeActiveTunaSpotPositionFusionInstruction(authority, tunaPosit
|
|
|
11562
11689
|
}))[0];
|
|
11563
11690
|
const swapTickArrays = await FusionUtils.getSwapTickArrayAddresses(fusionPool);
|
|
11564
11691
|
const remainingAccounts = [
|
|
11565
|
-
{ address: swapTickArrays[0], role:
|
|
11566
|
-
{ address: swapTickArrays[1], role:
|
|
11567
|
-
{ address: swapTickArrays[2], role:
|
|
11568
|
-
{ address: swapTickArrays[3], role:
|
|
11569
|
-
{ address: swapTickArrays[4], role:
|
|
11570
|
-
{ address: fusionPool.data.tokenVaultA, role:
|
|
11571
|
-
{ address: fusionPool.data.tokenVaultB, role:
|
|
11692
|
+
{ address: swapTickArrays[0], role: import_kit86.AccountRole.WRITABLE },
|
|
11693
|
+
{ address: swapTickArrays[1], role: import_kit86.AccountRole.WRITABLE },
|
|
11694
|
+
{ address: swapTickArrays[2], role: import_kit86.AccountRole.WRITABLE },
|
|
11695
|
+
{ address: swapTickArrays[3], role: import_kit86.AccountRole.WRITABLE },
|
|
11696
|
+
{ address: swapTickArrays[4], role: import_kit86.AccountRole.WRITABLE },
|
|
11697
|
+
{ address: fusionPool.data.tokenVaultA, role: import_kit86.AccountRole.WRITABLE },
|
|
11698
|
+
{ address: fusionPool.data.tokenVaultB, role: import_kit86.AccountRole.WRITABLE }
|
|
11572
11699
|
];
|
|
11573
11700
|
const remainingAccountsInfo = {
|
|
11574
11701
|
slices: [
|
|
@@ -11608,7 +11735,7 @@ async function closeActiveTunaSpotPositionFusionInstruction(authority, tunaPosit
|
|
|
11608
11735
|
|
|
11609
11736
|
// src/txbuilder/closeActiveTunaSpotPositionOrca.ts
|
|
11610
11737
|
var import_whirlpools_client7 = require("@orca-so/whirlpools-client");
|
|
11611
|
-
var
|
|
11738
|
+
var import_kit87 = require("@solana/kit");
|
|
11612
11739
|
var import_memo9 = require("@solana-program/memo");
|
|
11613
11740
|
var import_token_202214 = require("@solana-program/token-2022");
|
|
11614
11741
|
var import_assert12 = __toESM(require("assert"));
|
|
@@ -11686,14 +11813,14 @@ async function closeActiveTunaSpotPositionOrcaInstruction(authority, tunaPositio
|
|
|
11686
11813
|
}))[0];
|
|
11687
11814
|
const swapTickArrays = await OrcaUtils.getSwapTickArrayAddresses(whirlpool);
|
|
11688
11815
|
const remainingAccounts = [
|
|
11689
|
-
{ address: swapTickArrays[0], role:
|
|
11690
|
-
{ address: swapTickArrays[1], role:
|
|
11691
|
-
{ address: swapTickArrays[2], role:
|
|
11692
|
-
{ address: swapTickArrays[3], role:
|
|
11693
|
-
{ address: swapTickArrays[4], role:
|
|
11694
|
-
{ address: whirlpool.data.tokenVaultA, role:
|
|
11695
|
-
{ address: whirlpool.data.tokenVaultB, role:
|
|
11696
|
-
{ address: orcaOracleAddress, role:
|
|
11816
|
+
{ address: swapTickArrays[0], role: import_kit87.AccountRole.WRITABLE },
|
|
11817
|
+
{ address: swapTickArrays[1], role: import_kit87.AccountRole.WRITABLE },
|
|
11818
|
+
{ address: swapTickArrays[2], role: import_kit87.AccountRole.WRITABLE },
|
|
11819
|
+
{ address: swapTickArrays[3], role: import_kit87.AccountRole.WRITABLE },
|
|
11820
|
+
{ address: swapTickArrays[4], role: import_kit87.AccountRole.WRITABLE },
|
|
11821
|
+
{ address: whirlpool.data.tokenVaultA, role: import_kit87.AccountRole.WRITABLE },
|
|
11822
|
+
{ address: whirlpool.data.tokenVaultB, role: import_kit87.AccountRole.WRITABLE },
|
|
11823
|
+
{ address: orcaOracleAddress, role: import_kit87.AccountRole.WRITABLE }
|
|
11697
11824
|
];
|
|
11698
11825
|
const remainingAccountsInfo = {
|
|
11699
11826
|
slices: [
|
|
@@ -11734,7 +11861,7 @@ async function closeActiveTunaSpotPositionOrcaInstruction(authority, tunaPositio
|
|
|
11734
11861
|
|
|
11735
11862
|
// src/txbuilder/increaseTunaSpotPositionOrca.ts
|
|
11736
11863
|
var import_whirlpools_client8 = require("@orca-so/whirlpools-client");
|
|
11737
|
-
var
|
|
11864
|
+
var import_kit88 = require("@solana/kit");
|
|
11738
11865
|
var import_memo10 = require("@solana-program/memo");
|
|
11739
11866
|
var import_token_202215 = require("@solana-program/token-2022");
|
|
11740
11867
|
var import_assert13 = __toESM(require("assert"));
|
|
@@ -11839,14 +11966,14 @@ async function increaseTunaSpotPositionOrcaInstruction(authority, tunaPosition,
|
|
|
11839
11966
|
}))[0];
|
|
11840
11967
|
const swapTickArrays = await OrcaUtils.getSwapTickArrayAddresses(whirlpool);
|
|
11841
11968
|
const remainingAccounts = [
|
|
11842
|
-
{ address: swapTickArrays[0], role:
|
|
11843
|
-
{ address: swapTickArrays[1], role:
|
|
11844
|
-
{ address: swapTickArrays[2], role:
|
|
11845
|
-
{ address: swapTickArrays[3], role:
|
|
11846
|
-
{ address: swapTickArrays[4], role:
|
|
11847
|
-
{ address: whirlpool.data.tokenVaultA, role:
|
|
11848
|
-
{ address: whirlpool.data.tokenVaultB, role:
|
|
11849
|
-
{ address: orcaOracleAddress, role:
|
|
11969
|
+
{ address: swapTickArrays[0], role: import_kit88.AccountRole.WRITABLE },
|
|
11970
|
+
{ address: swapTickArrays[1], role: import_kit88.AccountRole.WRITABLE },
|
|
11971
|
+
{ address: swapTickArrays[2], role: import_kit88.AccountRole.WRITABLE },
|
|
11972
|
+
{ address: swapTickArrays[3], role: import_kit88.AccountRole.WRITABLE },
|
|
11973
|
+
{ address: swapTickArrays[4], role: import_kit88.AccountRole.WRITABLE },
|
|
11974
|
+
{ address: whirlpool.data.tokenVaultA, role: import_kit88.AccountRole.WRITABLE },
|
|
11975
|
+
{ address: whirlpool.data.tokenVaultB, role: import_kit88.AccountRole.WRITABLE },
|
|
11976
|
+
{ address: orcaOracleAddress, role: import_kit88.AccountRole.WRITABLE }
|
|
11850
11977
|
];
|
|
11851
11978
|
const remainingAccountsInfo = {
|
|
11852
11979
|
slices: [
|
|
@@ -11889,7 +12016,7 @@ async function increaseTunaSpotPositionOrcaInstruction(authority, tunaPosition,
|
|
|
11889
12016
|
|
|
11890
12017
|
// src/txbuilder/increaseTunaSpotPositionFusion.ts
|
|
11891
12018
|
var import_fusionamm_client8 = require("@crypticdot/fusionamm-client");
|
|
11892
|
-
var
|
|
12019
|
+
var import_kit89 = require("@solana/kit");
|
|
11893
12020
|
var import_memo11 = require("@solana-program/memo");
|
|
11894
12021
|
var import_token_202216 = require("@solana-program/token-2022");
|
|
11895
12022
|
var import_assert14 = __toESM(require("assert"));
|
|
@@ -11993,13 +12120,13 @@ async function increaseTunaSpotPositionFusionInstruction(authority, tunaPosition
|
|
|
11993
12120
|
}))[0];
|
|
11994
12121
|
const swapTickArrays = await FusionUtils.getSwapTickArrayAddresses(fusionPool);
|
|
11995
12122
|
const remainingAccounts = [
|
|
11996
|
-
{ address: swapTickArrays[0], role:
|
|
11997
|
-
{ address: swapTickArrays[1], role:
|
|
11998
|
-
{ address: swapTickArrays[2], role:
|
|
11999
|
-
{ address: swapTickArrays[3], role:
|
|
12000
|
-
{ address: swapTickArrays[4], role:
|
|
12001
|
-
{ address: fusionPool.data.tokenVaultA, role:
|
|
12002
|
-
{ address: fusionPool.data.tokenVaultB, role:
|
|
12123
|
+
{ address: swapTickArrays[0], role: import_kit89.AccountRole.WRITABLE },
|
|
12124
|
+
{ address: swapTickArrays[1], role: import_kit89.AccountRole.WRITABLE },
|
|
12125
|
+
{ address: swapTickArrays[2], role: import_kit89.AccountRole.WRITABLE },
|
|
12126
|
+
{ address: swapTickArrays[3], role: import_kit89.AccountRole.WRITABLE },
|
|
12127
|
+
{ address: swapTickArrays[4], role: import_kit89.AccountRole.WRITABLE },
|
|
12128
|
+
{ address: fusionPool.data.tokenVaultA, role: import_kit89.AccountRole.WRITABLE },
|
|
12129
|
+
{ address: fusionPool.data.tokenVaultB, role: import_kit89.AccountRole.WRITABLE }
|
|
12003
12130
|
];
|
|
12004
12131
|
const remainingAccountsInfo = {
|
|
12005
12132
|
slices: [
|
|
@@ -12041,7 +12168,7 @@ async function increaseTunaSpotPositionFusionInstruction(authority, tunaPosition
|
|
|
12041
12168
|
|
|
12042
12169
|
// src/txbuilder/decreaseTunaSpotPositionOrca.ts
|
|
12043
12170
|
var import_whirlpools_client9 = require("@orca-so/whirlpools-client");
|
|
12044
|
-
var
|
|
12171
|
+
var import_kit90 = require("@solana/kit");
|
|
12045
12172
|
var import_memo12 = require("@solana-program/memo");
|
|
12046
12173
|
var import_token_202217 = require("@solana-program/token-2022");
|
|
12047
12174
|
var import_assert15 = __toESM(require("assert"));
|
|
@@ -12146,14 +12273,14 @@ async function decreaseTunaSpotPositionOrcaInstruction(authority, tunaPosition,
|
|
|
12146
12273
|
}))[0];
|
|
12147
12274
|
const swapTickArrays = await OrcaUtils.getSwapTickArrayAddresses(whirlpool);
|
|
12148
12275
|
const remainingAccounts = [
|
|
12149
|
-
{ address: swapTickArrays[0], role:
|
|
12150
|
-
{ address: swapTickArrays[1], role:
|
|
12151
|
-
{ address: swapTickArrays[2], role:
|
|
12152
|
-
{ address: swapTickArrays[3], role:
|
|
12153
|
-
{ address: swapTickArrays[4], role:
|
|
12154
|
-
{ address: whirlpool.data.tokenVaultA, role:
|
|
12155
|
-
{ address: whirlpool.data.tokenVaultB, role:
|
|
12156
|
-
{ address: orcaOracleAddress, role:
|
|
12276
|
+
{ address: swapTickArrays[0], role: import_kit90.AccountRole.WRITABLE },
|
|
12277
|
+
{ address: swapTickArrays[1], role: import_kit90.AccountRole.WRITABLE },
|
|
12278
|
+
{ address: swapTickArrays[2], role: import_kit90.AccountRole.WRITABLE },
|
|
12279
|
+
{ address: swapTickArrays[3], role: import_kit90.AccountRole.WRITABLE },
|
|
12280
|
+
{ address: swapTickArrays[4], role: import_kit90.AccountRole.WRITABLE },
|
|
12281
|
+
{ address: whirlpool.data.tokenVaultA, role: import_kit90.AccountRole.WRITABLE },
|
|
12282
|
+
{ address: whirlpool.data.tokenVaultB, role: import_kit90.AccountRole.WRITABLE },
|
|
12283
|
+
{ address: orcaOracleAddress, role: import_kit90.AccountRole.WRITABLE }
|
|
12157
12284
|
];
|
|
12158
12285
|
const remainingAccountsInfo = {
|
|
12159
12286
|
slices: [
|
|
@@ -12194,7 +12321,7 @@ async function decreaseTunaSpotPositionOrcaInstruction(authority, tunaPosition,
|
|
|
12194
12321
|
|
|
12195
12322
|
// src/txbuilder/decreaseTunaSpotPositionFusion.ts
|
|
12196
12323
|
var import_fusionamm_client9 = require("@crypticdot/fusionamm-client");
|
|
12197
|
-
var
|
|
12324
|
+
var import_kit91 = require("@solana/kit");
|
|
12198
12325
|
var import_memo13 = require("@solana-program/memo");
|
|
12199
12326
|
var import_token_202218 = require("@solana-program/token-2022");
|
|
12200
12327
|
var import_assert16 = __toESM(require("assert"));
|
|
@@ -12298,13 +12425,13 @@ async function decreaseTunaSpotPositionFusionInstruction(authority, tunaPosition
|
|
|
12298
12425
|
}))[0];
|
|
12299
12426
|
const swapTickArrays = await FusionUtils.getSwapTickArrayAddresses(fusionPool);
|
|
12300
12427
|
const remainingAccounts = [
|
|
12301
|
-
{ address: swapTickArrays[0], role:
|
|
12302
|
-
{ address: swapTickArrays[1], role:
|
|
12303
|
-
{ address: swapTickArrays[2], role:
|
|
12304
|
-
{ address: swapTickArrays[3], role:
|
|
12305
|
-
{ address: swapTickArrays[4], role:
|
|
12306
|
-
{ address: fusionPool.data.tokenVaultA, role:
|
|
12307
|
-
{ address: fusionPool.data.tokenVaultB, role:
|
|
12428
|
+
{ address: swapTickArrays[0], role: import_kit91.AccountRole.WRITABLE },
|
|
12429
|
+
{ address: swapTickArrays[1], role: import_kit91.AccountRole.WRITABLE },
|
|
12430
|
+
{ address: swapTickArrays[2], role: import_kit91.AccountRole.WRITABLE },
|
|
12431
|
+
{ address: swapTickArrays[3], role: import_kit91.AccountRole.WRITABLE },
|
|
12432
|
+
{ address: swapTickArrays[4], role: import_kit91.AccountRole.WRITABLE },
|
|
12433
|
+
{ address: fusionPool.data.tokenVaultA, role: import_kit91.AccountRole.WRITABLE },
|
|
12434
|
+
{ address: fusionPool.data.tokenVaultB, role: import_kit91.AccountRole.WRITABLE }
|
|
12308
12435
|
];
|
|
12309
12436
|
const remainingAccountsInfo = {
|
|
12310
12437
|
slices: [
|
|
@@ -12430,7 +12557,7 @@ async function createVaultInstructions(authority, mint, args) {
|
|
|
12430
12557
|
|
|
12431
12558
|
// src/txbuilder/liquidateTunaLpPositionOrca.ts
|
|
12432
12559
|
var import_whirlpools_client10 = require("@orca-so/whirlpools-client");
|
|
12433
|
-
var
|
|
12560
|
+
var import_kit92 = require("@solana/kit");
|
|
12434
12561
|
var import_memo14 = require("@solana-program/memo");
|
|
12435
12562
|
var import_token_202221 = require("@solana-program/token-2022");
|
|
12436
12563
|
async function liquidateTunaLpPositionOrcaInstructions(authority, tunaPosition, tunaConfig, mintA, mintB, vaultA, vaultB, whirlpool, withdrawPercent) {
|
|
@@ -12517,16 +12644,16 @@ async function liquidateTunaLpPositionOrcaInstruction(authority, tunaPosition, t
|
|
|
12517
12644
|
tunaPosition.data.tickUpperIndex
|
|
12518
12645
|
);
|
|
12519
12646
|
const remainingAccounts = [
|
|
12520
|
-
{ address: swapTickArrays[0], role:
|
|
12521
|
-
{ address: swapTickArrays[1], role:
|
|
12522
|
-
{ address: swapTickArrays[2], role:
|
|
12523
|
-
{ address: swapTickArrays[3], role:
|
|
12524
|
-
{ address: swapTickArrays[4], role:
|
|
12525
|
-
{ address: lowerTickArrayAddress, role:
|
|
12526
|
-
{ address: upperTickArrayAddress, role:
|
|
12527
|
-
{ address: whirlpool.data.tokenVaultA, role:
|
|
12528
|
-
{ address: whirlpool.data.tokenVaultB, role:
|
|
12529
|
-
{ address: orcaOracleAddress, role:
|
|
12647
|
+
{ address: swapTickArrays[0], role: import_kit92.AccountRole.WRITABLE },
|
|
12648
|
+
{ address: swapTickArrays[1], role: import_kit92.AccountRole.WRITABLE },
|
|
12649
|
+
{ address: swapTickArrays[2], role: import_kit92.AccountRole.WRITABLE },
|
|
12650
|
+
{ address: swapTickArrays[3], role: import_kit92.AccountRole.WRITABLE },
|
|
12651
|
+
{ address: swapTickArrays[4], role: import_kit92.AccountRole.WRITABLE },
|
|
12652
|
+
{ address: lowerTickArrayAddress, role: import_kit92.AccountRole.WRITABLE },
|
|
12653
|
+
{ address: upperTickArrayAddress, role: import_kit92.AccountRole.WRITABLE },
|
|
12654
|
+
{ address: whirlpool.data.tokenVaultA, role: import_kit92.AccountRole.WRITABLE },
|
|
12655
|
+
{ address: whirlpool.data.tokenVaultB, role: import_kit92.AccountRole.WRITABLE },
|
|
12656
|
+
{ address: orcaOracleAddress, role: import_kit92.AccountRole.WRITABLE }
|
|
12530
12657
|
];
|
|
12531
12658
|
const remainingAccountsInfo = {
|
|
12532
12659
|
slices: [
|
|
@@ -12571,7 +12698,7 @@ async function liquidateTunaLpPositionOrcaInstruction(authority, tunaPosition, t
|
|
|
12571
12698
|
|
|
12572
12699
|
// src/txbuilder/liquidateTunaLpPositionFusion.ts
|
|
12573
12700
|
var import_fusionamm_client10 = require("@crypticdot/fusionamm-client");
|
|
12574
|
-
var
|
|
12701
|
+
var import_kit93 = require("@solana/kit");
|
|
12575
12702
|
var import_memo15 = require("@solana-program/memo");
|
|
12576
12703
|
var import_token_202222 = require("@solana-program/token-2022");
|
|
12577
12704
|
async function liquidateTunaLpPositionFusionInstructions(authority, tunaPosition, tunaConfig, mintA, mintB, vaultA, vaultB, whirlpool, withdrawPercent) {
|
|
@@ -12657,15 +12784,15 @@ async function liquidateTunaLpPositionFusionInstruction(authority, tunaPosition,
|
|
|
12657
12784
|
tunaPosition.data.tickUpperIndex
|
|
12658
12785
|
);
|
|
12659
12786
|
const remainingAccounts = [
|
|
12660
|
-
{ address: swapTickArrays[0], role:
|
|
12661
|
-
{ address: swapTickArrays[1], role:
|
|
12662
|
-
{ address: swapTickArrays[2], role:
|
|
12663
|
-
{ address: swapTickArrays[3], role:
|
|
12664
|
-
{ address: swapTickArrays[4], role:
|
|
12665
|
-
{ address: lowerTickArrayAddress, role:
|
|
12666
|
-
{ address: upperTickArrayAddress, role:
|
|
12667
|
-
{ address: fusionPool.data.tokenVaultA, role:
|
|
12668
|
-
{ address: fusionPool.data.tokenVaultB, role:
|
|
12787
|
+
{ address: swapTickArrays[0], role: import_kit93.AccountRole.WRITABLE },
|
|
12788
|
+
{ address: swapTickArrays[1], role: import_kit93.AccountRole.WRITABLE },
|
|
12789
|
+
{ address: swapTickArrays[2], role: import_kit93.AccountRole.WRITABLE },
|
|
12790
|
+
{ address: swapTickArrays[3], role: import_kit93.AccountRole.WRITABLE },
|
|
12791
|
+
{ address: swapTickArrays[4], role: import_kit93.AccountRole.WRITABLE },
|
|
12792
|
+
{ address: lowerTickArrayAddress, role: import_kit93.AccountRole.WRITABLE },
|
|
12793
|
+
{ address: upperTickArrayAddress, role: import_kit93.AccountRole.WRITABLE },
|
|
12794
|
+
{ address: fusionPool.data.tokenVaultA, role: import_kit93.AccountRole.WRITABLE },
|
|
12795
|
+
{ address: fusionPool.data.tokenVaultB, role: import_kit93.AccountRole.WRITABLE }
|
|
12669
12796
|
];
|
|
12670
12797
|
const remainingAccountsInfo = {
|
|
12671
12798
|
slices: [
|
|
@@ -12709,7 +12836,7 @@ async function liquidateTunaLpPositionFusionInstruction(authority, tunaPosition,
|
|
|
12709
12836
|
|
|
12710
12837
|
// src/txbuilder/liquidateTunaSpotPositionFusion.ts
|
|
12711
12838
|
var import_fusionamm_client11 = require("@crypticdot/fusionamm-client");
|
|
12712
|
-
var
|
|
12839
|
+
var import_kit94 = require("@solana/kit");
|
|
12713
12840
|
var import_memo16 = require("@solana-program/memo");
|
|
12714
12841
|
var import_token_202223 = require("@solana-program/token-2022");
|
|
12715
12842
|
async function liquidateTunaSpotPositionFusionInstructions(authority, tunaPosition, tunaConfig, mintA, mintB, vaultA, vaultB, fusionPool, withdrawPercent) {
|
|
@@ -12772,13 +12899,13 @@ async function liquidateTunaSpotPositionFusionInstruction(authority, positionMin
|
|
|
12772
12899
|
}))[0];
|
|
12773
12900
|
const swapTickArrays = await FusionUtils.getSwapTickArrayAddresses(fusionPool);
|
|
12774
12901
|
const remainingAccounts = [
|
|
12775
|
-
{ address: swapTickArrays[0], role:
|
|
12776
|
-
{ address: swapTickArrays[1], role:
|
|
12777
|
-
{ address: swapTickArrays[2], role:
|
|
12778
|
-
{ address: swapTickArrays[3], role:
|
|
12779
|
-
{ address: swapTickArrays[4], role:
|
|
12780
|
-
{ address: fusionPool.data.tokenVaultA, role:
|
|
12781
|
-
{ address: fusionPool.data.tokenVaultB, role:
|
|
12902
|
+
{ address: swapTickArrays[0], role: import_kit94.AccountRole.WRITABLE },
|
|
12903
|
+
{ address: swapTickArrays[1], role: import_kit94.AccountRole.WRITABLE },
|
|
12904
|
+
{ address: swapTickArrays[2], role: import_kit94.AccountRole.WRITABLE },
|
|
12905
|
+
{ address: swapTickArrays[3], role: import_kit94.AccountRole.WRITABLE },
|
|
12906
|
+
{ address: swapTickArrays[4], role: import_kit94.AccountRole.WRITABLE },
|
|
12907
|
+
{ address: fusionPool.data.tokenVaultA, role: import_kit94.AccountRole.WRITABLE },
|
|
12908
|
+
{ address: fusionPool.data.tokenVaultB, role: import_kit94.AccountRole.WRITABLE }
|
|
12782
12909
|
];
|
|
12783
12910
|
const remainingAccountsInfo = {
|
|
12784
12911
|
slices: [
|
|
@@ -12818,7 +12945,7 @@ async function liquidateTunaSpotPositionFusionInstruction(authority, positionMin
|
|
|
12818
12945
|
|
|
12819
12946
|
// src/txbuilder/liquidateTunaSpotPositionOrca.ts
|
|
12820
12947
|
var import_whirlpools_client11 = require("@orca-so/whirlpools-client");
|
|
12821
|
-
var
|
|
12948
|
+
var import_kit95 = require("@solana/kit");
|
|
12822
12949
|
var import_memo17 = require("@solana-program/memo");
|
|
12823
12950
|
var import_token_202224 = require("@solana-program/token-2022");
|
|
12824
12951
|
async function liquidateTunaSpotPositionOrcaInstructions(authority, tunaPosition, tunaConfig, mintA, mintB, vaultA, vaultB, whirlpool, withdrawPercent) {
|
|
@@ -12882,14 +13009,14 @@ async function liquidateTunaSpotPositionOrcaInstruction(authority, positionMint,
|
|
|
12882
13009
|
}))[0];
|
|
12883
13010
|
const swapTickArrays = await OrcaUtils.getSwapTickArrayAddresses(whirlpool);
|
|
12884
13011
|
const remainingAccounts = [
|
|
12885
|
-
{ address: swapTickArrays[0], role:
|
|
12886
|
-
{ address: swapTickArrays[1], role:
|
|
12887
|
-
{ address: swapTickArrays[2], role:
|
|
12888
|
-
{ address: swapTickArrays[3], role:
|
|
12889
|
-
{ address: swapTickArrays[4], role:
|
|
12890
|
-
{ address: whirlpool.data.tokenVaultA, role:
|
|
12891
|
-
{ address: whirlpool.data.tokenVaultB, role:
|
|
12892
|
-
{ address: orcaOracleAddress, role:
|
|
13012
|
+
{ address: swapTickArrays[0], role: import_kit95.AccountRole.WRITABLE },
|
|
13013
|
+
{ address: swapTickArrays[1], role: import_kit95.AccountRole.WRITABLE },
|
|
13014
|
+
{ address: swapTickArrays[2], role: import_kit95.AccountRole.WRITABLE },
|
|
13015
|
+
{ address: swapTickArrays[3], role: import_kit95.AccountRole.WRITABLE },
|
|
13016
|
+
{ address: swapTickArrays[4], role: import_kit95.AccountRole.WRITABLE },
|
|
13017
|
+
{ address: whirlpool.data.tokenVaultA, role: import_kit95.AccountRole.WRITABLE },
|
|
13018
|
+
{ address: whirlpool.data.tokenVaultB, role: import_kit95.AccountRole.WRITABLE },
|
|
13019
|
+
{ address: orcaOracleAddress, role: import_kit95.AccountRole.WRITABLE }
|
|
12893
13020
|
];
|
|
12894
13021
|
const remainingAccountsInfo = {
|
|
12895
13022
|
slices: [
|
|
@@ -13032,7 +13159,7 @@ async function openTunaLpPositionFusionInstruction(rpc, authority, positionMint,
|
|
|
13032
13159
|
// src/txbuilder/openAndIncreaseTunaLpPositionOrca.ts
|
|
13033
13160
|
var import_whirlpools_client13 = require("@orca-so/whirlpools-client");
|
|
13034
13161
|
var import_whirlpools_core4 = require("@orca-so/whirlpools-core");
|
|
13035
|
-
var
|
|
13162
|
+
var import_kit96 = require("@solana/kit");
|
|
13036
13163
|
var import_sysvars = require("@solana/sysvars");
|
|
13037
13164
|
var import_memo18 = require("@solana-program/memo");
|
|
13038
13165
|
var import_token_202227 = require("@solana-program/token-2022");
|
|
@@ -13054,7 +13181,7 @@ async function openAndIncreaseTunaLpPositionOrcaInstructions(rpc, authority, whi
|
|
|
13054
13181
|
if (!cleanupInstructions) cleanupInstructions = instructions;
|
|
13055
13182
|
const rent = await (0, import_sysvars.fetchSysvarRent)(rpc);
|
|
13056
13183
|
let nonRefundableRent = 0n;
|
|
13057
|
-
const positionMint = await (0,
|
|
13184
|
+
const positionMint = await (0, import_kit96.generateKeyPairSigner)();
|
|
13058
13185
|
const tunaConfig = await fetchTunaConfig(rpc, (await getTunaConfigAddress())[0]);
|
|
13059
13186
|
const whirlpool = await (0, import_whirlpools_client13.fetchMaybeWhirlpool)(rpc, whirlpoolAddress);
|
|
13060
13187
|
if (!whirlpool.exists) throw new Error("Whirlpool account not found");
|
|
@@ -13163,7 +13290,7 @@ async function openAndIncreaseTunaLpPositionOrcaInstructions(rpc, authority, whi
|
|
|
13163
13290
|
return {
|
|
13164
13291
|
instructions,
|
|
13165
13292
|
positionMint: positionMint.address,
|
|
13166
|
-
initializationCost: (0,
|
|
13293
|
+
initializationCost: (0, import_kit96.lamports)(nonRefundableRent)
|
|
13167
13294
|
};
|
|
13168
13295
|
}
|
|
13169
13296
|
async function openAndIncreaseTunaLpPositionOrcaInstruction(authority, positionMint, tunaConfig, mintA, mintB, vaultA, vaultB, whirlpool, args) {
|
|
@@ -13220,16 +13347,16 @@ async function openAndIncreaseTunaLpPositionOrcaInstruction(authority, positionM
|
|
|
13220
13347
|
const lowerTickArrayAddress = await OrcaUtils.getTickArrayAddressFromTickIndex(whirlpool, args.tickLowerIndex);
|
|
13221
13348
|
const upperTickArrayAddress = await OrcaUtils.getTickArrayAddressFromTickIndex(whirlpool, args.tickUpperIndex);
|
|
13222
13349
|
const remainingAccounts = [
|
|
13223
|
-
{ address: swapTickArrays[0], role:
|
|
13224
|
-
{ address: swapTickArrays[1], role:
|
|
13225
|
-
{ address: swapTickArrays[2], role:
|
|
13226
|
-
{ address: swapTickArrays[3], role:
|
|
13227
|
-
{ address: swapTickArrays[4], role:
|
|
13228
|
-
{ address: lowerTickArrayAddress, role:
|
|
13229
|
-
{ address: upperTickArrayAddress, role:
|
|
13230
|
-
{ address: whirlpool.data.tokenVaultA, role:
|
|
13231
|
-
{ address: whirlpool.data.tokenVaultB, role:
|
|
13232
|
-
{ address: orcaOracleAddress, role:
|
|
13350
|
+
{ address: swapTickArrays[0], role: import_kit96.AccountRole.WRITABLE },
|
|
13351
|
+
{ address: swapTickArrays[1], role: import_kit96.AccountRole.WRITABLE },
|
|
13352
|
+
{ address: swapTickArrays[2], role: import_kit96.AccountRole.WRITABLE },
|
|
13353
|
+
{ address: swapTickArrays[3], role: import_kit96.AccountRole.WRITABLE },
|
|
13354
|
+
{ address: swapTickArrays[4], role: import_kit96.AccountRole.WRITABLE },
|
|
13355
|
+
{ address: lowerTickArrayAddress, role: import_kit96.AccountRole.WRITABLE },
|
|
13356
|
+
{ address: upperTickArrayAddress, role: import_kit96.AccountRole.WRITABLE },
|
|
13357
|
+
{ address: whirlpool.data.tokenVaultA, role: import_kit96.AccountRole.WRITABLE },
|
|
13358
|
+
{ address: whirlpool.data.tokenVaultB, role: import_kit96.AccountRole.WRITABLE },
|
|
13359
|
+
{ address: orcaOracleAddress, role: import_kit96.AccountRole.WRITABLE }
|
|
13233
13360
|
];
|
|
13234
13361
|
const remainingAccountsInfo = {
|
|
13235
13362
|
slices: [
|
|
@@ -13281,7 +13408,7 @@ async function openAndIncreaseTunaLpPositionOrcaInstruction(authority, positionM
|
|
|
13281
13408
|
// src/txbuilder/openAndIncreaseTunaLpPositionFusion.ts
|
|
13282
13409
|
var import_fusionamm_client14 = require("@crypticdot/fusionamm-client");
|
|
13283
13410
|
var import_fusionamm_core5 = require("@crypticdot/fusionamm-core");
|
|
13284
|
-
var
|
|
13411
|
+
var import_kit97 = require("@solana/kit");
|
|
13285
13412
|
var import_sysvars2 = require("@solana/sysvars");
|
|
13286
13413
|
var import_memo19 = require("@solana-program/memo");
|
|
13287
13414
|
var import_token_202228 = require("@solana-program/token-2022");
|
|
@@ -13292,7 +13419,7 @@ async function openAndIncreaseTunaLpPositionFusionInstructions(rpc, authority, f
|
|
|
13292
13419
|
if (!cleanupInstructions) cleanupInstructions = instructions;
|
|
13293
13420
|
const rent = await (0, import_sysvars2.fetchSysvarRent)(rpc);
|
|
13294
13421
|
let nonRefundableRent = 0n;
|
|
13295
|
-
const positionMint = await (0,
|
|
13422
|
+
const positionMint = await (0, import_kit97.generateKeyPairSigner)();
|
|
13296
13423
|
const tunaConfig = await fetchTunaConfig(rpc, (await getTunaConfigAddress())[0]);
|
|
13297
13424
|
const fusionPool = await (0, import_fusionamm_client14.fetchMaybeFusionPool)(rpc, fusionPoolAddress);
|
|
13298
13425
|
if (!fusionPool.exists) throw new Error("FusionPool account not found");
|
|
@@ -13399,7 +13526,7 @@ async function openAndIncreaseTunaLpPositionFusionInstructions(rpc, authority, f
|
|
|
13399
13526
|
return {
|
|
13400
13527
|
instructions,
|
|
13401
13528
|
positionMint: positionMint.address,
|
|
13402
|
-
initializationCost: (0,
|
|
13529
|
+
initializationCost: (0, import_kit97.lamports)(nonRefundableRent)
|
|
13403
13530
|
};
|
|
13404
13531
|
}
|
|
13405
13532
|
async function openAndIncreaseTunaLpPositionFusionInstruction(authority, positionMint, tunaConfig, mintA, mintB, vaultA, vaultB, fusionPool, args) {
|
|
@@ -13455,15 +13582,15 @@ async function openAndIncreaseTunaLpPositionFusionInstruction(authority, positio
|
|
|
13455
13582
|
const lowerTickArrayAddress = await FusionUtils.getTickArrayAddressFromTickIndex(fusionPool, args.tickLowerIndex);
|
|
13456
13583
|
const upperTickArrayAddress = await FusionUtils.getTickArrayAddressFromTickIndex(fusionPool, args.tickUpperIndex);
|
|
13457
13584
|
const remainingAccounts = [
|
|
13458
|
-
{ address: swapTickArrays[0], role:
|
|
13459
|
-
{ address: swapTickArrays[1], role:
|
|
13460
|
-
{ address: swapTickArrays[2], role:
|
|
13461
|
-
{ address: swapTickArrays[3], role:
|
|
13462
|
-
{ address: swapTickArrays[4], role:
|
|
13463
|
-
{ address: lowerTickArrayAddress, role:
|
|
13464
|
-
{ address: upperTickArrayAddress, role:
|
|
13465
|
-
{ address: fusionPool.data.tokenVaultA, role:
|
|
13466
|
-
{ address: fusionPool.data.tokenVaultB, role:
|
|
13585
|
+
{ address: swapTickArrays[0], role: import_kit97.AccountRole.WRITABLE },
|
|
13586
|
+
{ address: swapTickArrays[1], role: import_kit97.AccountRole.WRITABLE },
|
|
13587
|
+
{ address: swapTickArrays[2], role: import_kit97.AccountRole.WRITABLE },
|
|
13588
|
+
{ address: swapTickArrays[3], role: import_kit97.AccountRole.WRITABLE },
|
|
13589
|
+
{ address: swapTickArrays[4], role: import_kit97.AccountRole.WRITABLE },
|
|
13590
|
+
{ address: lowerTickArrayAddress, role: import_kit97.AccountRole.WRITABLE },
|
|
13591
|
+
{ address: upperTickArrayAddress, role: import_kit97.AccountRole.WRITABLE },
|
|
13592
|
+
{ address: fusionPool.data.tokenVaultA, role: import_kit97.AccountRole.WRITABLE },
|
|
13593
|
+
{ address: fusionPool.data.tokenVaultB, role: import_kit97.AccountRole.WRITABLE }
|
|
13467
13594
|
];
|
|
13468
13595
|
const remainingAccountsInfo = {
|
|
13469
13596
|
slices: [
|
|
@@ -13513,7 +13640,7 @@ async function openAndIncreaseTunaLpPositionFusionInstruction(authority, positio
|
|
|
13513
13640
|
|
|
13514
13641
|
// src/txbuilder/openAndIncreaseTunaSpotPositionFusion.ts
|
|
13515
13642
|
var import_fusionamm_client15 = require("@crypticdot/fusionamm-client");
|
|
13516
|
-
var
|
|
13643
|
+
var import_kit98 = require("@solana/kit");
|
|
13517
13644
|
var import_memo20 = require("@solana-program/memo");
|
|
13518
13645
|
var import_token_202229 = require("@solana-program/token-2022");
|
|
13519
13646
|
var import_assert22 = __toESM(require("assert"));
|
|
@@ -13521,7 +13648,7 @@ async function openAndIncreaseTunaSpotPositionFusionInstructions(rpc, authority,
|
|
|
13521
13648
|
const instructions = [];
|
|
13522
13649
|
if (!createInstructions) createInstructions = instructions;
|
|
13523
13650
|
if (!cleanupInstructions) cleanupInstructions = instructions;
|
|
13524
|
-
const positionMint = await (0,
|
|
13651
|
+
const positionMint = await (0, import_kit98.generateKeyPairSigner)();
|
|
13525
13652
|
const tunaConfig = await fetchTunaConfig(rpc, (await getTunaConfigAddress())[0]);
|
|
13526
13653
|
const fusionPool = await (0, import_fusionamm_client15.fetchMaybeFusionPool)(rpc, fusionPoolAddress);
|
|
13527
13654
|
if (!fusionPool.exists) throw new Error("FusionPool account not found");
|
|
@@ -13621,13 +13748,13 @@ async function openAndIncreaseTunaSpotPositionFusionInstruction(authority, posit
|
|
|
13621
13748
|
}))[0];
|
|
13622
13749
|
const swapTickArrays = await FusionUtils.getSwapTickArrayAddresses(fusionPool);
|
|
13623
13750
|
const remainingAccounts = [
|
|
13624
|
-
{ address: swapTickArrays[0], role:
|
|
13625
|
-
{ address: swapTickArrays[1], role:
|
|
13626
|
-
{ address: swapTickArrays[2], role:
|
|
13627
|
-
{ address: swapTickArrays[3], role:
|
|
13628
|
-
{ address: swapTickArrays[4], role:
|
|
13629
|
-
{ address: fusionPool.data.tokenVaultA, role:
|
|
13630
|
-
{ address: fusionPool.data.tokenVaultB, role:
|
|
13751
|
+
{ address: swapTickArrays[0], role: import_kit98.AccountRole.WRITABLE },
|
|
13752
|
+
{ address: swapTickArrays[1], role: import_kit98.AccountRole.WRITABLE },
|
|
13753
|
+
{ address: swapTickArrays[2], role: import_kit98.AccountRole.WRITABLE },
|
|
13754
|
+
{ address: swapTickArrays[3], role: import_kit98.AccountRole.WRITABLE },
|
|
13755
|
+
{ address: swapTickArrays[4], role: import_kit98.AccountRole.WRITABLE },
|
|
13756
|
+
{ address: fusionPool.data.tokenVaultA, role: import_kit98.AccountRole.WRITABLE },
|
|
13757
|
+
{ address: fusionPool.data.tokenVaultB, role: import_kit98.AccountRole.WRITABLE }
|
|
13631
13758
|
];
|
|
13632
13759
|
const remainingAccountsInfo = {
|
|
13633
13760
|
slices: [
|
|
@@ -13671,7 +13798,7 @@ async function openAndIncreaseTunaSpotPositionFusionInstruction(authority, posit
|
|
|
13671
13798
|
|
|
13672
13799
|
// src/txbuilder/openAndIncreaseTunaSpotPositionOrca.ts
|
|
13673
13800
|
var import_whirlpools_client14 = require("@orca-so/whirlpools-client");
|
|
13674
|
-
var
|
|
13801
|
+
var import_kit99 = require("@solana/kit");
|
|
13675
13802
|
var import_memo21 = require("@solana-program/memo");
|
|
13676
13803
|
var import_token_202230 = require("@solana-program/token-2022");
|
|
13677
13804
|
var import_assert23 = __toESM(require("assert"));
|
|
@@ -13679,7 +13806,7 @@ async function openAndIncreaseTunaSpotPositionOrcaInstructions(rpc, authority, w
|
|
|
13679
13806
|
const instructions = [];
|
|
13680
13807
|
if (!createInstructions) createInstructions = instructions;
|
|
13681
13808
|
if (!cleanupInstructions) cleanupInstructions = instructions;
|
|
13682
|
-
const positionMint = await (0,
|
|
13809
|
+
const positionMint = await (0, import_kit99.generateKeyPairSigner)();
|
|
13683
13810
|
const tunaConfig = await fetchTunaConfig(rpc, (await getTunaConfigAddress())[0]);
|
|
13684
13811
|
const whirlpool = await (0, import_whirlpools_client14.fetchMaybeWhirlpool)(rpc, whirlpoolAddress);
|
|
13685
13812
|
if (!whirlpool.exists) throw new Error("Whirlpool account not found");
|
|
@@ -13780,14 +13907,14 @@ async function openAndIncreaseTunaSpotPositionOrcaInstruction(authority, positio
|
|
|
13780
13907
|
}))[0];
|
|
13781
13908
|
const swapTickArrays = await OrcaUtils.getSwapTickArrayAddresses(whirlpool);
|
|
13782
13909
|
const remainingAccounts = [
|
|
13783
|
-
{ address: swapTickArrays[0], role:
|
|
13784
|
-
{ address: swapTickArrays[1], role:
|
|
13785
|
-
{ address: swapTickArrays[2], role:
|
|
13786
|
-
{ address: swapTickArrays[3], role:
|
|
13787
|
-
{ address: swapTickArrays[4], role:
|
|
13788
|
-
{ address: whirlpool.data.tokenVaultA, role:
|
|
13789
|
-
{ address: whirlpool.data.tokenVaultB, role:
|
|
13790
|
-
{ address: orcaOracleAddress, role:
|
|
13910
|
+
{ address: swapTickArrays[0], role: import_kit99.AccountRole.WRITABLE },
|
|
13911
|
+
{ address: swapTickArrays[1], role: import_kit99.AccountRole.WRITABLE },
|
|
13912
|
+
{ address: swapTickArrays[2], role: import_kit99.AccountRole.WRITABLE },
|
|
13913
|
+
{ address: swapTickArrays[3], role: import_kit99.AccountRole.WRITABLE },
|
|
13914
|
+
{ address: swapTickArrays[4], role: import_kit99.AccountRole.WRITABLE },
|
|
13915
|
+
{ address: whirlpool.data.tokenVaultA, role: import_kit99.AccountRole.WRITABLE },
|
|
13916
|
+
{ address: whirlpool.data.tokenVaultB, role: import_kit99.AccountRole.WRITABLE },
|
|
13917
|
+
{ address: orcaOracleAddress, role: import_kit99.AccountRole.WRITABLE }
|
|
13791
13918
|
];
|
|
13792
13919
|
const remainingAccountsInfo = {
|
|
13793
13920
|
slices: [
|
|
@@ -13922,7 +14049,7 @@ async function openTunaSpotPositionOrcaInstruction(authority, positionMint, mint
|
|
|
13922
14049
|
// src/txbuilder/decreaseTunaLpPositionOrca.ts
|
|
13923
14050
|
var import_whirlpools_client16 = require("@orca-so/whirlpools-client");
|
|
13924
14051
|
var import_whirlpools_core5 = require("@orca-so/whirlpools-core");
|
|
13925
|
-
var
|
|
14052
|
+
var import_kit100 = require("@solana/kit");
|
|
13926
14053
|
var import_memo22 = require("@solana-program/memo");
|
|
13927
14054
|
var import_token_202233 = require("@solana-program/token-2022");
|
|
13928
14055
|
var import_assert26 = __toESM(require("assert"));
|
|
@@ -13944,7 +14071,7 @@ async function decreaseTunaLpPositionOrcaInstructions(rpc, authority, positionMi
|
|
|
13944
14071
|
const allMints = [mintA, mintB, ...rewardMints];
|
|
13945
14072
|
(0, import_assert26.default)(mintA.exists, "Token A account not found");
|
|
13946
14073
|
(0, import_assert26.default)(mintB.exists, "Token B account not found");
|
|
13947
|
-
(0,
|
|
14074
|
+
(0, import_kit100.assertAccountsExist)(rewardMints);
|
|
13948
14075
|
const lowerTickArrayStartIndex = (0, import_whirlpools_core5.getTickArrayStartTickIndex)(
|
|
13949
14076
|
tunaPosition.data.tickLowerIndex,
|
|
13950
14077
|
whirlpool.data.tickSpacing
|
|
@@ -14057,16 +14184,16 @@ async function decreaseTunaLpPositionOrcaInstruction(authority, tunaPosition, mi
|
|
|
14057
14184
|
tunaPosition.data.tickUpperIndex
|
|
14058
14185
|
);
|
|
14059
14186
|
const remainingAccounts = [
|
|
14060
|
-
{ address: swapTickArrays[0], role:
|
|
14061
|
-
{ address: swapTickArrays[1], role:
|
|
14062
|
-
{ address: swapTickArrays[2], role:
|
|
14063
|
-
{ address: swapTickArrays[3], role:
|
|
14064
|
-
{ address: swapTickArrays[4], role:
|
|
14065
|
-
{ address: lowerTickArrayAddress, role:
|
|
14066
|
-
{ address: upperTickArrayAddress, role:
|
|
14067
|
-
{ address: whirlpool.data.tokenVaultA, role:
|
|
14068
|
-
{ address: whirlpool.data.tokenVaultB, role:
|
|
14069
|
-
{ address: orcaOracleAddress, role:
|
|
14187
|
+
{ address: swapTickArrays[0], role: import_kit100.AccountRole.WRITABLE },
|
|
14188
|
+
{ address: swapTickArrays[1], role: import_kit100.AccountRole.WRITABLE },
|
|
14189
|
+
{ address: swapTickArrays[2], role: import_kit100.AccountRole.WRITABLE },
|
|
14190
|
+
{ address: swapTickArrays[3], role: import_kit100.AccountRole.WRITABLE },
|
|
14191
|
+
{ address: swapTickArrays[4], role: import_kit100.AccountRole.WRITABLE },
|
|
14192
|
+
{ address: lowerTickArrayAddress, role: import_kit100.AccountRole.WRITABLE },
|
|
14193
|
+
{ address: upperTickArrayAddress, role: import_kit100.AccountRole.WRITABLE },
|
|
14194
|
+
{ address: whirlpool.data.tokenVaultA, role: import_kit100.AccountRole.WRITABLE },
|
|
14195
|
+
{ address: whirlpool.data.tokenVaultB, role: import_kit100.AccountRole.WRITABLE },
|
|
14196
|
+
{ address: orcaOracleAddress, role: import_kit100.AccountRole.WRITABLE }
|
|
14070
14197
|
];
|
|
14071
14198
|
for (const rewardIndex of rewardIndicesToClaim) {
|
|
14072
14199
|
const rewardInfo = whirlpool.data.rewardInfos[rewardIndex];
|
|
@@ -14077,10 +14204,10 @@ async function decreaseTunaLpPositionOrcaInstruction(authority, tunaPosition, mi
|
|
|
14077
14204
|
mint: rewardMint.address,
|
|
14078
14205
|
tokenProgram: rewardMint.programAddress
|
|
14079
14206
|
});
|
|
14080
|
-
remainingAccounts.push({ address: rewardMint.address, role:
|
|
14081
|
-
remainingAccounts.push({ address: rewardMint.programAddress, role:
|
|
14082
|
-
remainingAccounts.push({ address: ownerAta[0], role:
|
|
14083
|
-
remainingAccounts.push({ address: rewardInfo.vault, role:
|
|
14207
|
+
remainingAccounts.push({ address: rewardMint.address, role: import_kit100.AccountRole.READONLY });
|
|
14208
|
+
remainingAccounts.push({ address: rewardMint.programAddress, role: import_kit100.AccountRole.READONLY });
|
|
14209
|
+
remainingAccounts.push({ address: ownerAta[0], role: import_kit100.AccountRole.WRITABLE });
|
|
14210
|
+
remainingAccounts.push({ address: rewardInfo.vault, role: import_kit100.AccountRole.WRITABLE });
|
|
14084
14211
|
}
|
|
14085
14212
|
const remainingAccountsInfo = {
|
|
14086
14213
|
slices: [
|
|
@@ -14128,7 +14255,7 @@ async function decreaseTunaLpPositionOrcaInstruction(authority, tunaPosition, mi
|
|
|
14128
14255
|
|
|
14129
14256
|
// src/txbuilder/decreaseTunaLpPositionFusion.ts
|
|
14130
14257
|
var import_fusionamm_client17 = require("@crypticdot/fusionamm-client");
|
|
14131
|
-
var
|
|
14258
|
+
var import_kit101 = require("@solana/kit");
|
|
14132
14259
|
var import_memo23 = require("@solana-program/memo");
|
|
14133
14260
|
var import_token_202234 = require("@solana-program/token-2022");
|
|
14134
14261
|
var import_assert27 = __toESM(require("assert"));
|
|
@@ -14229,15 +14356,15 @@ async function decreaseTunaLpPositionFusionInstruction(authority, tunaPosition,
|
|
|
14229
14356
|
tunaPosition.data.tickUpperIndex
|
|
14230
14357
|
);
|
|
14231
14358
|
const remainingAccounts = [
|
|
14232
|
-
{ address: swapTickArrays[0], role:
|
|
14233
|
-
{ address: swapTickArrays[1], role:
|
|
14234
|
-
{ address: swapTickArrays[2], role:
|
|
14235
|
-
{ address: swapTickArrays[3], role:
|
|
14236
|
-
{ address: swapTickArrays[4], role:
|
|
14237
|
-
{ address: lowerTickArrayAddress, role:
|
|
14238
|
-
{ address: upperTickArrayAddress, role:
|
|
14239
|
-
{ address: fusionPool.data.tokenVaultA, role:
|
|
14240
|
-
{ address: fusionPool.data.tokenVaultB, role:
|
|
14359
|
+
{ address: swapTickArrays[0], role: import_kit101.AccountRole.WRITABLE },
|
|
14360
|
+
{ address: swapTickArrays[1], role: import_kit101.AccountRole.WRITABLE },
|
|
14361
|
+
{ address: swapTickArrays[2], role: import_kit101.AccountRole.WRITABLE },
|
|
14362
|
+
{ address: swapTickArrays[3], role: import_kit101.AccountRole.WRITABLE },
|
|
14363
|
+
{ address: swapTickArrays[4], role: import_kit101.AccountRole.WRITABLE },
|
|
14364
|
+
{ address: lowerTickArrayAddress, role: import_kit101.AccountRole.WRITABLE },
|
|
14365
|
+
{ address: upperTickArrayAddress, role: import_kit101.AccountRole.WRITABLE },
|
|
14366
|
+
{ address: fusionPool.data.tokenVaultA, role: import_kit101.AccountRole.WRITABLE },
|
|
14367
|
+
{ address: fusionPool.data.tokenVaultB, role: import_kit101.AccountRole.WRITABLE }
|
|
14241
14368
|
];
|
|
14242
14369
|
const remainingAccountsInfo = {
|
|
14243
14370
|
slices: [
|
|
@@ -14326,6 +14453,56 @@ async function setTunaLpPositionLimitOrdersInstruction(authority, args, position
|
|
|
14326
14453
|
});
|
|
14327
14454
|
}
|
|
14328
14455
|
|
|
14456
|
+
// src/txbuilder/setTunaSpotPositionLimitOrders.ts
|
|
14457
|
+
async function setTunaSpotPositionLimitOrdersInstruction(authority, args, positionMint, tunaPositionAddress) {
|
|
14458
|
+
if (tunaPositionAddress === void 0) {
|
|
14459
|
+
if (positionMint === void 0) {
|
|
14460
|
+
throw new Error("At least one of 'positionMint' or 'tunaPositionAddress' must be provided.");
|
|
14461
|
+
}
|
|
14462
|
+
tunaPositionAddress = (await getTunaSpotPositionAddress(positionMint))[0];
|
|
14463
|
+
}
|
|
14464
|
+
return getSetTunaSpotPositionLimitOrdersInstruction({
|
|
14465
|
+
...args,
|
|
14466
|
+
authority,
|
|
14467
|
+
tunaPosition: tunaPositionAddress
|
|
14468
|
+
});
|
|
14469
|
+
}
|
|
14470
|
+
|
|
14471
|
+
// src/txbuilder/resetTunaSpotPosition.ts
|
|
14472
|
+
var import_token_202236 = require("@solana-program/token-2022");
|
|
14473
|
+
var import_assert28 = __toESM(require("assert"));
|
|
14474
|
+
async function resetTunaSpotPositionInstruction(rpc, authority, args, positionMint, tunaPositionAddress) {
|
|
14475
|
+
if (tunaPositionAddress === void 0) {
|
|
14476
|
+
if (positionMint === void 0) {
|
|
14477
|
+
throw new Error("At least one of 'positionMint' or 'tunaPositionAddress' must be provided.");
|
|
14478
|
+
}
|
|
14479
|
+
tunaPositionAddress = (await getTunaSpotPositionAddress(positionMint))[0];
|
|
14480
|
+
}
|
|
14481
|
+
const tunaPosition = await fetchTunaSpotPosition(rpc, tunaPositionAddress);
|
|
14482
|
+
const [mintA, mintB] = await (0, import_token_202236.fetchAllMaybeMint)(rpc, [tunaPosition.data.mintA, tunaPosition.data.mintB]);
|
|
14483
|
+
(0, import_assert28.default)(mintA.exists, "Token A not found");
|
|
14484
|
+
(0, import_assert28.default)(mintB.exists, "Token B not found");
|
|
14485
|
+
const tunaPositionAtaA = (await (0, import_token_202236.findAssociatedTokenPda)({
|
|
14486
|
+
owner: tunaPositionAddress,
|
|
14487
|
+
mint: mintA.address,
|
|
14488
|
+
tokenProgram: mintA.programAddress
|
|
14489
|
+
}))[0];
|
|
14490
|
+
const tunaPositionAtaB = (await (0, import_token_202236.findAssociatedTokenPda)({
|
|
14491
|
+
owner: tunaPositionAddress,
|
|
14492
|
+
mint: mintB.address,
|
|
14493
|
+
tokenProgram: mintB.programAddress
|
|
14494
|
+
}))[0];
|
|
14495
|
+
return getResetTunaSpotPositionInstruction({
|
|
14496
|
+
...args,
|
|
14497
|
+
authority,
|
|
14498
|
+
mintA: tunaPosition.data.mintA,
|
|
14499
|
+
mintB: tunaPosition.data.mintB,
|
|
14500
|
+
tunaPositionAtaA,
|
|
14501
|
+
tunaPositionAtaB,
|
|
14502
|
+
tunaPosition: tunaPositionAddress
|
|
14503
|
+
});
|
|
14504
|
+
}
|
|
14505
|
+
|
|
14329
14506
|
// src/txbuilder/updateMarket.ts
|
|
14330
14507
|
async function updateMarketInstruction(authority, pool, args) {
|
|
14331
14508
|
const tunaConfig = (await getTunaConfigAddress())[0];
|
|
@@ -14352,10 +14529,10 @@ async function updateVaultInstruction(authority, mint, args) {
|
|
|
14352
14529
|
|
|
14353
14530
|
// src/txbuilder/withdraw.ts
|
|
14354
14531
|
var import_memo25 = require("@solana-program/memo");
|
|
14355
|
-
var
|
|
14532
|
+
var import_token_202237 = require("@solana-program/token-2022");
|
|
14356
14533
|
async function withdrawInstructions(rpc, authority, mintAddress, funds, shares) {
|
|
14357
14534
|
const instructions = [];
|
|
14358
|
-
const mint = await (0,
|
|
14535
|
+
const mint = await (0, import_token_202237.fetchMaybeMint)(rpc, mintAddress);
|
|
14359
14536
|
if (!mint.exists) throw new Error("Mint account not found");
|
|
14360
14537
|
const createUserAtaInstructions = await getCreateAtaInstructions(
|
|
14361
14538
|
rpc,
|
|
@@ -14374,12 +14551,12 @@ async function withdrawInstruction(authority, mint, funds, shares) {
|
|
|
14374
14551
|
const tunaConfig = (await getTunaConfigAddress())[0];
|
|
14375
14552
|
const lendingPosition = (await getLendingPositionAddress(authority.address, mint.address))[0];
|
|
14376
14553
|
const vault = (await getLendingVaultAddress(mint.address))[0];
|
|
14377
|
-
const vaultAta = (await (0,
|
|
14554
|
+
const vaultAta = (await (0, import_token_202237.findAssociatedTokenPda)({
|
|
14378
14555
|
owner: vault,
|
|
14379
14556
|
mint: mint.address,
|
|
14380
14557
|
tokenProgram: mint.programAddress
|
|
14381
14558
|
}))[0];
|
|
14382
|
-
const authorityAta = (await (0,
|
|
14559
|
+
const authorityAta = (await (0, import_token_202237.findAssociatedTokenPda)({
|
|
14383
14560
|
owner: authority.address,
|
|
14384
14561
|
mint: mint.address,
|
|
14385
14562
|
tokenProgram: mint.programAddress
|
|
@@ -14402,25 +14579,25 @@ async function withdrawInstruction(authority, mint, funds, shares) {
|
|
|
14402
14579
|
// src/txbuilder/createMarketLookupTable.ts
|
|
14403
14580
|
var import_fusionamm_client18 = require("@crypticdot/fusionamm-client");
|
|
14404
14581
|
var import_whirlpools_client17 = require("@orca-so/whirlpools-client");
|
|
14405
|
-
var
|
|
14582
|
+
var import_kit102 = require("@solana/kit");
|
|
14406
14583
|
var import_memo26 = require("@solana-program/memo");
|
|
14407
14584
|
var import_system2 = require("@solana-program/system");
|
|
14408
14585
|
var import_token2 = require("@solana-program/token");
|
|
14409
|
-
var
|
|
14586
|
+
var import_token_202238 = require("@solana-program/token-2022");
|
|
14410
14587
|
async function getAddressesForMarketLookupTable(rpc, poolAddress, marketMaker) {
|
|
14411
14588
|
const tunaConfigAddress = (await getTunaConfigAddress())[0];
|
|
14412
14589
|
const marketAddress = (await getMarketAddress(poolAddress))[0];
|
|
14413
14590
|
const orcaOracleAddress = (await (0, import_whirlpools_client17.getOracleAddress)(poolAddress))[0];
|
|
14414
14591
|
const tunaConfig = await fetchTunaConfig(rpc, tunaConfigAddress);
|
|
14415
14592
|
const pool = marketMaker == 0 /* Orca */ ? await (0, import_whirlpools_client17.fetchWhirlpool)(rpc, poolAddress) : await (0, import_fusionamm_client18.fetchFusionPool)(rpc, poolAddress);
|
|
14416
|
-
const mintA = await (0,
|
|
14417
|
-
const mintB = await (0,
|
|
14418
|
-
const feeRecipientAtaA = (await (0,
|
|
14593
|
+
const mintA = await (0, import_token_202238.fetchMint)(rpc, pool.data.tokenMintA);
|
|
14594
|
+
const mintB = await (0, import_token_202238.fetchMint)(rpc, pool.data.tokenMintB);
|
|
14595
|
+
const feeRecipientAtaA = (await (0, import_token_202238.findAssociatedTokenPda)({
|
|
14419
14596
|
owner: tunaConfig.data.feeRecipient,
|
|
14420
14597
|
mint: mintA.address,
|
|
14421
14598
|
tokenProgram: mintA.programAddress
|
|
14422
14599
|
}))[0];
|
|
14423
|
-
const feeRecipientAtaB = (await (0,
|
|
14600
|
+
const feeRecipientAtaB = (await (0, import_token_202238.findAssociatedTokenPda)({
|
|
14424
14601
|
owner: tunaConfig.data.feeRecipient,
|
|
14425
14602
|
mint: mintB.address,
|
|
14426
14603
|
tokenProgram: mintB.programAddress
|
|
@@ -14429,22 +14606,22 @@ async function getAddressesForMarketLookupTable(rpc, poolAddress, marketMaker) {
|
|
|
14429
14606
|
(await getLendingVaultAddress(mintA.address))[0],
|
|
14430
14607
|
(await getLendingVaultAddress(mintB.address))[0]
|
|
14431
14608
|
]);
|
|
14432
|
-
const vaultAAta = (await (0,
|
|
14609
|
+
const vaultAAta = (await (0, import_token_202238.findAssociatedTokenPda)({
|
|
14433
14610
|
owner: vaultA.address,
|
|
14434
14611
|
mint: mintA.address,
|
|
14435
14612
|
tokenProgram: mintA.programAddress
|
|
14436
14613
|
}))[0];
|
|
14437
|
-
const vaultBAta = (await (0,
|
|
14614
|
+
const vaultBAta = (await (0, import_token_202238.findAssociatedTokenPda)({
|
|
14438
14615
|
owner: vaultB.address,
|
|
14439
14616
|
mint: mintB.address,
|
|
14440
14617
|
tokenProgram: mintB.programAddress
|
|
14441
14618
|
}))[0];
|
|
14442
14619
|
const addresses = [
|
|
14443
14620
|
import_system2.SYSTEM_PROGRAM_ADDRESS,
|
|
14444
|
-
(0,
|
|
14445
|
-
|
|
14621
|
+
(0, import_kit102.address)("SysvarRent111111111111111111111111111111111"),
|
|
14622
|
+
import_token_202238.ASSOCIATED_TOKEN_PROGRAM_ADDRESS,
|
|
14446
14623
|
import_token2.TOKEN_PROGRAM_ADDRESS,
|
|
14447
|
-
|
|
14624
|
+
import_token_202238.TOKEN_2022_PROGRAM_ADDRESS,
|
|
14448
14625
|
NATIVE_MINT,
|
|
14449
14626
|
import_memo26.MEMO_PROGRAM_ADDRESS,
|
|
14450
14627
|
tunaConfigAddress,
|
|
@@ -14489,16 +14666,16 @@ async function createAddressLookupTableForMarketInstructions(rpc, poolAddress, m
|
|
|
14489
14666
|
|
|
14490
14667
|
// src/txbuilder/repayTunaLpPositionDebt.ts
|
|
14491
14668
|
var import_memo27 = require("@solana-program/memo");
|
|
14492
|
-
var
|
|
14493
|
-
var
|
|
14669
|
+
var import_token_202239 = require("@solana-program/token-2022");
|
|
14670
|
+
var import_assert29 = __toESM(require("assert"));
|
|
14494
14671
|
async function repayTunaLpPositionDebtInstructions(rpc, authority, positionMint, collateralA, collateralB, createInstructions, cleanupInstructions) {
|
|
14495
14672
|
const instructions = [];
|
|
14496
14673
|
if (!createInstructions) createInstructions = instructions;
|
|
14497
14674
|
if (!cleanupInstructions) cleanupInstructions = instructions;
|
|
14498
14675
|
const tunaPosition = await fetchTunaLpPosition(rpc, (await getTunaLpPositionAddress(positionMint))[0]);
|
|
14499
|
-
const [mintA, mintB] = await (0,
|
|
14500
|
-
(0,
|
|
14501
|
-
(0,
|
|
14676
|
+
const [mintA, mintB] = await (0, import_token_202239.fetchAllMaybeMint)(rpc, [tunaPosition.data.mintA, tunaPosition.data.mintB]);
|
|
14677
|
+
(0, import_assert29.default)(mintA.exists, "Token A not found");
|
|
14678
|
+
(0, import_assert29.default)(mintB.exists, "Token B not found");
|
|
14502
14679
|
const marketAddress = (await getMarketAddress(tunaPosition.data.pool))[0];
|
|
14503
14680
|
const createUserAtaAInstructions = await getCreateAtaInstructions(
|
|
14504
14681
|
rpc,
|
|
@@ -14534,34 +14711,34 @@ async function repayTunaLpPositionDebtInstructions(rpc, authority, positionMint,
|
|
|
14534
14711
|
}
|
|
14535
14712
|
async function repayTunaLpPositionDebtInstruction(authority, positionMint, mintA, mintB, marketAddress, collateralA, collateralB) {
|
|
14536
14713
|
const tunaPositionAddress = (await getTunaLpPositionAddress(positionMint))[0];
|
|
14537
|
-
const tunaPositionOwnerAtaA = (await (0,
|
|
14714
|
+
const tunaPositionOwnerAtaA = (await (0, import_token_202239.findAssociatedTokenPda)({
|
|
14538
14715
|
owner: authority.address,
|
|
14539
14716
|
mint: mintA.address,
|
|
14540
14717
|
tokenProgram: mintA.programAddress
|
|
14541
14718
|
}))[0];
|
|
14542
|
-
const tunaPositionOwnerAtaB = (await (0,
|
|
14719
|
+
const tunaPositionOwnerAtaB = (await (0, import_token_202239.findAssociatedTokenPda)({
|
|
14543
14720
|
owner: authority.address,
|
|
14544
14721
|
mint: mintB.address,
|
|
14545
14722
|
tokenProgram: mintB.programAddress
|
|
14546
14723
|
}))[0];
|
|
14547
|
-
const tunaPositionAtaA = (await (0,
|
|
14724
|
+
const tunaPositionAtaA = (await (0, import_token_202239.findAssociatedTokenPda)({
|
|
14548
14725
|
owner: tunaPositionAddress,
|
|
14549
14726
|
mint: mintA.address,
|
|
14550
14727
|
tokenProgram: mintA.programAddress
|
|
14551
14728
|
}))[0];
|
|
14552
|
-
const tunaPositionAtaB = (await (0,
|
|
14729
|
+
const tunaPositionAtaB = (await (0, import_token_202239.findAssociatedTokenPda)({
|
|
14553
14730
|
owner: tunaPositionAddress,
|
|
14554
14731
|
mint: mintB.address,
|
|
14555
14732
|
tokenProgram: mintB.programAddress
|
|
14556
14733
|
}))[0];
|
|
14557
14734
|
const vaultAAddress = (await getLendingVaultAddress(mintA.address))[0];
|
|
14558
|
-
const vaultAAta = (await (0,
|
|
14735
|
+
const vaultAAta = (await (0, import_token_202239.findAssociatedTokenPda)({
|
|
14559
14736
|
owner: vaultAAddress,
|
|
14560
14737
|
mint: mintA.address,
|
|
14561
14738
|
tokenProgram: mintA.programAddress
|
|
14562
14739
|
}))[0];
|
|
14563
14740
|
const vaultBAddress = (await getLendingVaultAddress(mintB.address))[0];
|
|
14564
|
-
const vaultBAta = (await (0,
|
|
14741
|
+
const vaultBAta = (await (0, import_token_202239.findAssociatedTokenPda)({
|
|
14565
14742
|
owner: vaultBAddress,
|
|
14566
14743
|
mint: mintB.address,
|
|
14567
14744
|
tokenProgram: mintB.programAddress
|
|
@@ -14590,11 +14767,11 @@ async function repayTunaLpPositionDebtInstruction(authority, positionMint, mintA
|
|
|
14590
14767
|
|
|
14591
14768
|
// src/txbuilder/rebalanceTunaLpPositionOrca.ts
|
|
14592
14769
|
var import_whirlpools_client18 = require("@orca-so/whirlpools-client");
|
|
14593
|
-
var
|
|
14770
|
+
var import_kit103 = require("@solana/kit");
|
|
14594
14771
|
var import_sysvars3 = require("@solana/sysvars");
|
|
14595
14772
|
var import_memo28 = require("@solana-program/memo");
|
|
14596
|
-
var
|
|
14597
|
-
var
|
|
14773
|
+
var import_token_202240 = require("@solana-program/token-2022");
|
|
14774
|
+
var import_assert30 = __toESM(require("assert"));
|
|
14598
14775
|
async function rebalanceTunaLpPositionOrcaInstructions(rpc, authority, positionMint, createInstructions, cleanupInstructions) {
|
|
14599
14776
|
const rent = await (0, import_sysvars3.fetchSysvarRent)(rpc);
|
|
14600
14777
|
let nonRefundableRent = 0n;
|
|
@@ -14607,9 +14784,9 @@ async function rebalanceTunaLpPositionOrcaInstructions(rpc, authority, positionM
|
|
|
14607
14784
|
(await getLendingVaultAddress(whirlpool.data.tokenMintA))[0],
|
|
14608
14785
|
(await getLendingVaultAddress(whirlpool.data.tokenMintB))[0]
|
|
14609
14786
|
]);
|
|
14610
|
-
const [mintA, mintB] = await (0,
|
|
14611
|
-
(0,
|
|
14612
|
-
(0,
|
|
14787
|
+
const [mintA, mintB] = await (0, import_token_202240.fetchAllMaybeMint)(rpc, [whirlpool.data.tokenMintA, whirlpool.data.tokenMintB]);
|
|
14788
|
+
(0, import_assert30.default)(mintA.exists, "Token A account not found");
|
|
14789
|
+
(0, import_assert30.default)(mintB.exists, "Token B account not found");
|
|
14613
14790
|
const instructions = [];
|
|
14614
14791
|
if (!createInstructions) createInstructions = instructions;
|
|
14615
14792
|
if (!cleanupInstructions) cleanupInstructions = instructions;
|
|
@@ -14673,7 +14850,7 @@ async function rebalanceTunaLpPositionOrcaInstructions(rpc, authority, positionM
|
|
|
14673
14850
|
cleanupInstructions.push(...internalCleanupInstructions);
|
|
14674
14851
|
return {
|
|
14675
14852
|
instructions,
|
|
14676
|
-
initializationCost: (0,
|
|
14853
|
+
initializationCost: (0, import_kit103.lamports)(nonRefundableRent)
|
|
14677
14854
|
};
|
|
14678
14855
|
}
|
|
14679
14856
|
async function rebalanceTunaLpPositionOrcaInstruction(authority, tunaPosition, tunaConfig, mintA, mintB, vaultA, vaultB, whirlpool) {
|
|
@@ -14681,27 +14858,27 @@ async function rebalanceTunaLpPositionOrcaInstruction(authority, tunaPosition, t
|
|
|
14681
14858
|
const marketAddress = (await getMarketAddress(whirlpool.address))[0];
|
|
14682
14859
|
const orcaPositionAddress = (await (0, import_whirlpools_client18.getPositionAddress)(positionMint))[0];
|
|
14683
14860
|
const orcaOracleAddress = (await (0, import_whirlpools_client18.getOracleAddress)(whirlpool.address))[0];
|
|
14684
|
-
const tunaPositionAta = (await (0,
|
|
14861
|
+
const tunaPositionAta = (await (0, import_token_202240.findAssociatedTokenPda)({
|
|
14685
14862
|
owner: tunaPosition.address,
|
|
14686
14863
|
mint: positionMint,
|
|
14687
|
-
tokenProgram:
|
|
14864
|
+
tokenProgram: import_token_202240.TOKEN_2022_PROGRAM_ADDRESS
|
|
14688
14865
|
}))[0];
|
|
14689
|
-
const tunaPositionAtaA = (await (0,
|
|
14866
|
+
const tunaPositionAtaA = (await (0, import_token_202240.findAssociatedTokenPda)({
|
|
14690
14867
|
owner: tunaPosition.address,
|
|
14691
14868
|
mint: mintA.address,
|
|
14692
14869
|
tokenProgram: mintA.programAddress
|
|
14693
14870
|
}))[0];
|
|
14694
|
-
const tunaPositionAtaB = (await (0,
|
|
14871
|
+
const tunaPositionAtaB = (await (0, import_token_202240.findAssociatedTokenPda)({
|
|
14695
14872
|
owner: tunaPosition.address,
|
|
14696
14873
|
mint: mintB.address,
|
|
14697
14874
|
tokenProgram: mintB.programAddress
|
|
14698
14875
|
}))[0];
|
|
14699
|
-
const feeRecipientAtaA = (await (0,
|
|
14876
|
+
const feeRecipientAtaA = (await (0, import_token_202240.findAssociatedTokenPda)({
|
|
14700
14877
|
owner: tunaConfig.data.feeRecipient,
|
|
14701
14878
|
mint: mintA.address,
|
|
14702
14879
|
tokenProgram: mintA.programAddress
|
|
14703
14880
|
}))[0];
|
|
14704
|
-
const feeRecipientAtaB = (await (0,
|
|
14881
|
+
const feeRecipientAtaB = (await (0, import_token_202240.findAssociatedTokenPda)({
|
|
14705
14882
|
owner: tunaConfig.data.feeRecipient,
|
|
14706
14883
|
mint: mintB.address,
|
|
14707
14884
|
tokenProgram: mintB.programAddress
|
|
@@ -14717,18 +14894,18 @@ async function rebalanceTunaLpPositionOrcaInstruction(authority, tunaPosition, t
|
|
|
14717
14894
|
);
|
|
14718
14895
|
const secondaryTickArrays = await OrcaUtils.getTickArraysForRebalancedPosition(whirlpool, tunaPosition);
|
|
14719
14896
|
const remainingAccounts = [
|
|
14720
|
-
{ address: swapTickArrays[0], role:
|
|
14721
|
-
{ address: swapTickArrays[1], role:
|
|
14722
|
-
{ address: swapTickArrays[2], role:
|
|
14723
|
-
{ address: swapTickArrays[3], role:
|
|
14724
|
-
{ address: swapTickArrays[4], role:
|
|
14725
|
-
{ address: lowerTickArrayAddress, role:
|
|
14726
|
-
{ address: upperTickArrayAddress, role:
|
|
14727
|
-
{ address: secondaryTickArrays.lowerTickArrayAddress, role:
|
|
14728
|
-
{ address: secondaryTickArrays.upperTickArrayAddress, role:
|
|
14729
|
-
{ address: whirlpool.data.tokenVaultA, role:
|
|
14730
|
-
{ address: whirlpool.data.tokenVaultB, role:
|
|
14731
|
-
{ address: orcaOracleAddress, role:
|
|
14897
|
+
{ address: swapTickArrays[0], role: import_kit103.AccountRole.WRITABLE },
|
|
14898
|
+
{ address: swapTickArrays[1], role: import_kit103.AccountRole.WRITABLE },
|
|
14899
|
+
{ address: swapTickArrays[2], role: import_kit103.AccountRole.WRITABLE },
|
|
14900
|
+
{ address: swapTickArrays[3], role: import_kit103.AccountRole.WRITABLE },
|
|
14901
|
+
{ address: swapTickArrays[4], role: import_kit103.AccountRole.WRITABLE },
|
|
14902
|
+
{ address: lowerTickArrayAddress, role: import_kit103.AccountRole.WRITABLE },
|
|
14903
|
+
{ address: upperTickArrayAddress, role: import_kit103.AccountRole.WRITABLE },
|
|
14904
|
+
{ address: secondaryTickArrays.lowerTickArrayAddress, role: import_kit103.AccountRole.WRITABLE },
|
|
14905
|
+
{ address: secondaryTickArrays.upperTickArrayAddress, role: import_kit103.AccountRole.WRITABLE },
|
|
14906
|
+
{ address: whirlpool.data.tokenVaultA, role: import_kit103.AccountRole.WRITABLE },
|
|
14907
|
+
{ address: whirlpool.data.tokenVaultB, role: import_kit103.AccountRole.WRITABLE },
|
|
14908
|
+
{ address: orcaOracleAddress, role: import_kit103.AccountRole.WRITABLE }
|
|
14732
14909
|
];
|
|
14733
14910
|
const remainingAccountsInfo = {
|
|
14734
14911
|
slices: [
|
|
@@ -14772,11 +14949,11 @@ async function rebalanceTunaLpPositionOrcaInstruction(authority, tunaPosition, t
|
|
|
14772
14949
|
|
|
14773
14950
|
// src/txbuilder/rebalanceTunaLpPositionFusion.ts
|
|
14774
14951
|
var import_fusionamm_client19 = require("@crypticdot/fusionamm-client");
|
|
14775
|
-
var
|
|
14952
|
+
var import_kit104 = require("@solana/kit");
|
|
14776
14953
|
var import_sysvars4 = require("@solana/sysvars");
|
|
14777
14954
|
var import_memo29 = require("@solana-program/memo");
|
|
14778
|
-
var
|
|
14779
|
-
var
|
|
14955
|
+
var import_token_202241 = require("@solana-program/token-2022");
|
|
14956
|
+
var import_assert31 = __toESM(require("assert"));
|
|
14780
14957
|
async function rebalanceTunaLpPositionFusionInstructions(rpc, authority, positionMint, createInstructions, cleanupInstructions) {
|
|
14781
14958
|
const rent = await (0, import_sysvars4.fetchSysvarRent)(rpc);
|
|
14782
14959
|
let nonRefundableRent = 0n;
|
|
@@ -14789,9 +14966,9 @@ async function rebalanceTunaLpPositionFusionInstructions(rpc, authority, positio
|
|
|
14789
14966
|
(await getLendingVaultAddress(fusionPool.data.tokenMintA))[0],
|
|
14790
14967
|
(await getLendingVaultAddress(fusionPool.data.tokenMintB))[0]
|
|
14791
14968
|
]);
|
|
14792
|
-
const [mintA, mintB] = await (0,
|
|
14793
|
-
(0,
|
|
14794
|
-
(0,
|
|
14969
|
+
const [mintA, mintB] = await (0, import_token_202241.fetchAllMaybeMint)(rpc, [fusionPool.data.tokenMintA, fusionPool.data.tokenMintB]);
|
|
14970
|
+
(0, import_assert31.default)(mintA.exists, "Token A account not found");
|
|
14971
|
+
(0, import_assert31.default)(mintB.exists, "Token B account not found");
|
|
14795
14972
|
const instructions = [];
|
|
14796
14973
|
if (!createInstructions) createInstructions = instructions;
|
|
14797
14974
|
if (!cleanupInstructions) cleanupInstructions = instructions;
|
|
@@ -14851,34 +15028,34 @@ async function rebalanceTunaLpPositionFusionInstructions(rpc, authority, positio
|
|
|
14851
15028
|
instructions.push(ix);
|
|
14852
15029
|
return {
|
|
14853
15030
|
instructions,
|
|
14854
|
-
initializationCost: (0,
|
|
15031
|
+
initializationCost: (0, import_kit104.lamports)(nonRefundableRent)
|
|
14855
15032
|
};
|
|
14856
15033
|
}
|
|
14857
15034
|
async function rebalanceTunaLpPositionFusionInstruction(authority, tunaPosition, tunaConfig, mintA, mintB, vaultA, vaultB, fusionPool) {
|
|
14858
15035
|
const positionMint = tunaPosition.data.positionMint;
|
|
14859
15036
|
const marketAddress = (await getMarketAddress(fusionPool.address))[0];
|
|
14860
15037
|
const fusionPositionAddress = (await (0, import_fusionamm_client19.getPositionAddress)(positionMint))[0];
|
|
14861
|
-
const tunaPositionAta = (await (0,
|
|
15038
|
+
const tunaPositionAta = (await (0, import_token_202241.findAssociatedTokenPda)({
|
|
14862
15039
|
owner: tunaPosition.address,
|
|
14863
15040
|
mint: positionMint,
|
|
14864
|
-
tokenProgram:
|
|
15041
|
+
tokenProgram: import_token_202241.TOKEN_2022_PROGRAM_ADDRESS
|
|
14865
15042
|
}))[0];
|
|
14866
|
-
const tunaPositionAtaA = (await (0,
|
|
15043
|
+
const tunaPositionAtaA = (await (0, import_token_202241.findAssociatedTokenPda)({
|
|
14867
15044
|
owner: tunaPosition.address,
|
|
14868
15045
|
mint: mintA.address,
|
|
14869
15046
|
tokenProgram: mintA.programAddress
|
|
14870
15047
|
}))[0];
|
|
14871
|
-
const tunaPositionAtaB = (await (0,
|
|
15048
|
+
const tunaPositionAtaB = (await (0, import_token_202241.findAssociatedTokenPda)({
|
|
14872
15049
|
owner: tunaPosition.address,
|
|
14873
15050
|
mint: mintB.address,
|
|
14874
15051
|
tokenProgram: mintB.programAddress
|
|
14875
15052
|
}))[0];
|
|
14876
|
-
const feeRecipientAtaA = (await (0,
|
|
15053
|
+
const feeRecipientAtaA = (await (0, import_token_202241.findAssociatedTokenPda)({
|
|
14877
15054
|
owner: tunaConfig.data.feeRecipient,
|
|
14878
15055
|
mint: mintA.address,
|
|
14879
15056
|
tokenProgram: mintA.programAddress
|
|
14880
15057
|
}))[0];
|
|
14881
|
-
const feeRecipientAtaB = (await (0,
|
|
15058
|
+
const feeRecipientAtaB = (await (0, import_token_202241.findAssociatedTokenPda)({
|
|
14882
15059
|
owner: tunaConfig.data.feeRecipient,
|
|
14883
15060
|
mint: mintB.address,
|
|
14884
15061
|
tokenProgram: mintB.programAddress
|
|
@@ -14894,17 +15071,17 @@ async function rebalanceTunaLpPositionFusionInstruction(authority, tunaPosition,
|
|
|
14894
15071
|
);
|
|
14895
15072
|
const secondaryTickArrays = await FusionUtils.getTickArraysForRebalancedPosition(fusionPool, tunaPosition);
|
|
14896
15073
|
const remainingAccounts = [
|
|
14897
|
-
{ address: swapTickArrays[0], role:
|
|
14898
|
-
{ address: swapTickArrays[1], role:
|
|
14899
|
-
{ address: swapTickArrays[2], role:
|
|
14900
|
-
{ address: swapTickArrays[3], role:
|
|
14901
|
-
{ address: swapTickArrays[4], role:
|
|
14902
|
-
{ address: lowerTickArrayAddress, role:
|
|
14903
|
-
{ address: upperTickArrayAddress, role:
|
|
14904
|
-
{ address: secondaryTickArrays.lowerTickArrayAddress, role:
|
|
14905
|
-
{ address: secondaryTickArrays.upperTickArrayAddress, role:
|
|
14906
|
-
{ address: fusionPool.data.tokenVaultA, role:
|
|
14907
|
-
{ address: fusionPool.data.tokenVaultB, role:
|
|
15074
|
+
{ address: swapTickArrays[0], role: import_kit104.AccountRole.WRITABLE },
|
|
15075
|
+
{ address: swapTickArrays[1], role: import_kit104.AccountRole.WRITABLE },
|
|
15076
|
+
{ address: swapTickArrays[2], role: import_kit104.AccountRole.WRITABLE },
|
|
15077
|
+
{ address: swapTickArrays[3], role: import_kit104.AccountRole.WRITABLE },
|
|
15078
|
+
{ address: swapTickArrays[4], role: import_kit104.AccountRole.WRITABLE },
|
|
15079
|
+
{ address: lowerTickArrayAddress, role: import_kit104.AccountRole.WRITABLE },
|
|
15080
|
+
{ address: upperTickArrayAddress, role: import_kit104.AccountRole.WRITABLE },
|
|
15081
|
+
{ address: secondaryTickArrays.lowerTickArrayAddress, role: import_kit104.AccountRole.WRITABLE },
|
|
15082
|
+
{ address: secondaryTickArrays.upperTickArrayAddress, role: import_kit104.AccountRole.WRITABLE },
|
|
15083
|
+
{ address: fusionPool.data.tokenVaultA, role: import_kit104.AccountRole.WRITABLE },
|
|
15084
|
+
{ address: fusionPool.data.tokenVaultB, role: import_kit104.AccountRole.WRITABLE }
|
|
14908
15085
|
];
|
|
14909
15086
|
const remainingAccountsInfo = {
|
|
14910
15087
|
slices: [
|
|
@@ -15008,6 +15185,7 @@ async function rebalanceTunaLpPositionFusionInstruction(authority, tunaPosition,
|
|
|
15008
15185
|
REBALANCE_TUNA_LP_POSITION_ORCA_DISCRIMINATOR,
|
|
15009
15186
|
REPAY_BAD_DEBT_DISCRIMINATOR,
|
|
15010
15187
|
REPAY_TUNA_LP_POSITION_DEBT_DISCRIMINATOR,
|
|
15188
|
+
RESET_TUNA_SPOT_POSITION_DISCRIMINATOR,
|
|
15011
15189
|
SET_ADMIN_AUTHORITY_DISCRIMINATOR,
|
|
15012
15190
|
SET_DEFAULT_MAX_PERCENTAGE_OF_LEFTOVERS_DISCRIMINATOR,
|
|
15013
15191
|
SET_DEFAULT_MAX_SWAP_SLIPPAGE_DISCRIMINATOR,
|
|
@@ -15395,6 +15573,11 @@ async function rebalanceTunaLpPositionFusionInstruction(authority, tunaPosition,
|
|
|
15395
15573
|
getRepayTunaLpPositionDebtInstructionDataCodec,
|
|
15396
15574
|
getRepayTunaLpPositionDebtInstructionDataDecoder,
|
|
15397
15575
|
getRepayTunaLpPositionDebtInstructionDataEncoder,
|
|
15576
|
+
getResetTunaSpotPositionDiscriminatorBytes,
|
|
15577
|
+
getResetTunaSpotPositionInstruction,
|
|
15578
|
+
getResetTunaSpotPositionInstructionDataCodec,
|
|
15579
|
+
getResetTunaSpotPositionInstructionDataDecoder,
|
|
15580
|
+
getResetTunaSpotPositionInstructionDataEncoder,
|
|
15398
15581
|
getSetAdminAuthorityDiscriminatorBytes,
|
|
15399
15582
|
getSetAdminAuthorityInstruction,
|
|
15400
15583
|
getSetAdminAuthorityInstructionDataCodec,
|
|
@@ -15573,6 +15756,7 @@ async function rebalanceTunaLpPositionFusionInstruction(authority, tunaPosition,
|
|
|
15573
15756
|
parseRebalanceTunaLpPositionOrcaInstruction,
|
|
15574
15757
|
parseRepayBadDebtInstruction,
|
|
15575
15758
|
parseRepayTunaLpPositionDebtInstruction,
|
|
15759
|
+
parseResetTunaSpotPositionInstruction,
|
|
15576
15760
|
parseSetAdminAuthorityInstruction,
|
|
15577
15761
|
parseSetDefaultMaxPercentageOfLeftoversInstruction,
|
|
15578
15762
|
parseSetDefaultMaxSwapSlippageInstruction,
|
|
@@ -15595,7 +15779,9 @@ async function rebalanceTunaLpPositionFusionInstruction(authority, tunaPosition,
|
|
|
15595
15779
|
repayBadDebtInstruction,
|
|
15596
15780
|
repayTunaLpPositionDebtInstruction,
|
|
15597
15781
|
repayTunaLpPositionDebtInstructions,
|
|
15782
|
+
resetTunaSpotPositionInstruction,
|
|
15598
15783
|
setTunaLpPositionLimitOrdersInstruction,
|
|
15784
|
+
setTunaSpotPositionLimitOrdersInstruction,
|
|
15599
15785
|
tunaLpPositionAuthorityFilter,
|
|
15600
15786
|
tunaLpPositionMarketMakerFilter,
|
|
15601
15787
|
tunaLpPositionMintAFilter,
|