@crypticdot/defituna-client 3.2.6 → 3.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +51 -158
- package/dist/index.d.ts +51 -158
- package/dist/index.js +672 -851
- package/dist/index.mjs +515 -696
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -88,8 +88,7 @@ __export(index_exports, {
|
|
|
88
88
|
OPEN_LENDING_POSITION_DISCRIMINATOR: () => OPEN_LENDING_POSITION_DISCRIMINATOR,
|
|
89
89
|
OPEN_TUNA_LP_POSITION_FUSION_DISCRIMINATOR: () => OPEN_TUNA_LP_POSITION_FUSION_DISCRIMINATOR,
|
|
90
90
|
OPEN_TUNA_LP_POSITION_ORCA_DISCRIMINATOR: () => OPEN_TUNA_LP_POSITION_ORCA_DISCRIMINATOR,
|
|
91
|
-
|
|
92
|
-
OPEN_TUNA_SPOT_POSITION_ORCA_DISCRIMINATOR: () => OPEN_TUNA_SPOT_POSITION_ORCA_DISCRIMINATOR,
|
|
91
|
+
OPEN_TUNA_SPOT_POSITION_DISCRIMINATOR: () => OPEN_TUNA_SPOT_POSITION_DISCRIMINATOR,
|
|
93
92
|
OrcaUtils: () => OrcaUtils,
|
|
94
93
|
PoolToken: () => PoolToken,
|
|
95
94
|
REBALANCE_TUNA_LP_POSITION_FUSION_DISCRIMINATOR: () => REBALANCE_TUNA_LP_POSITION_FUSION_DISCRIMINATOR,
|
|
@@ -123,6 +122,7 @@ __export(index_exports, {
|
|
|
123
122
|
TUNA_ERROR__INVALID_INSTRUCTION_ARGUMENTS: () => TUNA_ERROR__INVALID_INSTRUCTION_ARGUMENTS,
|
|
124
123
|
TUNA_ERROR__INVALID_JUPITER_ROUTE: () => TUNA_ERROR__INVALID_JUPITER_ROUTE,
|
|
125
124
|
TUNA_ERROR__INVALID_MARKET_MAKER: () => TUNA_ERROR__INVALID_MARKET_MAKER,
|
|
125
|
+
TUNA_ERROR__INVALID_POOL: () => TUNA_ERROR__INVALID_POOL,
|
|
126
126
|
TUNA_ERROR__INVALID_REMAINING_ACCOUNTS_LENGTH: () => TUNA_ERROR__INVALID_REMAINING_ACCOUNTS_LENGTH,
|
|
127
127
|
TUNA_ERROR__INVALID_SQRT_PRICE_LIMIT_DIRECTION: () => TUNA_ERROR__INVALID_SQRT_PRICE_LIMIT_DIRECTION,
|
|
128
128
|
TUNA_ERROR__INVALID_TICK_ARRAY_SEQUENCE: () => TUNA_ERROR__INVALID_TICK_ARRAY_SEQUENCE,
|
|
@@ -464,16 +464,11 @@ __export(index_exports, {
|
|
|
464
464
|
getOpenTunaLpPositionOrcaInstructionDataCodec: () => getOpenTunaLpPositionOrcaInstructionDataCodec,
|
|
465
465
|
getOpenTunaLpPositionOrcaInstructionDataDecoder: () => getOpenTunaLpPositionOrcaInstructionDataDecoder,
|
|
466
466
|
getOpenTunaLpPositionOrcaInstructionDataEncoder: () => getOpenTunaLpPositionOrcaInstructionDataEncoder,
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
getOpenTunaSpotPositionOrcaDiscriminatorBytes: () => getOpenTunaSpotPositionOrcaDiscriminatorBytes,
|
|
473
|
-
getOpenTunaSpotPositionOrcaInstruction: () => getOpenTunaSpotPositionOrcaInstruction,
|
|
474
|
-
getOpenTunaSpotPositionOrcaInstructionDataCodec: () => getOpenTunaSpotPositionOrcaInstructionDataCodec,
|
|
475
|
-
getOpenTunaSpotPositionOrcaInstructionDataDecoder: () => getOpenTunaSpotPositionOrcaInstructionDataDecoder,
|
|
476
|
-
getOpenTunaSpotPositionOrcaInstructionDataEncoder: () => getOpenTunaSpotPositionOrcaInstructionDataEncoder,
|
|
467
|
+
getOpenTunaSpotPositionDiscriminatorBytes: () => getOpenTunaSpotPositionDiscriminatorBytes,
|
|
468
|
+
getOpenTunaSpotPositionInstruction: () => getOpenTunaSpotPositionInstruction,
|
|
469
|
+
getOpenTunaSpotPositionInstructionDataCodec: () => getOpenTunaSpotPositionInstructionDataCodec,
|
|
470
|
+
getOpenTunaSpotPositionInstructionDataDecoder: () => getOpenTunaSpotPositionInstructionDataDecoder,
|
|
471
|
+
getOpenTunaSpotPositionInstructionDataEncoder: () => getOpenTunaSpotPositionInstructionDataEncoder,
|
|
477
472
|
getPoolTokenCodec: () => getPoolTokenCodec,
|
|
478
473
|
getPoolTokenDecoder: () => getPoolTokenDecoder,
|
|
479
474
|
getPoolTokenEncoder: () => getPoolTokenEncoder,
|
|
@@ -647,10 +642,8 @@ __export(index_exports, {
|
|
|
647
642
|
openLendingPositionInstruction: () => openLendingPositionInstruction,
|
|
648
643
|
openTunaLpPositionFusionInstruction: () => openTunaLpPositionFusionInstruction,
|
|
649
644
|
openTunaLpPositionOrcaInstruction: () => openTunaLpPositionOrcaInstruction,
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
openTunaSpotPositionOrcaInstruction: () => openTunaSpotPositionOrcaInstruction,
|
|
653
|
-
openTunaSpotPositionOrcaInstructions: () => openTunaSpotPositionOrcaInstructions,
|
|
645
|
+
openTunaSpotPositionInstruction: () => openTunaSpotPositionInstruction,
|
|
646
|
+
openTunaSpotPositionInstructions: () => openTunaSpotPositionInstructions,
|
|
654
647
|
parseCloseActiveTunaSpotPositionFusionInstruction: () => parseCloseActiveTunaSpotPositionFusionInstruction,
|
|
655
648
|
parseCloseActiveTunaSpotPositionOrcaInstruction: () => parseCloseActiveTunaSpotPositionOrcaInstruction,
|
|
656
649
|
parseCloseTunaLpPositionFusionInstruction: () => parseCloseTunaLpPositionFusionInstruction,
|
|
@@ -686,8 +679,7 @@ __export(index_exports, {
|
|
|
686
679
|
parseOpenLendingPositionInstruction: () => parseOpenLendingPositionInstruction,
|
|
687
680
|
parseOpenTunaLpPositionFusionInstruction: () => parseOpenTunaLpPositionFusionInstruction,
|
|
688
681
|
parseOpenTunaLpPositionOrcaInstruction: () => parseOpenTunaLpPositionOrcaInstruction,
|
|
689
|
-
|
|
690
|
-
parseOpenTunaSpotPositionOrcaInstruction: () => parseOpenTunaSpotPositionOrcaInstruction,
|
|
682
|
+
parseOpenTunaSpotPositionInstruction: () => parseOpenTunaSpotPositionInstruction,
|
|
691
683
|
parseRebalanceTunaLpPositionFusionInstruction: () => parseRebalanceTunaLpPositionFusionInstruction,
|
|
692
684
|
parseRebalanceTunaLpPositionOrcaInstruction: () => parseRebalanceTunaLpPositionOrcaInstruction,
|
|
693
685
|
parseRepayBadDebtInstruction: () => parseRepayBadDebtInstruction,
|
|
@@ -1557,28 +1549,27 @@ var TunaInstruction = /* @__PURE__ */ ((TunaInstruction2) => {
|
|
|
1557
1549
|
TunaInstruction2[TunaInstruction2["OpenLendingPosition"] = 32] = "OpenLendingPosition";
|
|
1558
1550
|
TunaInstruction2[TunaInstruction2["OpenTunaLpPositionFusion"] = 33] = "OpenTunaLpPositionFusion";
|
|
1559
1551
|
TunaInstruction2[TunaInstruction2["OpenTunaLpPositionOrca"] = 34] = "OpenTunaLpPositionOrca";
|
|
1560
|
-
TunaInstruction2[TunaInstruction2["
|
|
1561
|
-
TunaInstruction2[TunaInstruction2["
|
|
1562
|
-
TunaInstruction2[TunaInstruction2["
|
|
1563
|
-
TunaInstruction2[TunaInstruction2["
|
|
1564
|
-
TunaInstruction2[TunaInstruction2["
|
|
1565
|
-
TunaInstruction2[TunaInstruction2["
|
|
1566
|
-
TunaInstruction2[TunaInstruction2["
|
|
1567
|
-
TunaInstruction2[TunaInstruction2["
|
|
1568
|
-
TunaInstruction2[TunaInstruction2["
|
|
1569
|
-
TunaInstruction2[TunaInstruction2["
|
|
1570
|
-
TunaInstruction2[TunaInstruction2["
|
|
1571
|
-
TunaInstruction2[TunaInstruction2["
|
|
1572
|
-
TunaInstruction2[TunaInstruction2["
|
|
1573
|
-
TunaInstruction2[TunaInstruction2["
|
|
1574
|
-
TunaInstruction2[TunaInstruction2["
|
|
1575
|
-
TunaInstruction2[TunaInstruction2["
|
|
1576
|
-
TunaInstruction2[TunaInstruction2["
|
|
1577
|
-
TunaInstruction2[TunaInstruction2["
|
|
1578
|
-
TunaInstruction2[TunaInstruction2["
|
|
1579
|
-
TunaInstruction2[TunaInstruction2["
|
|
1580
|
-
TunaInstruction2[TunaInstruction2["
|
|
1581
|
-
TunaInstruction2[TunaInstruction2["Withdraw"] = 56] = "Withdraw";
|
|
1552
|
+
TunaInstruction2[TunaInstruction2["OpenTunaSpotPosition"] = 35] = "OpenTunaSpotPosition";
|
|
1553
|
+
TunaInstruction2[TunaInstruction2["RebalanceTunaLpPositionFusion"] = 36] = "RebalanceTunaLpPositionFusion";
|
|
1554
|
+
TunaInstruction2[TunaInstruction2["RebalanceTunaLpPositionOrca"] = 37] = "RebalanceTunaLpPositionOrca";
|
|
1555
|
+
TunaInstruction2[TunaInstruction2["RepayBadDebt"] = 38] = "RepayBadDebt";
|
|
1556
|
+
TunaInstruction2[TunaInstruction2["RepayTunaLpPositionDebt"] = 39] = "RepayTunaLpPositionDebt";
|
|
1557
|
+
TunaInstruction2[TunaInstruction2["ResetTunaSpotPosition"] = 40] = "ResetTunaSpotPosition";
|
|
1558
|
+
TunaInstruction2[TunaInstruction2["SetAdminAuthority"] = 41] = "SetAdminAuthority";
|
|
1559
|
+
TunaInstruction2[TunaInstruction2["SetDefaultMaxPercentageOfLeftovers"] = 42] = "SetDefaultMaxPercentageOfLeftovers";
|
|
1560
|
+
TunaInstruction2[TunaInstruction2["SetDefaultMaxSwapSlippage"] = 43] = "SetDefaultMaxSwapSlippage";
|
|
1561
|
+
TunaInstruction2[TunaInstruction2["SetDefaultOraclePriceDeviationThreshold"] = 44] = "SetDefaultOraclePriceDeviationThreshold";
|
|
1562
|
+
TunaInstruction2[TunaInstruction2["SetFeeRecipient"] = 45] = "SetFeeRecipient";
|
|
1563
|
+
TunaInstruction2[TunaInstruction2["SetLiquidatorAuthority"] = 46] = "SetLiquidatorAuthority";
|
|
1564
|
+
TunaInstruction2[TunaInstruction2["SetOwnerAuthority"] = 47] = "SetOwnerAuthority";
|
|
1565
|
+
TunaInstruction2[TunaInstruction2["SetSuspendedState"] = 48] = "SetSuspendedState";
|
|
1566
|
+
TunaInstruction2[TunaInstruction2["SetTunaLpPositionFlags"] = 49] = "SetTunaLpPositionFlags";
|
|
1567
|
+
TunaInstruction2[TunaInstruction2["SetTunaLpPositionLimitOrders"] = 50] = "SetTunaLpPositionLimitOrders";
|
|
1568
|
+
TunaInstruction2[TunaInstruction2["SetTunaLpPositionRebalanceThreshold"] = 51] = "SetTunaLpPositionRebalanceThreshold";
|
|
1569
|
+
TunaInstruction2[TunaInstruction2["SetTunaSpotPositionLimitOrders"] = 52] = "SetTunaSpotPositionLimitOrders";
|
|
1570
|
+
TunaInstruction2[TunaInstruction2["UpdateMarket"] = 53] = "UpdateMarket";
|
|
1571
|
+
TunaInstruction2[TunaInstruction2["UpdateVault"] = 54] = "UpdateVault";
|
|
1572
|
+
TunaInstruction2[TunaInstruction2["Withdraw"] = 55] = "Withdraw";
|
|
1582
1573
|
return TunaInstruction2;
|
|
1583
1574
|
})(TunaInstruction || {});
|
|
1584
1575
|
function identifyTunaInstruction(instruction) {
|
|
@@ -1901,20 +1892,11 @@ function identifyTunaInstruction(instruction) {
|
|
|
1901
1892
|
if ((0, import_kit13.containsBytes)(
|
|
1902
1893
|
data,
|
|
1903
1894
|
(0, import_kit13.fixEncoderSize)((0, import_kit13.getBytesEncoder)(), 8).encode(
|
|
1904
|
-
new Uint8Array([
|
|
1895
|
+
new Uint8Array([87, 208, 173, 48, 231, 62, 210, 220])
|
|
1905
1896
|
),
|
|
1906
1897
|
0
|
|
1907
1898
|
)) {
|
|
1908
|
-
return 35 /*
|
|
1909
|
-
}
|
|
1910
|
-
if ((0, import_kit13.containsBytes)(
|
|
1911
|
-
data,
|
|
1912
|
-
(0, import_kit13.fixEncoderSize)((0, import_kit13.getBytesEncoder)(), 8).encode(
|
|
1913
|
-
new Uint8Array([90, 70, 21, 186, 147, 80, 191, 94])
|
|
1914
|
-
),
|
|
1915
|
-
0
|
|
1916
|
-
)) {
|
|
1917
|
-
return 36 /* OpenTunaSpotPositionOrca */;
|
|
1899
|
+
return 35 /* OpenTunaSpotPosition */;
|
|
1918
1900
|
}
|
|
1919
1901
|
if ((0, import_kit13.containsBytes)(
|
|
1920
1902
|
data,
|
|
@@ -1923,7 +1905,7 @@ function identifyTunaInstruction(instruction) {
|
|
|
1923
1905
|
),
|
|
1924
1906
|
0
|
|
1925
1907
|
)) {
|
|
1926
|
-
return
|
|
1908
|
+
return 36 /* RebalanceTunaLpPositionFusion */;
|
|
1927
1909
|
}
|
|
1928
1910
|
if ((0, import_kit13.containsBytes)(
|
|
1929
1911
|
data,
|
|
@@ -1932,7 +1914,7 @@ function identifyTunaInstruction(instruction) {
|
|
|
1932
1914
|
),
|
|
1933
1915
|
0
|
|
1934
1916
|
)) {
|
|
1935
|
-
return
|
|
1917
|
+
return 37 /* RebalanceTunaLpPositionOrca */;
|
|
1936
1918
|
}
|
|
1937
1919
|
if ((0, import_kit13.containsBytes)(
|
|
1938
1920
|
data,
|
|
@@ -1941,7 +1923,7 @@ function identifyTunaInstruction(instruction) {
|
|
|
1941
1923
|
),
|
|
1942
1924
|
0
|
|
1943
1925
|
)) {
|
|
1944
|
-
return
|
|
1926
|
+
return 38 /* RepayBadDebt */;
|
|
1945
1927
|
}
|
|
1946
1928
|
if ((0, import_kit13.containsBytes)(
|
|
1947
1929
|
data,
|
|
@@ -1950,7 +1932,7 @@ function identifyTunaInstruction(instruction) {
|
|
|
1950
1932
|
),
|
|
1951
1933
|
0
|
|
1952
1934
|
)) {
|
|
1953
|
-
return
|
|
1935
|
+
return 39 /* RepayTunaLpPositionDebt */;
|
|
1954
1936
|
}
|
|
1955
1937
|
if ((0, import_kit13.containsBytes)(
|
|
1956
1938
|
data,
|
|
@@ -1959,7 +1941,7 @@ function identifyTunaInstruction(instruction) {
|
|
|
1959
1941
|
),
|
|
1960
1942
|
0
|
|
1961
1943
|
)) {
|
|
1962
|
-
return
|
|
1944
|
+
return 40 /* ResetTunaSpotPosition */;
|
|
1963
1945
|
}
|
|
1964
1946
|
if ((0, import_kit13.containsBytes)(
|
|
1965
1947
|
data,
|
|
@@ -1968,7 +1950,7 @@ function identifyTunaInstruction(instruction) {
|
|
|
1968
1950
|
),
|
|
1969
1951
|
0
|
|
1970
1952
|
)) {
|
|
1971
|
-
return
|
|
1953
|
+
return 41 /* SetAdminAuthority */;
|
|
1972
1954
|
}
|
|
1973
1955
|
if ((0, import_kit13.containsBytes)(
|
|
1974
1956
|
data,
|
|
@@ -1977,7 +1959,7 @@ function identifyTunaInstruction(instruction) {
|
|
|
1977
1959
|
),
|
|
1978
1960
|
0
|
|
1979
1961
|
)) {
|
|
1980
|
-
return
|
|
1962
|
+
return 42 /* SetDefaultMaxPercentageOfLeftovers */;
|
|
1981
1963
|
}
|
|
1982
1964
|
if ((0, import_kit13.containsBytes)(
|
|
1983
1965
|
data,
|
|
@@ -1986,7 +1968,7 @@ function identifyTunaInstruction(instruction) {
|
|
|
1986
1968
|
),
|
|
1987
1969
|
0
|
|
1988
1970
|
)) {
|
|
1989
|
-
return
|
|
1971
|
+
return 43 /* SetDefaultMaxSwapSlippage */;
|
|
1990
1972
|
}
|
|
1991
1973
|
if ((0, import_kit13.containsBytes)(
|
|
1992
1974
|
data,
|
|
@@ -1995,7 +1977,7 @@ function identifyTunaInstruction(instruction) {
|
|
|
1995
1977
|
),
|
|
1996
1978
|
0
|
|
1997
1979
|
)) {
|
|
1998
|
-
return
|
|
1980
|
+
return 44 /* SetDefaultOraclePriceDeviationThreshold */;
|
|
1999
1981
|
}
|
|
2000
1982
|
if ((0, import_kit13.containsBytes)(
|
|
2001
1983
|
data,
|
|
@@ -2004,7 +1986,7 @@ function identifyTunaInstruction(instruction) {
|
|
|
2004
1986
|
),
|
|
2005
1987
|
0
|
|
2006
1988
|
)) {
|
|
2007
|
-
return
|
|
1989
|
+
return 45 /* SetFeeRecipient */;
|
|
2008
1990
|
}
|
|
2009
1991
|
if ((0, import_kit13.containsBytes)(
|
|
2010
1992
|
data,
|
|
@@ -2013,7 +1995,7 @@ function identifyTunaInstruction(instruction) {
|
|
|
2013
1995
|
),
|
|
2014
1996
|
0
|
|
2015
1997
|
)) {
|
|
2016
|
-
return
|
|
1998
|
+
return 46 /* SetLiquidatorAuthority */;
|
|
2017
1999
|
}
|
|
2018
2000
|
if ((0, import_kit13.containsBytes)(
|
|
2019
2001
|
data,
|
|
@@ -2022,7 +2004,7 @@ function identifyTunaInstruction(instruction) {
|
|
|
2022
2004
|
),
|
|
2023
2005
|
0
|
|
2024
2006
|
)) {
|
|
2025
|
-
return
|
|
2007
|
+
return 47 /* SetOwnerAuthority */;
|
|
2026
2008
|
}
|
|
2027
2009
|
if ((0, import_kit13.containsBytes)(
|
|
2028
2010
|
data,
|
|
@@ -2031,7 +2013,7 @@ function identifyTunaInstruction(instruction) {
|
|
|
2031
2013
|
),
|
|
2032
2014
|
0
|
|
2033
2015
|
)) {
|
|
2034
|
-
return
|
|
2016
|
+
return 48 /* SetSuspendedState */;
|
|
2035
2017
|
}
|
|
2036
2018
|
if ((0, import_kit13.containsBytes)(
|
|
2037
2019
|
data,
|
|
@@ -2040,7 +2022,7 @@ function identifyTunaInstruction(instruction) {
|
|
|
2040
2022
|
),
|
|
2041
2023
|
0
|
|
2042
2024
|
)) {
|
|
2043
|
-
return
|
|
2025
|
+
return 49 /* SetTunaLpPositionFlags */;
|
|
2044
2026
|
}
|
|
2045
2027
|
if ((0, import_kit13.containsBytes)(
|
|
2046
2028
|
data,
|
|
@@ -2049,7 +2031,7 @@ function identifyTunaInstruction(instruction) {
|
|
|
2049
2031
|
),
|
|
2050
2032
|
0
|
|
2051
2033
|
)) {
|
|
2052
|
-
return
|
|
2034
|
+
return 50 /* SetTunaLpPositionLimitOrders */;
|
|
2053
2035
|
}
|
|
2054
2036
|
if ((0, import_kit13.containsBytes)(
|
|
2055
2037
|
data,
|
|
@@ -2058,7 +2040,7 @@ function identifyTunaInstruction(instruction) {
|
|
|
2058
2040
|
),
|
|
2059
2041
|
0
|
|
2060
2042
|
)) {
|
|
2061
|
-
return
|
|
2043
|
+
return 51 /* SetTunaLpPositionRebalanceThreshold */;
|
|
2062
2044
|
}
|
|
2063
2045
|
if ((0, import_kit13.containsBytes)(
|
|
2064
2046
|
data,
|
|
@@ -2067,7 +2049,7 @@ function identifyTunaInstruction(instruction) {
|
|
|
2067
2049
|
),
|
|
2068
2050
|
0
|
|
2069
2051
|
)) {
|
|
2070
|
-
return
|
|
2052
|
+
return 52 /* SetTunaSpotPositionLimitOrders */;
|
|
2071
2053
|
}
|
|
2072
2054
|
if ((0, import_kit13.containsBytes)(
|
|
2073
2055
|
data,
|
|
@@ -2076,7 +2058,7 @@ function identifyTunaInstruction(instruction) {
|
|
|
2076
2058
|
),
|
|
2077
2059
|
0
|
|
2078
2060
|
)) {
|
|
2079
|
-
return
|
|
2061
|
+
return 53 /* UpdateMarket */;
|
|
2080
2062
|
}
|
|
2081
2063
|
if ((0, import_kit13.containsBytes)(
|
|
2082
2064
|
data,
|
|
@@ -2085,7 +2067,7 @@ function identifyTunaInstruction(instruction) {
|
|
|
2085
2067
|
),
|
|
2086
2068
|
0
|
|
2087
2069
|
)) {
|
|
2088
|
-
return
|
|
2070
|
+
return 54 /* UpdateVault */;
|
|
2089
2071
|
}
|
|
2090
2072
|
if ((0, import_kit13.containsBytes)(
|
|
2091
2073
|
data,
|
|
@@ -2094,7 +2076,7 @@ function identifyTunaInstruction(instruction) {
|
|
|
2094
2076
|
),
|
|
2095
2077
|
0
|
|
2096
2078
|
)) {
|
|
2097
|
-
return
|
|
2079
|
+
return 55 /* Withdraw */;
|
|
2098
2080
|
}
|
|
2099
2081
|
throw new Error(
|
|
2100
2082
|
"The provided instruction could not be identified as a tuna instruction."
|
|
@@ -2169,6 +2151,7 @@ var TUNA_ERROR__INCORRECT_SWAP_INPUT_AMOUNT = 6063;
|
|
|
2169
2151
|
var TUNA_ERROR__INSUFFICIENT_SWAP_OUTPUT_AMOUNT = 6064;
|
|
2170
2152
|
var TUNA_ERROR__ACCOUNT_NOT_INITIALIZED = 6065;
|
|
2171
2153
|
var TUNA_ERROR__INVALID_ACCOUNT_DISCRIMINATOR = 6066;
|
|
2154
|
+
var TUNA_ERROR__INVALID_POOL = 6067;
|
|
2172
2155
|
var tunaErrorMessages;
|
|
2173
2156
|
if (process.env.NODE_ENV !== "production") {
|
|
2174
2157
|
tunaErrorMessages = {
|
|
@@ -2185,6 +2168,7 @@ if (process.env.NODE_ENV !== "production") {
|
|
|
2185
2168
|
[TUNA_ERROR__INVALID_INSTRUCTION_ARGUMENTS]: `Invalid instruction arguments`,
|
|
2186
2169
|
[TUNA_ERROR__INVALID_JUPITER_ROUTE]: `Invalid jupiter route data`,
|
|
2187
2170
|
[TUNA_ERROR__INVALID_MARKET_MAKER]: `Invalid market maker`,
|
|
2171
|
+
[TUNA_ERROR__INVALID_POOL]: `Invalid Fusion or Orca pool`,
|
|
2188
2172
|
[TUNA_ERROR__INVALID_REMAINING_ACCOUNTS_LENGTH]: `Invalid number of remaining accounts`,
|
|
2189
2173
|
[TUNA_ERROR__INVALID_SQRT_PRICE_LIMIT_DIRECTION]: `Provided SqrtPriceLimit not in the same direction as the swap.`,
|
|
2190
2174
|
[TUNA_ERROR__INVALID_TICK_ARRAY_SEQUENCE]: `Invalid tick array sequence provided for instruction`,
|
|
@@ -7959,24 +7943,24 @@ function parseOpenTunaLpPositionOrcaInstruction(instruction) {
|
|
|
7959
7943
|
};
|
|
7960
7944
|
}
|
|
7961
7945
|
|
|
7962
|
-
// src/generated/instructions/
|
|
7946
|
+
// src/generated/instructions/openTunaSpotPosition.ts
|
|
7963
7947
|
var import_kit51 = require("@solana/kit");
|
|
7964
|
-
var
|
|
7965
|
-
|
|
7966
|
-
|
|
7967
|
-
|
|
7968
|
-
|
|
7969
|
-
|
|
7970
|
-
|
|
7971
|
-
|
|
7972
|
-
|
|
7948
|
+
var OPEN_TUNA_SPOT_POSITION_DISCRIMINATOR = new Uint8Array([
|
|
7949
|
+
87,
|
|
7950
|
+
208,
|
|
7951
|
+
173,
|
|
7952
|
+
48,
|
|
7953
|
+
231,
|
|
7954
|
+
62,
|
|
7955
|
+
210,
|
|
7956
|
+
220
|
|
7973
7957
|
]);
|
|
7974
|
-
function
|
|
7958
|
+
function getOpenTunaSpotPositionDiscriminatorBytes() {
|
|
7975
7959
|
return (0, import_kit51.fixEncoderSize)((0, import_kit51.getBytesEncoder)(), 8).encode(
|
|
7976
|
-
|
|
7960
|
+
OPEN_TUNA_SPOT_POSITION_DISCRIMINATOR
|
|
7977
7961
|
);
|
|
7978
7962
|
}
|
|
7979
|
-
function
|
|
7963
|
+
function getOpenTunaSpotPositionInstructionDataEncoder() {
|
|
7980
7964
|
return (0, import_kit51.transformEncoder)(
|
|
7981
7965
|
(0, import_kit51.getStructEncoder)([
|
|
7982
7966
|
["discriminator", (0, import_kit51.fixEncoderSize)((0, import_kit51.getBytesEncoder)(), 8)],
|
|
@@ -7985,149 +7969,24 @@ function getOpenTunaSpotPositionFusionInstructionDataEncoder() {
|
|
|
7985
7969
|
]),
|
|
7986
7970
|
(value) => ({
|
|
7987
7971
|
...value,
|
|
7988
|
-
discriminator:
|
|
7972
|
+
discriminator: OPEN_TUNA_SPOT_POSITION_DISCRIMINATOR
|
|
7989
7973
|
})
|
|
7990
7974
|
);
|
|
7991
7975
|
}
|
|
7992
|
-
function
|
|
7976
|
+
function getOpenTunaSpotPositionInstructionDataDecoder() {
|
|
7993
7977
|
return (0, import_kit51.getStructDecoder)([
|
|
7994
7978
|
["discriminator", (0, import_kit51.fixDecoderSize)((0, import_kit51.getBytesDecoder)(), 8)],
|
|
7995
7979
|
["positionToken", getPoolTokenDecoder()],
|
|
7996
7980
|
["collateralToken", getPoolTokenDecoder()]
|
|
7997
7981
|
]);
|
|
7998
7982
|
}
|
|
7999
|
-
function
|
|
7983
|
+
function getOpenTunaSpotPositionInstructionDataCodec() {
|
|
8000
7984
|
return (0, import_kit51.combineCodec)(
|
|
8001
|
-
|
|
8002
|
-
|
|
8003
|
-
);
|
|
8004
|
-
}
|
|
8005
|
-
function getOpenTunaSpotPositionFusionInstruction(input, config) {
|
|
8006
|
-
const programAddress = config?.programAddress ?? TUNA_PROGRAM_ADDRESS;
|
|
8007
|
-
const originalAccounts = {
|
|
8008
|
-
authority: { value: input.authority ?? null, isWritable: true },
|
|
8009
|
-
mintA: { value: input.mintA ?? null, isWritable: false },
|
|
8010
|
-
mintB: { value: input.mintB ?? null, isWritable: false },
|
|
8011
|
-
tokenProgramA: { value: input.tokenProgramA ?? null, isWritable: false },
|
|
8012
|
-
tokenProgramB: { value: input.tokenProgramB ?? null, isWritable: false },
|
|
8013
|
-
tunaPosition: { value: input.tunaPosition ?? null, isWritable: true },
|
|
8014
|
-
tunaPositionAtaA: {
|
|
8015
|
-
value: input.tunaPositionAtaA ?? null,
|
|
8016
|
-
isWritable: true
|
|
8017
|
-
},
|
|
8018
|
-
tunaPositionAtaB: {
|
|
8019
|
-
value: input.tunaPositionAtaB ?? null,
|
|
8020
|
-
isWritable: true
|
|
8021
|
-
},
|
|
8022
|
-
fusionPool: { value: input.fusionPool ?? null, isWritable: true },
|
|
8023
|
-
systemProgram: { value: input.systemProgram ?? null, isWritable: false },
|
|
8024
|
-
associatedTokenProgram: {
|
|
8025
|
-
value: input.associatedTokenProgram ?? null,
|
|
8026
|
-
isWritable: false
|
|
8027
|
-
}
|
|
8028
|
-
};
|
|
8029
|
-
const accounts = originalAccounts;
|
|
8030
|
-
const args = { ...input };
|
|
8031
|
-
if (!accounts.systemProgram.value) {
|
|
8032
|
-
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
8033
|
-
}
|
|
8034
|
-
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
8035
|
-
const instruction = {
|
|
8036
|
-
accounts: [
|
|
8037
|
-
getAccountMeta(accounts.authority),
|
|
8038
|
-
getAccountMeta(accounts.mintA),
|
|
8039
|
-
getAccountMeta(accounts.mintB),
|
|
8040
|
-
getAccountMeta(accounts.tokenProgramA),
|
|
8041
|
-
getAccountMeta(accounts.tokenProgramB),
|
|
8042
|
-
getAccountMeta(accounts.tunaPosition),
|
|
8043
|
-
getAccountMeta(accounts.tunaPositionAtaA),
|
|
8044
|
-
getAccountMeta(accounts.tunaPositionAtaB),
|
|
8045
|
-
getAccountMeta(accounts.fusionPool),
|
|
8046
|
-
getAccountMeta(accounts.systemProgram),
|
|
8047
|
-
getAccountMeta(accounts.associatedTokenProgram)
|
|
8048
|
-
],
|
|
8049
|
-
programAddress,
|
|
8050
|
-
data: getOpenTunaSpotPositionFusionInstructionDataEncoder().encode(
|
|
8051
|
-
args
|
|
8052
|
-
)
|
|
8053
|
-
};
|
|
8054
|
-
return instruction;
|
|
8055
|
-
}
|
|
8056
|
-
function parseOpenTunaSpotPositionFusionInstruction(instruction) {
|
|
8057
|
-
if (instruction.accounts.length < 11) {
|
|
8058
|
-
throw new Error("Not enough accounts");
|
|
8059
|
-
}
|
|
8060
|
-
let accountIndex = 0;
|
|
8061
|
-
const getNextAccount = () => {
|
|
8062
|
-
const accountMeta = instruction.accounts[accountIndex];
|
|
8063
|
-
accountIndex += 1;
|
|
8064
|
-
return accountMeta;
|
|
8065
|
-
};
|
|
8066
|
-
return {
|
|
8067
|
-
programAddress: instruction.programAddress,
|
|
8068
|
-
accounts: {
|
|
8069
|
-
authority: getNextAccount(),
|
|
8070
|
-
mintA: getNextAccount(),
|
|
8071
|
-
mintB: getNextAccount(),
|
|
8072
|
-
tokenProgramA: getNextAccount(),
|
|
8073
|
-
tokenProgramB: getNextAccount(),
|
|
8074
|
-
tunaPosition: getNextAccount(),
|
|
8075
|
-
tunaPositionAtaA: getNextAccount(),
|
|
8076
|
-
tunaPositionAtaB: getNextAccount(),
|
|
8077
|
-
fusionPool: getNextAccount(),
|
|
8078
|
-
systemProgram: getNextAccount(),
|
|
8079
|
-
associatedTokenProgram: getNextAccount()
|
|
8080
|
-
},
|
|
8081
|
-
data: getOpenTunaSpotPositionFusionInstructionDataDecoder().decode(
|
|
8082
|
-
instruction.data
|
|
8083
|
-
)
|
|
8084
|
-
};
|
|
8085
|
-
}
|
|
8086
|
-
|
|
8087
|
-
// src/generated/instructions/openTunaSpotPositionOrca.ts
|
|
8088
|
-
var import_kit52 = require("@solana/kit");
|
|
8089
|
-
var OPEN_TUNA_SPOT_POSITION_ORCA_DISCRIMINATOR = new Uint8Array([
|
|
8090
|
-
90,
|
|
8091
|
-
70,
|
|
8092
|
-
21,
|
|
8093
|
-
186,
|
|
8094
|
-
147,
|
|
8095
|
-
80,
|
|
8096
|
-
191,
|
|
8097
|
-
94
|
|
8098
|
-
]);
|
|
8099
|
-
function getOpenTunaSpotPositionOrcaDiscriminatorBytes() {
|
|
8100
|
-
return (0, import_kit52.fixEncoderSize)((0, import_kit52.getBytesEncoder)(), 8).encode(
|
|
8101
|
-
OPEN_TUNA_SPOT_POSITION_ORCA_DISCRIMINATOR
|
|
8102
|
-
);
|
|
8103
|
-
}
|
|
8104
|
-
function getOpenTunaSpotPositionOrcaInstructionDataEncoder() {
|
|
8105
|
-
return (0, import_kit52.transformEncoder)(
|
|
8106
|
-
(0, import_kit52.getStructEncoder)([
|
|
8107
|
-
["discriminator", (0, import_kit52.fixEncoderSize)((0, import_kit52.getBytesEncoder)(), 8)],
|
|
8108
|
-
["positionToken", getPoolTokenEncoder()],
|
|
8109
|
-
["collateralToken", getPoolTokenEncoder()]
|
|
8110
|
-
]),
|
|
8111
|
-
(value) => ({
|
|
8112
|
-
...value,
|
|
8113
|
-
discriminator: OPEN_TUNA_SPOT_POSITION_ORCA_DISCRIMINATOR
|
|
8114
|
-
})
|
|
8115
|
-
);
|
|
8116
|
-
}
|
|
8117
|
-
function getOpenTunaSpotPositionOrcaInstructionDataDecoder() {
|
|
8118
|
-
return (0, import_kit52.getStructDecoder)([
|
|
8119
|
-
["discriminator", (0, import_kit52.fixDecoderSize)((0, import_kit52.getBytesDecoder)(), 8)],
|
|
8120
|
-
["positionToken", getPoolTokenDecoder()],
|
|
8121
|
-
["collateralToken", getPoolTokenDecoder()]
|
|
8122
|
-
]);
|
|
8123
|
-
}
|
|
8124
|
-
function getOpenTunaSpotPositionOrcaInstructionDataCodec() {
|
|
8125
|
-
return (0, import_kit52.combineCodec)(
|
|
8126
|
-
getOpenTunaSpotPositionOrcaInstructionDataEncoder(),
|
|
8127
|
-
getOpenTunaSpotPositionOrcaInstructionDataDecoder()
|
|
7985
|
+
getOpenTunaSpotPositionInstructionDataEncoder(),
|
|
7986
|
+
getOpenTunaSpotPositionInstructionDataDecoder()
|
|
8128
7987
|
);
|
|
8129
7988
|
}
|
|
8130
|
-
function
|
|
7989
|
+
function getOpenTunaSpotPositionInstruction(input, config) {
|
|
8131
7990
|
const programAddress = config?.programAddress ?? TUNA_PROGRAM_ADDRESS;
|
|
8132
7991
|
const originalAccounts = {
|
|
8133
7992
|
authority: { value: input.authority ?? null, isWritable: true },
|
|
@@ -8144,7 +8003,7 @@ function getOpenTunaSpotPositionOrcaInstruction(input, config) {
|
|
|
8144
8003
|
value: input.tunaPositionAtaB ?? null,
|
|
8145
8004
|
isWritable: true
|
|
8146
8005
|
},
|
|
8147
|
-
|
|
8006
|
+
pool: { value: input.pool ?? null, isWritable: false },
|
|
8148
8007
|
systemProgram: { value: input.systemProgram ?? null, isWritable: false },
|
|
8149
8008
|
associatedTokenProgram: {
|
|
8150
8009
|
value: input.associatedTokenProgram ?? null,
|
|
@@ -8167,18 +8026,18 @@ function getOpenTunaSpotPositionOrcaInstruction(input, config) {
|
|
|
8167
8026
|
getAccountMeta(accounts.tunaPosition),
|
|
8168
8027
|
getAccountMeta(accounts.tunaPositionAtaA),
|
|
8169
8028
|
getAccountMeta(accounts.tunaPositionAtaB),
|
|
8170
|
-
getAccountMeta(accounts.
|
|
8029
|
+
getAccountMeta(accounts.pool),
|
|
8171
8030
|
getAccountMeta(accounts.systemProgram),
|
|
8172
8031
|
getAccountMeta(accounts.associatedTokenProgram)
|
|
8173
8032
|
],
|
|
8174
8033
|
programAddress,
|
|
8175
|
-
data:
|
|
8034
|
+
data: getOpenTunaSpotPositionInstructionDataEncoder().encode(
|
|
8176
8035
|
args
|
|
8177
8036
|
)
|
|
8178
8037
|
};
|
|
8179
8038
|
return instruction;
|
|
8180
8039
|
}
|
|
8181
|
-
function
|
|
8040
|
+
function parseOpenTunaSpotPositionInstruction(instruction) {
|
|
8182
8041
|
if (instruction.accounts.length < 11) {
|
|
8183
8042
|
throw new Error("Not enough accounts");
|
|
8184
8043
|
}
|
|
@@ -8199,18 +8058,18 @@ function parseOpenTunaSpotPositionOrcaInstruction(instruction) {
|
|
|
8199
8058
|
tunaPosition: getNextAccount(),
|
|
8200
8059
|
tunaPositionAtaA: getNextAccount(),
|
|
8201
8060
|
tunaPositionAtaB: getNextAccount(),
|
|
8202
|
-
|
|
8061
|
+
pool: getNextAccount(),
|
|
8203
8062
|
systemProgram: getNextAccount(),
|
|
8204
8063
|
associatedTokenProgram: getNextAccount()
|
|
8205
8064
|
},
|
|
8206
|
-
data:
|
|
8065
|
+
data: getOpenTunaSpotPositionInstructionDataDecoder().decode(
|
|
8207
8066
|
instruction.data
|
|
8208
8067
|
)
|
|
8209
8068
|
};
|
|
8210
8069
|
}
|
|
8211
8070
|
|
|
8212
8071
|
// src/generated/instructions/rebalanceTunaLpPositionFusion.ts
|
|
8213
|
-
var
|
|
8072
|
+
var import_kit52 = require("@solana/kit");
|
|
8214
8073
|
var REBALANCE_TUNA_LP_POSITION_FUSION_DISCRIMINATOR = new Uint8Array([
|
|
8215
8074
|
190,
|
|
8216
8075
|
86,
|
|
@@ -8222,14 +8081,14 @@ var REBALANCE_TUNA_LP_POSITION_FUSION_DISCRIMINATOR = new Uint8Array([
|
|
|
8222
8081
|
51
|
|
8223
8082
|
]);
|
|
8224
8083
|
function getRebalanceTunaLpPositionFusionDiscriminatorBytes() {
|
|
8225
|
-
return (0,
|
|
8084
|
+
return (0, import_kit52.fixEncoderSize)((0, import_kit52.getBytesEncoder)(), 8).encode(
|
|
8226
8085
|
REBALANCE_TUNA_LP_POSITION_FUSION_DISCRIMINATOR
|
|
8227
8086
|
);
|
|
8228
8087
|
}
|
|
8229
8088
|
function getRebalanceTunaLpPositionFusionInstructionDataEncoder() {
|
|
8230
|
-
return (0,
|
|
8231
|
-
(0,
|
|
8232
|
-
["discriminator", (0,
|
|
8089
|
+
return (0, import_kit52.transformEncoder)(
|
|
8090
|
+
(0, import_kit52.getStructEncoder)([
|
|
8091
|
+
["discriminator", (0, import_kit52.fixEncoderSize)((0, import_kit52.getBytesEncoder)(), 8)],
|
|
8233
8092
|
["remainingAccountsInfo", getRemainingAccountsInfoEncoder()]
|
|
8234
8093
|
]),
|
|
8235
8094
|
(value) => ({
|
|
@@ -8239,13 +8098,13 @@ function getRebalanceTunaLpPositionFusionInstructionDataEncoder() {
|
|
|
8239
8098
|
);
|
|
8240
8099
|
}
|
|
8241
8100
|
function getRebalanceTunaLpPositionFusionInstructionDataDecoder() {
|
|
8242
|
-
return (0,
|
|
8243
|
-
["discriminator", (0,
|
|
8101
|
+
return (0, import_kit52.getStructDecoder)([
|
|
8102
|
+
["discriminator", (0, import_kit52.fixDecoderSize)((0, import_kit52.getBytesDecoder)(), 8)],
|
|
8244
8103
|
["remainingAccountsInfo", getRemainingAccountsInfoDecoder()]
|
|
8245
8104
|
]);
|
|
8246
8105
|
}
|
|
8247
8106
|
function getRebalanceTunaLpPositionFusionInstructionDataCodec() {
|
|
8248
|
-
return (0,
|
|
8107
|
+
return (0, import_kit52.combineCodec)(
|
|
8249
8108
|
getRebalanceTunaLpPositionFusionInstructionDataEncoder(),
|
|
8250
8109
|
getRebalanceTunaLpPositionFusionInstructionDataDecoder()
|
|
8251
8110
|
);
|
|
@@ -8372,7 +8231,7 @@ function parseRebalanceTunaLpPositionFusionInstruction(instruction) {
|
|
|
8372
8231
|
}
|
|
8373
8232
|
|
|
8374
8233
|
// src/generated/instructions/rebalanceTunaLpPositionOrca.ts
|
|
8375
|
-
var
|
|
8234
|
+
var import_kit53 = require("@solana/kit");
|
|
8376
8235
|
var REBALANCE_TUNA_LP_POSITION_ORCA_DISCRIMINATOR = new Uint8Array([
|
|
8377
8236
|
124,
|
|
8378
8237
|
212,
|
|
@@ -8384,14 +8243,14 @@ var REBALANCE_TUNA_LP_POSITION_ORCA_DISCRIMINATOR = new Uint8Array([
|
|
|
8384
8243
|
231
|
|
8385
8244
|
]);
|
|
8386
8245
|
function getRebalanceTunaLpPositionOrcaDiscriminatorBytes() {
|
|
8387
|
-
return (0,
|
|
8246
|
+
return (0, import_kit53.fixEncoderSize)((0, import_kit53.getBytesEncoder)(), 8).encode(
|
|
8388
8247
|
REBALANCE_TUNA_LP_POSITION_ORCA_DISCRIMINATOR
|
|
8389
8248
|
);
|
|
8390
8249
|
}
|
|
8391
8250
|
function getRebalanceTunaLpPositionOrcaInstructionDataEncoder() {
|
|
8392
|
-
return (0,
|
|
8393
|
-
(0,
|
|
8394
|
-
["discriminator", (0,
|
|
8251
|
+
return (0, import_kit53.transformEncoder)(
|
|
8252
|
+
(0, import_kit53.getStructEncoder)([
|
|
8253
|
+
["discriminator", (0, import_kit53.fixEncoderSize)((0, import_kit53.getBytesEncoder)(), 8)],
|
|
8395
8254
|
["remainingAccountsInfo", getRemainingAccountsInfoEncoder()]
|
|
8396
8255
|
]),
|
|
8397
8256
|
(value) => ({
|
|
@@ -8401,13 +8260,13 @@ function getRebalanceTunaLpPositionOrcaInstructionDataEncoder() {
|
|
|
8401
8260
|
);
|
|
8402
8261
|
}
|
|
8403
8262
|
function getRebalanceTunaLpPositionOrcaInstructionDataDecoder() {
|
|
8404
|
-
return (0,
|
|
8405
|
-
["discriminator", (0,
|
|
8263
|
+
return (0, import_kit53.getStructDecoder)([
|
|
8264
|
+
["discriminator", (0, import_kit53.fixDecoderSize)((0, import_kit53.getBytesDecoder)(), 8)],
|
|
8406
8265
|
["remainingAccountsInfo", getRemainingAccountsInfoDecoder()]
|
|
8407
8266
|
]);
|
|
8408
8267
|
}
|
|
8409
8268
|
function getRebalanceTunaLpPositionOrcaInstructionDataCodec() {
|
|
8410
|
-
return (0,
|
|
8269
|
+
return (0, import_kit53.combineCodec)(
|
|
8411
8270
|
getRebalanceTunaLpPositionOrcaInstructionDataEncoder(),
|
|
8412
8271
|
getRebalanceTunaLpPositionOrcaInstructionDataDecoder()
|
|
8413
8272
|
);
|
|
@@ -8540,7 +8399,7 @@ function parseRebalanceTunaLpPositionOrcaInstruction(instruction) {
|
|
|
8540
8399
|
}
|
|
8541
8400
|
|
|
8542
8401
|
// src/generated/instructions/repayBadDebt.ts
|
|
8543
|
-
var
|
|
8402
|
+
var import_kit54 = require("@solana/kit");
|
|
8544
8403
|
var REPAY_BAD_DEBT_DISCRIMINATOR = new Uint8Array([
|
|
8545
8404
|
112,
|
|
8546
8405
|
144,
|
|
@@ -8552,29 +8411,29 @@ var REPAY_BAD_DEBT_DISCRIMINATOR = new Uint8Array([
|
|
|
8552
8411
|
34
|
|
8553
8412
|
]);
|
|
8554
8413
|
function getRepayBadDebtDiscriminatorBytes() {
|
|
8555
|
-
return (0,
|
|
8414
|
+
return (0, import_kit54.fixEncoderSize)((0, import_kit54.getBytesEncoder)(), 8).encode(
|
|
8556
8415
|
REPAY_BAD_DEBT_DISCRIMINATOR
|
|
8557
8416
|
);
|
|
8558
8417
|
}
|
|
8559
8418
|
function getRepayBadDebtInstructionDataEncoder() {
|
|
8560
|
-
return (0,
|
|
8561
|
-
(0,
|
|
8562
|
-
["discriminator", (0,
|
|
8563
|
-
["funds", (0,
|
|
8564
|
-
["shares", (0,
|
|
8419
|
+
return (0, import_kit54.transformEncoder)(
|
|
8420
|
+
(0, import_kit54.getStructEncoder)([
|
|
8421
|
+
["discriminator", (0, import_kit54.fixEncoderSize)((0, import_kit54.getBytesEncoder)(), 8)],
|
|
8422
|
+
["funds", (0, import_kit54.getU64Encoder)()],
|
|
8423
|
+
["shares", (0, import_kit54.getU64Encoder)()]
|
|
8565
8424
|
]),
|
|
8566
8425
|
(value) => ({ ...value, discriminator: REPAY_BAD_DEBT_DISCRIMINATOR })
|
|
8567
8426
|
);
|
|
8568
8427
|
}
|
|
8569
8428
|
function getRepayBadDebtInstructionDataDecoder() {
|
|
8570
|
-
return (0,
|
|
8571
|
-
["discriminator", (0,
|
|
8572
|
-
["funds", (0,
|
|
8573
|
-
["shares", (0,
|
|
8429
|
+
return (0, import_kit54.getStructDecoder)([
|
|
8430
|
+
["discriminator", (0, import_kit54.fixDecoderSize)((0, import_kit54.getBytesDecoder)(), 8)],
|
|
8431
|
+
["funds", (0, import_kit54.getU64Decoder)()],
|
|
8432
|
+
["shares", (0, import_kit54.getU64Decoder)()]
|
|
8574
8433
|
]);
|
|
8575
8434
|
}
|
|
8576
8435
|
function getRepayBadDebtInstructionDataCodec() {
|
|
8577
|
-
return (0,
|
|
8436
|
+
return (0, import_kit54.combineCodec)(
|
|
8578
8437
|
getRepayBadDebtInstructionDataEncoder(),
|
|
8579
8438
|
getRepayBadDebtInstructionDataDecoder()
|
|
8580
8439
|
);
|
|
@@ -8642,7 +8501,7 @@ function parseRepayBadDebtInstruction(instruction) {
|
|
|
8642
8501
|
}
|
|
8643
8502
|
|
|
8644
8503
|
// src/generated/instructions/repayTunaLpPositionDebt.ts
|
|
8645
|
-
var
|
|
8504
|
+
var import_kit55 = require("@solana/kit");
|
|
8646
8505
|
var REPAY_TUNA_LP_POSITION_DEBT_DISCRIMINATOR = new Uint8Array([
|
|
8647
8506
|
79,
|
|
8648
8507
|
200,
|
|
@@ -8654,16 +8513,16 @@ var REPAY_TUNA_LP_POSITION_DEBT_DISCRIMINATOR = new Uint8Array([
|
|
|
8654
8513
|
8
|
|
8655
8514
|
]);
|
|
8656
8515
|
function getRepayTunaLpPositionDebtDiscriminatorBytes() {
|
|
8657
|
-
return (0,
|
|
8516
|
+
return (0, import_kit55.fixEncoderSize)((0, import_kit55.getBytesEncoder)(), 8).encode(
|
|
8658
8517
|
REPAY_TUNA_LP_POSITION_DEBT_DISCRIMINATOR
|
|
8659
8518
|
);
|
|
8660
8519
|
}
|
|
8661
8520
|
function getRepayTunaLpPositionDebtInstructionDataEncoder() {
|
|
8662
|
-
return (0,
|
|
8663
|
-
(0,
|
|
8664
|
-
["discriminator", (0,
|
|
8665
|
-
["collateralFundsA", (0,
|
|
8666
|
-
["collateralFundsB", (0,
|
|
8521
|
+
return (0, import_kit55.transformEncoder)(
|
|
8522
|
+
(0, import_kit55.getStructEncoder)([
|
|
8523
|
+
["discriminator", (0, import_kit55.fixEncoderSize)((0, import_kit55.getBytesEncoder)(), 8)],
|
|
8524
|
+
["collateralFundsA", (0, import_kit55.getU64Encoder)()],
|
|
8525
|
+
["collateralFundsB", (0, import_kit55.getU64Encoder)()]
|
|
8667
8526
|
]),
|
|
8668
8527
|
(value) => ({
|
|
8669
8528
|
...value,
|
|
@@ -8672,14 +8531,14 @@ function getRepayTunaLpPositionDebtInstructionDataEncoder() {
|
|
|
8672
8531
|
);
|
|
8673
8532
|
}
|
|
8674
8533
|
function getRepayTunaLpPositionDebtInstructionDataDecoder() {
|
|
8675
|
-
return (0,
|
|
8676
|
-
["discriminator", (0,
|
|
8677
|
-
["collateralFundsA", (0,
|
|
8678
|
-
["collateralFundsB", (0,
|
|
8534
|
+
return (0, import_kit55.getStructDecoder)([
|
|
8535
|
+
["discriminator", (0, import_kit55.fixDecoderSize)((0, import_kit55.getBytesDecoder)(), 8)],
|
|
8536
|
+
["collateralFundsA", (0, import_kit55.getU64Decoder)()],
|
|
8537
|
+
["collateralFundsB", (0, import_kit55.getU64Decoder)()]
|
|
8679
8538
|
]);
|
|
8680
8539
|
}
|
|
8681
8540
|
function getRepayTunaLpPositionDebtInstructionDataCodec() {
|
|
8682
|
-
return (0,
|
|
8541
|
+
return (0, import_kit55.combineCodec)(
|
|
8683
8542
|
getRepayTunaLpPositionDebtInstructionDataEncoder(),
|
|
8684
8543
|
getRepayTunaLpPositionDebtInstructionDataDecoder()
|
|
8685
8544
|
);
|
|
@@ -8782,7 +8641,7 @@ function parseRepayTunaLpPositionDebtInstruction(instruction) {
|
|
|
8782
8641
|
}
|
|
8783
8642
|
|
|
8784
8643
|
// src/generated/instructions/resetTunaSpotPosition.ts
|
|
8785
|
-
var
|
|
8644
|
+
var import_kit56 = require("@solana/kit");
|
|
8786
8645
|
var RESET_TUNA_SPOT_POSITION_DISCRIMINATOR = new Uint8Array([
|
|
8787
8646
|
194,
|
|
8788
8647
|
68,
|
|
@@ -8794,14 +8653,14 @@ var RESET_TUNA_SPOT_POSITION_DISCRIMINATOR = new Uint8Array([
|
|
|
8794
8653
|
127
|
|
8795
8654
|
]);
|
|
8796
8655
|
function getResetTunaSpotPositionDiscriminatorBytes() {
|
|
8797
|
-
return (0,
|
|
8656
|
+
return (0, import_kit56.fixEncoderSize)((0, import_kit56.getBytesEncoder)(), 8).encode(
|
|
8798
8657
|
RESET_TUNA_SPOT_POSITION_DISCRIMINATOR
|
|
8799
8658
|
);
|
|
8800
8659
|
}
|
|
8801
8660
|
function getResetTunaSpotPositionInstructionDataEncoder() {
|
|
8802
|
-
return (0,
|
|
8803
|
-
(0,
|
|
8804
|
-
["discriminator", (0,
|
|
8661
|
+
return (0, import_kit56.transformEncoder)(
|
|
8662
|
+
(0, import_kit56.getStructEncoder)([
|
|
8663
|
+
["discriminator", (0, import_kit56.fixEncoderSize)((0, import_kit56.getBytesEncoder)(), 8)],
|
|
8805
8664
|
["positionToken", getPoolTokenEncoder()],
|
|
8806
8665
|
["collateralToken", getPoolTokenEncoder()]
|
|
8807
8666
|
]),
|
|
@@ -8812,14 +8671,14 @@ function getResetTunaSpotPositionInstructionDataEncoder() {
|
|
|
8812
8671
|
);
|
|
8813
8672
|
}
|
|
8814
8673
|
function getResetTunaSpotPositionInstructionDataDecoder() {
|
|
8815
|
-
return (0,
|
|
8816
|
-
["discriminator", (0,
|
|
8674
|
+
return (0, import_kit56.getStructDecoder)([
|
|
8675
|
+
["discriminator", (0, import_kit56.fixDecoderSize)((0, import_kit56.getBytesDecoder)(), 8)],
|
|
8817
8676
|
["positionToken", getPoolTokenDecoder()],
|
|
8818
8677
|
["collateralToken", getPoolTokenDecoder()]
|
|
8819
8678
|
]);
|
|
8820
8679
|
}
|
|
8821
8680
|
function getResetTunaSpotPositionInstructionDataCodec() {
|
|
8822
|
-
return (0,
|
|
8681
|
+
return (0, import_kit56.combineCodec)(
|
|
8823
8682
|
getResetTunaSpotPositionInstructionDataEncoder(),
|
|
8824
8683
|
getResetTunaSpotPositionInstructionDataDecoder()
|
|
8825
8684
|
);
|
|
@@ -8886,7 +8745,7 @@ function parseResetTunaSpotPositionInstruction(instruction) {
|
|
|
8886
8745
|
}
|
|
8887
8746
|
|
|
8888
8747
|
// src/generated/instructions/setAdminAuthority.ts
|
|
8889
|
-
var
|
|
8748
|
+
var import_kit57 = require("@solana/kit");
|
|
8890
8749
|
var SET_ADMIN_AUTHORITY_DISCRIMINATOR = new Uint8Array([
|
|
8891
8750
|
72,
|
|
8892
8751
|
49,
|
|
@@ -8898,27 +8757,27 @@ var SET_ADMIN_AUTHORITY_DISCRIMINATOR = new Uint8Array([
|
|
|
8898
8757
|
174
|
|
8899
8758
|
]);
|
|
8900
8759
|
function getSetAdminAuthorityDiscriminatorBytes() {
|
|
8901
|
-
return (0,
|
|
8760
|
+
return (0, import_kit57.fixEncoderSize)((0, import_kit57.getBytesEncoder)(), 8).encode(
|
|
8902
8761
|
SET_ADMIN_AUTHORITY_DISCRIMINATOR
|
|
8903
8762
|
);
|
|
8904
8763
|
}
|
|
8905
8764
|
function getSetAdminAuthorityInstructionDataEncoder() {
|
|
8906
|
-
return (0,
|
|
8907
|
-
(0,
|
|
8908
|
-
["discriminator", (0,
|
|
8909
|
-
["adminAuthority", (0,
|
|
8765
|
+
return (0, import_kit57.transformEncoder)(
|
|
8766
|
+
(0, import_kit57.getStructEncoder)([
|
|
8767
|
+
["discriminator", (0, import_kit57.fixEncoderSize)((0, import_kit57.getBytesEncoder)(), 8)],
|
|
8768
|
+
["adminAuthority", (0, import_kit57.getAddressEncoder)()]
|
|
8910
8769
|
]),
|
|
8911
8770
|
(value) => ({ ...value, discriminator: SET_ADMIN_AUTHORITY_DISCRIMINATOR })
|
|
8912
8771
|
);
|
|
8913
8772
|
}
|
|
8914
8773
|
function getSetAdminAuthorityInstructionDataDecoder() {
|
|
8915
|
-
return (0,
|
|
8916
|
-
["discriminator", (0,
|
|
8917
|
-
["adminAuthority", (0,
|
|
8774
|
+
return (0, import_kit57.getStructDecoder)([
|
|
8775
|
+
["discriminator", (0, import_kit57.fixDecoderSize)((0, import_kit57.getBytesDecoder)(), 8)],
|
|
8776
|
+
["adminAuthority", (0, import_kit57.getAddressDecoder)()]
|
|
8918
8777
|
]);
|
|
8919
8778
|
}
|
|
8920
8779
|
function getSetAdminAuthorityInstructionDataCodec() {
|
|
8921
|
-
return (0,
|
|
8780
|
+
return (0, import_kit57.combineCodec)(
|
|
8922
8781
|
getSetAdminAuthorityInstructionDataEncoder(),
|
|
8923
8782
|
getSetAdminAuthorityInstructionDataDecoder()
|
|
8924
8783
|
);
|
|
@@ -8965,18 +8824,18 @@ function parseSetAdminAuthorityInstruction(instruction) {
|
|
|
8965
8824
|
}
|
|
8966
8825
|
|
|
8967
8826
|
// src/generated/instructions/setDefaultMaxPercentageOfLeftovers.ts
|
|
8968
|
-
var
|
|
8827
|
+
var import_kit58 = require("@solana/kit");
|
|
8969
8828
|
var SET_DEFAULT_MAX_PERCENTAGE_OF_LEFTOVERS_DISCRIMINATOR = new Uint8Array([37, 179, 107, 65, 203, 141, 183, 27]);
|
|
8970
8829
|
function getSetDefaultMaxPercentageOfLeftoversDiscriminatorBytes() {
|
|
8971
|
-
return (0,
|
|
8830
|
+
return (0, import_kit58.fixEncoderSize)((0, import_kit58.getBytesEncoder)(), 8).encode(
|
|
8972
8831
|
SET_DEFAULT_MAX_PERCENTAGE_OF_LEFTOVERS_DISCRIMINATOR
|
|
8973
8832
|
);
|
|
8974
8833
|
}
|
|
8975
8834
|
function getSetDefaultMaxPercentageOfLeftoversInstructionDataEncoder() {
|
|
8976
|
-
return (0,
|
|
8977
|
-
(0,
|
|
8978
|
-
["discriminator", (0,
|
|
8979
|
-
["maxPercentageOfLeftovers", (0,
|
|
8835
|
+
return (0, import_kit58.transformEncoder)(
|
|
8836
|
+
(0, import_kit58.getStructEncoder)([
|
|
8837
|
+
["discriminator", (0, import_kit58.fixEncoderSize)((0, import_kit58.getBytesEncoder)(), 8)],
|
|
8838
|
+
["maxPercentageOfLeftovers", (0, import_kit58.getU32Encoder)()]
|
|
8980
8839
|
]),
|
|
8981
8840
|
(value) => ({
|
|
8982
8841
|
...value,
|
|
@@ -8985,13 +8844,13 @@ function getSetDefaultMaxPercentageOfLeftoversInstructionDataEncoder() {
|
|
|
8985
8844
|
);
|
|
8986
8845
|
}
|
|
8987
8846
|
function getSetDefaultMaxPercentageOfLeftoversInstructionDataDecoder() {
|
|
8988
|
-
return (0,
|
|
8989
|
-
["discriminator", (0,
|
|
8990
|
-
["maxPercentageOfLeftovers", (0,
|
|
8847
|
+
return (0, import_kit58.getStructDecoder)([
|
|
8848
|
+
["discriminator", (0, import_kit58.fixDecoderSize)((0, import_kit58.getBytesDecoder)(), 8)],
|
|
8849
|
+
["maxPercentageOfLeftovers", (0, import_kit58.getU32Decoder)()]
|
|
8991
8850
|
]);
|
|
8992
8851
|
}
|
|
8993
8852
|
function getSetDefaultMaxPercentageOfLeftoversInstructionDataCodec() {
|
|
8994
|
-
return (0,
|
|
8853
|
+
return (0, import_kit58.combineCodec)(
|
|
8995
8854
|
getSetDefaultMaxPercentageOfLeftoversInstructionDataEncoder(),
|
|
8996
8855
|
getSetDefaultMaxPercentageOfLeftoversInstructionDataDecoder()
|
|
8997
8856
|
);
|
|
@@ -9040,7 +8899,7 @@ function parseSetDefaultMaxPercentageOfLeftoversInstruction(instruction) {
|
|
|
9040
8899
|
}
|
|
9041
8900
|
|
|
9042
8901
|
// src/generated/instructions/setDefaultMaxSwapSlippage.ts
|
|
9043
|
-
var
|
|
8902
|
+
var import_kit59 = require("@solana/kit");
|
|
9044
8903
|
var SET_DEFAULT_MAX_SWAP_SLIPPAGE_DISCRIMINATOR = new Uint8Array([
|
|
9045
8904
|
122,
|
|
9046
8905
|
22,
|
|
@@ -9052,15 +8911,15 @@ var SET_DEFAULT_MAX_SWAP_SLIPPAGE_DISCRIMINATOR = new Uint8Array([
|
|
|
9052
8911
|
181
|
|
9053
8912
|
]);
|
|
9054
8913
|
function getSetDefaultMaxSwapSlippageDiscriminatorBytes() {
|
|
9055
|
-
return (0,
|
|
8914
|
+
return (0, import_kit59.fixEncoderSize)((0, import_kit59.getBytesEncoder)(), 8).encode(
|
|
9056
8915
|
SET_DEFAULT_MAX_SWAP_SLIPPAGE_DISCRIMINATOR
|
|
9057
8916
|
);
|
|
9058
8917
|
}
|
|
9059
8918
|
function getSetDefaultMaxSwapSlippageInstructionDataEncoder() {
|
|
9060
|
-
return (0,
|
|
9061
|
-
(0,
|
|
9062
|
-
["discriminator", (0,
|
|
9063
|
-
["maxSwapSlippage", (0,
|
|
8919
|
+
return (0, import_kit59.transformEncoder)(
|
|
8920
|
+
(0, import_kit59.getStructEncoder)([
|
|
8921
|
+
["discriminator", (0, import_kit59.fixEncoderSize)((0, import_kit59.getBytesEncoder)(), 8)],
|
|
8922
|
+
["maxSwapSlippage", (0, import_kit59.getU32Encoder)()]
|
|
9064
8923
|
]),
|
|
9065
8924
|
(value) => ({
|
|
9066
8925
|
...value,
|
|
@@ -9069,13 +8928,13 @@ function getSetDefaultMaxSwapSlippageInstructionDataEncoder() {
|
|
|
9069
8928
|
);
|
|
9070
8929
|
}
|
|
9071
8930
|
function getSetDefaultMaxSwapSlippageInstructionDataDecoder() {
|
|
9072
|
-
return (0,
|
|
9073
|
-
["discriminator", (0,
|
|
9074
|
-
["maxSwapSlippage", (0,
|
|
8931
|
+
return (0, import_kit59.getStructDecoder)([
|
|
8932
|
+
["discriminator", (0, import_kit59.fixDecoderSize)((0, import_kit59.getBytesDecoder)(), 8)],
|
|
8933
|
+
["maxSwapSlippage", (0, import_kit59.getU32Decoder)()]
|
|
9075
8934
|
]);
|
|
9076
8935
|
}
|
|
9077
8936
|
function getSetDefaultMaxSwapSlippageInstructionDataCodec() {
|
|
9078
|
-
return (0,
|
|
8937
|
+
return (0, import_kit59.combineCodec)(
|
|
9079
8938
|
getSetDefaultMaxSwapSlippageInstructionDataEncoder(),
|
|
9080
8939
|
getSetDefaultMaxSwapSlippageInstructionDataDecoder()
|
|
9081
8940
|
);
|
|
@@ -9124,18 +8983,18 @@ function parseSetDefaultMaxSwapSlippageInstruction(instruction) {
|
|
|
9124
8983
|
}
|
|
9125
8984
|
|
|
9126
8985
|
// src/generated/instructions/setDefaultOraclePriceDeviationThreshold.ts
|
|
9127
|
-
var
|
|
8986
|
+
var import_kit60 = require("@solana/kit");
|
|
9128
8987
|
var SET_DEFAULT_ORACLE_PRICE_DEVIATION_THRESHOLD_DISCRIMINATOR = new Uint8Array([142, 158, 143, 67, 206, 91, 139, 120]);
|
|
9129
8988
|
function getSetDefaultOraclePriceDeviationThresholdDiscriminatorBytes() {
|
|
9130
|
-
return (0,
|
|
8989
|
+
return (0, import_kit60.fixEncoderSize)((0, import_kit60.getBytesEncoder)(), 8).encode(
|
|
9131
8990
|
SET_DEFAULT_ORACLE_PRICE_DEVIATION_THRESHOLD_DISCRIMINATOR
|
|
9132
8991
|
);
|
|
9133
8992
|
}
|
|
9134
8993
|
function getSetDefaultOraclePriceDeviationThresholdInstructionDataEncoder() {
|
|
9135
|
-
return (0,
|
|
9136
|
-
(0,
|
|
9137
|
-
["discriminator", (0,
|
|
9138
|
-
["oraclePriceDeviationThreshold", (0,
|
|
8994
|
+
return (0, import_kit60.transformEncoder)(
|
|
8995
|
+
(0, import_kit60.getStructEncoder)([
|
|
8996
|
+
["discriminator", (0, import_kit60.fixEncoderSize)((0, import_kit60.getBytesEncoder)(), 8)],
|
|
8997
|
+
["oraclePriceDeviationThreshold", (0, import_kit60.getU32Encoder)()]
|
|
9139
8998
|
]),
|
|
9140
8999
|
(value) => ({
|
|
9141
9000
|
...value,
|
|
@@ -9144,13 +9003,13 @@ function getSetDefaultOraclePriceDeviationThresholdInstructionDataEncoder() {
|
|
|
9144
9003
|
);
|
|
9145
9004
|
}
|
|
9146
9005
|
function getSetDefaultOraclePriceDeviationThresholdInstructionDataDecoder() {
|
|
9147
|
-
return (0,
|
|
9148
|
-
["discriminator", (0,
|
|
9149
|
-
["oraclePriceDeviationThreshold", (0,
|
|
9006
|
+
return (0, import_kit60.getStructDecoder)([
|
|
9007
|
+
["discriminator", (0, import_kit60.fixDecoderSize)((0, import_kit60.getBytesDecoder)(), 8)],
|
|
9008
|
+
["oraclePriceDeviationThreshold", (0, import_kit60.getU32Decoder)()]
|
|
9150
9009
|
]);
|
|
9151
9010
|
}
|
|
9152
9011
|
function getSetDefaultOraclePriceDeviationThresholdInstructionDataCodec() {
|
|
9153
|
-
return (0,
|
|
9012
|
+
return (0, import_kit60.combineCodec)(
|
|
9154
9013
|
getSetDefaultOraclePriceDeviationThresholdInstructionDataEncoder(),
|
|
9155
9014
|
getSetDefaultOraclePriceDeviationThresholdInstructionDataDecoder()
|
|
9156
9015
|
);
|
|
@@ -9199,7 +9058,7 @@ function parseSetDefaultOraclePriceDeviationThresholdInstruction(instruction) {
|
|
|
9199
9058
|
}
|
|
9200
9059
|
|
|
9201
9060
|
// src/generated/instructions/setFeeRecipient.ts
|
|
9202
|
-
var
|
|
9061
|
+
var import_kit61 = require("@solana/kit");
|
|
9203
9062
|
var SET_FEE_RECIPIENT_DISCRIMINATOR = new Uint8Array([
|
|
9204
9063
|
227,
|
|
9205
9064
|
18,
|
|
@@ -9211,27 +9070,27 @@ var SET_FEE_RECIPIENT_DISCRIMINATOR = new Uint8Array([
|
|
|
9211
9070
|
66
|
|
9212
9071
|
]);
|
|
9213
9072
|
function getSetFeeRecipientDiscriminatorBytes() {
|
|
9214
|
-
return (0,
|
|
9073
|
+
return (0, import_kit61.fixEncoderSize)((0, import_kit61.getBytesEncoder)(), 8).encode(
|
|
9215
9074
|
SET_FEE_RECIPIENT_DISCRIMINATOR
|
|
9216
9075
|
);
|
|
9217
9076
|
}
|
|
9218
9077
|
function getSetFeeRecipientInstructionDataEncoder() {
|
|
9219
|
-
return (0,
|
|
9220
|
-
(0,
|
|
9221
|
-
["discriminator", (0,
|
|
9222
|
-
["feeRecipient", (0,
|
|
9078
|
+
return (0, import_kit61.transformEncoder)(
|
|
9079
|
+
(0, import_kit61.getStructEncoder)([
|
|
9080
|
+
["discriminator", (0, import_kit61.fixEncoderSize)((0, import_kit61.getBytesEncoder)(), 8)],
|
|
9081
|
+
["feeRecipient", (0, import_kit61.getAddressEncoder)()]
|
|
9223
9082
|
]),
|
|
9224
9083
|
(value) => ({ ...value, discriminator: SET_FEE_RECIPIENT_DISCRIMINATOR })
|
|
9225
9084
|
);
|
|
9226
9085
|
}
|
|
9227
9086
|
function getSetFeeRecipientInstructionDataDecoder() {
|
|
9228
|
-
return (0,
|
|
9229
|
-
["discriminator", (0,
|
|
9230
|
-
["feeRecipient", (0,
|
|
9087
|
+
return (0, import_kit61.getStructDecoder)([
|
|
9088
|
+
["discriminator", (0, import_kit61.fixDecoderSize)((0, import_kit61.getBytesDecoder)(), 8)],
|
|
9089
|
+
["feeRecipient", (0, import_kit61.getAddressDecoder)()]
|
|
9231
9090
|
]);
|
|
9232
9091
|
}
|
|
9233
9092
|
function getSetFeeRecipientInstructionDataCodec() {
|
|
9234
|
-
return (0,
|
|
9093
|
+
return (0, import_kit61.combineCodec)(
|
|
9235
9094
|
getSetFeeRecipientInstructionDataEncoder(),
|
|
9236
9095
|
getSetFeeRecipientInstructionDataDecoder()
|
|
9237
9096
|
);
|
|
@@ -9278,7 +9137,7 @@ function parseSetFeeRecipientInstruction(instruction) {
|
|
|
9278
9137
|
}
|
|
9279
9138
|
|
|
9280
9139
|
// src/generated/instructions/setLiquidatorAuthority.ts
|
|
9281
|
-
var
|
|
9140
|
+
var import_kit62 = require("@solana/kit");
|
|
9282
9141
|
var SET_LIQUIDATOR_AUTHORITY_DISCRIMINATOR = new Uint8Array([
|
|
9283
9142
|
246,
|
|
9284
9143
|
146,
|
|
@@ -9290,15 +9149,15 @@ var SET_LIQUIDATOR_AUTHORITY_DISCRIMINATOR = new Uint8Array([
|
|
|
9290
9149
|
143
|
|
9291
9150
|
]);
|
|
9292
9151
|
function getSetLiquidatorAuthorityDiscriminatorBytes() {
|
|
9293
|
-
return (0,
|
|
9152
|
+
return (0, import_kit62.fixEncoderSize)((0, import_kit62.getBytesEncoder)(), 8).encode(
|
|
9294
9153
|
SET_LIQUIDATOR_AUTHORITY_DISCRIMINATOR
|
|
9295
9154
|
);
|
|
9296
9155
|
}
|
|
9297
9156
|
function getSetLiquidatorAuthorityInstructionDataEncoder() {
|
|
9298
|
-
return (0,
|
|
9299
|
-
(0,
|
|
9300
|
-
["discriminator", (0,
|
|
9301
|
-
["liquidatorAuthority", (0,
|
|
9157
|
+
return (0, import_kit62.transformEncoder)(
|
|
9158
|
+
(0, import_kit62.getStructEncoder)([
|
|
9159
|
+
["discriminator", (0, import_kit62.fixEncoderSize)((0, import_kit62.getBytesEncoder)(), 8)],
|
|
9160
|
+
["liquidatorAuthority", (0, import_kit62.getAddressEncoder)()]
|
|
9302
9161
|
]),
|
|
9303
9162
|
(value) => ({
|
|
9304
9163
|
...value,
|
|
@@ -9307,13 +9166,13 @@ function getSetLiquidatorAuthorityInstructionDataEncoder() {
|
|
|
9307
9166
|
);
|
|
9308
9167
|
}
|
|
9309
9168
|
function getSetLiquidatorAuthorityInstructionDataDecoder() {
|
|
9310
|
-
return (0,
|
|
9311
|
-
["discriminator", (0,
|
|
9312
|
-
["liquidatorAuthority", (0,
|
|
9169
|
+
return (0, import_kit62.getStructDecoder)([
|
|
9170
|
+
["discriminator", (0, import_kit62.fixDecoderSize)((0, import_kit62.getBytesDecoder)(), 8)],
|
|
9171
|
+
["liquidatorAuthority", (0, import_kit62.getAddressDecoder)()]
|
|
9313
9172
|
]);
|
|
9314
9173
|
}
|
|
9315
9174
|
function getSetLiquidatorAuthorityInstructionDataCodec() {
|
|
9316
|
-
return (0,
|
|
9175
|
+
return (0, import_kit62.combineCodec)(
|
|
9317
9176
|
getSetLiquidatorAuthorityInstructionDataEncoder(),
|
|
9318
9177
|
getSetLiquidatorAuthorityInstructionDataDecoder()
|
|
9319
9178
|
);
|
|
@@ -9362,7 +9221,7 @@ function parseSetLiquidatorAuthorityInstruction(instruction) {
|
|
|
9362
9221
|
}
|
|
9363
9222
|
|
|
9364
9223
|
// src/generated/instructions/setOwnerAuthority.ts
|
|
9365
|
-
var
|
|
9224
|
+
var import_kit63 = require("@solana/kit");
|
|
9366
9225
|
var SET_OWNER_AUTHORITY_DISCRIMINATOR = new Uint8Array([
|
|
9367
9226
|
128,
|
|
9368
9227
|
171,
|
|
@@ -9374,27 +9233,27 @@ var SET_OWNER_AUTHORITY_DISCRIMINATOR = new Uint8Array([
|
|
|
9374
9233
|
117
|
|
9375
9234
|
]);
|
|
9376
9235
|
function getSetOwnerAuthorityDiscriminatorBytes() {
|
|
9377
|
-
return (0,
|
|
9236
|
+
return (0, import_kit63.fixEncoderSize)((0, import_kit63.getBytesEncoder)(), 8).encode(
|
|
9378
9237
|
SET_OWNER_AUTHORITY_DISCRIMINATOR
|
|
9379
9238
|
);
|
|
9380
9239
|
}
|
|
9381
9240
|
function getSetOwnerAuthorityInstructionDataEncoder() {
|
|
9382
|
-
return (0,
|
|
9383
|
-
(0,
|
|
9384
|
-
["discriminator", (0,
|
|
9385
|
-
["ownerAuthority", (0,
|
|
9241
|
+
return (0, import_kit63.transformEncoder)(
|
|
9242
|
+
(0, import_kit63.getStructEncoder)([
|
|
9243
|
+
["discriminator", (0, import_kit63.fixEncoderSize)((0, import_kit63.getBytesEncoder)(), 8)],
|
|
9244
|
+
["ownerAuthority", (0, import_kit63.getAddressEncoder)()]
|
|
9386
9245
|
]),
|
|
9387
9246
|
(value) => ({ ...value, discriminator: SET_OWNER_AUTHORITY_DISCRIMINATOR })
|
|
9388
9247
|
);
|
|
9389
9248
|
}
|
|
9390
9249
|
function getSetOwnerAuthorityInstructionDataDecoder() {
|
|
9391
|
-
return (0,
|
|
9392
|
-
["discriminator", (0,
|
|
9393
|
-
["ownerAuthority", (0,
|
|
9250
|
+
return (0, import_kit63.getStructDecoder)([
|
|
9251
|
+
["discriminator", (0, import_kit63.fixDecoderSize)((0, import_kit63.getBytesDecoder)(), 8)],
|
|
9252
|
+
["ownerAuthority", (0, import_kit63.getAddressDecoder)()]
|
|
9394
9253
|
]);
|
|
9395
9254
|
}
|
|
9396
9255
|
function getSetOwnerAuthorityInstructionDataCodec() {
|
|
9397
|
-
return (0,
|
|
9256
|
+
return (0, import_kit63.combineCodec)(
|
|
9398
9257
|
getSetOwnerAuthorityInstructionDataEncoder(),
|
|
9399
9258
|
getSetOwnerAuthorityInstructionDataDecoder()
|
|
9400
9259
|
);
|
|
@@ -9441,7 +9300,7 @@ function parseSetOwnerAuthorityInstruction(instruction) {
|
|
|
9441
9300
|
}
|
|
9442
9301
|
|
|
9443
9302
|
// src/generated/instructions/setSuspendedState.ts
|
|
9444
|
-
var
|
|
9303
|
+
var import_kit64 = require("@solana/kit");
|
|
9445
9304
|
var SET_SUSPENDED_STATE_DISCRIMINATOR = new Uint8Array([
|
|
9446
9305
|
145,
|
|
9447
9306
|
13,
|
|
@@ -9453,33 +9312,33 @@ var SET_SUSPENDED_STATE_DISCRIMINATOR = new Uint8Array([
|
|
|
9453
9312
|
32
|
|
9454
9313
|
]);
|
|
9455
9314
|
function getSetSuspendedStateDiscriminatorBytes() {
|
|
9456
|
-
return (0,
|
|
9315
|
+
return (0, import_kit64.fixEncoderSize)((0, import_kit64.getBytesEncoder)(), 8).encode(
|
|
9457
9316
|
SET_SUSPENDED_STATE_DISCRIMINATOR
|
|
9458
9317
|
);
|
|
9459
9318
|
}
|
|
9460
9319
|
function getSetSuspendedStateInstructionDataEncoder() {
|
|
9461
|
-
return (0,
|
|
9462
|
-
(0,
|
|
9463
|
-
["discriminator", (0,
|
|
9464
|
-
["suspendLendingDeposits", (0,
|
|
9465
|
-
["suspendLendingWithdrawals", (0,
|
|
9466
|
-
["suspendAddLiquidity", (0,
|
|
9467
|
-
["suspendRemoveLiquidity", (0,
|
|
9320
|
+
return (0, import_kit64.transformEncoder)(
|
|
9321
|
+
(0, import_kit64.getStructEncoder)([
|
|
9322
|
+
["discriminator", (0, import_kit64.fixEncoderSize)((0, import_kit64.getBytesEncoder)(), 8)],
|
|
9323
|
+
["suspendLendingDeposits", (0, import_kit64.getBooleanEncoder)()],
|
|
9324
|
+
["suspendLendingWithdrawals", (0, import_kit64.getBooleanEncoder)()],
|
|
9325
|
+
["suspendAddLiquidity", (0, import_kit64.getBooleanEncoder)()],
|
|
9326
|
+
["suspendRemoveLiquidity", (0, import_kit64.getBooleanEncoder)()]
|
|
9468
9327
|
]),
|
|
9469
9328
|
(value) => ({ ...value, discriminator: SET_SUSPENDED_STATE_DISCRIMINATOR })
|
|
9470
9329
|
);
|
|
9471
9330
|
}
|
|
9472
9331
|
function getSetSuspendedStateInstructionDataDecoder() {
|
|
9473
|
-
return (0,
|
|
9474
|
-
["discriminator", (0,
|
|
9475
|
-
["suspendLendingDeposits", (0,
|
|
9476
|
-
["suspendLendingWithdrawals", (0,
|
|
9477
|
-
["suspendAddLiquidity", (0,
|
|
9478
|
-
["suspendRemoveLiquidity", (0,
|
|
9332
|
+
return (0, import_kit64.getStructDecoder)([
|
|
9333
|
+
["discriminator", (0, import_kit64.fixDecoderSize)((0, import_kit64.getBytesDecoder)(), 8)],
|
|
9334
|
+
["suspendLendingDeposits", (0, import_kit64.getBooleanDecoder)()],
|
|
9335
|
+
["suspendLendingWithdrawals", (0, import_kit64.getBooleanDecoder)()],
|
|
9336
|
+
["suspendAddLiquidity", (0, import_kit64.getBooleanDecoder)()],
|
|
9337
|
+
["suspendRemoveLiquidity", (0, import_kit64.getBooleanDecoder)()]
|
|
9479
9338
|
]);
|
|
9480
9339
|
}
|
|
9481
9340
|
function getSetSuspendedStateInstructionDataCodec() {
|
|
9482
|
-
return (0,
|
|
9341
|
+
return (0, import_kit64.combineCodec)(
|
|
9483
9342
|
getSetSuspendedStateInstructionDataEncoder(),
|
|
9484
9343
|
getSetSuspendedStateInstructionDataDecoder()
|
|
9485
9344
|
);
|
|
@@ -9526,7 +9385,7 @@ function parseSetSuspendedStateInstruction(instruction) {
|
|
|
9526
9385
|
}
|
|
9527
9386
|
|
|
9528
9387
|
// src/generated/instructions/setTunaLpPositionFlags.ts
|
|
9529
|
-
var
|
|
9388
|
+
var import_kit65 = require("@solana/kit");
|
|
9530
9389
|
var SET_TUNA_LP_POSITION_FLAGS_DISCRIMINATOR = new Uint8Array([
|
|
9531
9390
|
110,
|
|
9532
9391
|
73,
|
|
@@ -9538,15 +9397,15 @@ var SET_TUNA_LP_POSITION_FLAGS_DISCRIMINATOR = new Uint8Array([
|
|
|
9538
9397
|
57
|
|
9539
9398
|
]);
|
|
9540
9399
|
function getSetTunaLpPositionFlagsDiscriminatorBytes() {
|
|
9541
|
-
return (0,
|
|
9400
|
+
return (0, import_kit65.fixEncoderSize)((0, import_kit65.getBytesEncoder)(), 8).encode(
|
|
9542
9401
|
SET_TUNA_LP_POSITION_FLAGS_DISCRIMINATOR
|
|
9543
9402
|
);
|
|
9544
9403
|
}
|
|
9545
9404
|
function getSetTunaLpPositionFlagsInstructionDataEncoder() {
|
|
9546
|
-
return (0,
|
|
9547
|
-
(0,
|
|
9548
|
-
["discriminator", (0,
|
|
9549
|
-
["flags", (0,
|
|
9405
|
+
return (0, import_kit65.transformEncoder)(
|
|
9406
|
+
(0, import_kit65.getStructEncoder)([
|
|
9407
|
+
["discriminator", (0, import_kit65.fixEncoderSize)((0, import_kit65.getBytesEncoder)(), 8)],
|
|
9408
|
+
["flags", (0, import_kit65.getU32Encoder)()]
|
|
9550
9409
|
]),
|
|
9551
9410
|
(value) => ({
|
|
9552
9411
|
...value,
|
|
@@ -9555,13 +9414,13 @@ function getSetTunaLpPositionFlagsInstructionDataEncoder() {
|
|
|
9555
9414
|
);
|
|
9556
9415
|
}
|
|
9557
9416
|
function getSetTunaLpPositionFlagsInstructionDataDecoder() {
|
|
9558
|
-
return (0,
|
|
9559
|
-
["discriminator", (0,
|
|
9560
|
-
["flags", (0,
|
|
9417
|
+
return (0, import_kit65.getStructDecoder)([
|
|
9418
|
+
["discriminator", (0, import_kit65.fixDecoderSize)((0, import_kit65.getBytesDecoder)(), 8)],
|
|
9419
|
+
["flags", (0, import_kit65.getU32Decoder)()]
|
|
9561
9420
|
]);
|
|
9562
9421
|
}
|
|
9563
9422
|
function getSetTunaLpPositionFlagsInstructionDataCodec() {
|
|
9564
|
-
return (0,
|
|
9423
|
+
return (0, import_kit65.combineCodec)(
|
|
9565
9424
|
getSetTunaLpPositionFlagsInstructionDataEncoder(),
|
|
9566
9425
|
getSetTunaLpPositionFlagsInstructionDataDecoder()
|
|
9567
9426
|
);
|
|
@@ -9610,7 +9469,7 @@ function parseSetTunaLpPositionFlagsInstruction(instruction) {
|
|
|
9610
9469
|
}
|
|
9611
9470
|
|
|
9612
9471
|
// src/generated/instructions/setTunaLpPositionLimitOrders.ts
|
|
9613
|
-
var
|
|
9472
|
+
var import_kit66 = require("@solana/kit");
|
|
9614
9473
|
var SET_TUNA_LP_POSITION_LIMIT_ORDERS_DISCRIMINATOR = new Uint8Array([
|
|
9615
9474
|
65,
|
|
9616
9475
|
128,
|
|
@@ -9622,17 +9481,17 @@ var SET_TUNA_LP_POSITION_LIMIT_ORDERS_DISCRIMINATOR = new Uint8Array([
|
|
|
9622
9481
|
255
|
|
9623
9482
|
]);
|
|
9624
9483
|
function getSetTunaLpPositionLimitOrdersDiscriminatorBytes() {
|
|
9625
|
-
return (0,
|
|
9484
|
+
return (0, import_kit66.fixEncoderSize)((0, import_kit66.getBytesEncoder)(), 8).encode(
|
|
9626
9485
|
SET_TUNA_LP_POSITION_LIMIT_ORDERS_DISCRIMINATOR
|
|
9627
9486
|
);
|
|
9628
9487
|
}
|
|
9629
9488
|
function getSetTunaLpPositionLimitOrdersInstructionDataEncoder() {
|
|
9630
|
-
return (0,
|
|
9631
|
-
(0,
|
|
9632
|
-
["discriminator", (0,
|
|
9633
|
-
["lowerLimitOrderSqrtPrice", (0,
|
|
9634
|
-
["upperLimitOrderSqrtPrice", (0,
|
|
9635
|
-
["swapToTokenOnLimitOrder", (0,
|
|
9489
|
+
return (0, import_kit66.transformEncoder)(
|
|
9490
|
+
(0, import_kit66.getStructEncoder)([
|
|
9491
|
+
["discriminator", (0, import_kit66.fixEncoderSize)((0, import_kit66.getBytesEncoder)(), 8)],
|
|
9492
|
+
["lowerLimitOrderSqrtPrice", (0, import_kit66.getU128Encoder)()],
|
|
9493
|
+
["upperLimitOrderSqrtPrice", (0, import_kit66.getU128Encoder)()],
|
|
9494
|
+
["swapToTokenOnLimitOrder", (0, import_kit66.getU8Encoder)()]
|
|
9636
9495
|
]),
|
|
9637
9496
|
(value) => ({
|
|
9638
9497
|
...value,
|
|
@@ -9641,15 +9500,15 @@ function getSetTunaLpPositionLimitOrdersInstructionDataEncoder() {
|
|
|
9641
9500
|
);
|
|
9642
9501
|
}
|
|
9643
9502
|
function getSetTunaLpPositionLimitOrdersInstructionDataDecoder() {
|
|
9644
|
-
return (0,
|
|
9645
|
-
["discriminator", (0,
|
|
9646
|
-
["lowerLimitOrderSqrtPrice", (0,
|
|
9647
|
-
["upperLimitOrderSqrtPrice", (0,
|
|
9648
|
-
["swapToTokenOnLimitOrder", (0,
|
|
9503
|
+
return (0, import_kit66.getStructDecoder)([
|
|
9504
|
+
["discriminator", (0, import_kit66.fixDecoderSize)((0, import_kit66.getBytesDecoder)(), 8)],
|
|
9505
|
+
["lowerLimitOrderSqrtPrice", (0, import_kit66.getU128Decoder)()],
|
|
9506
|
+
["upperLimitOrderSqrtPrice", (0, import_kit66.getU128Decoder)()],
|
|
9507
|
+
["swapToTokenOnLimitOrder", (0, import_kit66.getU8Decoder)()]
|
|
9649
9508
|
]);
|
|
9650
9509
|
}
|
|
9651
9510
|
function getSetTunaLpPositionLimitOrdersInstructionDataCodec() {
|
|
9652
|
-
return (0,
|
|
9511
|
+
return (0, import_kit66.combineCodec)(
|
|
9653
9512
|
getSetTunaLpPositionLimitOrdersInstructionDataEncoder(),
|
|
9654
9513
|
getSetTunaLpPositionLimitOrdersInstructionDataDecoder()
|
|
9655
9514
|
);
|
|
@@ -9698,18 +9557,18 @@ function parseSetTunaLpPositionLimitOrdersInstruction(instruction) {
|
|
|
9698
9557
|
}
|
|
9699
9558
|
|
|
9700
9559
|
// src/generated/instructions/setTunaLpPositionRebalanceThreshold.ts
|
|
9701
|
-
var
|
|
9560
|
+
var import_kit67 = require("@solana/kit");
|
|
9702
9561
|
var SET_TUNA_LP_POSITION_REBALANCE_THRESHOLD_DISCRIMINATOR = new Uint8Array([244, 174, 185, 58, 90, 150, 162, 51]);
|
|
9703
9562
|
function getSetTunaLpPositionRebalanceThresholdDiscriminatorBytes() {
|
|
9704
|
-
return (0,
|
|
9563
|
+
return (0, import_kit67.fixEncoderSize)((0, import_kit67.getBytesEncoder)(), 8).encode(
|
|
9705
9564
|
SET_TUNA_LP_POSITION_REBALANCE_THRESHOLD_DISCRIMINATOR
|
|
9706
9565
|
);
|
|
9707
9566
|
}
|
|
9708
9567
|
function getSetTunaLpPositionRebalanceThresholdInstructionDataEncoder() {
|
|
9709
|
-
return (0,
|
|
9710
|
-
(0,
|
|
9711
|
-
["discriminator", (0,
|
|
9712
|
-
["rebalanceThresholdTicks", (0,
|
|
9568
|
+
return (0, import_kit67.transformEncoder)(
|
|
9569
|
+
(0, import_kit67.getStructEncoder)([
|
|
9570
|
+
["discriminator", (0, import_kit67.fixEncoderSize)((0, import_kit67.getBytesEncoder)(), 8)],
|
|
9571
|
+
["rebalanceThresholdTicks", (0, import_kit67.getU32Encoder)()]
|
|
9713
9572
|
]),
|
|
9714
9573
|
(value) => ({
|
|
9715
9574
|
...value,
|
|
@@ -9718,13 +9577,13 @@ function getSetTunaLpPositionRebalanceThresholdInstructionDataEncoder() {
|
|
|
9718
9577
|
);
|
|
9719
9578
|
}
|
|
9720
9579
|
function getSetTunaLpPositionRebalanceThresholdInstructionDataDecoder() {
|
|
9721
|
-
return (0,
|
|
9722
|
-
["discriminator", (0,
|
|
9723
|
-
["rebalanceThresholdTicks", (0,
|
|
9580
|
+
return (0, import_kit67.getStructDecoder)([
|
|
9581
|
+
["discriminator", (0, import_kit67.fixDecoderSize)((0, import_kit67.getBytesDecoder)(), 8)],
|
|
9582
|
+
["rebalanceThresholdTicks", (0, import_kit67.getU32Decoder)()]
|
|
9724
9583
|
]);
|
|
9725
9584
|
}
|
|
9726
9585
|
function getSetTunaLpPositionRebalanceThresholdInstructionDataCodec() {
|
|
9727
|
-
return (0,
|
|
9586
|
+
return (0, import_kit67.combineCodec)(
|
|
9728
9587
|
getSetTunaLpPositionRebalanceThresholdInstructionDataEncoder(),
|
|
9729
9588
|
getSetTunaLpPositionRebalanceThresholdInstructionDataDecoder()
|
|
9730
9589
|
);
|
|
@@ -9773,21 +9632,21 @@ function parseSetTunaLpPositionRebalanceThresholdInstruction(instruction) {
|
|
|
9773
9632
|
}
|
|
9774
9633
|
|
|
9775
9634
|
// src/generated/instructions/setTunaSpotPositionLimitOrders.ts
|
|
9776
|
-
var
|
|
9635
|
+
var import_kit68 = require("@solana/kit");
|
|
9777
9636
|
var SET_TUNA_SPOT_POSITION_LIMIT_ORDERS_DISCRIMINATOR = new Uint8Array(
|
|
9778
9637
|
[10, 180, 19, 205, 169, 133, 52, 118]
|
|
9779
9638
|
);
|
|
9780
9639
|
function getSetTunaSpotPositionLimitOrdersDiscriminatorBytes() {
|
|
9781
|
-
return (0,
|
|
9640
|
+
return (0, import_kit68.fixEncoderSize)((0, import_kit68.getBytesEncoder)(), 8).encode(
|
|
9782
9641
|
SET_TUNA_SPOT_POSITION_LIMIT_ORDERS_DISCRIMINATOR
|
|
9783
9642
|
);
|
|
9784
9643
|
}
|
|
9785
9644
|
function getSetTunaSpotPositionLimitOrdersInstructionDataEncoder() {
|
|
9786
|
-
return (0,
|
|
9787
|
-
(0,
|
|
9788
|
-
["discriminator", (0,
|
|
9789
|
-
["lowerLimitOrderSqrtPrice", (0,
|
|
9790
|
-
["upperLimitOrderSqrtPrice", (0,
|
|
9645
|
+
return (0, import_kit68.transformEncoder)(
|
|
9646
|
+
(0, import_kit68.getStructEncoder)([
|
|
9647
|
+
["discriminator", (0, import_kit68.fixEncoderSize)((0, import_kit68.getBytesEncoder)(), 8)],
|
|
9648
|
+
["lowerLimitOrderSqrtPrice", (0, import_kit68.getU128Encoder)()],
|
|
9649
|
+
["upperLimitOrderSqrtPrice", (0, import_kit68.getU128Encoder)()]
|
|
9791
9650
|
]),
|
|
9792
9651
|
(value) => ({
|
|
9793
9652
|
...value,
|
|
@@ -9796,14 +9655,14 @@ function getSetTunaSpotPositionLimitOrdersInstructionDataEncoder() {
|
|
|
9796
9655
|
);
|
|
9797
9656
|
}
|
|
9798
9657
|
function getSetTunaSpotPositionLimitOrdersInstructionDataDecoder() {
|
|
9799
|
-
return (0,
|
|
9800
|
-
["discriminator", (0,
|
|
9801
|
-
["lowerLimitOrderSqrtPrice", (0,
|
|
9802
|
-
["upperLimitOrderSqrtPrice", (0,
|
|
9658
|
+
return (0, import_kit68.getStructDecoder)([
|
|
9659
|
+
["discriminator", (0, import_kit68.fixDecoderSize)((0, import_kit68.getBytesDecoder)(), 8)],
|
|
9660
|
+
["lowerLimitOrderSqrtPrice", (0, import_kit68.getU128Decoder)()],
|
|
9661
|
+
["upperLimitOrderSqrtPrice", (0, import_kit68.getU128Decoder)()]
|
|
9803
9662
|
]);
|
|
9804
9663
|
}
|
|
9805
9664
|
function getSetTunaSpotPositionLimitOrdersInstructionDataCodec() {
|
|
9806
|
-
return (0,
|
|
9665
|
+
return (0, import_kit68.combineCodec)(
|
|
9807
9666
|
getSetTunaSpotPositionLimitOrdersInstructionDataEncoder(),
|
|
9808
9667
|
getSetTunaSpotPositionLimitOrdersInstructionDataDecoder()
|
|
9809
9668
|
);
|
|
@@ -9852,7 +9711,7 @@ function parseSetTunaSpotPositionLimitOrdersInstruction(instruction) {
|
|
|
9852
9711
|
}
|
|
9853
9712
|
|
|
9854
9713
|
// src/generated/instructions/updateMarket.ts
|
|
9855
|
-
var
|
|
9714
|
+
var import_kit69 = require("@solana/kit");
|
|
9856
9715
|
var UPDATE_MARKET_DISCRIMINATOR = new Uint8Array([
|
|
9857
9716
|
153,
|
|
9858
9717
|
39,
|
|
@@ -9864,55 +9723,55 @@ var UPDATE_MARKET_DISCRIMINATOR = new Uint8Array([
|
|
|
9864
9723
|
217
|
|
9865
9724
|
]);
|
|
9866
9725
|
function getUpdateMarketDiscriminatorBytes() {
|
|
9867
|
-
return (0,
|
|
9726
|
+
return (0, import_kit69.fixEncoderSize)((0, import_kit69.getBytesEncoder)(), 8).encode(
|
|
9868
9727
|
UPDATE_MARKET_DISCRIMINATOR
|
|
9869
9728
|
);
|
|
9870
9729
|
}
|
|
9871
9730
|
function getUpdateMarketInstructionDataEncoder() {
|
|
9872
|
-
return (0,
|
|
9873
|
-
(0,
|
|
9874
|
-
["discriminator", (0,
|
|
9875
|
-
["addressLookupTable", (0,
|
|
9876
|
-
["maxLeverage", (0,
|
|
9877
|
-
["protocolFee", (0,
|
|
9878
|
-
["protocolFeeOnCollateral", (0,
|
|
9879
|
-
["liquidationFee", (0,
|
|
9880
|
-
["liquidationThreshold", (0,
|
|
9881
|
-
["limitOrderExecutionFee", (0,
|
|
9882
|
-
["oraclePriceDeviationThreshold", (0,
|
|
9883
|
-
["disabled", (0,
|
|
9884
|
-
["borrowLimitA", (0,
|
|
9885
|
-
["borrowLimitB", (0,
|
|
9886
|
-
["maxSwapSlippage", (0,
|
|
9887
|
-
["rebalanceProtocolFee", (0,
|
|
9888
|
-
["spotPositionSizeLimitA", (0,
|
|
9889
|
-
["spotPositionSizeLimitB", (0,
|
|
9731
|
+
return (0, import_kit69.transformEncoder)(
|
|
9732
|
+
(0, import_kit69.getStructEncoder)([
|
|
9733
|
+
["discriminator", (0, import_kit69.fixEncoderSize)((0, import_kit69.getBytesEncoder)(), 8)],
|
|
9734
|
+
["addressLookupTable", (0, import_kit69.getAddressEncoder)()],
|
|
9735
|
+
["maxLeverage", (0, import_kit69.getU32Encoder)()],
|
|
9736
|
+
["protocolFee", (0, import_kit69.getU16Encoder)()],
|
|
9737
|
+
["protocolFeeOnCollateral", (0, import_kit69.getU16Encoder)()],
|
|
9738
|
+
["liquidationFee", (0, import_kit69.getU32Encoder)()],
|
|
9739
|
+
["liquidationThreshold", (0, import_kit69.getU32Encoder)()],
|
|
9740
|
+
["limitOrderExecutionFee", (0, import_kit69.getU32Encoder)()],
|
|
9741
|
+
["oraclePriceDeviationThreshold", (0, import_kit69.getU32Encoder)()],
|
|
9742
|
+
["disabled", (0, import_kit69.getBooleanEncoder)()],
|
|
9743
|
+
["borrowLimitA", (0, import_kit69.getU64Encoder)()],
|
|
9744
|
+
["borrowLimitB", (0, import_kit69.getU64Encoder)()],
|
|
9745
|
+
["maxSwapSlippage", (0, import_kit69.getU32Encoder)()],
|
|
9746
|
+
["rebalanceProtocolFee", (0, import_kit69.getU32Encoder)()],
|
|
9747
|
+
["spotPositionSizeLimitA", (0, import_kit69.getU64Encoder)()],
|
|
9748
|
+
["spotPositionSizeLimitB", (0, import_kit69.getU64Encoder)()]
|
|
9890
9749
|
]),
|
|
9891
9750
|
(value) => ({ ...value, discriminator: UPDATE_MARKET_DISCRIMINATOR })
|
|
9892
9751
|
);
|
|
9893
9752
|
}
|
|
9894
9753
|
function getUpdateMarketInstructionDataDecoder() {
|
|
9895
|
-
return (0,
|
|
9896
|
-
["discriminator", (0,
|
|
9897
|
-
["addressLookupTable", (0,
|
|
9898
|
-
["maxLeverage", (0,
|
|
9899
|
-
["protocolFee", (0,
|
|
9900
|
-
["protocolFeeOnCollateral", (0,
|
|
9901
|
-
["liquidationFee", (0,
|
|
9902
|
-
["liquidationThreshold", (0,
|
|
9903
|
-
["limitOrderExecutionFee", (0,
|
|
9904
|
-
["oraclePriceDeviationThreshold", (0,
|
|
9905
|
-
["disabled", (0,
|
|
9906
|
-
["borrowLimitA", (0,
|
|
9907
|
-
["borrowLimitB", (0,
|
|
9908
|
-
["maxSwapSlippage", (0,
|
|
9909
|
-
["rebalanceProtocolFee", (0,
|
|
9910
|
-
["spotPositionSizeLimitA", (0,
|
|
9911
|
-
["spotPositionSizeLimitB", (0,
|
|
9754
|
+
return (0, import_kit69.getStructDecoder)([
|
|
9755
|
+
["discriminator", (0, import_kit69.fixDecoderSize)((0, import_kit69.getBytesDecoder)(), 8)],
|
|
9756
|
+
["addressLookupTable", (0, import_kit69.getAddressDecoder)()],
|
|
9757
|
+
["maxLeverage", (0, import_kit69.getU32Decoder)()],
|
|
9758
|
+
["protocolFee", (0, import_kit69.getU16Decoder)()],
|
|
9759
|
+
["protocolFeeOnCollateral", (0, import_kit69.getU16Decoder)()],
|
|
9760
|
+
["liquidationFee", (0, import_kit69.getU32Decoder)()],
|
|
9761
|
+
["liquidationThreshold", (0, import_kit69.getU32Decoder)()],
|
|
9762
|
+
["limitOrderExecutionFee", (0, import_kit69.getU32Decoder)()],
|
|
9763
|
+
["oraclePriceDeviationThreshold", (0, import_kit69.getU32Decoder)()],
|
|
9764
|
+
["disabled", (0, import_kit69.getBooleanDecoder)()],
|
|
9765
|
+
["borrowLimitA", (0, import_kit69.getU64Decoder)()],
|
|
9766
|
+
["borrowLimitB", (0, import_kit69.getU64Decoder)()],
|
|
9767
|
+
["maxSwapSlippage", (0, import_kit69.getU32Decoder)()],
|
|
9768
|
+
["rebalanceProtocolFee", (0, import_kit69.getU32Decoder)()],
|
|
9769
|
+
["spotPositionSizeLimitA", (0, import_kit69.getU64Decoder)()],
|
|
9770
|
+
["spotPositionSizeLimitB", (0, import_kit69.getU64Decoder)()]
|
|
9912
9771
|
]);
|
|
9913
9772
|
}
|
|
9914
9773
|
function getUpdateMarketInstructionDataCodec() {
|
|
9915
|
-
return (0,
|
|
9774
|
+
return (0, import_kit69.combineCodec)(
|
|
9916
9775
|
getUpdateMarketInstructionDataEncoder(),
|
|
9917
9776
|
getUpdateMarketInstructionDataDecoder()
|
|
9918
9777
|
);
|
|
@@ -9962,7 +9821,7 @@ function parseUpdateMarketInstruction(instruction) {
|
|
|
9962
9821
|
}
|
|
9963
9822
|
|
|
9964
9823
|
// src/generated/instructions/updateVault.ts
|
|
9965
|
-
var
|
|
9824
|
+
var import_kit70 = require("@solana/kit");
|
|
9966
9825
|
var UPDATE_VAULT_DISCRIMINATOR = new Uint8Array([
|
|
9967
9826
|
67,
|
|
9968
9827
|
229,
|
|
@@ -9974,33 +9833,33 @@ var UPDATE_VAULT_DISCRIMINATOR = new Uint8Array([
|
|
|
9974
9833
|
60
|
|
9975
9834
|
]);
|
|
9976
9835
|
function getUpdateVaultDiscriminatorBytes() {
|
|
9977
|
-
return (0,
|
|
9836
|
+
return (0, import_kit70.fixEncoderSize)((0, import_kit70.getBytesEncoder)(), 8).encode(
|
|
9978
9837
|
UPDATE_VAULT_DISCRIMINATOR
|
|
9979
9838
|
);
|
|
9980
9839
|
}
|
|
9981
9840
|
function getUpdateVaultInstructionDataEncoder() {
|
|
9982
|
-
return (0,
|
|
9983
|
-
(0,
|
|
9984
|
-
["discriminator", (0,
|
|
9985
|
-
["interestRate", (0,
|
|
9986
|
-
["supplyLimit", (0,
|
|
9987
|
-
["pythOraclePriceUpdate", (0,
|
|
9988
|
-
["pythOracleFeedId", (0,
|
|
9841
|
+
return (0, import_kit70.transformEncoder)(
|
|
9842
|
+
(0, import_kit70.getStructEncoder)([
|
|
9843
|
+
["discriminator", (0, import_kit70.fixEncoderSize)((0, import_kit70.getBytesEncoder)(), 8)],
|
|
9844
|
+
["interestRate", (0, import_kit70.getU64Encoder)()],
|
|
9845
|
+
["supplyLimit", (0, import_kit70.getU64Encoder)()],
|
|
9846
|
+
["pythOraclePriceUpdate", (0, import_kit70.getAddressEncoder)()],
|
|
9847
|
+
["pythOracleFeedId", (0, import_kit70.getAddressEncoder)()]
|
|
9989
9848
|
]),
|
|
9990
9849
|
(value) => ({ ...value, discriminator: UPDATE_VAULT_DISCRIMINATOR })
|
|
9991
9850
|
);
|
|
9992
9851
|
}
|
|
9993
9852
|
function getUpdateVaultInstructionDataDecoder() {
|
|
9994
|
-
return (0,
|
|
9995
|
-
["discriminator", (0,
|
|
9996
|
-
["interestRate", (0,
|
|
9997
|
-
["supplyLimit", (0,
|
|
9998
|
-
["pythOraclePriceUpdate", (0,
|
|
9999
|
-
["pythOracleFeedId", (0,
|
|
9853
|
+
return (0, import_kit70.getStructDecoder)([
|
|
9854
|
+
["discriminator", (0, import_kit70.fixDecoderSize)((0, import_kit70.getBytesDecoder)(), 8)],
|
|
9855
|
+
["interestRate", (0, import_kit70.getU64Decoder)()],
|
|
9856
|
+
["supplyLimit", (0, import_kit70.getU64Decoder)()],
|
|
9857
|
+
["pythOraclePriceUpdate", (0, import_kit70.getAddressDecoder)()],
|
|
9858
|
+
["pythOracleFeedId", (0, import_kit70.getAddressDecoder)()]
|
|
10000
9859
|
]);
|
|
10001
9860
|
}
|
|
10002
9861
|
function getUpdateVaultInstructionDataCodec() {
|
|
10003
|
-
return (0,
|
|
9862
|
+
return (0, import_kit70.combineCodec)(
|
|
10004
9863
|
getUpdateVaultInstructionDataEncoder(),
|
|
10005
9864
|
getUpdateVaultInstructionDataDecoder()
|
|
10006
9865
|
);
|
|
@@ -10050,7 +9909,7 @@ function parseUpdateVaultInstruction(instruction) {
|
|
|
10050
9909
|
}
|
|
10051
9910
|
|
|
10052
9911
|
// src/generated/instructions/withdraw.ts
|
|
10053
|
-
var
|
|
9912
|
+
var import_kit71 = require("@solana/kit");
|
|
10054
9913
|
var WITHDRAW_DISCRIMINATOR = new Uint8Array([
|
|
10055
9914
|
183,
|
|
10056
9915
|
18,
|
|
@@ -10062,27 +9921,27 @@ var WITHDRAW_DISCRIMINATOR = new Uint8Array([
|
|
|
10062
9921
|
34
|
|
10063
9922
|
]);
|
|
10064
9923
|
function getWithdrawDiscriminatorBytes() {
|
|
10065
|
-
return (0,
|
|
9924
|
+
return (0, import_kit71.fixEncoderSize)((0, import_kit71.getBytesEncoder)(), 8).encode(WITHDRAW_DISCRIMINATOR);
|
|
10066
9925
|
}
|
|
10067
9926
|
function getWithdrawInstructionDataEncoder() {
|
|
10068
|
-
return (0,
|
|
10069
|
-
(0,
|
|
10070
|
-
["discriminator", (0,
|
|
10071
|
-
["funds", (0,
|
|
10072
|
-
["shares", (0,
|
|
9927
|
+
return (0, import_kit71.transformEncoder)(
|
|
9928
|
+
(0, import_kit71.getStructEncoder)([
|
|
9929
|
+
["discriminator", (0, import_kit71.fixEncoderSize)((0, import_kit71.getBytesEncoder)(), 8)],
|
|
9930
|
+
["funds", (0, import_kit71.getU64Encoder)()],
|
|
9931
|
+
["shares", (0, import_kit71.getU64Encoder)()]
|
|
10073
9932
|
]),
|
|
10074
9933
|
(value) => ({ ...value, discriminator: WITHDRAW_DISCRIMINATOR })
|
|
10075
9934
|
);
|
|
10076
9935
|
}
|
|
10077
9936
|
function getWithdrawInstructionDataDecoder() {
|
|
10078
|
-
return (0,
|
|
10079
|
-
["discriminator", (0,
|
|
10080
|
-
["funds", (0,
|
|
10081
|
-
["shares", (0,
|
|
9937
|
+
return (0, import_kit71.getStructDecoder)([
|
|
9938
|
+
["discriminator", (0, import_kit71.fixDecoderSize)((0, import_kit71.getBytesDecoder)(), 8)],
|
|
9939
|
+
["funds", (0, import_kit71.getU64Decoder)()],
|
|
9940
|
+
["shares", (0, import_kit71.getU64Decoder)()]
|
|
10082
9941
|
]);
|
|
10083
9942
|
}
|
|
10084
9943
|
function getWithdrawInstructionDataCodec() {
|
|
10085
|
-
return (0,
|
|
9944
|
+
return (0, import_kit71.combineCodec)(
|
|
10086
9945
|
getWithdrawInstructionDataEncoder(),
|
|
10087
9946
|
getWithdrawInstructionDataDecoder()
|
|
10088
9947
|
);
|
|
@@ -10153,11 +10012,11 @@ function parseWithdrawInstruction(instruction) {
|
|
|
10153
10012
|
}
|
|
10154
10013
|
|
|
10155
10014
|
// src/pda.ts
|
|
10156
|
-
var
|
|
10015
|
+
var import_kit73 = require("@solana/kit");
|
|
10157
10016
|
|
|
10158
10017
|
// src/consts.ts
|
|
10159
|
-
var
|
|
10160
|
-
var DEFAULT_ADDRESS = (0,
|
|
10018
|
+
var import_kit72 = require("@solana/kit");
|
|
10019
|
+
var DEFAULT_ADDRESS = (0, import_kit72.address)("11111111111111111111111111111111");
|
|
10161
10020
|
var HUNDRED_PERCENT = 1e6;
|
|
10162
10021
|
var HUNDRED_PERCENTn = 1000000n;
|
|
10163
10022
|
var LEVERAGE_ONE = HUNDRED_PERCENT;
|
|
@@ -10178,48 +10037,48 @@ var TUNA_POSITION_FLAGS_UPPER_LIMIT_ORDER_SWAP_TO_TOKEN_B = 1 << 3;
|
|
|
10178
10037
|
var TUNA_POSITION_FLAGS_AUTO_COMPOUND_YIELD = 1 << 4;
|
|
10179
10038
|
var TUNA_POSITION_FLAGS_AUTO_COMPOUND_YIELD_WITH_LEVERAGE = 1 << 5;
|
|
10180
10039
|
var TUNA_POSITION_FLAGS_ALLOW_REBALANCING = 1 << 6;
|
|
10181
|
-
var WP_NFT_UPDATE_AUTH = (0,
|
|
10182
|
-
var DEFAULT_PUSH_ORACLE_PROGRAM_ID = (0,
|
|
10183
|
-
var JUPITER_EVENT_AUTHORITY = (0,
|
|
10184
|
-
var JUPITER_PROGRAM_AUTHORITY = (0,
|
|
10040
|
+
var WP_NFT_UPDATE_AUTH = (0, import_kit72.address)("3axbTs2z5GBy6usVbNVoqEgZMng3vZvMnAoX29BFfwhr");
|
|
10041
|
+
var DEFAULT_PUSH_ORACLE_PROGRAM_ID = (0, import_kit72.address)("pythWSnswVUd12oZpeFP8e9CVaEqJg25g1Vtc2biRsT");
|
|
10042
|
+
var JUPITER_EVENT_AUTHORITY = (0, import_kit72.address)("D8cy77BBepLMngZx6ZukaTff5hCt1HrWyKk3Hnd9oitf");
|
|
10043
|
+
var JUPITER_PROGRAM_AUTHORITY = (0, import_kit72.address)("9nnLbotNTcUhvbrsA6Mdkx45Sm82G35zo28AqUvjExn8");
|
|
10185
10044
|
var MIN_SQRT_PRICE = 4295048016n;
|
|
10186
10045
|
var MAX_SQRT_PRICE = 79226673515401279992447579055n;
|
|
10187
10046
|
|
|
10188
10047
|
// src/pda.ts
|
|
10189
10048
|
async function getTunaConfigAddress() {
|
|
10190
|
-
return await (0,
|
|
10049
|
+
return await (0, import_kit73.getProgramDerivedAddress)({
|
|
10191
10050
|
programAddress: TUNA_PROGRAM_ADDRESS,
|
|
10192
10051
|
seeds: ["tuna_config"]
|
|
10193
10052
|
});
|
|
10194
10053
|
}
|
|
10195
10054
|
async function getMarketAddress(pool) {
|
|
10196
|
-
return await (0,
|
|
10055
|
+
return await (0, import_kit73.getProgramDerivedAddress)({
|
|
10197
10056
|
programAddress: TUNA_PROGRAM_ADDRESS,
|
|
10198
|
-
seeds: ["market", (0,
|
|
10057
|
+
seeds: ["market", (0, import_kit73.getAddressEncoder)().encode(pool)]
|
|
10199
10058
|
});
|
|
10200
10059
|
}
|
|
10201
10060
|
async function getLendingVaultAddress(mint) {
|
|
10202
|
-
return await (0,
|
|
10061
|
+
return await (0, import_kit73.getProgramDerivedAddress)({
|
|
10203
10062
|
programAddress: TUNA_PROGRAM_ADDRESS,
|
|
10204
|
-
seeds: ["vault", (0,
|
|
10063
|
+
seeds: ["vault", (0, import_kit73.getAddressEncoder)().encode(mint)]
|
|
10205
10064
|
});
|
|
10206
10065
|
}
|
|
10207
10066
|
async function getLendingPositionAddress(authority, mint) {
|
|
10208
|
-
return await (0,
|
|
10067
|
+
return await (0, import_kit73.getProgramDerivedAddress)({
|
|
10209
10068
|
programAddress: TUNA_PROGRAM_ADDRESS,
|
|
10210
|
-
seeds: ["lending_position", (0,
|
|
10069
|
+
seeds: ["lending_position", (0, import_kit73.getAddressEncoder)().encode(authority), (0, import_kit73.getAddressEncoder)().encode(mint)]
|
|
10211
10070
|
});
|
|
10212
10071
|
}
|
|
10213
10072
|
async function getTunaLpPositionAddress(positionMint) {
|
|
10214
|
-
return await (0,
|
|
10073
|
+
return await (0, import_kit73.getProgramDerivedAddress)({
|
|
10215
10074
|
programAddress: TUNA_PROGRAM_ADDRESS,
|
|
10216
|
-
seeds: ["tuna_position", (0,
|
|
10075
|
+
seeds: ["tuna_position", (0, import_kit73.getAddressEncoder)().encode(positionMint)]
|
|
10217
10076
|
});
|
|
10218
10077
|
}
|
|
10219
10078
|
async function getTunaSpotPositionAddress(authority, pool) {
|
|
10220
|
-
return await (0,
|
|
10079
|
+
return await (0, import_kit73.getProgramDerivedAddress)({
|
|
10221
10080
|
programAddress: TUNA_PROGRAM_ADDRESS,
|
|
10222
|
-
seeds: ["tuna_spot_position", (0,
|
|
10081
|
+
seeds: ["tuna_spot_position", (0, import_kit73.getAddressEncoder)().encode(authority), (0, import_kit73.getAddressEncoder)().encode(pool)]
|
|
10223
10082
|
});
|
|
10224
10083
|
}
|
|
10225
10084
|
async function getPythPriceUpdateAccountAddress(shardId, priceFeedId) {
|
|
@@ -10235,23 +10094,23 @@ async function getPythPriceUpdateAccountAddress(shardId, priceFeedId) {
|
|
|
10235
10094
|
}
|
|
10236
10095
|
const shardBuffer = Buffer.alloc(2);
|
|
10237
10096
|
shardBuffer.writeUint16LE(shardId, 0);
|
|
10238
|
-
return await (0,
|
|
10097
|
+
return await (0, import_kit73.getProgramDerivedAddress)({
|
|
10239
10098
|
programAddress: DEFAULT_PUSH_ORACLE_PROGRAM_ID,
|
|
10240
10099
|
seeds: [shardBuffer, priceFeedId]
|
|
10241
10100
|
});
|
|
10242
10101
|
}
|
|
10243
10102
|
|
|
10244
10103
|
// src/gpa/tunaLpPosition.ts
|
|
10245
|
-
var
|
|
10104
|
+
var import_kit75 = require("@solana/kit");
|
|
10246
10105
|
|
|
10247
10106
|
// src/gpa/utils.ts
|
|
10248
|
-
var
|
|
10107
|
+
var import_kit74 = require("@solana/kit");
|
|
10249
10108
|
async function fetchDecodedProgramAccounts(rpc, programAddress, filters, decoder) {
|
|
10250
10109
|
const accountInfos = await rpc.getProgramAccounts(programAddress, {
|
|
10251
10110
|
encoding: "base64",
|
|
10252
10111
|
filters
|
|
10253
10112
|
}).send();
|
|
10254
|
-
const encoder = (0,
|
|
10113
|
+
const encoder = (0, import_kit74.getBase64Encoder)();
|
|
10255
10114
|
const datas = accountInfos.map((x) => encoder.encode(x.account.data[0]));
|
|
10256
10115
|
const decoded = datas.map((x) => decoder.decode(x));
|
|
10257
10116
|
return decoded.map((data, i) => ({
|
|
@@ -10267,7 +10126,7 @@ function tunaLpPositionAuthorityFilter(address4) {
|
|
|
10267
10126
|
return {
|
|
10268
10127
|
memcmp: {
|
|
10269
10128
|
offset: 11n,
|
|
10270
|
-
bytes: (0,
|
|
10129
|
+
bytes: (0, import_kit75.getBase58Decoder)().decode((0, import_kit75.getAddressEncoder)().encode(address4)),
|
|
10271
10130
|
encoding: "base58"
|
|
10272
10131
|
}
|
|
10273
10132
|
};
|
|
@@ -10276,7 +10135,7 @@ function tunaLpPositionPoolFilter(address4) {
|
|
|
10276
10135
|
return {
|
|
10277
10136
|
memcmp: {
|
|
10278
10137
|
offset: 43n,
|
|
10279
|
-
bytes: (0,
|
|
10138
|
+
bytes: (0, import_kit75.getBase58Decoder)().decode((0, import_kit75.getAddressEncoder)().encode(address4)),
|
|
10280
10139
|
encoding: "base58"
|
|
10281
10140
|
}
|
|
10282
10141
|
};
|
|
@@ -10285,7 +10144,7 @@ function tunaLpPositionMintAFilter(address4) {
|
|
|
10285
10144
|
return {
|
|
10286
10145
|
memcmp: {
|
|
10287
10146
|
offset: 75n,
|
|
10288
|
-
bytes: (0,
|
|
10147
|
+
bytes: (0, import_kit75.getBase58Decoder)().decode((0, import_kit75.getAddressEncoder)().encode(address4)),
|
|
10289
10148
|
encoding: "base58"
|
|
10290
10149
|
}
|
|
10291
10150
|
};
|
|
@@ -10294,7 +10153,7 @@ function tunaLpPositionMintBFilter(address4) {
|
|
|
10294
10153
|
return {
|
|
10295
10154
|
memcmp: {
|
|
10296
10155
|
offset: 107n,
|
|
10297
|
-
bytes: (0,
|
|
10156
|
+
bytes: (0, import_kit75.getBase58Decoder)().decode((0, import_kit75.getAddressEncoder)().encode(address4)),
|
|
10298
10157
|
encoding: "base58"
|
|
10299
10158
|
}
|
|
10300
10159
|
};
|
|
@@ -10303,7 +10162,7 @@ function tunaLpPositionMintFilter(address4) {
|
|
|
10303
10162
|
return {
|
|
10304
10163
|
memcmp: {
|
|
10305
10164
|
offset: 139n,
|
|
10306
|
-
bytes: (0,
|
|
10165
|
+
bytes: (0, import_kit75.getBase58Decoder)().decode((0, import_kit75.getAddressEncoder)().encode(address4)),
|
|
10307
10166
|
encoding: "base58"
|
|
10308
10167
|
}
|
|
10309
10168
|
};
|
|
@@ -10312,13 +10171,13 @@ function tunaLpPositionMarketMakerFilter(marketMaker) {
|
|
|
10312
10171
|
return {
|
|
10313
10172
|
memcmp: {
|
|
10314
10173
|
offset: 277n,
|
|
10315
|
-
bytes: (0,
|
|
10174
|
+
bytes: (0, import_kit75.getBase58Decoder)().decode((0, import_kit75.getI8Encoder)().encode(marketMaker)),
|
|
10316
10175
|
encoding: "base58"
|
|
10317
10176
|
}
|
|
10318
10177
|
};
|
|
10319
10178
|
}
|
|
10320
10179
|
async function fetchAllTunaLpPositionWithFilter(rpc, ...filters) {
|
|
10321
|
-
const discriminator = (0,
|
|
10180
|
+
const discriminator = (0, import_kit75.getBase58Decoder)().decode(TUNA_LP_POSITION_DISCRIMINATOR);
|
|
10322
10181
|
const discriminatorFilter = {
|
|
10323
10182
|
memcmp: {
|
|
10324
10183
|
offset: 0n,
|
|
@@ -10335,12 +10194,12 @@ async function fetchAllTunaLpPositionWithFilter(rpc, ...filters) {
|
|
|
10335
10194
|
}
|
|
10336
10195
|
|
|
10337
10196
|
// src/gpa/tunaSpotPosition.ts
|
|
10338
|
-
var
|
|
10197
|
+
var import_kit76 = require("@solana/kit");
|
|
10339
10198
|
function tunaSpotPositionAuthorityFilter(address4) {
|
|
10340
10199
|
return {
|
|
10341
10200
|
memcmp: {
|
|
10342
10201
|
offset: 11n,
|
|
10343
|
-
bytes: (0,
|
|
10202
|
+
bytes: (0, import_kit76.getBase58Decoder)().decode((0, import_kit76.getAddressEncoder)().encode(address4)),
|
|
10344
10203
|
encoding: "base58"
|
|
10345
10204
|
}
|
|
10346
10205
|
};
|
|
@@ -10349,7 +10208,7 @@ function tunaSpotPositionPoolFilter(address4) {
|
|
|
10349
10208
|
return {
|
|
10350
10209
|
memcmp: {
|
|
10351
10210
|
offset: 43n,
|
|
10352
|
-
bytes: (0,
|
|
10211
|
+
bytes: (0, import_kit76.getBase58Decoder)().decode((0, import_kit76.getAddressEncoder)().encode(address4)),
|
|
10353
10212
|
encoding: "base58"
|
|
10354
10213
|
}
|
|
10355
10214
|
};
|
|
@@ -10358,7 +10217,7 @@ function tunaSpotPositionMintAFilter(address4) {
|
|
|
10358
10217
|
return {
|
|
10359
10218
|
memcmp: {
|
|
10360
10219
|
offset: 75n,
|
|
10361
|
-
bytes: (0,
|
|
10220
|
+
bytes: (0, import_kit76.getBase58Decoder)().decode((0, import_kit76.getAddressEncoder)().encode(address4)),
|
|
10362
10221
|
encoding: "base58"
|
|
10363
10222
|
}
|
|
10364
10223
|
};
|
|
@@ -10367,13 +10226,13 @@ function tunaSpotPositionMintBFilter(address4) {
|
|
|
10367
10226
|
return {
|
|
10368
10227
|
memcmp: {
|
|
10369
10228
|
offset: 107n,
|
|
10370
|
-
bytes: (0,
|
|
10229
|
+
bytes: (0, import_kit76.getBase58Decoder)().decode((0, import_kit76.getAddressEncoder)().encode(address4)),
|
|
10371
10230
|
encoding: "base58"
|
|
10372
10231
|
}
|
|
10373
10232
|
};
|
|
10374
10233
|
}
|
|
10375
10234
|
async function fetchAllTunaSpotPositionWithFilter(rpc, ...filters) {
|
|
10376
|
-
const discriminator = (0,
|
|
10235
|
+
const discriminator = (0, import_kit76.getBase58Decoder)().decode(TUNA_SPOT_POSITION_DISCRIMINATOR);
|
|
10377
10236
|
const discriminatorFilter = {
|
|
10378
10237
|
memcmp: {
|
|
10379
10238
|
offset: 0n,
|
|
@@ -10390,12 +10249,12 @@ async function fetchAllTunaSpotPositionWithFilter(rpc, ...filters) {
|
|
|
10390
10249
|
}
|
|
10391
10250
|
|
|
10392
10251
|
// src/gpa/lendingPosition.ts
|
|
10393
|
-
var
|
|
10252
|
+
var import_kit77 = require("@solana/kit");
|
|
10394
10253
|
function lendingPositionAuthorityFilter(address4) {
|
|
10395
10254
|
return {
|
|
10396
10255
|
memcmp: {
|
|
10397
10256
|
offset: 11n,
|
|
10398
|
-
bytes: (0,
|
|
10257
|
+
bytes: (0, import_kit77.getBase58Decoder)().decode((0, import_kit77.getAddressEncoder)().encode(address4)),
|
|
10399
10258
|
encoding: "base58"
|
|
10400
10259
|
}
|
|
10401
10260
|
};
|
|
@@ -10404,13 +10263,13 @@ function lendingPositionMintFilter(address4) {
|
|
|
10404
10263
|
return {
|
|
10405
10264
|
memcmp: {
|
|
10406
10265
|
offset: 43n,
|
|
10407
|
-
bytes: (0,
|
|
10266
|
+
bytes: (0, import_kit77.getBase58Decoder)().decode((0, import_kit77.getAddressEncoder)().encode(address4)),
|
|
10408
10267
|
encoding: "base58"
|
|
10409
10268
|
}
|
|
10410
10269
|
};
|
|
10411
10270
|
}
|
|
10412
10271
|
async function fetchAllLendingPositionWithFilter(rpc, ...filters) {
|
|
10413
|
-
const discriminator = (0,
|
|
10272
|
+
const discriminator = (0, import_kit77.getBase58Decoder)().decode(LENDING_POSITION_DISCRIMINATOR);
|
|
10414
10273
|
const discriminatorFilter = {
|
|
10415
10274
|
memcmp: {
|
|
10416
10275
|
offset: 0n,
|
|
@@ -10427,9 +10286,9 @@ async function fetchAllLendingPositionWithFilter(rpc, ...filters) {
|
|
|
10427
10286
|
}
|
|
10428
10287
|
|
|
10429
10288
|
// src/gpa/market.ts
|
|
10430
|
-
var
|
|
10289
|
+
var import_kit78 = require("@solana/kit");
|
|
10431
10290
|
async function fetchAllMarketWithFilter(rpc, ...filters) {
|
|
10432
|
-
const discriminator = (0,
|
|
10291
|
+
const discriminator = (0, import_kit78.getBase58Decoder)().decode(MARKET_DISCRIMINATOR);
|
|
10433
10292
|
const discriminatorFilter = {
|
|
10434
10293
|
memcmp: {
|
|
10435
10294
|
offset: 0n,
|
|
@@ -10531,11 +10390,11 @@ var FusionUtils = class {
|
|
|
10531
10390
|
};
|
|
10532
10391
|
|
|
10533
10392
|
// src/utils/token.ts
|
|
10534
|
-
var
|
|
10393
|
+
var import_kit79 = require("@solana/kit");
|
|
10535
10394
|
var import_system = require("@solana-program/system");
|
|
10536
10395
|
var import_token = require("@solana-program/token");
|
|
10537
10396
|
var import_token_2022 = require("@solana-program/token-2022");
|
|
10538
|
-
var NATIVE_MINT = (0,
|
|
10397
|
+
var NATIVE_MINT = (0, import_kit79.address)("So11111111111111111111111111111111111111112");
|
|
10539
10398
|
async function getCreateAtaInstruction(mint, owner, payer, tokenProgram = import_token.TOKEN_PROGRAM_ADDRESS) {
|
|
10540
10399
|
const ata = (await (0, import_token.findAssociatedTokenPda)({
|
|
10541
10400
|
mint,
|
|
@@ -10722,7 +10581,7 @@ function calculateProtocolFee(collateralAmount, borrowAmount, protocolFeeRateOnC
|
|
|
10722
10581
|
// src/txbuilder/increaseTunaLpPositionOrca.ts
|
|
10723
10582
|
var import_whirlpools_client2 = require("@orca-so/whirlpools-client");
|
|
10724
10583
|
var import_whirlpools_core2 = require("@orca-so/whirlpools-core");
|
|
10725
|
-
var
|
|
10584
|
+
var import_kit80 = require("@solana/kit");
|
|
10726
10585
|
var import_memo = require("@solana-program/memo");
|
|
10727
10586
|
var import_token_20222 = require("@solana-program/token-2022");
|
|
10728
10587
|
var import_assert = __toESM(require("assert"));
|
|
@@ -10896,16 +10755,16 @@ async function increaseTunaLpPositionOrcaInstruction(authority, tunaPosition, tu
|
|
|
10896
10755
|
tunaPosition.data.tickUpperIndex
|
|
10897
10756
|
);
|
|
10898
10757
|
const remainingAccounts = [
|
|
10899
|
-
{ address: swapTickArrays[0], role:
|
|
10900
|
-
{ address: swapTickArrays[1], role:
|
|
10901
|
-
{ address: swapTickArrays[2], role:
|
|
10902
|
-
{ address: swapTickArrays[3], role:
|
|
10903
|
-
{ address: swapTickArrays[4], role:
|
|
10904
|
-
{ address: lowerTickArrayAddress, role:
|
|
10905
|
-
{ address: upperTickArrayAddress, role:
|
|
10906
|
-
{ address: whirlpool.data.tokenVaultA, role:
|
|
10907
|
-
{ address: whirlpool.data.tokenVaultB, role:
|
|
10908
|
-
{ address: orcaOracleAddress, role:
|
|
10758
|
+
{ address: swapTickArrays[0], role: import_kit80.AccountRole.WRITABLE },
|
|
10759
|
+
{ address: swapTickArrays[1], role: import_kit80.AccountRole.WRITABLE },
|
|
10760
|
+
{ address: swapTickArrays[2], role: import_kit80.AccountRole.WRITABLE },
|
|
10761
|
+
{ address: swapTickArrays[3], role: import_kit80.AccountRole.WRITABLE },
|
|
10762
|
+
{ address: swapTickArrays[4], role: import_kit80.AccountRole.WRITABLE },
|
|
10763
|
+
{ address: lowerTickArrayAddress, role: import_kit80.AccountRole.WRITABLE },
|
|
10764
|
+
{ address: upperTickArrayAddress, role: import_kit80.AccountRole.WRITABLE },
|
|
10765
|
+
{ address: whirlpool.data.tokenVaultA, role: import_kit80.AccountRole.WRITABLE },
|
|
10766
|
+
{ address: whirlpool.data.tokenVaultB, role: import_kit80.AccountRole.WRITABLE },
|
|
10767
|
+
{ address: orcaOracleAddress, role: import_kit80.AccountRole.WRITABLE }
|
|
10909
10768
|
];
|
|
10910
10769
|
const remainingAccountsInfo = {
|
|
10911
10770
|
slices: [
|
|
@@ -10953,7 +10812,7 @@ async function increaseTunaLpPositionOrcaInstruction(authority, tunaPosition, tu
|
|
|
10953
10812
|
// src/txbuilder/increaseTunaLpPositionFusion.ts
|
|
10954
10813
|
var import_fusionamm_client2 = require("@crypticdot/fusionamm-client");
|
|
10955
10814
|
var import_fusionamm_core4 = require("@crypticdot/fusionamm-core");
|
|
10956
|
-
var
|
|
10815
|
+
var import_kit81 = require("@solana/kit");
|
|
10957
10816
|
var import_memo2 = require("@solana-program/memo");
|
|
10958
10817
|
var import_token_20223 = require("@solana-program/token-2022");
|
|
10959
10818
|
var import_assert2 = __toESM(require("assert"));
|
|
@@ -11132,15 +10991,15 @@ async function increaseTunaLpPositionFusionInstruction(authority, tunaPosition,
|
|
|
11132
10991
|
tunaPosition.data.tickUpperIndex
|
|
11133
10992
|
);
|
|
11134
10993
|
const remainingAccounts = [
|
|
11135
|
-
{ address: swapTickArrays[0], role:
|
|
11136
|
-
{ address: swapTickArrays[1], role:
|
|
11137
|
-
{ address: swapTickArrays[2], role:
|
|
11138
|
-
{ address: swapTickArrays[3], role:
|
|
11139
|
-
{ address: swapTickArrays[4], role:
|
|
11140
|
-
{ address: lowerTickArrayAddress, role:
|
|
11141
|
-
{ address: upperTickArrayAddress, role:
|
|
11142
|
-
{ address: fusionPool.data.tokenVaultA, role:
|
|
11143
|
-
{ address: fusionPool.data.tokenVaultB, role:
|
|
10994
|
+
{ address: swapTickArrays[0], role: import_kit81.AccountRole.WRITABLE },
|
|
10995
|
+
{ address: swapTickArrays[1], role: import_kit81.AccountRole.WRITABLE },
|
|
10996
|
+
{ address: swapTickArrays[2], role: import_kit81.AccountRole.WRITABLE },
|
|
10997
|
+
{ address: swapTickArrays[3], role: import_kit81.AccountRole.WRITABLE },
|
|
10998
|
+
{ address: swapTickArrays[4], role: import_kit81.AccountRole.WRITABLE },
|
|
10999
|
+
{ address: lowerTickArrayAddress, role: import_kit81.AccountRole.WRITABLE },
|
|
11000
|
+
{ address: upperTickArrayAddress, role: import_kit81.AccountRole.WRITABLE },
|
|
11001
|
+
{ address: fusionPool.data.tokenVaultA, role: import_kit81.AccountRole.WRITABLE },
|
|
11002
|
+
{ address: fusionPool.data.tokenVaultB, role: import_kit81.AccountRole.WRITABLE }
|
|
11144
11003
|
];
|
|
11145
11004
|
const remainingAccountsInfo = {
|
|
11146
11005
|
slices: [
|
|
@@ -11278,7 +11137,7 @@ async function closeTunaLpPositionFusionInstruction(rpc, authority, positionMint
|
|
|
11278
11137
|
|
|
11279
11138
|
// src/txbuilder/collectAndCompoundFeesOrca.ts
|
|
11280
11139
|
var import_whirlpools_client4 = require("@orca-so/whirlpools-client");
|
|
11281
|
-
var
|
|
11140
|
+
var import_kit82 = require("@solana/kit");
|
|
11282
11141
|
var import_memo3 = require("@solana-program/memo");
|
|
11283
11142
|
var import_token_20226 = require("@solana-program/token-2022");
|
|
11284
11143
|
var import_assert5 = __toESM(require("assert"));
|
|
@@ -11376,16 +11235,16 @@ async function collectAndCompoundFeesOrcaInstruction(authority, tunaConfig, tuna
|
|
|
11376
11235
|
tunaPosition.data.tickUpperIndex
|
|
11377
11236
|
);
|
|
11378
11237
|
const remainingAccounts = [
|
|
11379
|
-
{ address: swapTickArrays[0], role:
|
|
11380
|
-
{ address: swapTickArrays[1], role:
|
|
11381
|
-
{ address: swapTickArrays[2], role:
|
|
11382
|
-
{ address: swapTickArrays[3], role:
|
|
11383
|
-
{ address: swapTickArrays[4], role:
|
|
11384
|
-
{ address: lowerTickArrayAddress, role:
|
|
11385
|
-
{ address: upperTickArrayAddress, role:
|
|
11386
|
-
{ address: whirlpool.data.tokenVaultA, role:
|
|
11387
|
-
{ address: whirlpool.data.tokenVaultB, role:
|
|
11388
|
-
{ address: orcaOracleAddress, role:
|
|
11238
|
+
{ address: swapTickArrays[0], role: import_kit82.AccountRole.WRITABLE },
|
|
11239
|
+
{ address: swapTickArrays[1], role: import_kit82.AccountRole.WRITABLE },
|
|
11240
|
+
{ address: swapTickArrays[2], role: import_kit82.AccountRole.WRITABLE },
|
|
11241
|
+
{ address: swapTickArrays[3], role: import_kit82.AccountRole.WRITABLE },
|
|
11242
|
+
{ address: swapTickArrays[4], role: import_kit82.AccountRole.WRITABLE },
|
|
11243
|
+
{ address: lowerTickArrayAddress, role: import_kit82.AccountRole.WRITABLE },
|
|
11244
|
+
{ address: upperTickArrayAddress, role: import_kit82.AccountRole.WRITABLE },
|
|
11245
|
+
{ address: whirlpool.data.tokenVaultA, role: import_kit82.AccountRole.WRITABLE },
|
|
11246
|
+
{ address: whirlpool.data.tokenVaultB, role: import_kit82.AccountRole.WRITABLE },
|
|
11247
|
+
{ address: orcaOracleAddress, role: import_kit82.AccountRole.WRITABLE }
|
|
11389
11248
|
];
|
|
11390
11249
|
const remainingAccountsInfo = {
|
|
11391
11250
|
slices: [
|
|
@@ -11430,7 +11289,7 @@ async function collectAndCompoundFeesOrcaInstruction(authority, tunaConfig, tuna
|
|
|
11430
11289
|
|
|
11431
11290
|
// src/txbuilder/collectAndCompoundFeesFusion.ts
|
|
11432
11291
|
var import_fusionamm_client4 = require("@crypticdot/fusionamm-client");
|
|
11433
|
-
var
|
|
11292
|
+
var import_kit83 = require("@solana/kit");
|
|
11434
11293
|
var import_memo4 = require("@solana-program/memo");
|
|
11435
11294
|
var import_token_20227 = require("@solana-program/token-2022");
|
|
11436
11295
|
var import_assert6 = __toESM(require("assert"));
|
|
@@ -11527,15 +11386,15 @@ async function collectAndCompoundFeesFusionInstruction(authority, tunaConfig, tu
|
|
|
11527
11386
|
tunaPosition.data.tickUpperIndex
|
|
11528
11387
|
);
|
|
11529
11388
|
const remainingAccounts = [
|
|
11530
|
-
{ address: swapTickArrays[0], role:
|
|
11531
|
-
{ address: swapTickArrays[1], role:
|
|
11532
|
-
{ address: swapTickArrays[2], role:
|
|
11533
|
-
{ address: swapTickArrays[3], role:
|
|
11534
|
-
{ address: swapTickArrays[4], role:
|
|
11535
|
-
{ address: lowerTickArrayAddress, role:
|
|
11536
|
-
{ address: upperTickArrayAddress, role:
|
|
11537
|
-
{ address: fusionPool.data.tokenVaultA, role:
|
|
11538
|
-
{ address: fusionPool.data.tokenVaultB, role:
|
|
11389
|
+
{ address: swapTickArrays[0], role: import_kit83.AccountRole.WRITABLE },
|
|
11390
|
+
{ address: swapTickArrays[1], role: import_kit83.AccountRole.WRITABLE },
|
|
11391
|
+
{ address: swapTickArrays[2], role: import_kit83.AccountRole.WRITABLE },
|
|
11392
|
+
{ address: swapTickArrays[3], role: import_kit83.AccountRole.WRITABLE },
|
|
11393
|
+
{ address: swapTickArrays[4], role: import_kit83.AccountRole.WRITABLE },
|
|
11394
|
+
{ address: lowerTickArrayAddress, role: import_kit83.AccountRole.WRITABLE },
|
|
11395
|
+
{ address: upperTickArrayAddress, role: import_kit83.AccountRole.WRITABLE },
|
|
11396
|
+
{ address: fusionPool.data.tokenVaultA, role: import_kit83.AccountRole.WRITABLE },
|
|
11397
|
+
{ address: fusionPool.data.tokenVaultB, role: import_kit83.AccountRole.WRITABLE }
|
|
11539
11398
|
];
|
|
11540
11399
|
const remainingAccountsInfo = {
|
|
11541
11400
|
slices: [
|
|
@@ -11579,7 +11438,7 @@ async function collectAndCompoundFeesFusionInstruction(authority, tunaConfig, tu
|
|
|
11579
11438
|
|
|
11580
11439
|
// src/txbuilder/collectFeesOrca.ts
|
|
11581
11440
|
var import_whirlpools_client5 = require("@orca-so/whirlpools-client");
|
|
11582
|
-
var
|
|
11441
|
+
var import_kit84 = require("@solana/kit");
|
|
11583
11442
|
var import_memo5 = require("@solana-program/memo");
|
|
11584
11443
|
var import_token_20228 = require("@solana-program/token-2022");
|
|
11585
11444
|
var import_assert7 = __toESM(require("assert"));
|
|
@@ -11655,10 +11514,10 @@ async function collectFeesOrcaInstruction(authority, tunaPosition, mintA, mintB,
|
|
|
11655
11514
|
tunaPosition.data.tickUpperIndex
|
|
11656
11515
|
);
|
|
11657
11516
|
const remainingAccounts = [
|
|
11658
|
-
{ address: lowerTickArrayAddress, role:
|
|
11659
|
-
{ address: upperTickArrayAddress, role:
|
|
11660
|
-
{ address: whirlpool.data.tokenVaultA, role:
|
|
11661
|
-
{ address: whirlpool.data.tokenVaultB, role:
|
|
11517
|
+
{ address: lowerTickArrayAddress, role: import_kit84.AccountRole.WRITABLE },
|
|
11518
|
+
{ address: upperTickArrayAddress, role: import_kit84.AccountRole.WRITABLE },
|
|
11519
|
+
{ address: whirlpool.data.tokenVaultA, role: import_kit84.AccountRole.WRITABLE },
|
|
11520
|
+
{ address: whirlpool.data.tokenVaultB, role: import_kit84.AccountRole.WRITABLE }
|
|
11662
11521
|
];
|
|
11663
11522
|
const remainingAccountsInfo = {
|
|
11664
11523
|
slices: [
|
|
@@ -11693,7 +11552,7 @@ async function collectFeesOrcaInstruction(authority, tunaPosition, mintA, mintB,
|
|
|
11693
11552
|
|
|
11694
11553
|
// src/txbuilder/collectFeesFusion.ts
|
|
11695
11554
|
var import_fusionamm_client5 = require("@crypticdot/fusionamm-client");
|
|
11696
|
-
var
|
|
11555
|
+
var import_kit85 = require("@solana/kit");
|
|
11697
11556
|
var import_memo6 = require("@solana-program/memo");
|
|
11698
11557
|
var import_token_20229 = require("@solana-program/token-2022");
|
|
11699
11558
|
var import_assert8 = __toESM(require("assert"));
|
|
@@ -11769,10 +11628,10 @@ async function collectFeesFusionInstruction(authority, tunaPosition, mintA, mint
|
|
|
11769
11628
|
tunaPosition.data.tickUpperIndex
|
|
11770
11629
|
);
|
|
11771
11630
|
const remainingAccounts = [
|
|
11772
|
-
{ address: lowerTickArrayAddress, role:
|
|
11773
|
-
{ address: upperTickArrayAddress, role:
|
|
11774
|
-
{ address: fusionPool.data.tokenVaultA, role:
|
|
11775
|
-
{ address: fusionPool.data.tokenVaultB, role:
|
|
11631
|
+
{ address: lowerTickArrayAddress, role: import_kit85.AccountRole.WRITABLE },
|
|
11632
|
+
{ address: upperTickArrayAddress, role: import_kit85.AccountRole.WRITABLE },
|
|
11633
|
+
{ address: fusionPool.data.tokenVaultA, role: import_kit85.AccountRole.WRITABLE },
|
|
11634
|
+
{ address: fusionPool.data.tokenVaultB, role: import_kit85.AccountRole.WRITABLE }
|
|
11776
11635
|
];
|
|
11777
11636
|
const remainingAccountsInfo = {
|
|
11778
11637
|
slices: [
|
|
@@ -11883,7 +11742,7 @@ async function openLendingPositionAndDepositInstructions(rpc, authority, mintAdd
|
|
|
11883
11742
|
// src/txbuilder/closeActiveTunaLpPositionOrca.ts
|
|
11884
11743
|
var import_whirlpools_client6 = require("@orca-so/whirlpools-client");
|
|
11885
11744
|
var import_whirlpools_core3 = require("@orca-so/whirlpools-core");
|
|
11886
|
-
var
|
|
11745
|
+
var import_kit86 = require("@solana/kit");
|
|
11887
11746
|
var import_token_202211 = require("@solana-program/token-2022");
|
|
11888
11747
|
var import_assert9 = __toESM(require("assert"));
|
|
11889
11748
|
async function closeActiveTunaLpPositionOrcaInstructions(rpc, authority, positionMint, args) {
|
|
@@ -11904,7 +11763,7 @@ async function closeActiveTunaLpPositionOrcaInstructions(rpc, authority, positio
|
|
|
11904
11763
|
const allMints = [mintA, mintB, ...rewardMints];
|
|
11905
11764
|
(0, import_assert9.default)(mintA.exists, "Token A account not found");
|
|
11906
11765
|
(0, import_assert9.default)(mintB.exists, "Token B account not found");
|
|
11907
|
-
(0,
|
|
11766
|
+
(0, import_kit86.assertAccountsExist)(rewardMints);
|
|
11908
11767
|
const lowerTickArrayStartIndex = (0, import_whirlpools_core3.getTickArrayStartTickIndex)(
|
|
11909
11768
|
tunaPosition.data.tickLowerIndex,
|
|
11910
11769
|
whirlpool.data.tickSpacing
|
|
@@ -12085,7 +11944,7 @@ async function closeActiveTunaLpPositionFusionInstructions(rpc, authority, posit
|
|
|
12085
11944
|
|
|
12086
11945
|
// src/txbuilder/closeActiveTunaSpotPositionFusion.ts
|
|
12087
11946
|
var import_fusionamm_client7 = require("@crypticdot/fusionamm-client");
|
|
12088
|
-
var
|
|
11947
|
+
var import_kit87 = require("@solana/kit");
|
|
12089
11948
|
var import_memo8 = require("@solana-program/memo");
|
|
12090
11949
|
var import_token_202213 = require("@solana-program/token-2022");
|
|
12091
11950
|
var import_assert11 = __toESM(require("assert"));
|
|
@@ -12175,13 +12034,13 @@ async function closeActiveTunaSpotPositionFusionInstruction(authority, tunaPosit
|
|
|
12175
12034
|
}))[0];
|
|
12176
12035
|
const swapTickArrays = await FusionUtils.getSwapTickArrayAddresses(fusionPool);
|
|
12177
12036
|
const remainingAccounts = [
|
|
12178
|
-
{ address: swapTickArrays[0], role:
|
|
12179
|
-
{ address: swapTickArrays[1], role:
|
|
12180
|
-
{ address: swapTickArrays[2], role:
|
|
12181
|
-
{ address: swapTickArrays[3], role:
|
|
12182
|
-
{ address: swapTickArrays[4], role:
|
|
12183
|
-
{ address: fusionPool.data.tokenVaultA, role:
|
|
12184
|
-
{ address: fusionPool.data.tokenVaultB, role:
|
|
12037
|
+
{ address: swapTickArrays[0], role: import_kit87.AccountRole.WRITABLE },
|
|
12038
|
+
{ address: swapTickArrays[1], role: import_kit87.AccountRole.WRITABLE },
|
|
12039
|
+
{ address: swapTickArrays[2], role: import_kit87.AccountRole.WRITABLE },
|
|
12040
|
+
{ address: swapTickArrays[3], role: import_kit87.AccountRole.WRITABLE },
|
|
12041
|
+
{ address: swapTickArrays[4], role: import_kit87.AccountRole.WRITABLE },
|
|
12042
|
+
{ address: fusionPool.data.tokenVaultA, role: import_kit87.AccountRole.WRITABLE },
|
|
12043
|
+
{ address: fusionPool.data.tokenVaultB, role: import_kit87.AccountRole.WRITABLE }
|
|
12185
12044
|
];
|
|
12186
12045
|
const remainingAccountsInfo = {
|
|
12187
12046
|
slices: [
|
|
@@ -12221,7 +12080,7 @@ async function closeActiveTunaSpotPositionFusionInstruction(authority, tunaPosit
|
|
|
12221
12080
|
|
|
12222
12081
|
// src/txbuilder/closeActiveTunaSpotPositionOrca.ts
|
|
12223
12082
|
var import_whirlpools_client7 = require("@orca-so/whirlpools-client");
|
|
12224
|
-
var
|
|
12083
|
+
var import_kit88 = require("@solana/kit");
|
|
12225
12084
|
var import_memo9 = require("@solana-program/memo");
|
|
12226
12085
|
var import_token_202214 = require("@solana-program/token-2022");
|
|
12227
12086
|
var import_assert12 = __toESM(require("assert"));
|
|
@@ -12312,14 +12171,14 @@ async function closeActiveTunaSpotPositionOrcaInstruction(authority, tunaPositio
|
|
|
12312
12171
|
}))[0];
|
|
12313
12172
|
const swapTickArrays = await OrcaUtils.getSwapTickArrayAddresses(whirlpool);
|
|
12314
12173
|
const remainingAccounts = [
|
|
12315
|
-
{ address: swapTickArrays[0], role:
|
|
12316
|
-
{ address: swapTickArrays[1], role:
|
|
12317
|
-
{ address: swapTickArrays[2], role:
|
|
12318
|
-
{ address: swapTickArrays[3], role:
|
|
12319
|
-
{ address: swapTickArrays[4], role:
|
|
12320
|
-
{ address: whirlpool.data.tokenVaultA, role:
|
|
12321
|
-
{ address: whirlpool.data.tokenVaultB, role:
|
|
12322
|
-
{ address: orcaOracleAddress, role:
|
|
12174
|
+
{ address: swapTickArrays[0], role: import_kit88.AccountRole.WRITABLE },
|
|
12175
|
+
{ address: swapTickArrays[1], role: import_kit88.AccountRole.WRITABLE },
|
|
12176
|
+
{ address: swapTickArrays[2], role: import_kit88.AccountRole.WRITABLE },
|
|
12177
|
+
{ address: swapTickArrays[3], role: import_kit88.AccountRole.WRITABLE },
|
|
12178
|
+
{ address: swapTickArrays[4], role: import_kit88.AccountRole.WRITABLE },
|
|
12179
|
+
{ address: whirlpool.data.tokenVaultA, role: import_kit88.AccountRole.WRITABLE },
|
|
12180
|
+
{ address: whirlpool.data.tokenVaultB, role: import_kit88.AccountRole.WRITABLE },
|
|
12181
|
+
{ address: orcaOracleAddress, role: import_kit88.AccountRole.WRITABLE }
|
|
12323
12182
|
];
|
|
12324
12183
|
const remainingAccountsInfo = {
|
|
12325
12184
|
slices: [
|
|
@@ -12360,7 +12219,7 @@ async function closeActiveTunaSpotPositionOrcaInstruction(authority, tunaPositio
|
|
|
12360
12219
|
|
|
12361
12220
|
// src/txbuilder/increaseTunaSpotPositionOrca.ts
|
|
12362
12221
|
var import_whirlpools_client8 = require("@orca-so/whirlpools-client");
|
|
12363
|
-
var
|
|
12222
|
+
var import_kit89 = require("@solana/kit");
|
|
12364
12223
|
var import_memo10 = require("@solana-program/memo");
|
|
12365
12224
|
var import_token_202215 = require("@solana-program/token-2022");
|
|
12366
12225
|
var import_assert13 = __toESM(require("assert"));
|
|
@@ -12466,14 +12325,14 @@ async function increaseTunaSpotPositionOrcaInstruction(authority, tunaPosition,
|
|
|
12466
12325
|
}))[0];
|
|
12467
12326
|
const swapTickArrays = await OrcaUtils.getSwapTickArrayAddresses(whirlpool);
|
|
12468
12327
|
const remainingAccounts = [
|
|
12469
|
-
{ address: swapTickArrays[0], role:
|
|
12470
|
-
{ address: swapTickArrays[1], role:
|
|
12471
|
-
{ address: swapTickArrays[2], role:
|
|
12472
|
-
{ address: swapTickArrays[3], role:
|
|
12473
|
-
{ address: swapTickArrays[4], role:
|
|
12474
|
-
{ address: whirlpool.data.tokenVaultA, role:
|
|
12475
|
-
{ address: whirlpool.data.tokenVaultB, role:
|
|
12476
|
-
{ address: orcaOracleAddress, role:
|
|
12328
|
+
{ address: swapTickArrays[0], role: import_kit89.AccountRole.WRITABLE },
|
|
12329
|
+
{ address: swapTickArrays[1], role: import_kit89.AccountRole.WRITABLE },
|
|
12330
|
+
{ address: swapTickArrays[2], role: import_kit89.AccountRole.WRITABLE },
|
|
12331
|
+
{ address: swapTickArrays[3], role: import_kit89.AccountRole.WRITABLE },
|
|
12332
|
+
{ address: swapTickArrays[4], role: import_kit89.AccountRole.WRITABLE },
|
|
12333
|
+
{ address: whirlpool.data.tokenVaultA, role: import_kit89.AccountRole.WRITABLE },
|
|
12334
|
+
{ address: whirlpool.data.tokenVaultB, role: import_kit89.AccountRole.WRITABLE },
|
|
12335
|
+
{ address: orcaOracleAddress, role: import_kit89.AccountRole.WRITABLE }
|
|
12477
12336
|
];
|
|
12478
12337
|
const remainingAccountsInfo = {
|
|
12479
12338
|
slices: [
|
|
@@ -12516,7 +12375,7 @@ async function increaseTunaSpotPositionOrcaInstruction(authority, tunaPosition,
|
|
|
12516
12375
|
|
|
12517
12376
|
// src/txbuilder/increaseTunaSpotPositionFusion.ts
|
|
12518
12377
|
var import_fusionamm_client8 = require("@crypticdot/fusionamm-client");
|
|
12519
|
-
var
|
|
12378
|
+
var import_kit90 = require("@solana/kit");
|
|
12520
12379
|
var import_memo11 = require("@solana-program/memo");
|
|
12521
12380
|
var import_token_202216 = require("@solana-program/token-2022");
|
|
12522
12381
|
var import_assert14 = __toESM(require("assert"));
|
|
@@ -12621,13 +12480,13 @@ async function increaseTunaSpotPositionFusionInstruction(authority, tunaPosition
|
|
|
12621
12480
|
}))[0];
|
|
12622
12481
|
const swapTickArrays = await FusionUtils.getSwapTickArrayAddresses(fusionPool);
|
|
12623
12482
|
const remainingAccounts = [
|
|
12624
|
-
{ address: swapTickArrays[0], role:
|
|
12625
|
-
{ address: swapTickArrays[1], role:
|
|
12626
|
-
{ address: swapTickArrays[2], role:
|
|
12627
|
-
{ address: swapTickArrays[3], role:
|
|
12628
|
-
{ address: swapTickArrays[4], role:
|
|
12629
|
-
{ address: fusionPool.data.tokenVaultA, role:
|
|
12630
|
-
{ address: fusionPool.data.tokenVaultB, role:
|
|
12483
|
+
{ address: swapTickArrays[0], role: import_kit90.AccountRole.WRITABLE },
|
|
12484
|
+
{ address: swapTickArrays[1], role: import_kit90.AccountRole.WRITABLE },
|
|
12485
|
+
{ address: swapTickArrays[2], role: import_kit90.AccountRole.WRITABLE },
|
|
12486
|
+
{ address: swapTickArrays[3], role: import_kit90.AccountRole.WRITABLE },
|
|
12487
|
+
{ address: swapTickArrays[4], role: import_kit90.AccountRole.WRITABLE },
|
|
12488
|
+
{ address: fusionPool.data.tokenVaultA, role: import_kit90.AccountRole.WRITABLE },
|
|
12489
|
+
{ address: fusionPool.data.tokenVaultB, role: import_kit90.AccountRole.WRITABLE }
|
|
12631
12490
|
];
|
|
12632
12491
|
const remainingAccountsInfo = {
|
|
12633
12492
|
slices: [
|
|
@@ -12671,6 +12530,7 @@ async function increaseTunaSpotPositionFusionInstruction(authority, tunaPosition
|
|
|
12671
12530
|
var import_fusionamm_client9 = require("@crypticdot/fusionamm-client");
|
|
12672
12531
|
|
|
12673
12532
|
// ../../node_modules/.pnpm/@crypticdot+jupiter-solana-client@1.0.0_fastestsmallesttextencoderdecoder@1.0.22_typesc_c15ee540b6a974c893a6f86bc9defff2/node_modules/@crypticdot/jupiter-solana-client/dist/index.mjs
|
|
12533
|
+
var import_kit91 = require("@solana/kit");
|
|
12674
12534
|
var import_kit92 = require("@solana/kit");
|
|
12675
12535
|
var import_kit93 = require("@solana/kit");
|
|
12676
12536
|
var import_kit94 = require("@solana/kit");
|
|
@@ -12704,7 +12564,6 @@ var import_kit121 = require("@solana/kit");
|
|
|
12704
12564
|
var import_kit122 = require("@solana/kit");
|
|
12705
12565
|
var import_kit123 = require("@solana/kit");
|
|
12706
12566
|
var import_kit124 = require("@solana/kit");
|
|
12707
|
-
var import_kit125 = require("@solana/kit");
|
|
12708
12567
|
var TOKEN_LEDGER_DISCRIMINATOR = new Uint8Array([
|
|
12709
12568
|
156,
|
|
12710
12569
|
247,
|
|
@@ -12954,7 +12813,7 @@ async function increaseTunaSpotPositionJupiterInstructions(rpc, authority, poolA
|
|
|
12954
12813
|
]);
|
|
12955
12814
|
let collateralToken;
|
|
12956
12815
|
if (openArgs != void 0) {
|
|
12957
|
-
const openIx =
|
|
12816
|
+
const openIx = await openTunaSpotPositionInstruction(authority, mintA, mintB, poolAddress, openArgs);
|
|
12958
12817
|
instructions.push(openIx);
|
|
12959
12818
|
collateralToken = openArgs.collateralToken;
|
|
12960
12819
|
} else {
|
|
@@ -13080,7 +12939,7 @@ async function increaseTunaSpotPositionJupiterInstruction(authority, poolAddress
|
|
|
13080
12939
|
|
|
13081
12940
|
// src/txbuilder/decreaseTunaSpotPositionOrca.ts
|
|
13082
12941
|
var import_whirlpools_client10 = require("@orca-so/whirlpools-client");
|
|
13083
|
-
var
|
|
12942
|
+
var import_kit125 = require("@solana/kit");
|
|
13084
12943
|
var import_memo13 = require("@solana-program/memo");
|
|
13085
12944
|
var import_token_202218 = require("@solana-program/token-2022");
|
|
13086
12945
|
var import_assert16 = __toESM(require("assert"));
|
|
@@ -13171,14 +13030,14 @@ async function decreaseTunaSpotPositionOrcaInstruction(authority, tunaPosition,
|
|
|
13171
13030
|
}))[0];
|
|
13172
13031
|
const swapTickArrays = await OrcaUtils.getSwapTickArrayAddresses(whirlpool);
|
|
13173
13032
|
const remainingAccounts = [
|
|
13174
|
-
{ address: swapTickArrays[0], role:
|
|
13175
|
-
{ address: swapTickArrays[1], role:
|
|
13176
|
-
{ address: swapTickArrays[2], role:
|
|
13177
|
-
{ address: swapTickArrays[3], role:
|
|
13178
|
-
{ address: swapTickArrays[4], role:
|
|
13179
|
-
{ address: whirlpool.data.tokenVaultA, role:
|
|
13180
|
-
{ address: whirlpool.data.tokenVaultB, role:
|
|
13181
|
-
{ address: orcaOracleAddress, role:
|
|
13033
|
+
{ address: swapTickArrays[0], role: import_kit125.AccountRole.WRITABLE },
|
|
13034
|
+
{ address: swapTickArrays[1], role: import_kit125.AccountRole.WRITABLE },
|
|
13035
|
+
{ address: swapTickArrays[2], role: import_kit125.AccountRole.WRITABLE },
|
|
13036
|
+
{ address: swapTickArrays[3], role: import_kit125.AccountRole.WRITABLE },
|
|
13037
|
+
{ address: swapTickArrays[4], role: import_kit125.AccountRole.WRITABLE },
|
|
13038
|
+
{ address: whirlpool.data.tokenVaultA, role: import_kit125.AccountRole.WRITABLE },
|
|
13039
|
+
{ address: whirlpool.data.tokenVaultB, role: import_kit125.AccountRole.WRITABLE },
|
|
13040
|
+
{ address: orcaOracleAddress, role: import_kit125.AccountRole.WRITABLE }
|
|
13182
13041
|
];
|
|
13183
13042
|
const remainingAccountsInfo = {
|
|
13184
13043
|
slices: [
|
|
@@ -13219,7 +13078,7 @@ async function decreaseTunaSpotPositionOrcaInstruction(authority, tunaPosition,
|
|
|
13219
13078
|
|
|
13220
13079
|
// src/txbuilder/decreaseTunaSpotPositionFusion.ts
|
|
13221
13080
|
var import_fusionamm_client10 = require("@crypticdot/fusionamm-client");
|
|
13222
|
-
var
|
|
13081
|
+
var import_kit126 = require("@solana/kit");
|
|
13223
13082
|
var import_memo14 = require("@solana-program/memo");
|
|
13224
13083
|
var import_token_202219 = require("@solana-program/token-2022");
|
|
13225
13084
|
var import_assert17 = __toESM(require("assert"));
|
|
@@ -13309,13 +13168,13 @@ async function decreaseTunaSpotPositionFusionInstruction(authority, tunaPosition
|
|
|
13309
13168
|
}))[0];
|
|
13310
13169
|
const swapTickArrays = await FusionUtils.getSwapTickArrayAddresses(fusionPool);
|
|
13311
13170
|
const remainingAccounts = [
|
|
13312
|
-
{ address: swapTickArrays[0], role:
|
|
13313
|
-
{ address: swapTickArrays[1], role:
|
|
13314
|
-
{ address: swapTickArrays[2], role:
|
|
13315
|
-
{ address: swapTickArrays[3], role:
|
|
13316
|
-
{ address: swapTickArrays[4], role:
|
|
13317
|
-
{ address: fusionPool.data.tokenVaultA, role:
|
|
13318
|
-
{ address: fusionPool.data.tokenVaultB, role:
|
|
13171
|
+
{ address: swapTickArrays[0], role: import_kit126.AccountRole.WRITABLE },
|
|
13172
|
+
{ address: swapTickArrays[1], role: import_kit126.AccountRole.WRITABLE },
|
|
13173
|
+
{ address: swapTickArrays[2], role: import_kit126.AccountRole.WRITABLE },
|
|
13174
|
+
{ address: swapTickArrays[3], role: import_kit126.AccountRole.WRITABLE },
|
|
13175
|
+
{ address: swapTickArrays[4], role: import_kit126.AccountRole.WRITABLE },
|
|
13176
|
+
{ address: fusionPool.data.tokenVaultA, role: import_kit126.AccountRole.WRITABLE },
|
|
13177
|
+
{ address: fusionPool.data.tokenVaultB, role: import_kit126.AccountRole.WRITABLE }
|
|
13319
13178
|
];
|
|
13320
13179
|
const remainingAccountsInfo = {
|
|
13321
13180
|
slices: [
|
|
@@ -13555,7 +13414,7 @@ async function createVaultInstructions(authority, mint, args) {
|
|
|
13555
13414
|
|
|
13556
13415
|
// src/txbuilder/liquidateTunaLpPositionOrca.ts
|
|
13557
13416
|
var import_whirlpools_client11 = require("@orca-so/whirlpools-client");
|
|
13558
|
-
var
|
|
13417
|
+
var import_kit127 = require("@solana/kit");
|
|
13559
13418
|
var import_memo16 = require("@solana-program/memo");
|
|
13560
13419
|
var import_token_202223 = require("@solana-program/token-2022");
|
|
13561
13420
|
async function liquidateTunaLpPositionOrcaInstructions(authority, tunaPosition, tunaConfig, mintA, mintB, vaultA, vaultB, whirlpool, withdrawPercent) {
|
|
@@ -13642,16 +13501,16 @@ async function liquidateTunaLpPositionOrcaInstruction(authority, tunaPosition, t
|
|
|
13642
13501
|
tunaPosition.data.tickUpperIndex
|
|
13643
13502
|
);
|
|
13644
13503
|
const remainingAccounts = [
|
|
13645
|
-
{ address: swapTickArrays[0], role:
|
|
13646
|
-
{ address: swapTickArrays[1], role:
|
|
13647
|
-
{ address: swapTickArrays[2], role:
|
|
13648
|
-
{ address: swapTickArrays[3], role:
|
|
13649
|
-
{ address: swapTickArrays[4], role:
|
|
13650
|
-
{ address: lowerTickArrayAddress, role:
|
|
13651
|
-
{ address: upperTickArrayAddress, role:
|
|
13652
|
-
{ address: whirlpool.data.tokenVaultA, role:
|
|
13653
|
-
{ address: whirlpool.data.tokenVaultB, role:
|
|
13654
|
-
{ address: orcaOracleAddress, role:
|
|
13504
|
+
{ address: swapTickArrays[0], role: import_kit127.AccountRole.WRITABLE },
|
|
13505
|
+
{ address: swapTickArrays[1], role: import_kit127.AccountRole.WRITABLE },
|
|
13506
|
+
{ address: swapTickArrays[2], role: import_kit127.AccountRole.WRITABLE },
|
|
13507
|
+
{ address: swapTickArrays[3], role: import_kit127.AccountRole.WRITABLE },
|
|
13508
|
+
{ address: swapTickArrays[4], role: import_kit127.AccountRole.WRITABLE },
|
|
13509
|
+
{ address: lowerTickArrayAddress, role: import_kit127.AccountRole.WRITABLE },
|
|
13510
|
+
{ address: upperTickArrayAddress, role: import_kit127.AccountRole.WRITABLE },
|
|
13511
|
+
{ address: whirlpool.data.tokenVaultA, role: import_kit127.AccountRole.WRITABLE },
|
|
13512
|
+
{ address: whirlpool.data.tokenVaultB, role: import_kit127.AccountRole.WRITABLE },
|
|
13513
|
+
{ address: orcaOracleAddress, role: import_kit127.AccountRole.WRITABLE }
|
|
13655
13514
|
];
|
|
13656
13515
|
const remainingAccountsInfo = {
|
|
13657
13516
|
slices: [
|
|
@@ -13696,7 +13555,7 @@ async function liquidateTunaLpPositionOrcaInstruction(authority, tunaPosition, t
|
|
|
13696
13555
|
|
|
13697
13556
|
// src/txbuilder/liquidateTunaLpPositionFusion.ts
|
|
13698
13557
|
var import_fusionamm_client11 = require("@crypticdot/fusionamm-client");
|
|
13699
|
-
var
|
|
13558
|
+
var import_kit128 = require("@solana/kit");
|
|
13700
13559
|
var import_memo17 = require("@solana-program/memo");
|
|
13701
13560
|
var import_token_202224 = require("@solana-program/token-2022");
|
|
13702
13561
|
async function liquidateTunaLpPositionFusionInstructions(authority, tunaPosition, tunaConfig, mintA, mintB, vaultA, vaultB, whirlpool, withdrawPercent) {
|
|
@@ -13782,15 +13641,15 @@ async function liquidateTunaLpPositionFusionInstruction(authority, tunaPosition,
|
|
|
13782
13641
|
tunaPosition.data.tickUpperIndex
|
|
13783
13642
|
);
|
|
13784
13643
|
const remainingAccounts = [
|
|
13785
|
-
{ address: swapTickArrays[0], role:
|
|
13786
|
-
{ address: swapTickArrays[1], role:
|
|
13787
|
-
{ address: swapTickArrays[2], role:
|
|
13788
|
-
{ address: swapTickArrays[3], role:
|
|
13789
|
-
{ address: swapTickArrays[4], role:
|
|
13790
|
-
{ address: lowerTickArrayAddress, role:
|
|
13791
|
-
{ address: upperTickArrayAddress, role:
|
|
13792
|
-
{ address: fusionPool.data.tokenVaultA, role:
|
|
13793
|
-
{ address: fusionPool.data.tokenVaultB, role:
|
|
13644
|
+
{ address: swapTickArrays[0], role: import_kit128.AccountRole.WRITABLE },
|
|
13645
|
+
{ address: swapTickArrays[1], role: import_kit128.AccountRole.WRITABLE },
|
|
13646
|
+
{ address: swapTickArrays[2], role: import_kit128.AccountRole.WRITABLE },
|
|
13647
|
+
{ address: swapTickArrays[3], role: import_kit128.AccountRole.WRITABLE },
|
|
13648
|
+
{ address: swapTickArrays[4], role: import_kit128.AccountRole.WRITABLE },
|
|
13649
|
+
{ address: lowerTickArrayAddress, role: import_kit128.AccountRole.WRITABLE },
|
|
13650
|
+
{ address: upperTickArrayAddress, role: import_kit128.AccountRole.WRITABLE },
|
|
13651
|
+
{ address: fusionPool.data.tokenVaultA, role: import_kit128.AccountRole.WRITABLE },
|
|
13652
|
+
{ address: fusionPool.data.tokenVaultB, role: import_kit128.AccountRole.WRITABLE }
|
|
13794
13653
|
];
|
|
13795
13654
|
const remainingAccountsInfo = {
|
|
13796
13655
|
slices: [
|
|
@@ -13834,7 +13693,7 @@ async function liquidateTunaLpPositionFusionInstruction(authority, tunaPosition,
|
|
|
13834
13693
|
|
|
13835
13694
|
// src/txbuilder/liquidateTunaSpotPositionFusion.ts
|
|
13836
13695
|
var import_fusionamm_client12 = require("@crypticdot/fusionamm-client");
|
|
13837
|
-
var
|
|
13696
|
+
var import_kit129 = require("@solana/kit");
|
|
13838
13697
|
var import_memo18 = require("@solana-program/memo");
|
|
13839
13698
|
var import_token_202225 = require("@solana-program/token-2022");
|
|
13840
13699
|
async function liquidateTunaSpotPositionFusionInstructions(authority, tunaPosition, tunaConfig, mintA, mintB, vaultA, vaultB, fusionPool, createTunaPositionOwnerAta, withdrawPercent) {
|
|
@@ -13926,13 +13785,13 @@ async function liquidateTunaSpotPositionFusionInstruction(authority, tunaPositio
|
|
|
13926
13785
|
}))[0];
|
|
13927
13786
|
const swapTickArrays = await FusionUtils.getSwapTickArrayAddresses(fusionPool);
|
|
13928
13787
|
const remainingAccounts = [
|
|
13929
|
-
{ address: swapTickArrays[0], role:
|
|
13930
|
-
{ address: swapTickArrays[1], role:
|
|
13931
|
-
{ address: swapTickArrays[2], role:
|
|
13932
|
-
{ address: swapTickArrays[3], role:
|
|
13933
|
-
{ address: swapTickArrays[4], role:
|
|
13934
|
-
{ address: fusionPool.data.tokenVaultA, role:
|
|
13935
|
-
{ address: fusionPool.data.tokenVaultB, role:
|
|
13788
|
+
{ address: swapTickArrays[0], role: import_kit129.AccountRole.WRITABLE },
|
|
13789
|
+
{ address: swapTickArrays[1], role: import_kit129.AccountRole.WRITABLE },
|
|
13790
|
+
{ address: swapTickArrays[2], role: import_kit129.AccountRole.WRITABLE },
|
|
13791
|
+
{ address: swapTickArrays[3], role: import_kit129.AccountRole.WRITABLE },
|
|
13792
|
+
{ address: swapTickArrays[4], role: import_kit129.AccountRole.WRITABLE },
|
|
13793
|
+
{ address: fusionPool.data.tokenVaultA, role: import_kit129.AccountRole.WRITABLE },
|
|
13794
|
+
{ address: fusionPool.data.tokenVaultB, role: import_kit129.AccountRole.WRITABLE }
|
|
13936
13795
|
];
|
|
13937
13796
|
const remainingAccountsInfo = {
|
|
13938
13797
|
slices: [
|
|
@@ -13975,7 +13834,7 @@ async function liquidateTunaSpotPositionFusionInstruction(authority, tunaPositio
|
|
|
13975
13834
|
|
|
13976
13835
|
// src/txbuilder/liquidateTunaSpotPositionOrca.ts
|
|
13977
13836
|
var import_whirlpools_client12 = require("@orca-so/whirlpools-client");
|
|
13978
|
-
var
|
|
13837
|
+
var import_kit130 = require("@solana/kit");
|
|
13979
13838
|
var import_memo19 = require("@solana-program/memo");
|
|
13980
13839
|
var import_token_202226 = require("@solana-program/token-2022");
|
|
13981
13840
|
async function liquidateTunaSpotPositionOrcaInstructions(authority, tunaPosition, tunaConfig, mintA, mintB, vaultA, vaultB, whirlpool, createTunaPositionOwnerAta, withdrawPercent) {
|
|
@@ -14068,14 +13927,14 @@ async function liquidateTunaSpotPositionOrcaInstruction(authority, tunaPosition,
|
|
|
14068
13927
|
}))[0];
|
|
14069
13928
|
const swapTickArrays = await OrcaUtils.getSwapTickArrayAddresses(whirlpool);
|
|
14070
13929
|
const remainingAccounts = [
|
|
14071
|
-
{ address: swapTickArrays[0], role:
|
|
14072
|
-
{ address: swapTickArrays[1], role:
|
|
14073
|
-
{ address: swapTickArrays[2], role:
|
|
14074
|
-
{ address: swapTickArrays[3], role:
|
|
14075
|
-
{ address: swapTickArrays[4], role:
|
|
14076
|
-
{ address: whirlpool.data.tokenVaultA, role:
|
|
14077
|
-
{ address: whirlpool.data.tokenVaultB, role:
|
|
14078
|
-
{ address: orcaOracleAddress, role:
|
|
13930
|
+
{ address: swapTickArrays[0], role: import_kit130.AccountRole.WRITABLE },
|
|
13931
|
+
{ address: swapTickArrays[1], role: import_kit130.AccountRole.WRITABLE },
|
|
13932
|
+
{ address: swapTickArrays[2], role: import_kit130.AccountRole.WRITABLE },
|
|
13933
|
+
{ address: swapTickArrays[3], role: import_kit130.AccountRole.WRITABLE },
|
|
13934
|
+
{ address: swapTickArrays[4], role: import_kit130.AccountRole.WRITABLE },
|
|
13935
|
+
{ address: whirlpool.data.tokenVaultA, role: import_kit130.AccountRole.WRITABLE },
|
|
13936
|
+
{ address: whirlpool.data.tokenVaultB, role: import_kit130.AccountRole.WRITABLE },
|
|
13937
|
+
{ address: orcaOracleAddress, role: import_kit130.AccountRole.WRITABLE }
|
|
14079
13938
|
];
|
|
14080
13939
|
const remainingAccountsInfo = {
|
|
14081
13940
|
slices: [
|
|
@@ -14221,7 +14080,7 @@ async function openTunaLpPositionFusionInstruction(rpc, authority, positionMint,
|
|
|
14221
14080
|
// src/txbuilder/openAndIncreaseTunaLpPositionOrca.ts
|
|
14222
14081
|
var import_whirlpools_client14 = require("@orca-so/whirlpools-client");
|
|
14223
14082
|
var import_whirlpools_core4 = require("@orca-so/whirlpools-core");
|
|
14224
|
-
var
|
|
14083
|
+
var import_kit131 = require("@solana/kit");
|
|
14225
14084
|
var import_sysvars = require("@solana/sysvars");
|
|
14226
14085
|
var import_memo20 = require("@solana-program/memo");
|
|
14227
14086
|
var import_token_202229 = require("@solana-program/token-2022");
|
|
@@ -14243,7 +14102,7 @@ async function openAndIncreaseTunaLpPositionOrcaInstructions(rpc, authority, whi
|
|
|
14243
14102
|
if (!cleanupInstructions) cleanupInstructions = instructions;
|
|
14244
14103
|
const rent = await (0, import_sysvars.fetchSysvarRent)(rpc);
|
|
14245
14104
|
let nonRefundableRent = 0n;
|
|
14246
|
-
const positionMint = await (0,
|
|
14105
|
+
const positionMint = await (0, import_kit131.generateKeyPairSigner)();
|
|
14247
14106
|
const tunaConfig = await fetchTunaConfig(rpc, (await getTunaConfigAddress())[0]);
|
|
14248
14107
|
const whirlpool = await (0, import_whirlpools_client14.fetchMaybeWhirlpool)(rpc, whirlpoolAddress);
|
|
14249
14108
|
if (!whirlpool.exists) throw new Error("Whirlpool account not found");
|
|
@@ -14352,7 +14211,7 @@ async function openAndIncreaseTunaLpPositionOrcaInstructions(rpc, authority, whi
|
|
|
14352
14211
|
return {
|
|
14353
14212
|
instructions,
|
|
14354
14213
|
positionMint: positionMint.address,
|
|
14355
|
-
initializationCost: (0,
|
|
14214
|
+
initializationCost: (0, import_kit131.lamports)(nonRefundableRent)
|
|
14356
14215
|
};
|
|
14357
14216
|
}
|
|
14358
14217
|
async function openAndIncreaseTunaLpPositionOrcaInstruction(authority, positionMint, tunaConfig, mintA, mintB, vaultA, vaultB, whirlpool, args) {
|
|
@@ -14409,16 +14268,16 @@ async function openAndIncreaseTunaLpPositionOrcaInstruction(authority, positionM
|
|
|
14409
14268
|
const lowerTickArrayAddress = await OrcaUtils.getTickArrayAddressFromTickIndex(whirlpool, args.tickLowerIndex);
|
|
14410
14269
|
const upperTickArrayAddress = await OrcaUtils.getTickArrayAddressFromTickIndex(whirlpool, args.tickUpperIndex);
|
|
14411
14270
|
const remainingAccounts = [
|
|
14412
|
-
{ address: swapTickArrays[0], role:
|
|
14413
|
-
{ address: swapTickArrays[1], role:
|
|
14414
|
-
{ address: swapTickArrays[2], role:
|
|
14415
|
-
{ address: swapTickArrays[3], role:
|
|
14416
|
-
{ address: swapTickArrays[4], role:
|
|
14417
|
-
{ address: lowerTickArrayAddress, role:
|
|
14418
|
-
{ address: upperTickArrayAddress, role:
|
|
14419
|
-
{ address: whirlpool.data.tokenVaultA, role:
|
|
14420
|
-
{ address: whirlpool.data.tokenVaultB, role:
|
|
14421
|
-
{ address: orcaOracleAddress, role:
|
|
14271
|
+
{ address: swapTickArrays[0], role: import_kit131.AccountRole.WRITABLE },
|
|
14272
|
+
{ address: swapTickArrays[1], role: import_kit131.AccountRole.WRITABLE },
|
|
14273
|
+
{ address: swapTickArrays[2], role: import_kit131.AccountRole.WRITABLE },
|
|
14274
|
+
{ address: swapTickArrays[3], role: import_kit131.AccountRole.WRITABLE },
|
|
14275
|
+
{ address: swapTickArrays[4], role: import_kit131.AccountRole.WRITABLE },
|
|
14276
|
+
{ address: lowerTickArrayAddress, role: import_kit131.AccountRole.WRITABLE },
|
|
14277
|
+
{ address: upperTickArrayAddress, role: import_kit131.AccountRole.WRITABLE },
|
|
14278
|
+
{ address: whirlpool.data.tokenVaultA, role: import_kit131.AccountRole.WRITABLE },
|
|
14279
|
+
{ address: whirlpool.data.tokenVaultB, role: import_kit131.AccountRole.WRITABLE },
|
|
14280
|
+
{ address: orcaOracleAddress, role: import_kit131.AccountRole.WRITABLE }
|
|
14422
14281
|
];
|
|
14423
14282
|
const remainingAccountsInfo = {
|
|
14424
14283
|
slices: [
|
|
@@ -14470,7 +14329,7 @@ async function openAndIncreaseTunaLpPositionOrcaInstruction(authority, positionM
|
|
|
14470
14329
|
// src/txbuilder/openAndIncreaseTunaLpPositionFusion.ts
|
|
14471
14330
|
var import_fusionamm_client15 = require("@crypticdot/fusionamm-client");
|
|
14472
14331
|
var import_fusionamm_core5 = require("@crypticdot/fusionamm-core");
|
|
14473
|
-
var
|
|
14332
|
+
var import_kit132 = require("@solana/kit");
|
|
14474
14333
|
var import_sysvars2 = require("@solana/sysvars");
|
|
14475
14334
|
var import_memo21 = require("@solana-program/memo");
|
|
14476
14335
|
var import_token_202230 = require("@solana-program/token-2022");
|
|
@@ -14481,7 +14340,7 @@ async function openAndIncreaseTunaLpPositionFusionInstructions(rpc, authority, f
|
|
|
14481
14340
|
if (!cleanupInstructions) cleanupInstructions = instructions;
|
|
14482
14341
|
const rent = await (0, import_sysvars2.fetchSysvarRent)(rpc);
|
|
14483
14342
|
let nonRefundableRent = 0n;
|
|
14484
|
-
const positionMint = await (0,
|
|
14343
|
+
const positionMint = await (0, import_kit132.generateKeyPairSigner)();
|
|
14485
14344
|
const tunaConfig = await fetchTunaConfig(rpc, (await getTunaConfigAddress())[0]);
|
|
14486
14345
|
const fusionPool = await (0, import_fusionamm_client15.fetchMaybeFusionPool)(rpc, fusionPoolAddress);
|
|
14487
14346
|
if (!fusionPool.exists) throw new Error("FusionPool account not found");
|
|
@@ -14588,7 +14447,7 @@ async function openAndIncreaseTunaLpPositionFusionInstructions(rpc, authority, f
|
|
|
14588
14447
|
return {
|
|
14589
14448
|
instructions,
|
|
14590
14449
|
positionMint: positionMint.address,
|
|
14591
|
-
initializationCost: (0,
|
|
14450
|
+
initializationCost: (0, import_kit132.lamports)(nonRefundableRent)
|
|
14592
14451
|
};
|
|
14593
14452
|
}
|
|
14594
14453
|
async function openAndIncreaseTunaLpPositionFusionInstruction(authority, positionMint, tunaConfig, mintA, mintB, vaultA, vaultB, fusionPool, args) {
|
|
@@ -14644,15 +14503,15 @@ async function openAndIncreaseTunaLpPositionFusionInstruction(authority, positio
|
|
|
14644
14503
|
const lowerTickArrayAddress = await FusionUtils.getTickArrayAddressFromTickIndex(fusionPool, args.tickLowerIndex);
|
|
14645
14504
|
const upperTickArrayAddress = await FusionUtils.getTickArrayAddressFromTickIndex(fusionPool, args.tickUpperIndex);
|
|
14646
14505
|
const remainingAccounts = [
|
|
14647
|
-
{ address: swapTickArrays[0], role:
|
|
14648
|
-
{ address: swapTickArrays[1], role:
|
|
14649
|
-
{ address: swapTickArrays[2], role:
|
|
14650
|
-
{ address: swapTickArrays[3], role:
|
|
14651
|
-
{ address: swapTickArrays[4], role:
|
|
14652
|
-
{ address: lowerTickArrayAddress, role:
|
|
14653
|
-
{ address: upperTickArrayAddress, role:
|
|
14654
|
-
{ address: fusionPool.data.tokenVaultA, role:
|
|
14655
|
-
{ address: fusionPool.data.tokenVaultB, role:
|
|
14506
|
+
{ address: swapTickArrays[0], role: import_kit132.AccountRole.WRITABLE },
|
|
14507
|
+
{ address: swapTickArrays[1], role: import_kit132.AccountRole.WRITABLE },
|
|
14508
|
+
{ address: swapTickArrays[2], role: import_kit132.AccountRole.WRITABLE },
|
|
14509
|
+
{ address: swapTickArrays[3], role: import_kit132.AccountRole.WRITABLE },
|
|
14510
|
+
{ address: swapTickArrays[4], role: import_kit132.AccountRole.WRITABLE },
|
|
14511
|
+
{ address: lowerTickArrayAddress, role: import_kit132.AccountRole.WRITABLE },
|
|
14512
|
+
{ address: upperTickArrayAddress, role: import_kit132.AccountRole.WRITABLE },
|
|
14513
|
+
{ address: fusionPool.data.tokenVaultA, role: import_kit132.AccountRole.WRITABLE },
|
|
14514
|
+
{ address: fusionPool.data.tokenVaultB, role: import_kit132.AccountRole.WRITABLE }
|
|
14656
14515
|
];
|
|
14657
14516
|
const remainingAccountsInfo = {
|
|
14658
14517
|
slices: [
|
|
@@ -14702,7 +14561,7 @@ async function openAndIncreaseTunaLpPositionFusionInstruction(authority, positio
|
|
|
14702
14561
|
|
|
14703
14562
|
// src/txbuilder/openAndIncreaseTunaSpotPositionFusion.ts
|
|
14704
14563
|
var import_fusionamm_client16 = require("@crypticdot/fusionamm-client");
|
|
14705
|
-
var
|
|
14564
|
+
var import_kit133 = require("@solana/kit");
|
|
14706
14565
|
var import_memo22 = require("@solana-program/memo");
|
|
14707
14566
|
var import_token_202231 = require("@solana-program/token-2022");
|
|
14708
14567
|
var import_assert24 = __toESM(require("assert"));
|
|
@@ -14805,13 +14664,13 @@ async function openAndIncreaseTunaSpotPositionFusionInstruction(authority, tunaC
|
|
|
14805
14664
|
}))[0];
|
|
14806
14665
|
const swapTickArrays = await FusionUtils.getSwapTickArrayAddresses(fusionPool);
|
|
14807
14666
|
const remainingAccounts = [
|
|
14808
|
-
{ address: swapTickArrays[0], role:
|
|
14809
|
-
{ address: swapTickArrays[1], role:
|
|
14810
|
-
{ address: swapTickArrays[2], role:
|
|
14811
|
-
{ address: swapTickArrays[3], role:
|
|
14812
|
-
{ address: swapTickArrays[4], role:
|
|
14813
|
-
{ address: fusionPool.data.tokenVaultA, role:
|
|
14814
|
-
{ address: fusionPool.data.tokenVaultB, role:
|
|
14667
|
+
{ address: swapTickArrays[0], role: import_kit133.AccountRole.WRITABLE },
|
|
14668
|
+
{ address: swapTickArrays[1], role: import_kit133.AccountRole.WRITABLE },
|
|
14669
|
+
{ address: swapTickArrays[2], role: import_kit133.AccountRole.WRITABLE },
|
|
14670
|
+
{ address: swapTickArrays[3], role: import_kit133.AccountRole.WRITABLE },
|
|
14671
|
+
{ address: swapTickArrays[4], role: import_kit133.AccountRole.WRITABLE },
|
|
14672
|
+
{ address: fusionPool.data.tokenVaultA, role: import_kit133.AccountRole.WRITABLE },
|
|
14673
|
+
{ address: fusionPool.data.tokenVaultB, role: import_kit133.AccountRole.WRITABLE }
|
|
14815
14674
|
];
|
|
14816
14675
|
const remainingAccountsInfo = {
|
|
14817
14676
|
slices: [
|
|
@@ -14854,7 +14713,7 @@ async function openAndIncreaseTunaSpotPositionFusionInstruction(authority, tunaC
|
|
|
14854
14713
|
|
|
14855
14714
|
// src/txbuilder/openAndIncreaseTunaSpotPositionOrca.ts
|
|
14856
14715
|
var import_whirlpools_client15 = require("@orca-so/whirlpools-client");
|
|
14857
|
-
var
|
|
14716
|
+
var import_kit134 = require("@solana/kit");
|
|
14858
14717
|
var import_memo23 = require("@solana-program/memo");
|
|
14859
14718
|
var import_token_202232 = require("@solana-program/token-2022");
|
|
14860
14719
|
var import_assert25 = __toESM(require("assert"));
|
|
@@ -14958,14 +14817,14 @@ async function openAndIncreaseTunaSpotPositionOrcaInstruction(authority, tunaCon
|
|
|
14958
14817
|
}))[0];
|
|
14959
14818
|
const swapTickArrays = await OrcaUtils.getSwapTickArrayAddresses(whirlpool);
|
|
14960
14819
|
const remainingAccounts = [
|
|
14961
|
-
{ address: swapTickArrays[0], role:
|
|
14962
|
-
{ address: swapTickArrays[1], role:
|
|
14963
|
-
{ address: swapTickArrays[2], role:
|
|
14964
|
-
{ address: swapTickArrays[3], role:
|
|
14965
|
-
{ address: swapTickArrays[4], role:
|
|
14966
|
-
{ address: whirlpool.data.tokenVaultA, role:
|
|
14967
|
-
{ address: whirlpool.data.tokenVaultB, role:
|
|
14968
|
-
{ address: orcaOracleAddress, role:
|
|
14820
|
+
{ address: swapTickArrays[0], role: import_kit134.AccountRole.WRITABLE },
|
|
14821
|
+
{ address: swapTickArrays[1], role: import_kit134.AccountRole.WRITABLE },
|
|
14822
|
+
{ address: swapTickArrays[2], role: import_kit134.AccountRole.WRITABLE },
|
|
14823
|
+
{ address: swapTickArrays[3], role: import_kit134.AccountRole.WRITABLE },
|
|
14824
|
+
{ address: swapTickArrays[4], role: import_kit134.AccountRole.WRITABLE },
|
|
14825
|
+
{ address: whirlpool.data.tokenVaultA, role: import_kit134.AccountRole.WRITABLE },
|
|
14826
|
+
{ address: whirlpool.data.tokenVaultB, role: import_kit134.AccountRole.WRITABLE },
|
|
14827
|
+
{ address: orcaOracleAddress, role: import_kit134.AccountRole.WRITABLE }
|
|
14969
14828
|
];
|
|
14970
14829
|
const remainingAccountsInfo = {
|
|
14971
14830
|
slices: [
|
|
@@ -15007,21 +14866,31 @@ async function openAndIncreaseTunaSpotPositionOrcaInstruction(authority, tunaCon
|
|
|
15007
14866
|
return ix;
|
|
15008
14867
|
}
|
|
15009
14868
|
|
|
15010
|
-
// src/txbuilder/
|
|
14869
|
+
// src/txbuilder/openTunaSpotPosition.ts
|
|
15011
14870
|
var import_fusionamm_client17 = require("@crypticdot/fusionamm-client");
|
|
14871
|
+
var import_whirlpools_client16 = require("@orca-so/whirlpools-client");
|
|
14872
|
+
var import_kit135 = require("@solana/kit");
|
|
15012
14873
|
var import_token_202233 = require("@solana-program/token-2022");
|
|
15013
14874
|
var import_assert26 = __toESM(require("assert"));
|
|
15014
|
-
async function
|
|
15015
|
-
const
|
|
15016
|
-
|
|
15017
|
-
|
|
14875
|
+
async function openTunaSpotPositionInstructions(rpc, authority, poolAddress, args) {
|
|
14876
|
+
const poolAccount = await (0, import_kit135.fetchEncodedAccount)(rpc, poolAddress);
|
|
14877
|
+
(0, import_assert26.default)(poolAccount.exists, "Pool account not found");
|
|
14878
|
+
let pool;
|
|
14879
|
+
if (poolAccount.programAddress == import_fusionamm_client17.FUSIONAMM_PROGRAM_ADDRESS) {
|
|
14880
|
+
pool = (0, import_kit135.decodeAccount)(poolAccount, (0, import_fusionamm_client17.getFusionPoolDecoder)());
|
|
14881
|
+
} else if (poolAccount.programAddress == import_whirlpools_client16.WHIRLPOOL_PROGRAM_ADDRESS) {
|
|
14882
|
+
pool = (0, import_kit135.decodeAccount)(poolAccount, (0, import_whirlpools_client16.getWhirlpoolDecoder)());
|
|
14883
|
+
} else {
|
|
14884
|
+
throw new Error("Incorrect Fusion or Orca pool account");
|
|
14885
|
+
}
|
|
14886
|
+
const [mintA, mintB] = await (0, import_token_202233.fetchAllMaybeMint)(rpc, [pool.data.tokenMintA, pool.data.tokenMintB]);
|
|
15018
14887
|
(0, import_assert26.default)(mintA.exists, "Token A account not found");
|
|
15019
14888
|
(0, import_assert26.default)(mintB.exists, "Token B account not found");
|
|
15020
|
-
const ix = await
|
|
14889
|
+
const ix = await openTunaSpotPositionInstruction(authority, mintA, mintB, poolAddress, args);
|
|
15021
14890
|
return [ix];
|
|
15022
14891
|
}
|
|
15023
|
-
async function
|
|
15024
|
-
const tunaPositionAddress = (await getTunaSpotPositionAddress(authority.address,
|
|
14892
|
+
async function openTunaSpotPositionInstruction(authority, mintA, mintB, poolAddress, args) {
|
|
14893
|
+
const tunaPositionAddress = (await getTunaSpotPositionAddress(authority.address, poolAddress))[0];
|
|
15025
14894
|
const tunaPositionAtaA = (await (0, import_token_202233.findAssociatedTokenPda)({
|
|
15026
14895
|
owner: tunaPositionAddress,
|
|
15027
14896
|
mint: mintA.address,
|
|
@@ -15032,7 +14901,7 @@ async function openTunaSpotPositionFusionInstruction(authority, mintA, mintB, fu
|
|
|
15032
14901
|
mint: mintB.address,
|
|
15033
14902
|
tokenProgram: mintB.programAddress
|
|
15034
14903
|
}))[0];
|
|
15035
|
-
return
|
|
14904
|
+
return getOpenTunaSpotPositionInstruction({
|
|
15036
14905
|
authority,
|
|
15037
14906
|
mintA: mintA.address,
|
|
15038
14907
|
mintB: mintB.address,
|
|
@@ -15041,59 +14910,19 @@ async function openTunaSpotPositionFusionInstruction(authority, mintA, mintB, fu
|
|
|
15041
14910
|
tunaPosition: tunaPositionAddress,
|
|
15042
14911
|
tunaPositionAtaA,
|
|
15043
14912
|
tunaPositionAtaB,
|
|
15044
|
-
|
|
14913
|
+
pool: poolAddress,
|
|
15045
14914
|
associatedTokenProgram: import_token_202233.ASSOCIATED_TOKEN_PROGRAM_ADDRESS,
|
|
15046
14915
|
...args
|
|
15047
14916
|
});
|
|
15048
14917
|
}
|
|
15049
14918
|
|
|
15050
|
-
// src/txbuilder/openTunaSpotPositionOrca.ts
|
|
15051
|
-
var import_whirlpools_client16 = require("@orca-so/whirlpools-client");
|
|
15052
|
-
var import_token_202234 = require("@solana-program/token-2022");
|
|
15053
|
-
var import_assert27 = __toESM(require("assert"));
|
|
15054
|
-
async function openTunaSpotPositionOrcaInstructions(rpc, authority, whirlpoolAddress, args) {
|
|
15055
|
-
const whirlpool = await (0, import_whirlpools_client16.fetchMaybeWhirlpool)(rpc, whirlpoolAddress);
|
|
15056
|
-
if (!whirlpool.exists) throw new Error("Whirlpool account not found");
|
|
15057
|
-
const [mintA, mintB] = await (0, import_token_202234.fetchAllMaybeMint)(rpc, [whirlpool.data.tokenMintA, whirlpool.data.tokenMintB]);
|
|
15058
|
-
(0, import_assert27.default)(mintA.exists, "Token A account not found");
|
|
15059
|
-
(0, import_assert27.default)(mintB.exists, "Token B account not found");
|
|
15060
|
-
const ix = await openTunaSpotPositionOrcaInstruction(authority, mintA, mintB, whirlpoolAddress, args);
|
|
15061
|
-
return [ix];
|
|
15062
|
-
}
|
|
15063
|
-
async function openTunaSpotPositionOrcaInstruction(authority, mintA, mintB, whirlpoolAddress, args) {
|
|
15064
|
-
const tunaPositionAddress = (await getTunaSpotPositionAddress(authority.address, whirlpoolAddress))[0];
|
|
15065
|
-
const tunaPositionAtaA = (await (0, import_token_202234.findAssociatedTokenPda)({
|
|
15066
|
-
owner: tunaPositionAddress,
|
|
15067
|
-
mint: mintA.address,
|
|
15068
|
-
tokenProgram: mintA.programAddress
|
|
15069
|
-
}))[0];
|
|
15070
|
-
const tunaPositionAtaB = (await (0, import_token_202234.findAssociatedTokenPda)({
|
|
15071
|
-
owner: tunaPositionAddress,
|
|
15072
|
-
mint: mintB.address,
|
|
15073
|
-
tokenProgram: mintB.programAddress
|
|
15074
|
-
}))[0];
|
|
15075
|
-
return getOpenTunaSpotPositionOrcaInstruction({
|
|
15076
|
-
authority,
|
|
15077
|
-
mintA: mintA.address,
|
|
15078
|
-
mintB: mintB.address,
|
|
15079
|
-
tokenProgramA: mintA.programAddress,
|
|
15080
|
-
tokenProgramB: mintB.programAddress,
|
|
15081
|
-
tunaPosition: tunaPositionAddress,
|
|
15082
|
-
tunaPositionAtaA,
|
|
15083
|
-
tunaPositionAtaB,
|
|
15084
|
-
whirlpool: whirlpoolAddress,
|
|
15085
|
-
associatedTokenProgram: import_token_202234.ASSOCIATED_TOKEN_PROGRAM_ADDRESS,
|
|
15086
|
-
...args
|
|
15087
|
-
});
|
|
15088
|
-
}
|
|
15089
|
-
|
|
15090
14919
|
// src/txbuilder/decreaseTunaLpPositionOrca.ts
|
|
15091
14920
|
var import_whirlpools_client17 = require("@orca-so/whirlpools-client");
|
|
15092
14921
|
var import_whirlpools_core5 = require("@orca-so/whirlpools-core");
|
|
15093
14922
|
var import_kit136 = require("@solana/kit");
|
|
15094
14923
|
var import_memo24 = require("@solana-program/memo");
|
|
15095
|
-
var
|
|
15096
|
-
var
|
|
14924
|
+
var import_token_202234 = require("@solana-program/token-2022");
|
|
14925
|
+
var import_assert27 = __toESM(require("assert"));
|
|
15097
14926
|
async function decreaseTunaLpPositionOrcaInstructions(rpc, authority, positionMint, args, createInstructions, cleanupInstructions) {
|
|
15098
14927
|
const tunaPosition = await fetchMaybeTunaLpPosition(rpc, (await getTunaLpPositionAddress(positionMint))[0]);
|
|
15099
14928
|
if (!tunaPosition.exists) throw new Error("Tuna position account not found");
|
|
@@ -15104,14 +14933,14 @@ async function decreaseTunaLpPositionOrcaInstructions(rpc, authority, positionMi
|
|
|
15104
14933
|
(await getLendingVaultAddress(whirlpool.data.tokenMintA))[0],
|
|
15105
14934
|
(await getLendingVaultAddress(whirlpool.data.tokenMintB))[0]
|
|
15106
14935
|
]);
|
|
15107
|
-
const [mintA, mintB, ...rewardMints] = await (0,
|
|
14936
|
+
const [mintA, mintB, ...rewardMints] = await (0, import_token_202234.fetchAllMaybeMint)(rpc, [
|
|
15108
14937
|
whirlpool.data.tokenMintA,
|
|
15109
14938
|
whirlpool.data.tokenMintB,
|
|
15110
14939
|
...whirlpool.data.rewardInfos.map((x) => x.mint).filter((x) => x !== DEFAULT_ADDRESS)
|
|
15111
14940
|
]);
|
|
15112
14941
|
const allMints = [mintA, mintB, ...rewardMints];
|
|
15113
|
-
(0,
|
|
15114
|
-
(0,
|
|
14942
|
+
(0, import_assert27.default)(mintA.exists, "Token A account not found");
|
|
14943
|
+
(0, import_assert27.default)(mintB.exists, "Token B account not found");
|
|
15115
14944
|
(0, import_kit136.assertAccountsExist)(rewardMints);
|
|
15116
14945
|
const lowerTickArrayStartIndex = (0, import_whirlpools_core5.getTickArrayStartTickIndex)(
|
|
15117
14946
|
tunaPosition.data.tickLowerIndex,
|
|
@@ -15152,7 +14981,7 @@ async function decreaseTunaLpPositionOrcaInstructions(rpc, authority, positionMi
|
|
|
15152
14981
|
}
|
|
15153
14982
|
for (const mintAddress of requiredMints) {
|
|
15154
14983
|
const mint = allMints.find((mint2) => mint2.address == mintAddress);
|
|
15155
|
-
(0,
|
|
14984
|
+
(0, import_assert27.default)(mint && mint.exists);
|
|
15156
14985
|
const ixs = await getCreateAtaInstructions(rpc, authority, mint.address, authority.address, mint.programAddress);
|
|
15157
14986
|
createInstructions.push(...ixs.init);
|
|
15158
14987
|
internalCleanupInstructions.push(...ixs.cleanup);
|
|
@@ -15180,37 +15009,37 @@ async function decreaseTunaLpPositionOrcaInstruction(authority, tunaPosition, mi
|
|
|
15180
15009
|
const marketAddress = (await getMarketAddress(whirlpool.address))[0];
|
|
15181
15010
|
const orcaPositionAddress = (await (0, import_whirlpools_client17.getPositionAddress)(positionMint))[0];
|
|
15182
15011
|
const orcaOracleAddress = (await (0, import_whirlpools_client17.getOracleAddress)(whirlpool.address))[0];
|
|
15183
|
-
const tunaPositionAta = (await (0,
|
|
15012
|
+
const tunaPositionAta = (await (0, import_token_202234.findAssociatedTokenPda)({
|
|
15184
15013
|
owner: tunaPosition.address,
|
|
15185
15014
|
mint: positionMint,
|
|
15186
|
-
tokenProgram:
|
|
15015
|
+
tokenProgram: import_token_202234.TOKEN_2022_PROGRAM_ADDRESS
|
|
15187
15016
|
}))[0];
|
|
15188
|
-
const tunaPositionOwnerAtaA = (await (0,
|
|
15017
|
+
const tunaPositionOwnerAtaA = (await (0, import_token_202234.findAssociatedTokenPda)({
|
|
15189
15018
|
owner: authority.address,
|
|
15190
15019
|
mint: mintA.address,
|
|
15191
15020
|
tokenProgram: mintA.programAddress
|
|
15192
15021
|
}))[0];
|
|
15193
|
-
const tunaPositionOwnerAtaB = (await (0,
|
|
15022
|
+
const tunaPositionOwnerAtaB = (await (0, import_token_202234.findAssociatedTokenPda)({
|
|
15194
15023
|
owner: authority.address,
|
|
15195
15024
|
mint: mintB.address,
|
|
15196
15025
|
tokenProgram: mintB.programAddress
|
|
15197
15026
|
}))[0];
|
|
15198
|
-
const tunaPositionAtaA = (await (0,
|
|
15027
|
+
const tunaPositionAtaA = (await (0, import_token_202234.findAssociatedTokenPda)({
|
|
15199
15028
|
owner: tunaPosition.address,
|
|
15200
15029
|
mint: mintA.address,
|
|
15201
15030
|
tokenProgram: mintA.programAddress
|
|
15202
15031
|
}))[0];
|
|
15203
|
-
const tunaPositionAtaB = (await (0,
|
|
15032
|
+
const tunaPositionAtaB = (await (0, import_token_202234.findAssociatedTokenPda)({
|
|
15204
15033
|
owner: tunaPosition.address,
|
|
15205
15034
|
mint: mintB.address,
|
|
15206
15035
|
tokenProgram: mintB.programAddress
|
|
15207
15036
|
}))[0];
|
|
15208
|
-
const vaultAAta = (await (0,
|
|
15037
|
+
const vaultAAta = (await (0, import_token_202234.findAssociatedTokenPda)({
|
|
15209
15038
|
owner: vaultA.address,
|
|
15210
15039
|
mint: mintA.address,
|
|
15211
15040
|
tokenProgram: mintA.programAddress
|
|
15212
15041
|
}))[0];
|
|
15213
|
-
const vaultBAta = (await (0,
|
|
15042
|
+
const vaultBAta = (await (0, import_token_202234.findAssociatedTokenPda)({
|
|
15214
15043
|
owner: vaultB.address,
|
|
15215
15044
|
mint: mintB.address,
|
|
15216
15045
|
tokenProgram: mintB.programAddress
|
|
@@ -15239,8 +15068,8 @@ async function decreaseTunaLpPositionOrcaInstruction(authority, tunaPosition, mi
|
|
|
15239
15068
|
for (const rewardIndex of rewardIndicesToClaim) {
|
|
15240
15069
|
const rewardInfo = whirlpool.data.rewardInfos[rewardIndex];
|
|
15241
15070
|
const rewardMint = rewardMints.find((mint) => mint.address == rewardInfo.mint);
|
|
15242
|
-
(0,
|
|
15243
|
-
const ownerAta = await (0,
|
|
15071
|
+
(0, import_assert27.default)(rewardMint, "Reward mint not found in the provided reward mint accounts");
|
|
15072
|
+
const ownerAta = await (0, import_token_202234.findAssociatedTokenPda)({
|
|
15244
15073
|
owner: authority.address,
|
|
15245
15074
|
mint: rewardMint.address,
|
|
15246
15075
|
tokenProgram: rewardMint.programAddress
|
|
@@ -15298,8 +15127,8 @@ async function decreaseTunaLpPositionOrcaInstruction(authority, tunaPosition, mi
|
|
|
15298
15127
|
var import_fusionamm_client18 = require("@crypticdot/fusionamm-client");
|
|
15299
15128
|
var import_kit137 = require("@solana/kit");
|
|
15300
15129
|
var import_memo25 = require("@solana-program/memo");
|
|
15301
|
-
var
|
|
15302
|
-
var
|
|
15130
|
+
var import_token_202235 = require("@solana-program/token-2022");
|
|
15131
|
+
var import_assert28 = __toESM(require("assert"));
|
|
15303
15132
|
async function decreaseTunaLpPositionFusionInstructions(rpc, authority, positionMint, args, createInstructions, cleanupInstructions) {
|
|
15304
15133
|
const tunaPosition = await fetchMaybeTunaLpPosition(rpc, (await getTunaLpPositionAddress(positionMint))[0]);
|
|
15305
15134
|
if (!tunaPosition.exists) throw new Error("Tuna position account not found");
|
|
@@ -15309,9 +15138,9 @@ async function decreaseTunaLpPositionFusionInstructions(rpc, authority, position
|
|
|
15309
15138
|
(await getLendingVaultAddress(fusionPool.data.tokenMintA))[0],
|
|
15310
15139
|
(await getLendingVaultAddress(fusionPool.data.tokenMintB))[0]
|
|
15311
15140
|
]);
|
|
15312
|
-
const [mintA, mintB] = await (0,
|
|
15313
|
-
(0,
|
|
15314
|
-
(0,
|
|
15141
|
+
const [mintA, mintB] = await (0, import_token_202235.fetchAllMaybeMint)(rpc, [fusionPool.data.tokenMintA, fusionPool.data.tokenMintB]);
|
|
15142
|
+
(0, import_assert28.default)(mintA.exists, "Token A account not found");
|
|
15143
|
+
(0, import_assert28.default)(mintB.exists, "Token B account not found");
|
|
15315
15144
|
const instructions = [];
|
|
15316
15145
|
if (!createInstructions) createInstructions = instructions;
|
|
15317
15146
|
if (!cleanupInstructions) cleanupInstructions = instructions;
|
|
@@ -15352,37 +15181,37 @@ async function decreaseTunaLpPositionFusionInstruction(authority, tunaPosition,
|
|
|
15352
15181
|
const tunaConfig = (await getTunaConfigAddress())[0];
|
|
15353
15182
|
const marketAddress = (await getMarketAddress(fusionPool.address))[0];
|
|
15354
15183
|
const fusionPositionAddress = (await (0, import_fusionamm_client18.getPositionAddress)(positionMint))[0];
|
|
15355
|
-
const tunaPositionAta = (await (0,
|
|
15184
|
+
const tunaPositionAta = (await (0, import_token_202235.findAssociatedTokenPda)({
|
|
15356
15185
|
owner: tunaPosition.address,
|
|
15357
15186
|
mint: positionMint,
|
|
15358
|
-
tokenProgram:
|
|
15187
|
+
tokenProgram: import_token_202235.TOKEN_2022_PROGRAM_ADDRESS
|
|
15359
15188
|
}))[0];
|
|
15360
|
-
const tunaPositionOwnerAtaA = (await (0,
|
|
15189
|
+
const tunaPositionOwnerAtaA = (await (0, import_token_202235.findAssociatedTokenPda)({
|
|
15361
15190
|
owner: authority.address,
|
|
15362
15191
|
mint: mintA.address,
|
|
15363
15192
|
tokenProgram: mintA.programAddress
|
|
15364
15193
|
}))[0];
|
|
15365
|
-
const tunaPositionOwnerAtaB = (await (0,
|
|
15194
|
+
const tunaPositionOwnerAtaB = (await (0, import_token_202235.findAssociatedTokenPda)({
|
|
15366
15195
|
owner: authority.address,
|
|
15367
15196
|
mint: mintB.address,
|
|
15368
15197
|
tokenProgram: mintB.programAddress
|
|
15369
15198
|
}))[0];
|
|
15370
|
-
const tunaPositionAtaA = (await (0,
|
|
15199
|
+
const tunaPositionAtaA = (await (0, import_token_202235.findAssociatedTokenPda)({
|
|
15371
15200
|
owner: tunaPosition.address,
|
|
15372
15201
|
mint: mintA.address,
|
|
15373
15202
|
tokenProgram: mintA.programAddress
|
|
15374
15203
|
}))[0];
|
|
15375
|
-
const tunaPositionAtaB = (await (0,
|
|
15204
|
+
const tunaPositionAtaB = (await (0, import_token_202235.findAssociatedTokenPda)({
|
|
15376
15205
|
owner: tunaPosition.address,
|
|
15377
15206
|
mint: mintB.address,
|
|
15378
15207
|
tokenProgram: mintB.programAddress
|
|
15379
15208
|
}))[0];
|
|
15380
|
-
const vaultAAta = (await (0,
|
|
15209
|
+
const vaultAAta = (await (0, import_token_202235.findAssociatedTokenPda)({
|
|
15381
15210
|
owner: vaultA.address,
|
|
15382
15211
|
mint: mintA.address,
|
|
15383
15212
|
tokenProgram: mintA.programAddress
|
|
15384
15213
|
}))[0];
|
|
15385
|
-
const vaultBAta = (await (0,
|
|
15214
|
+
const vaultBAta = (await (0, import_token_202235.findAssociatedTokenPda)({
|
|
15386
15215
|
owner: vaultB.address,
|
|
15387
15216
|
mint: mintB.address,
|
|
15388
15217
|
tokenProgram: mintB.programAddress
|
|
@@ -15449,18 +15278,18 @@ async function decreaseTunaLpPositionFusionInstruction(authority, tunaPosition,
|
|
|
15449
15278
|
|
|
15450
15279
|
// src/txbuilder/repayBadDebt.ts
|
|
15451
15280
|
var import_memo26 = require("@solana-program/memo");
|
|
15452
|
-
var
|
|
15281
|
+
var import_token_202236 = require("@solana-program/token-2022");
|
|
15453
15282
|
async function repayBadDebtInstruction(rpc, authority, mintAddress, funds, shares) {
|
|
15454
|
-
const mint = await (0,
|
|
15283
|
+
const mint = await (0, import_token_202236.fetchMaybeMint)(rpc, mintAddress);
|
|
15455
15284
|
if (!mint.exists) throw new Error("Mint account not found");
|
|
15456
15285
|
const tunaConfig = (await getTunaConfigAddress())[0];
|
|
15457
15286
|
const vault = (await getLendingVaultAddress(mint.address))[0];
|
|
15458
|
-
const vaultAta = (await (0,
|
|
15287
|
+
const vaultAta = (await (0, import_token_202236.findAssociatedTokenPda)({
|
|
15459
15288
|
owner: vault,
|
|
15460
15289
|
mint: mint.address,
|
|
15461
15290
|
tokenProgram: mint.programAddress
|
|
15462
15291
|
}))[0];
|
|
15463
|
-
const authorityAta = (await (0,
|
|
15292
|
+
const authorityAta = (await (0, import_token_202236.findAssociatedTokenPda)({
|
|
15464
15293
|
owner: authority.address,
|
|
15465
15294
|
mint: mint.address,
|
|
15466
15295
|
tokenProgram: mint.programAddress
|
|
@@ -15505,20 +15334,20 @@ async function setTunaSpotPositionLimitOrdersInstruction(authority, poolAddress,
|
|
|
15505
15334
|
}
|
|
15506
15335
|
|
|
15507
15336
|
// src/txbuilder/resetTunaSpotPosition.ts
|
|
15508
|
-
var
|
|
15509
|
-
var
|
|
15337
|
+
var import_token_202237 = require("@solana-program/token-2022");
|
|
15338
|
+
var import_assert29 = __toESM(require("assert"));
|
|
15510
15339
|
async function resetTunaSpotPositionInstruction(rpc, authority, poolAddress, args) {
|
|
15511
15340
|
const tunaPositionAddress = (await getTunaSpotPositionAddress(authority.address, poolAddress))[0];
|
|
15512
15341
|
const tunaPosition = await fetchTunaSpotPosition(rpc, tunaPositionAddress);
|
|
15513
|
-
const [mintA, mintB] = await (0,
|
|
15514
|
-
(0,
|
|
15515
|
-
(0,
|
|
15516
|
-
const tunaPositionAtaA = (await (0,
|
|
15342
|
+
const [mintA, mintB] = await (0, import_token_202237.fetchAllMaybeMint)(rpc, [tunaPosition.data.mintA, tunaPosition.data.mintB]);
|
|
15343
|
+
(0, import_assert29.default)(mintA.exists, "Token A not found");
|
|
15344
|
+
(0, import_assert29.default)(mintB.exists, "Token B not found");
|
|
15345
|
+
const tunaPositionAtaA = (await (0, import_token_202237.findAssociatedTokenPda)({
|
|
15517
15346
|
owner: tunaPositionAddress,
|
|
15518
15347
|
mint: mintA.address,
|
|
15519
15348
|
tokenProgram: mintA.programAddress
|
|
15520
15349
|
}))[0];
|
|
15521
|
-
const tunaPositionAtaB = (await (0,
|
|
15350
|
+
const tunaPositionAtaB = (await (0, import_token_202237.findAssociatedTokenPda)({
|
|
15522
15351
|
owner: tunaPositionAddress,
|
|
15523
15352
|
mint: mintB.address,
|
|
15524
15353
|
tokenProgram: mintB.programAddress
|
|
@@ -15560,10 +15389,10 @@ async function updateVaultInstruction(authority, mint, args) {
|
|
|
15560
15389
|
|
|
15561
15390
|
// src/txbuilder/withdraw.ts
|
|
15562
15391
|
var import_memo27 = require("@solana-program/memo");
|
|
15563
|
-
var
|
|
15392
|
+
var import_token_202238 = require("@solana-program/token-2022");
|
|
15564
15393
|
async function withdrawInstructions(rpc, authority, mintAddress, funds, shares) {
|
|
15565
15394
|
const instructions = [];
|
|
15566
|
-
const mint = await (0,
|
|
15395
|
+
const mint = await (0, import_token_202238.fetchMaybeMint)(rpc, mintAddress);
|
|
15567
15396
|
if (!mint.exists) throw new Error("Mint account not found");
|
|
15568
15397
|
const createUserAtaInstructions = await getCreateAtaInstructions(
|
|
15569
15398
|
rpc,
|
|
@@ -15582,12 +15411,12 @@ async function withdrawInstruction(authority, mint, funds, shares) {
|
|
|
15582
15411
|
const tunaConfig = (await getTunaConfigAddress())[0];
|
|
15583
15412
|
const lendingPosition = (await getLendingPositionAddress(authority.address, mint.address))[0];
|
|
15584
15413
|
const vault = (await getLendingVaultAddress(mint.address))[0];
|
|
15585
|
-
const vaultAta = (await (0,
|
|
15414
|
+
const vaultAta = (await (0, import_token_202238.findAssociatedTokenPda)({
|
|
15586
15415
|
owner: vault,
|
|
15587
15416
|
mint: mint.address,
|
|
15588
15417
|
tokenProgram: mint.programAddress
|
|
15589
15418
|
}))[0];
|
|
15590
|
-
const authorityAta = (await (0,
|
|
15419
|
+
const authorityAta = (await (0, import_token_202238.findAssociatedTokenPda)({
|
|
15591
15420
|
owner: authority.address,
|
|
15592
15421
|
mint: mint.address,
|
|
15593
15422
|
tokenProgram: mint.programAddress
|
|
@@ -15615,21 +15444,21 @@ var import_address_lookup_table2 = require("@solana-program/address-lookup-table
|
|
|
15615
15444
|
var import_memo28 = require("@solana-program/memo");
|
|
15616
15445
|
var import_system2 = require("@solana-program/system");
|
|
15617
15446
|
var import_token2 = require("@solana-program/token");
|
|
15618
|
-
var
|
|
15447
|
+
var import_token_202239 = require("@solana-program/token-2022");
|
|
15619
15448
|
async function getAddressesForMarketLookupTable(rpc, poolAddress, marketMaker) {
|
|
15620
15449
|
const tunaConfigAddress = (await getTunaConfigAddress())[0];
|
|
15621
15450
|
const marketAddress = (await getMarketAddress(poolAddress))[0];
|
|
15622
15451
|
const orcaOracleAddress = (await (0, import_whirlpools_client18.getOracleAddress)(poolAddress))[0];
|
|
15623
15452
|
const tunaConfig = await fetchTunaConfig(rpc, tunaConfigAddress);
|
|
15624
15453
|
const pool = marketMaker == 0 /* Orca */ ? await (0, import_whirlpools_client18.fetchWhirlpool)(rpc, poolAddress) : await (0, import_fusionamm_client19.fetchFusionPool)(rpc, poolAddress);
|
|
15625
|
-
const mintA = await (0,
|
|
15626
|
-
const mintB = await (0,
|
|
15627
|
-
const feeRecipientAtaA = (await (0,
|
|
15454
|
+
const mintA = await (0, import_token_202239.fetchMint)(rpc, pool.data.tokenMintA);
|
|
15455
|
+
const mintB = await (0, import_token_202239.fetchMint)(rpc, pool.data.tokenMintB);
|
|
15456
|
+
const feeRecipientAtaA = (await (0, import_token_202239.findAssociatedTokenPda)({
|
|
15628
15457
|
owner: tunaConfig.data.feeRecipient,
|
|
15629
15458
|
mint: mintA.address,
|
|
15630
15459
|
tokenProgram: mintA.programAddress
|
|
15631
15460
|
}))[0];
|
|
15632
|
-
const feeRecipientAtaB = (await (0,
|
|
15461
|
+
const feeRecipientAtaB = (await (0, import_token_202239.findAssociatedTokenPda)({
|
|
15633
15462
|
owner: tunaConfig.data.feeRecipient,
|
|
15634
15463
|
mint: mintB.address,
|
|
15635
15464
|
tokenProgram: mintB.programAddress
|
|
@@ -15638,12 +15467,12 @@ async function getAddressesForMarketLookupTable(rpc, poolAddress, marketMaker) {
|
|
|
15638
15467
|
(await getLendingVaultAddress(mintA.address))[0],
|
|
15639
15468
|
(await getLendingVaultAddress(mintB.address))[0]
|
|
15640
15469
|
]);
|
|
15641
|
-
const vaultAAta = (await (0,
|
|
15470
|
+
const vaultAAta = (await (0, import_token_202239.findAssociatedTokenPda)({
|
|
15642
15471
|
owner: vaultA.address,
|
|
15643
15472
|
mint: mintA.address,
|
|
15644
15473
|
tokenProgram: mintA.programAddress
|
|
15645
15474
|
}))[0];
|
|
15646
|
-
const vaultBAta = (await (0,
|
|
15475
|
+
const vaultBAta = (await (0, import_token_202239.findAssociatedTokenPda)({
|
|
15647
15476
|
owner: vaultB.address,
|
|
15648
15477
|
mint: mintB.address,
|
|
15649
15478
|
tokenProgram: mintB.programAddress
|
|
@@ -15651,9 +15480,9 @@ async function getAddressesForMarketLookupTable(rpc, poolAddress, marketMaker) {
|
|
|
15651
15480
|
const addresses = [
|
|
15652
15481
|
import_system2.SYSTEM_PROGRAM_ADDRESS,
|
|
15653
15482
|
(0, import_kit138.address)("SysvarRent111111111111111111111111111111111"),
|
|
15654
|
-
|
|
15483
|
+
import_token_202239.ASSOCIATED_TOKEN_PROGRAM_ADDRESS,
|
|
15655
15484
|
import_token2.TOKEN_PROGRAM_ADDRESS,
|
|
15656
|
-
|
|
15485
|
+
import_token_202239.TOKEN_2022_PROGRAM_ADDRESS,
|
|
15657
15486
|
NATIVE_MINT,
|
|
15658
15487
|
import_memo28.MEMO_PROGRAM_ADDRESS,
|
|
15659
15488
|
tunaConfigAddress,
|
|
@@ -15711,16 +15540,16 @@ async function extendAddressLookupTableForMarketInstructions(rpc, poolAddress, m
|
|
|
15711
15540
|
|
|
15712
15541
|
// src/txbuilder/repayTunaLpPositionDebt.ts
|
|
15713
15542
|
var import_memo29 = require("@solana-program/memo");
|
|
15714
|
-
var
|
|
15715
|
-
var
|
|
15543
|
+
var import_token_202240 = require("@solana-program/token-2022");
|
|
15544
|
+
var import_assert30 = __toESM(require("assert"));
|
|
15716
15545
|
async function repayTunaLpPositionDebtInstructions(rpc, authority, positionMint, collateralA, collateralB, createInstructions, cleanupInstructions) {
|
|
15717
15546
|
const instructions = [];
|
|
15718
15547
|
if (!createInstructions) createInstructions = instructions;
|
|
15719
15548
|
if (!cleanupInstructions) cleanupInstructions = instructions;
|
|
15720
15549
|
const tunaPosition = await fetchTunaLpPosition(rpc, (await getTunaLpPositionAddress(positionMint))[0]);
|
|
15721
|
-
const [mintA, mintB] = await (0,
|
|
15722
|
-
(0,
|
|
15723
|
-
(0,
|
|
15550
|
+
const [mintA, mintB] = await (0, import_token_202240.fetchAllMaybeMint)(rpc, [tunaPosition.data.mintA, tunaPosition.data.mintB]);
|
|
15551
|
+
(0, import_assert30.default)(mintA.exists, "Token A not found");
|
|
15552
|
+
(0, import_assert30.default)(mintB.exists, "Token B not found");
|
|
15724
15553
|
const marketAddress = (await getMarketAddress(tunaPosition.data.pool))[0];
|
|
15725
15554
|
const createUserAtaAInstructions = await getCreateAtaInstructions(
|
|
15726
15555
|
rpc,
|
|
@@ -15756,34 +15585,34 @@ async function repayTunaLpPositionDebtInstructions(rpc, authority, positionMint,
|
|
|
15756
15585
|
}
|
|
15757
15586
|
async function repayTunaLpPositionDebtInstruction(authority, positionMint, mintA, mintB, marketAddress, collateralA, collateralB) {
|
|
15758
15587
|
const tunaPositionAddress = (await getTunaLpPositionAddress(positionMint))[0];
|
|
15759
|
-
const tunaPositionOwnerAtaA = (await (0,
|
|
15588
|
+
const tunaPositionOwnerAtaA = (await (0, import_token_202240.findAssociatedTokenPda)({
|
|
15760
15589
|
owner: authority.address,
|
|
15761
15590
|
mint: mintA.address,
|
|
15762
15591
|
tokenProgram: mintA.programAddress
|
|
15763
15592
|
}))[0];
|
|
15764
|
-
const tunaPositionOwnerAtaB = (await (0,
|
|
15593
|
+
const tunaPositionOwnerAtaB = (await (0, import_token_202240.findAssociatedTokenPda)({
|
|
15765
15594
|
owner: authority.address,
|
|
15766
15595
|
mint: mintB.address,
|
|
15767
15596
|
tokenProgram: mintB.programAddress
|
|
15768
15597
|
}))[0];
|
|
15769
|
-
const tunaPositionAtaA = (await (0,
|
|
15598
|
+
const tunaPositionAtaA = (await (0, import_token_202240.findAssociatedTokenPda)({
|
|
15770
15599
|
owner: tunaPositionAddress,
|
|
15771
15600
|
mint: mintA.address,
|
|
15772
15601
|
tokenProgram: mintA.programAddress
|
|
15773
15602
|
}))[0];
|
|
15774
|
-
const tunaPositionAtaB = (await (0,
|
|
15603
|
+
const tunaPositionAtaB = (await (0, import_token_202240.findAssociatedTokenPda)({
|
|
15775
15604
|
owner: tunaPositionAddress,
|
|
15776
15605
|
mint: mintB.address,
|
|
15777
15606
|
tokenProgram: mintB.programAddress
|
|
15778
15607
|
}))[0];
|
|
15779
15608
|
const vaultAAddress = (await getLendingVaultAddress(mintA.address))[0];
|
|
15780
|
-
const vaultAAta = (await (0,
|
|
15609
|
+
const vaultAAta = (await (0, import_token_202240.findAssociatedTokenPda)({
|
|
15781
15610
|
owner: vaultAAddress,
|
|
15782
15611
|
mint: mintA.address,
|
|
15783
15612
|
tokenProgram: mintA.programAddress
|
|
15784
15613
|
}))[0];
|
|
15785
15614
|
const vaultBAddress = (await getLendingVaultAddress(mintB.address))[0];
|
|
15786
|
-
const vaultBAta = (await (0,
|
|
15615
|
+
const vaultBAta = (await (0, import_token_202240.findAssociatedTokenPda)({
|
|
15787
15616
|
owner: vaultBAddress,
|
|
15788
15617
|
mint: mintB.address,
|
|
15789
15618
|
tokenProgram: mintB.programAddress
|
|
@@ -15815,8 +15644,8 @@ var import_whirlpools_client19 = require("@orca-so/whirlpools-client");
|
|
|
15815
15644
|
var import_kit139 = require("@solana/kit");
|
|
15816
15645
|
var import_sysvars3 = require("@solana/sysvars");
|
|
15817
15646
|
var import_memo30 = require("@solana-program/memo");
|
|
15818
|
-
var
|
|
15819
|
-
var
|
|
15647
|
+
var import_token_202241 = require("@solana-program/token-2022");
|
|
15648
|
+
var import_assert31 = __toESM(require("assert"));
|
|
15820
15649
|
async function rebalanceTunaLpPositionOrcaInstructions(rpc, authority, positionMint, createInstructions, cleanupInstructions) {
|
|
15821
15650
|
const rent = await (0, import_sysvars3.fetchSysvarRent)(rpc);
|
|
15822
15651
|
let nonRefundableRent = 0n;
|
|
@@ -15829,9 +15658,9 @@ async function rebalanceTunaLpPositionOrcaInstructions(rpc, authority, positionM
|
|
|
15829
15658
|
(await getLendingVaultAddress(whirlpool.data.tokenMintA))[0],
|
|
15830
15659
|
(await getLendingVaultAddress(whirlpool.data.tokenMintB))[0]
|
|
15831
15660
|
]);
|
|
15832
|
-
const [mintA, mintB] = await (0,
|
|
15833
|
-
(0,
|
|
15834
|
-
(0,
|
|
15661
|
+
const [mintA, mintB] = await (0, import_token_202241.fetchAllMaybeMint)(rpc, [whirlpool.data.tokenMintA, whirlpool.data.tokenMintB]);
|
|
15662
|
+
(0, import_assert31.default)(mintA.exists, "Token A account not found");
|
|
15663
|
+
(0, import_assert31.default)(mintB.exists, "Token B account not found");
|
|
15835
15664
|
const instructions = [];
|
|
15836
15665
|
if (!createInstructions) createInstructions = instructions;
|
|
15837
15666
|
if (!cleanupInstructions) cleanupInstructions = instructions;
|
|
@@ -15903,27 +15732,27 @@ async function rebalanceTunaLpPositionOrcaInstruction(authority, tunaPosition, t
|
|
|
15903
15732
|
const marketAddress = (await getMarketAddress(whirlpool.address))[0];
|
|
15904
15733
|
const orcaPositionAddress = (await (0, import_whirlpools_client19.getPositionAddress)(positionMint))[0];
|
|
15905
15734
|
const orcaOracleAddress = (await (0, import_whirlpools_client19.getOracleAddress)(whirlpool.address))[0];
|
|
15906
|
-
const tunaPositionAta = (await (0,
|
|
15735
|
+
const tunaPositionAta = (await (0, import_token_202241.findAssociatedTokenPda)({
|
|
15907
15736
|
owner: tunaPosition.address,
|
|
15908
15737
|
mint: positionMint,
|
|
15909
|
-
tokenProgram:
|
|
15738
|
+
tokenProgram: import_token_202241.TOKEN_2022_PROGRAM_ADDRESS
|
|
15910
15739
|
}))[0];
|
|
15911
|
-
const tunaPositionAtaA = (await (0,
|
|
15740
|
+
const tunaPositionAtaA = (await (0, import_token_202241.findAssociatedTokenPda)({
|
|
15912
15741
|
owner: tunaPosition.address,
|
|
15913
15742
|
mint: mintA.address,
|
|
15914
15743
|
tokenProgram: mintA.programAddress
|
|
15915
15744
|
}))[0];
|
|
15916
|
-
const tunaPositionAtaB = (await (0,
|
|
15745
|
+
const tunaPositionAtaB = (await (0, import_token_202241.findAssociatedTokenPda)({
|
|
15917
15746
|
owner: tunaPosition.address,
|
|
15918
15747
|
mint: mintB.address,
|
|
15919
15748
|
tokenProgram: mintB.programAddress
|
|
15920
15749
|
}))[0];
|
|
15921
|
-
const feeRecipientAtaA = (await (0,
|
|
15750
|
+
const feeRecipientAtaA = (await (0, import_token_202241.findAssociatedTokenPda)({
|
|
15922
15751
|
owner: tunaConfig.data.feeRecipient,
|
|
15923
15752
|
mint: mintA.address,
|
|
15924
15753
|
tokenProgram: mintA.programAddress
|
|
15925
15754
|
}))[0];
|
|
15926
|
-
const feeRecipientAtaB = (await (0,
|
|
15755
|
+
const feeRecipientAtaB = (await (0, import_token_202241.findAssociatedTokenPda)({
|
|
15927
15756
|
owner: tunaConfig.data.feeRecipient,
|
|
15928
15757
|
mint: mintB.address,
|
|
15929
15758
|
tokenProgram: mintB.programAddress
|
|
@@ -15997,8 +15826,8 @@ var import_fusionamm_client20 = require("@crypticdot/fusionamm-client");
|
|
|
15997
15826
|
var import_kit140 = require("@solana/kit");
|
|
15998
15827
|
var import_sysvars4 = require("@solana/sysvars");
|
|
15999
15828
|
var import_memo31 = require("@solana-program/memo");
|
|
16000
|
-
var
|
|
16001
|
-
var
|
|
15829
|
+
var import_token_202242 = require("@solana-program/token-2022");
|
|
15830
|
+
var import_assert32 = __toESM(require("assert"));
|
|
16002
15831
|
async function rebalanceTunaLpPositionFusionInstructions(rpc, authority, positionMint, createInstructions, cleanupInstructions) {
|
|
16003
15832
|
const rent = await (0, import_sysvars4.fetchSysvarRent)(rpc);
|
|
16004
15833
|
let nonRefundableRent = 0n;
|
|
@@ -16011,9 +15840,9 @@ async function rebalanceTunaLpPositionFusionInstructions(rpc, authority, positio
|
|
|
16011
15840
|
(await getLendingVaultAddress(fusionPool.data.tokenMintA))[0],
|
|
16012
15841
|
(await getLendingVaultAddress(fusionPool.data.tokenMintB))[0]
|
|
16013
15842
|
]);
|
|
16014
|
-
const [mintA, mintB] = await (0,
|
|
16015
|
-
(0,
|
|
16016
|
-
(0,
|
|
15843
|
+
const [mintA, mintB] = await (0, import_token_202242.fetchAllMaybeMint)(rpc, [fusionPool.data.tokenMintA, fusionPool.data.tokenMintB]);
|
|
15844
|
+
(0, import_assert32.default)(mintA.exists, "Token A account not found");
|
|
15845
|
+
(0, import_assert32.default)(mintB.exists, "Token B account not found");
|
|
16017
15846
|
const instructions = [];
|
|
16018
15847
|
if (!createInstructions) createInstructions = instructions;
|
|
16019
15848
|
if (!cleanupInstructions) cleanupInstructions = instructions;
|
|
@@ -16080,27 +15909,27 @@ async function rebalanceTunaLpPositionFusionInstruction(authority, tunaPosition,
|
|
|
16080
15909
|
const positionMint = tunaPosition.data.positionMint;
|
|
16081
15910
|
const marketAddress = (await getMarketAddress(fusionPool.address))[0];
|
|
16082
15911
|
const fusionPositionAddress = (await (0, import_fusionamm_client20.getPositionAddress)(positionMint))[0];
|
|
16083
|
-
const tunaPositionAta = (await (0,
|
|
15912
|
+
const tunaPositionAta = (await (0, import_token_202242.findAssociatedTokenPda)({
|
|
16084
15913
|
owner: tunaPosition.address,
|
|
16085
15914
|
mint: positionMint,
|
|
16086
|
-
tokenProgram:
|
|
15915
|
+
tokenProgram: import_token_202242.TOKEN_2022_PROGRAM_ADDRESS
|
|
16087
15916
|
}))[0];
|
|
16088
|
-
const tunaPositionAtaA = (await (0,
|
|
15917
|
+
const tunaPositionAtaA = (await (0, import_token_202242.findAssociatedTokenPda)({
|
|
16089
15918
|
owner: tunaPosition.address,
|
|
16090
15919
|
mint: mintA.address,
|
|
16091
15920
|
tokenProgram: mintA.programAddress
|
|
16092
15921
|
}))[0];
|
|
16093
|
-
const tunaPositionAtaB = (await (0,
|
|
15922
|
+
const tunaPositionAtaB = (await (0, import_token_202242.findAssociatedTokenPda)({
|
|
16094
15923
|
owner: tunaPosition.address,
|
|
16095
15924
|
mint: mintB.address,
|
|
16096
15925
|
tokenProgram: mintB.programAddress
|
|
16097
15926
|
}))[0];
|
|
16098
|
-
const feeRecipientAtaA = (await (0,
|
|
15927
|
+
const feeRecipientAtaA = (await (0, import_token_202242.findAssociatedTokenPda)({
|
|
16099
15928
|
owner: tunaConfig.data.feeRecipient,
|
|
16100
15929
|
mint: mintA.address,
|
|
16101
15930
|
tokenProgram: mintA.programAddress
|
|
16102
15931
|
}))[0];
|
|
16103
|
-
const feeRecipientAtaB = (await (0,
|
|
15932
|
+
const feeRecipientAtaB = (await (0, import_token_202242.findAssociatedTokenPda)({
|
|
16104
15933
|
owner: tunaConfig.data.feeRecipient,
|
|
16105
15934
|
mint: mintB.address,
|
|
16106
15935
|
tokenProgram: mintB.programAddress
|
|
@@ -16227,8 +16056,7 @@ async function rebalanceTunaLpPositionFusionInstruction(authority, tunaPosition,
|
|
|
16227
16056
|
OPEN_LENDING_POSITION_DISCRIMINATOR,
|
|
16228
16057
|
OPEN_TUNA_LP_POSITION_FUSION_DISCRIMINATOR,
|
|
16229
16058
|
OPEN_TUNA_LP_POSITION_ORCA_DISCRIMINATOR,
|
|
16230
|
-
|
|
16231
|
-
OPEN_TUNA_SPOT_POSITION_ORCA_DISCRIMINATOR,
|
|
16059
|
+
OPEN_TUNA_SPOT_POSITION_DISCRIMINATOR,
|
|
16232
16060
|
OrcaUtils,
|
|
16233
16061
|
PoolToken,
|
|
16234
16062
|
REBALANCE_TUNA_LP_POSITION_FUSION_DISCRIMINATOR,
|
|
@@ -16262,6 +16090,7 @@ async function rebalanceTunaLpPositionFusionInstruction(authority, tunaPosition,
|
|
|
16262
16090
|
TUNA_ERROR__INVALID_INSTRUCTION_ARGUMENTS,
|
|
16263
16091
|
TUNA_ERROR__INVALID_JUPITER_ROUTE,
|
|
16264
16092
|
TUNA_ERROR__INVALID_MARKET_MAKER,
|
|
16093
|
+
TUNA_ERROR__INVALID_POOL,
|
|
16265
16094
|
TUNA_ERROR__INVALID_REMAINING_ACCOUNTS_LENGTH,
|
|
16266
16095
|
TUNA_ERROR__INVALID_SQRT_PRICE_LIMIT_DIRECTION,
|
|
16267
16096
|
TUNA_ERROR__INVALID_TICK_ARRAY_SEQUENCE,
|
|
@@ -16603,16 +16432,11 @@ async function rebalanceTunaLpPositionFusionInstruction(authority, tunaPosition,
|
|
|
16603
16432
|
getOpenTunaLpPositionOrcaInstructionDataCodec,
|
|
16604
16433
|
getOpenTunaLpPositionOrcaInstructionDataDecoder,
|
|
16605
16434
|
getOpenTunaLpPositionOrcaInstructionDataEncoder,
|
|
16606
|
-
|
|
16607
|
-
|
|
16608
|
-
|
|
16609
|
-
|
|
16610
|
-
|
|
16611
|
-
getOpenTunaSpotPositionOrcaDiscriminatorBytes,
|
|
16612
|
-
getOpenTunaSpotPositionOrcaInstruction,
|
|
16613
|
-
getOpenTunaSpotPositionOrcaInstructionDataCodec,
|
|
16614
|
-
getOpenTunaSpotPositionOrcaInstructionDataDecoder,
|
|
16615
|
-
getOpenTunaSpotPositionOrcaInstructionDataEncoder,
|
|
16435
|
+
getOpenTunaSpotPositionDiscriminatorBytes,
|
|
16436
|
+
getOpenTunaSpotPositionInstruction,
|
|
16437
|
+
getOpenTunaSpotPositionInstructionDataCodec,
|
|
16438
|
+
getOpenTunaSpotPositionInstructionDataDecoder,
|
|
16439
|
+
getOpenTunaSpotPositionInstructionDataEncoder,
|
|
16616
16440
|
getPoolTokenCodec,
|
|
16617
16441
|
getPoolTokenDecoder,
|
|
16618
16442
|
getPoolTokenEncoder,
|
|
@@ -16786,10 +16610,8 @@ async function rebalanceTunaLpPositionFusionInstruction(authority, tunaPosition,
|
|
|
16786
16610
|
openLendingPositionInstruction,
|
|
16787
16611
|
openTunaLpPositionFusionInstruction,
|
|
16788
16612
|
openTunaLpPositionOrcaInstruction,
|
|
16789
|
-
|
|
16790
|
-
|
|
16791
|
-
openTunaSpotPositionOrcaInstruction,
|
|
16792
|
-
openTunaSpotPositionOrcaInstructions,
|
|
16613
|
+
openTunaSpotPositionInstruction,
|
|
16614
|
+
openTunaSpotPositionInstructions,
|
|
16793
16615
|
parseCloseActiveTunaSpotPositionFusionInstruction,
|
|
16794
16616
|
parseCloseActiveTunaSpotPositionOrcaInstruction,
|
|
16795
16617
|
parseCloseTunaLpPositionFusionInstruction,
|
|
@@ -16825,8 +16647,7 @@ async function rebalanceTunaLpPositionFusionInstruction(authority, tunaPosition,
|
|
|
16825
16647
|
parseOpenLendingPositionInstruction,
|
|
16826
16648
|
parseOpenTunaLpPositionFusionInstruction,
|
|
16827
16649
|
parseOpenTunaLpPositionOrcaInstruction,
|
|
16828
|
-
|
|
16829
|
-
parseOpenTunaSpotPositionOrcaInstruction,
|
|
16650
|
+
parseOpenTunaSpotPositionInstruction,
|
|
16830
16651
|
parseRebalanceTunaLpPositionFusionInstruction,
|
|
16831
16652
|
parseRebalanceTunaLpPositionOrcaInstruction,
|
|
16832
16653
|
parseRepayBadDebtInstruction,
|