@crypticdot/defituna-client 3.5.10 → 3.5.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +754 -640
- package/dist/index.d.cts +81 -22
- package/dist/index.d.ts +81 -22
- package/dist/index.js +486 -370
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -92,6 +92,7 @@ __export(index_exports, {
|
|
|
92
92
|
REBALANCE_TUNA_LP_POSITION_ORCA_DISCRIMINATOR: () => REBALANCE_TUNA_LP_POSITION_ORCA_DISCRIMINATOR,
|
|
93
93
|
REPAY_BAD_DEBT_DISCRIMINATOR: () => REPAY_BAD_DEBT_DISCRIMINATOR,
|
|
94
94
|
REPAY_TUNA_LP_POSITION_DEBT_DISCRIMINATOR: () => REPAY_TUNA_LP_POSITION_DEBT_DISCRIMINATOR,
|
|
95
|
+
RESET_MARKET_BAD_DEBT_DISCRIMINATOR: () => RESET_MARKET_BAD_DEBT_DISCRIMINATOR,
|
|
95
96
|
RESET_TUNA_SPOT_POSITION_DISCRIMINATOR: () => RESET_TUNA_SPOT_POSITION_DISCRIMINATOR,
|
|
96
97
|
SET_ADMIN_AUTHORITY_DISCRIMINATOR: () => SET_ADMIN_AUTHORITY_DISCRIMINATOR,
|
|
97
98
|
SET_DEFAULT_LIQUIDATION_FEE_RATE_DISCRIMINATOR: () => SET_DEFAULT_LIQUIDATION_FEE_RATE_DISCRIMINATOR,
|
|
@@ -492,6 +493,11 @@ __export(index_exports, {
|
|
|
492
493
|
getRepayTunaLpPositionDebtInstructionDataCodec: () => getRepayTunaLpPositionDebtInstructionDataCodec,
|
|
493
494
|
getRepayTunaLpPositionDebtInstructionDataDecoder: () => getRepayTunaLpPositionDebtInstructionDataDecoder,
|
|
494
495
|
getRepayTunaLpPositionDebtInstructionDataEncoder: () => getRepayTunaLpPositionDebtInstructionDataEncoder,
|
|
496
|
+
getResetMarketBadDebtDiscriminatorBytes: () => getResetMarketBadDebtDiscriminatorBytes,
|
|
497
|
+
getResetMarketBadDebtInstruction: () => getResetMarketBadDebtInstruction,
|
|
498
|
+
getResetMarketBadDebtInstructionDataCodec: () => getResetMarketBadDebtInstructionDataCodec,
|
|
499
|
+
getResetMarketBadDebtInstructionDataDecoder: () => getResetMarketBadDebtInstructionDataDecoder,
|
|
500
|
+
getResetMarketBadDebtInstructionDataEncoder: () => getResetMarketBadDebtInstructionDataEncoder,
|
|
495
501
|
getResetTunaSpotPositionDiscriminatorBytes: () => getResetTunaSpotPositionDiscriminatorBytes,
|
|
496
502
|
getResetTunaSpotPositionInstruction: () => getResetTunaSpotPositionInstruction,
|
|
497
503
|
getResetTunaSpotPositionInstructionDataCodec: () => getResetTunaSpotPositionInstructionDataCodec,
|
|
@@ -706,6 +712,7 @@ __export(index_exports, {
|
|
|
706
712
|
parseRebalanceTunaLpPositionOrcaInstruction: () => parseRebalanceTunaLpPositionOrcaInstruction,
|
|
707
713
|
parseRepayBadDebtInstruction: () => parseRepayBadDebtInstruction,
|
|
708
714
|
parseRepayTunaLpPositionDebtInstruction: () => parseRepayTunaLpPositionDebtInstruction,
|
|
715
|
+
parseResetMarketBadDebtInstruction: () => parseResetMarketBadDebtInstruction,
|
|
709
716
|
parseResetTunaSpotPositionInstruction: () => parseResetTunaSpotPositionInstruction,
|
|
710
717
|
parseSetAdminAuthorityInstruction: () => parseSetAdminAuthorityInstruction,
|
|
711
718
|
parseSetDefaultLiquidationFeeRateInstruction: () => parseSetDefaultLiquidationFeeRateInstruction,
|
|
@@ -1020,9 +1027,11 @@ function getMarketEncoder() {
|
|
|
1020
1027
|
["rebalanceProtocolFee", (0, import_kit9.getU32Encoder)()],
|
|
1021
1028
|
["spotPositionSizeLimitA", (0, import_kit9.getU64Encoder)()],
|
|
1022
1029
|
["spotPositionSizeLimitB", (0, import_kit9.getU64Encoder)()],
|
|
1030
|
+
["badDebtA", (0, import_kit9.getU64Encoder)()],
|
|
1031
|
+
["badDebtB", (0, import_kit9.getU64Encoder)()],
|
|
1023
1032
|
["vaultA", (0, import_kit9.getAddressEncoder)()],
|
|
1024
1033
|
["vaultB", (0, import_kit9.getAddressEncoder)()],
|
|
1025
|
-
["reserved", (0, import_kit9.fixEncoderSize)((0, import_kit9.getBytesEncoder)(),
|
|
1034
|
+
["reserved", (0, import_kit9.fixEncoderSize)((0, import_kit9.getBytesEncoder)(), 111)]
|
|
1026
1035
|
]),
|
|
1027
1036
|
(value) => ({ ...value, discriminator: MARKET_DISCRIMINATOR })
|
|
1028
1037
|
);
|
|
@@ -1051,9 +1060,11 @@ function getMarketDecoder() {
|
|
|
1051
1060
|
["rebalanceProtocolFee", (0, import_kit9.getU32Decoder)()],
|
|
1052
1061
|
["spotPositionSizeLimitA", (0, import_kit9.getU64Decoder)()],
|
|
1053
1062
|
["spotPositionSizeLimitB", (0, import_kit9.getU64Decoder)()],
|
|
1063
|
+
["badDebtA", (0, import_kit9.getU64Decoder)()],
|
|
1064
|
+
["badDebtB", (0, import_kit9.getU64Decoder)()],
|
|
1054
1065
|
["vaultA", (0, import_kit9.getAddressDecoder)()],
|
|
1055
1066
|
["vaultB", (0, import_kit9.getAddressDecoder)()],
|
|
1056
|
-
["reserved", (0, import_kit9.fixDecoderSize)((0, import_kit9.getBytesDecoder)(),
|
|
1067
|
+
["reserved", (0, import_kit9.fixDecoderSize)((0, import_kit9.getBytesDecoder)(), 111)]
|
|
1057
1068
|
]);
|
|
1058
1069
|
}
|
|
1059
1070
|
function getMarketCodec() {
|
|
@@ -1701,27 +1712,28 @@ var TunaInstruction = /* @__PURE__ */ ((TunaInstruction2) => {
|
|
|
1701
1712
|
TunaInstruction2[TunaInstruction2["RebalanceTunaLpPositionOrca"] = 35] = "RebalanceTunaLpPositionOrca";
|
|
1702
1713
|
TunaInstruction2[TunaInstruction2["RepayBadDebt"] = 36] = "RepayBadDebt";
|
|
1703
1714
|
TunaInstruction2[TunaInstruction2["RepayTunaLpPositionDebt"] = 37] = "RepayTunaLpPositionDebt";
|
|
1704
|
-
TunaInstruction2[TunaInstruction2["
|
|
1705
|
-
TunaInstruction2[TunaInstruction2["
|
|
1706
|
-
TunaInstruction2[TunaInstruction2["
|
|
1707
|
-
TunaInstruction2[TunaInstruction2["
|
|
1708
|
-
TunaInstruction2[TunaInstruction2["
|
|
1709
|
-
TunaInstruction2[TunaInstruction2["
|
|
1710
|
-
TunaInstruction2[TunaInstruction2["
|
|
1711
|
-
TunaInstruction2[TunaInstruction2["
|
|
1712
|
-
TunaInstruction2[TunaInstruction2["
|
|
1713
|
-
TunaInstruction2[TunaInstruction2["
|
|
1714
|
-
TunaInstruction2[TunaInstruction2["
|
|
1715
|
-
TunaInstruction2[TunaInstruction2["
|
|
1716
|
-
TunaInstruction2[TunaInstruction2["
|
|
1717
|
-
TunaInstruction2[TunaInstruction2["
|
|
1718
|
-
TunaInstruction2[TunaInstruction2["
|
|
1719
|
-
TunaInstruction2[TunaInstruction2["
|
|
1720
|
-
TunaInstruction2[TunaInstruction2["
|
|
1721
|
-
TunaInstruction2[TunaInstruction2["
|
|
1722
|
-
TunaInstruction2[TunaInstruction2["
|
|
1723
|
-
TunaInstruction2[TunaInstruction2["
|
|
1724
|
-
TunaInstruction2[TunaInstruction2["
|
|
1715
|
+
TunaInstruction2[TunaInstruction2["ResetMarketBadDebt"] = 38] = "ResetMarketBadDebt";
|
|
1716
|
+
TunaInstruction2[TunaInstruction2["ResetTunaSpotPosition"] = 39] = "ResetTunaSpotPosition";
|
|
1717
|
+
TunaInstruction2[TunaInstruction2["SetAdminAuthority"] = 40] = "SetAdminAuthority";
|
|
1718
|
+
TunaInstruction2[TunaInstruction2["SetDefaultLiquidationFeeRate"] = 41] = "SetDefaultLiquidationFeeRate";
|
|
1719
|
+
TunaInstruction2[TunaInstruction2["SetDefaultMaxPercentageOfLeftovers"] = 42] = "SetDefaultMaxPercentageOfLeftovers";
|
|
1720
|
+
TunaInstruction2[TunaInstruction2["SetDefaultMaxSwapSlippage"] = 43] = "SetDefaultMaxSwapSlippage";
|
|
1721
|
+
TunaInstruction2[TunaInstruction2["SetDefaultOraclePriceDeviationThreshold"] = 44] = "SetDefaultOraclePriceDeviationThreshold";
|
|
1722
|
+
TunaInstruction2[TunaInstruction2["SetDefaultProtocolFeeRate"] = 45] = "SetDefaultProtocolFeeRate";
|
|
1723
|
+
TunaInstruction2[TunaInstruction2["SetDefaultRebalanceFeeRate"] = 46] = "SetDefaultRebalanceFeeRate";
|
|
1724
|
+
TunaInstruction2[TunaInstruction2["SetFeeRecipient"] = 47] = "SetFeeRecipient";
|
|
1725
|
+
TunaInstruction2[TunaInstruction2["SetLiquidatorAuthority"] = 48] = "SetLiquidatorAuthority";
|
|
1726
|
+
TunaInstruction2[TunaInstruction2["SetOraclePriceUpdateAuthority"] = 49] = "SetOraclePriceUpdateAuthority";
|
|
1727
|
+
TunaInstruction2[TunaInstruction2["SetOwnerAuthority"] = 50] = "SetOwnerAuthority";
|
|
1728
|
+
TunaInstruction2[TunaInstruction2["SetSuspendedState"] = 51] = "SetSuspendedState";
|
|
1729
|
+
TunaInstruction2[TunaInstruction2["SetTunaLpPositionFlags"] = 52] = "SetTunaLpPositionFlags";
|
|
1730
|
+
TunaInstruction2[TunaInstruction2["SetTunaLpPositionLimitOrders"] = 53] = "SetTunaLpPositionLimitOrders";
|
|
1731
|
+
TunaInstruction2[TunaInstruction2["SetTunaLpPositionRebalanceThreshold"] = 54] = "SetTunaLpPositionRebalanceThreshold";
|
|
1732
|
+
TunaInstruction2[TunaInstruction2["SetTunaSpotPositionLimitOrders"] = 55] = "SetTunaSpotPositionLimitOrders";
|
|
1733
|
+
TunaInstruction2[TunaInstruction2["UpdateMarket"] = 56] = "UpdateMarket";
|
|
1734
|
+
TunaInstruction2[TunaInstruction2["UpdateOraclePrice"] = 57] = "UpdateOraclePrice";
|
|
1735
|
+
TunaInstruction2[TunaInstruction2["UpdateVault"] = 58] = "UpdateVault";
|
|
1736
|
+
TunaInstruction2[TunaInstruction2["Withdraw"] = 59] = "Withdraw";
|
|
1725
1737
|
return TunaInstruction2;
|
|
1726
1738
|
})(TunaInstruction || {});
|
|
1727
1739
|
function identifyTunaInstruction(instruction) {
|
|
@@ -2068,6 +2080,15 @@ function identifyTunaInstruction(instruction) {
|
|
|
2068
2080
|
)) {
|
|
2069
2081
|
return 37 /* RepayTunaLpPositionDebt */;
|
|
2070
2082
|
}
|
|
2083
|
+
if ((0, import_kit15.containsBytes)(
|
|
2084
|
+
data,
|
|
2085
|
+
(0, import_kit15.fixEncoderSize)((0, import_kit15.getBytesEncoder)(), 8).encode(
|
|
2086
|
+
new Uint8Array([157, 174, 126, 44, 249, 40, 241, 118])
|
|
2087
|
+
),
|
|
2088
|
+
0
|
|
2089
|
+
)) {
|
|
2090
|
+
return 38 /* ResetMarketBadDebt */;
|
|
2091
|
+
}
|
|
2071
2092
|
if ((0, import_kit15.containsBytes)(
|
|
2072
2093
|
data,
|
|
2073
2094
|
(0, import_kit15.fixEncoderSize)((0, import_kit15.getBytesEncoder)(), 8).encode(
|
|
@@ -2075,7 +2096,7 @@ function identifyTunaInstruction(instruction) {
|
|
|
2075
2096
|
),
|
|
2076
2097
|
0
|
|
2077
2098
|
)) {
|
|
2078
|
-
return
|
|
2099
|
+
return 39 /* ResetTunaSpotPosition */;
|
|
2079
2100
|
}
|
|
2080
2101
|
if ((0, import_kit15.containsBytes)(
|
|
2081
2102
|
data,
|
|
@@ -2084,7 +2105,7 @@ function identifyTunaInstruction(instruction) {
|
|
|
2084
2105
|
),
|
|
2085
2106
|
0
|
|
2086
2107
|
)) {
|
|
2087
|
-
return
|
|
2108
|
+
return 40 /* SetAdminAuthority */;
|
|
2088
2109
|
}
|
|
2089
2110
|
if ((0, import_kit15.containsBytes)(
|
|
2090
2111
|
data,
|
|
@@ -2093,7 +2114,7 @@ function identifyTunaInstruction(instruction) {
|
|
|
2093
2114
|
),
|
|
2094
2115
|
0
|
|
2095
2116
|
)) {
|
|
2096
|
-
return
|
|
2117
|
+
return 41 /* SetDefaultLiquidationFeeRate */;
|
|
2097
2118
|
}
|
|
2098
2119
|
if ((0, import_kit15.containsBytes)(
|
|
2099
2120
|
data,
|
|
@@ -2102,7 +2123,7 @@ function identifyTunaInstruction(instruction) {
|
|
|
2102
2123
|
),
|
|
2103
2124
|
0
|
|
2104
2125
|
)) {
|
|
2105
|
-
return
|
|
2126
|
+
return 42 /* SetDefaultMaxPercentageOfLeftovers */;
|
|
2106
2127
|
}
|
|
2107
2128
|
if ((0, import_kit15.containsBytes)(
|
|
2108
2129
|
data,
|
|
@@ -2111,7 +2132,7 @@ function identifyTunaInstruction(instruction) {
|
|
|
2111
2132
|
),
|
|
2112
2133
|
0
|
|
2113
2134
|
)) {
|
|
2114
|
-
return
|
|
2135
|
+
return 43 /* SetDefaultMaxSwapSlippage */;
|
|
2115
2136
|
}
|
|
2116
2137
|
if ((0, import_kit15.containsBytes)(
|
|
2117
2138
|
data,
|
|
@@ -2120,7 +2141,7 @@ function identifyTunaInstruction(instruction) {
|
|
|
2120
2141
|
),
|
|
2121
2142
|
0
|
|
2122
2143
|
)) {
|
|
2123
|
-
return
|
|
2144
|
+
return 44 /* SetDefaultOraclePriceDeviationThreshold */;
|
|
2124
2145
|
}
|
|
2125
2146
|
if ((0, import_kit15.containsBytes)(
|
|
2126
2147
|
data,
|
|
@@ -2129,7 +2150,7 @@ function identifyTunaInstruction(instruction) {
|
|
|
2129
2150
|
),
|
|
2130
2151
|
0
|
|
2131
2152
|
)) {
|
|
2132
|
-
return
|
|
2153
|
+
return 45 /* SetDefaultProtocolFeeRate */;
|
|
2133
2154
|
}
|
|
2134
2155
|
if ((0, import_kit15.containsBytes)(
|
|
2135
2156
|
data,
|
|
@@ -2138,7 +2159,7 @@ function identifyTunaInstruction(instruction) {
|
|
|
2138
2159
|
),
|
|
2139
2160
|
0
|
|
2140
2161
|
)) {
|
|
2141
|
-
return
|
|
2162
|
+
return 46 /* SetDefaultRebalanceFeeRate */;
|
|
2142
2163
|
}
|
|
2143
2164
|
if ((0, import_kit15.containsBytes)(
|
|
2144
2165
|
data,
|
|
@@ -2147,7 +2168,7 @@ function identifyTunaInstruction(instruction) {
|
|
|
2147
2168
|
),
|
|
2148
2169
|
0
|
|
2149
2170
|
)) {
|
|
2150
|
-
return
|
|
2171
|
+
return 47 /* SetFeeRecipient */;
|
|
2151
2172
|
}
|
|
2152
2173
|
if ((0, import_kit15.containsBytes)(
|
|
2153
2174
|
data,
|
|
@@ -2156,7 +2177,7 @@ function identifyTunaInstruction(instruction) {
|
|
|
2156
2177
|
),
|
|
2157
2178
|
0
|
|
2158
2179
|
)) {
|
|
2159
|
-
return
|
|
2180
|
+
return 48 /* SetLiquidatorAuthority */;
|
|
2160
2181
|
}
|
|
2161
2182
|
if ((0, import_kit15.containsBytes)(
|
|
2162
2183
|
data,
|
|
@@ -2165,7 +2186,7 @@ function identifyTunaInstruction(instruction) {
|
|
|
2165
2186
|
),
|
|
2166
2187
|
0
|
|
2167
2188
|
)) {
|
|
2168
|
-
return
|
|
2189
|
+
return 49 /* SetOraclePriceUpdateAuthority */;
|
|
2169
2190
|
}
|
|
2170
2191
|
if ((0, import_kit15.containsBytes)(
|
|
2171
2192
|
data,
|
|
@@ -2174,7 +2195,7 @@ function identifyTunaInstruction(instruction) {
|
|
|
2174
2195
|
),
|
|
2175
2196
|
0
|
|
2176
2197
|
)) {
|
|
2177
|
-
return
|
|
2198
|
+
return 50 /* SetOwnerAuthority */;
|
|
2178
2199
|
}
|
|
2179
2200
|
if ((0, import_kit15.containsBytes)(
|
|
2180
2201
|
data,
|
|
@@ -2183,7 +2204,7 @@ function identifyTunaInstruction(instruction) {
|
|
|
2183
2204
|
),
|
|
2184
2205
|
0
|
|
2185
2206
|
)) {
|
|
2186
|
-
return
|
|
2207
|
+
return 51 /* SetSuspendedState */;
|
|
2187
2208
|
}
|
|
2188
2209
|
if ((0, import_kit15.containsBytes)(
|
|
2189
2210
|
data,
|
|
@@ -2192,7 +2213,7 @@ function identifyTunaInstruction(instruction) {
|
|
|
2192
2213
|
),
|
|
2193
2214
|
0
|
|
2194
2215
|
)) {
|
|
2195
|
-
return
|
|
2216
|
+
return 52 /* SetTunaLpPositionFlags */;
|
|
2196
2217
|
}
|
|
2197
2218
|
if ((0, import_kit15.containsBytes)(
|
|
2198
2219
|
data,
|
|
@@ -2201,7 +2222,7 @@ function identifyTunaInstruction(instruction) {
|
|
|
2201
2222
|
),
|
|
2202
2223
|
0
|
|
2203
2224
|
)) {
|
|
2204
|
-
return
|
|
2225
|
+
return 53 /* SetTunaLpPositionLimitOrders */;
|
|
2205
2226
|
}
|
|
2206
2227
|
if ((0, import_kit15.containsBytes)(
|
|
2207
2228
|
data,
|
|
@@ -2210,7 +2231,7 @@ function identifyTunaInstruction(instruction) {
|
|
|
2210
2231
|
),
|
|
2211
2232
|
0
|
|
2212
2233
|
)) {
|
|
2213
|
-
return
|
|
2234
|
+
return 54 /* SetTunaLpPositionRebalanceThreshold */;
|
|
2214
2235
|
}
|
|
2215
2236
|
if ((0, import_kit15.containsBytes)(
|
|
2216
2237
|
data,
|
|
@@ -2219,7 +2240,7 @@ function identifyTunaInstruction(instruction) {
|
|
|
2219
2240
|
),
|
|
2220
2241
|
0
|
|
2221
2242
|
)) {
|
|
2222
|
-
return
|
|
2243
|
+
return 55 /* SetTunaSpotPositionLimitOrders */;
|
|
2223
2244
|
}
|
|
2224
2245
|
if ((0, import_kit15.containsBytes)(
|
|
2225
2246
|
data,
|
|
@@ -2228,7 +2249,7 @@ function identifyTunaInstruction(instruction) {
|
|
|
2228
2249
|
),
|
|
2229
2250
|
0
|
|
2230
2251
|
)) {
|
|
2231
|
-
return
|
|
2252
|
+
return 56 /* UpdateMarket */;
|
|
2232
2253
|
}
|
|
2233
2254
|
if ((0, import_kit15.containsBytes)(
|
|
2234
2255
|
data,
|
|
@@ -2237,7 +2258,7 @@ function identifyTunaInstruction(instruction) {
|
|
|
2237
2258
|
),
|
|
2238
2259
|
0
|
|
2239
2260
|
)) {
|
|
2240
|
-
return
|
|
2261
|
+
return 57 /* UpdateOraclePrice */;
|
|
2241
2262
|
}
|
|
2242
2263
|
if ((0, import_kit15.containsBytes)(
|
|
2243
2264
|
data,
|
|
@@ -2246,7 +2267,7 @@ function identifyTunaInstruction(instruction) {
|
|
|
2246
2267
|
),
|
|
2247
2268
|
0
|
|
2248
2269
|
)) {
|
|
2249
|
-
return
|
|
2270
|
+
return 58 /* UpdateVault */;
|
|
2250
2271
|
}
|
|
2251
2272
|
if ((0, import_kit15.containsBytes)(
|
|
2252
2273
|
data,
|
|
@@ -2255,7 +2276,7 @@ function identifyTunaInstruction(instruction) {
|
|
|
2255
2276
|
),
|
|
2256
2277
|
0
|
|
2257
2278
|
)) {
|
|
2258
|
-
return
|
|
2279
|
+
return 59 /* Withdraw */;
|
|
2259
2280
|
}
|
|
2260
2281
|
throw new Error(
|
|
2261
2282
|
"The provided instruction could not be identified as a tuna instruction."
|
|
@@ -8197,8 +8218,94 @@ function parseRepayTunaLpPositionDebtInstruction(instruction) {
|
|
|
8197
8218
|
};
|
|
8198
8219
|
}
|
|
8199
8220
|
|
|
8200
|
-
// src/generated/instructions/
|
|
8221
|
+
// src/generated/instructions/resetMarketBadDebt.ts
|
|
8201
8222
|
var import_kit56 = require("@solana/kit");
|
|
8223
|
+
var RESET_MARKET_BAD_DEBT_DISCRIMINATOR = new Uint8Array([
|
|
8224
|
+
157,
|
|
8225
|
+
174,
|
|
8226
|
+
126,
|
|
8227
|
+
44,
|
|
8228
|
+
249,
|
|
8229
|
+
40,
|
|
8230
|
+
241,
|
|
8231
|
+
118
|
|
8232
|
+
]);
|
|
8233
|
+
function getResetMarketBadDebtDiscriminatorBytes() {
|
|
8234
|
+
return (0, import_kit56.fixEncoderSize)((0, import_kit56.getBytesEncoder)(), 8).encode(
|
|
8235
|
+
RESET_MARKET_BAD_DEBT_DISCRIMINATOR
|
|
8236
|
+
);
|
|
8237
|
+
}
|
|
8238
|
+
function getResetMarketBadDebtInstructionDataEncoder() {
|
|
8239
|
+
return (0, import_kit56.transformEncoder)(
|
|
8240
|
+
(0, import_kit56.getStructEncoder)([["discriminator", (0, import_kit56.fixEncoderSize)((0, import_kit56.getBytesEncoder)(), 8)]]),
|
|
8241
|
+
(value) => ({
|
|
8242
|
+
...value,
|
|
8243
|
+
discriminator: RESET_MARKET_BAD_DEBT_DISCRIMINATOR
|
|
8244
|
+
})
|
|
8245
|
+
);
|
|
8246
|
+
}
|
|
8247
|
+
function getResetMarketBadDebtInstructionDataDecoder() {
|
|
8248
|
+
return (0, import_kit56.getStructDecoder)([
|
|
8249
|
+
["discriminator", (0, import_kit56.fixDecoderSize)((0, import_kit56.getBytesDecoder)(), 8)]
|
|
8250
|
+
]);
|
|
8251
|
+
}
|
|
8252
|
+
function getResetMarketBadDebtInstructionDataCodec() {
|
|
8253
|
+
return (0, import_kit56.combineCodec)(
|
|
8254
|
+
getResetMarketBadDebtInstructionDataEncoder(),
|
|
8255
|
+
getResetMarketBadDebtInstructionDataDecoder()
|
|
8256
|
+
);
|
|
8257
|
+
}
|
|
8258
|
+
function getResetMarketBadDebtInstruction(input, config) {
|
|
8259
|
+
const programAddress = config?.programAddress ?? TUNA_PROGRAM_ADDRESS;
|
|
8260
|
+
const originalAccounts = {
|
|
8261
|
+
authority: { value: input.authority ?? null, isWritable: true },
|
|
8262
|
+
tunaConfig: { value: input.tunaConfig ?? null, isWritable: false },
|
|
8263
|
+
market: { value: input.market ?? null, isWritable: true },
|
|
8264
|
+
vaultA: { value: input.vaultA ?? null, isWritable: true },
|
|
8265
|
+
vaultB: { value: input.vaultB ?? null, isWritable: true }
|
|
8266
|
+
};
|
|
8267
|
+
const accounts = originalAccounts;
|
|
8268
|
+
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
8269
|
+
const instruction = {
|
|
8270
|
+
accounts: [
|
|
8271
|
+
getAccountMeta(accounts.authority),
|
|
8272
|
+
getAccountMeta(accounts.tunaConfig),
|
|
8273
|
+
getAccountMeta(accounts.market),
|
|
8274
|
+
getAccountMeta(accounts.vaultA),
|
|
8275
|
+
getAccountMeta(accounts.vaultB)
|
|
8276
|
+
],
|
|
8277
|
+
programAddress,
|
|
8278
|
+
data: getResetMarketBadDebtInstructionDataEncoder().encode({})
|
|
8279
|
+
};
|
|
8280
|
+
return instruction;
|
|
8281
|
+
}
|
|
8282
|
+
function parseResetMarketBadDebtInstruction(instruction) {
|
|
8283
|
+
if (instruction.accounts.length < 5) {
|
|
8284
|
+
throw new Error("Not enough accounts");
|
|
8285
|
+
}
|
|
8286
|
+
let accountIndex = 0;
|
|
8287
|
+
const getNextAccount = () => {
|
|
8288
|
+
const accountMeta = instruction.accounts[accountIndex];
|
|
8289
|
+
accountIndex += 1;
|
|
8290
|
+
return accountMeta;
|
|
8291
|
+
};
|
|
8292
|
+
return {
|
|
8293
|
+
programAddress: instruction.programAddress,
|
|
8294
|
+
accounts: {
|
|
8295
|
+
authority: getNextAccount(),
|
|
8296
|
+
tunaConfig: getNextAccount(),
|
|
8297
|
+
market: getNextAccount(),
|
|
8298
|
+
vaultA: getNextAccount(),
|
|
8299
|
+
vaultB: getNextAccount()
|
|
8300
|
+
},
|
|
8301
|
+
data: getResetMarketBadDebtInstructionDataDecoder().decode(
|
|
8302
|
+
instruction.data
|
|
8303
|
+
)
|
|
8304
|
+
};
|
|
8305
|
+
}
|
|
8306
|
+
|
|
8307
|
+
// src/generated/instructions/resetTunaSpotPosition.ts
|
|
8308
|
+
var import_kit57 = require("@solana/kit");
|
|
8202
8309
|
var RESET_TUNA_SPOT_POSITION_DISCRIMINATOR = new Uint8Array([
|
|
8203
8310
|
194,
|
|
8204
8311
|
68,
|
|
@@ -8210,14 +8317,14 @@ var RESET_TUNA_SPOT_POSITION_DISCRIMINATOR = new Uint8Array([
|
|
|
8210
8317
|
127
|
|
8211
8318
|
]);
|
|
8212
8319
|
function getResetTunaSpotPositionDiscriminatorBytes() {
|
|
8213
|
-
return (0,
|
|
8320
|
+
return (0, import_kit57.fixEncoderSize)((0, import_kit57.getBytesEncoder)(), 8).encode(
|
|
8214
8321
|
RESET_TUNA_SPOT_POSITION_DISCRIMINATOR
|
|
8215
8322
|
);
|
|
8216
8323
|
}
|
|
8217
8324
|
function getResetTunaSpotPositionInstructionDataEncoder() {
|
|
8218
|
-
return (0,
|
|
8219
|
-
(0,
|
|
8220
|
-
["discriminator", (0,
|
|
8325
|
+
return (0, import_kit57.transformEncoder)(
|
|
8326
|
+
(0, import_kit57.getStructEncoder)([
|
|
8327
|
+
["discriminator", (0, import_kit57.fixEncoderSize)((0, import_kit57.getBytesEncoder)(), 8)],
|
|
8221
8328
|
["positionToken", getPoolTokenEncoder()],
|
|
8222
8329
|
["collateralToken", getPoolTokenEncoder()]
|
|
8223
8330
|
]),
|
|
@@ -8228,14 +8335,14 @@ function getResetTunaSpotPositionInstructionDataEncoder() {
|
|
|
8228
8335
|
);
|
|
8229
8336
|
}
|
|
8230
8337
|
function getResetTunaSpotPositionInstructionDataDecoder() {
|
|
8231
|
-
return (0,
|
|
8232
|
-
["discriminator", (0,
|
|
8338
|
+
return (0, import_kit57.getStructDecoder)([
|
|
8339
|
+
["discriminator", (0, import_kit57.fixDecoderSize)((0, import_kit57.getBytesDecoder)(), 8)],
|
|
8233
8340
|
["positionToken", getPoolTokenDecoder()],
|
|
8234
8341
|
["collateralToken", getPoolTokenDecoder()]
|
|
8235
8342
|
]);
|
|
8236
8343
|
}
|
|
8237
8344
|
function getResetTunaSpotPositionInstructionDataCodec() {
|
|
8238
|
-
return (0,
|
|
8345
|
+
return (0, import_kit57.combineCodec)(
|
|
8239
8346
|
getResetTunaSpotPositionInstructionDataEncoder(),
|
|
8240
8347
|
getResetTunaSpotPositionInstructionDataDecoder()
|
|
8241
8348
|
);
|
|
@@ -8302,7 +8409,7 @@ function parseResetTunaSpotPositionInstruction(instruction) {
|
|
|
8302
8409
|
}
|
|
8303
8410
|
|
|
8304
8411
|
// src/generated/instructions/setAdminAuthority.ts
|
|
8305
|
-
var
|
|
8412
|
+
var import_kit58 = require("@solana/kit");
|
|
8306
8413
|
var SET_ADMIN_AUTHORITY_DISCRIMINATOR = new Uint8Array([
|
|
8307
8414
|
72,
|
|
8308
8415
|
49,
|
|
@@ -8314,27 +8421,27 @@ var SET_ADMIN_AUTHORITY_DISCRIMINATOR = new Uint8Array([
|
|
|
8314
8421
|
174
|
|
8315
8422
|
]);
|
|
8316
8423
|
function getSetAdminAuthorityDiscriminatorBytes() {
|
|
8317
|
-
return (0,
|
|
8424
|
+
return (0, import_kit58.fixEncoderSize)((0, import_kit58.getBytesEncoder)(), 8).encode(
|
|
8318
8425
|
SET_ADMIN_AUTHORITY_DISCRIMINATOR
|
|
8319
8426
|
);
|
|
8320
8427
|
}
|
|
8321
8428
|
function getSetAdminAuthorityInstructionDataEncoder() {
|
|
8322
|
-
return (0,
|
|
8323
|
-
(0,
|
|
8324
|
-
["discriminator", (0,
|
|
8325
|
-
["adminAuthority", (0,
|
|
8429
|
+
return (0, import_kit58.transformEncoder)(
|
|
8430
|
+
(0, import_kit58.getStructEncoder)([
|
|
8431
|
+
["discriminator", (0, import_kit58.fixEncoderSize)((0, import_kit58.getBytesEncoder)(), 8)],
|
|
8432
|
+
["adminAuthority", (0, import_kit58.getAddressEncoder)()]
|
|
8326
8433
|
]),
|
|
8327
8434
|
(value) => ({ ...value, discriminator: SET_ADMIN_AUTHORITY_DISCRIMINATOR })
|
|
8328
8435
|
);
|
|
8329
8436
|
}
|
|
8330
8437
|
function getSetAdminAuthorityInstructionDataDecoder() {
|
|
8331
|
-
return (0,
|
|
8332
|
-
["discriminator", (0,
|
|
8333
|
-
["adminAuthority", (0,
|
|
8438
|
+
return (0, import_kit58.getStructDecoder)([
|
|
8439
|
+
["discriminator", (0, import_kit58.fixDecoderSize)((0, import_kit58.getBytesDecoder)(), 8)],
|
|
8440
|
+
["adminAuthority", (0, import_kit58.getAddressDecoder)()]
|
|
8334
8441
|
]);
|
|
8335
8442
|
}
|
|
8336
8443
|
function getSetAdminAuthorityInstructionDataCodec() {
|
|
8337
|
-
return (0,
|
|
8444
|
+
return (0, import_kit58.combineCodec)(
|
|
8338
8445
|
getSetAdminAuthorityInstructionDataEncoder(),
|
|
8339
8446
|
getSetAdminAuthorityInstructionDataDecoder()
|
|
8340
8447
|
);
|
|
@@ -8381,7 +8488,7 @@ function parseSetAdminAuthorityInstruction(instruction) {
|
|
|
8381
8488
|
}
|
|
8382
8489
|
|
|
8383
8490
|
// src/generated/instructions/setDefaultLiquidationFeeRate.ts
|
|
8384
|
-
var
|
|
8491
|
+
var import_kit59 = require("@solana/kit");
|
|
8385
8492
|
var SET_DEFAULT_LIQUIDATION_FEE_RATE_DISCRIMINATOR = new Uint8Array([
|
|
8386
8493
|
108,
|
|
8387
8494
|
26,
|
|
@@ -8393,15 +8500,15 @@ var SET_DEFAULT_LIQUIDATION_FEE_RATE_DISCRIMINATOR = new Uint8Array([
|
|
|
8393
8500
|
100
|
|
8394
8501
|
]);
|
|
8395
8502
|
function getSetDefaultLiquidationFeeRateDiscriminatorBytes() {
|
|
8396
|
-
return (0,
|
|
8503
|
+
return (0, import_kit59.fixEncoderSize)((0, import_kit59.getBytesEncoder)(), 8).encode(
|
|
8397
8504
|
SET_DEFAULT_LIQUIDATION_FEE_RATE_DISCRIMINATOR
|
|
8398
8505
|
);
|
|
8399
8506
|
}
|
|
8400
8507
|
function getSetDefaultLiquidationFeeRateInstructionDataEncoder() {
|
|
8401
|
-
return (0,
|
|
8402
|
-
(0,
|
|
8403
|
-
["discriminator", (0,
|
|
8404
|
-
["defaultLiquidationFeeRate", (0,
|
|
8508
|
+
return (0, import_kit59.transformEncoder)(
|
|
8509
|
+
(0, import_kit59.getStructEncoder)([
|
|
8510
|
+
["discriminator", (0, import_kit59.fixEncoderSize)((0, import_kit59.getBytesEncoder)(), 8)],
|
|
8511
|
+
["defaultLiquidationFeeRate", (0, import_kit59.getU32Encoder)()]
|
|
8405
8512
|
]),
|
|
8406
8513
|
(value) => ({
|
|
8407
8514
|
...value,
|
|
@@ -8410,13 +8517,13 @@ function getSetDefaultLiquidationFeeRateInstructionDataEncoder() {
|
|
|
8410
8517
|
);
|
|
8411
8518
|
}
|
|
8412
8519
|
function getSetDefaultLiquidationFeeRateInstructionDataDecoder() {
|
|
8413
|
-
return (0,
|
|
8414
|
-
["discriminator", (0,
|
|
8415
|
-
["defaultLiquidationFeeRate", (0,
|
|
8520
|
+
return (0, import_kit59.getStructDecoder)([
|
|
8521
|
+
["discriminator", (0, import_kit59.fixDecoderSize)((0, import_kit59.getBytesDecoder)(), 8)],
|
|
8522
|
+
["defaultLiquidationFeeRate", (0, import_kit59.getU32Decoder)()]
|
|
8416
8523
|
]);
|
|
8417
8524
|
}
|
|
8418
8525
|
function getSetDefaultLiquidationFeeRateInstructionDataCodec() {
|
|
8419
|
-
return (0,
|
|
8526
|
+
return (0, import_kit59.combineCodec)(
|
|
8420
8527
|
getSetDefaultLiquidationFeeRateInstructionDataEncoder(),
|
|
8421
8528
|
getSetDefaultLiquidationFeeRateInstructionDataDecoder()
|
|
8422
8529
|
);
|
|
@@ -8465,18 +8572,18 @@ function parseSetDefaultLiquidationFeeRateInstruction(instruction) {
|
|
|
8465
8572
|
}
|
|
8466
8573
|
|
|
8467
8574
|
// src/generated/instructions/setDefaultMaxPercentageOfLeftovers.ts
|
|
8468
|
-
var
|
|
8575
|
+
var import_kit60 = require("@solana/kit");
|
|
8469
8576
|
var SET_DEFAULT_MAX_PERCENTAGE_OF_LEFTOVERS_DISCRIMINATOR = new Uint8Array([37, 179, 107, 65, 203, 141, 183, 27]);
|
|
8470
8577
|
function getSetDefaultMaxPercentageOfLeftoversDiscriminatorBytes() {
|
|
8471
|
-
return (0,
|
|
8578
|
+
return (0, import_kit60.fixEncoderSize)((0, import_kit60.getBytesEncoder)(), 8).encode(
|
|
8472
8579
|
SET_DEFAULT_MAX_PERCENTAGE_OF_LEFTOVERS_DISCRIMINATOR
|
|
8473
8580
|
);
|
|
8474
8581
|
}
|
|
8475
8582
|
function getSetDefaultMaxPercentageOfLeftoversInstructionDataEncoder() {
|
|
8476
|
-
return (0,
|
|
8477
|
-
(0,
|
|
8478
|
-
["discriminator", (0,
|
|
8479
|
-
["maxPercentageOfLeftovers", (0,
|
|
8583
|
+
return (0, import_kit60.transformEncoder)(
|
|
8584
|
+
(0, import_kit60.getStructEncoder)([
|
|
8585
|
+
["discriminator", (0, import_kit60.fixEncoderSize)((0, import_kit60.getBytesEncoder)(), 8)],
|
|
8586
|
+
["maxPercentageOfLeftovers", (0, import_kit60.getU32Encoder)()]
|
|
8480
8587
|
]),
|
|
8481
8588
|
(value) => ({
|
|
8482
8589
|
...value,
|
|
@@ -8485,13 +8592,13 @@ function getSetDefaultMaxPercentageOfLeftoversInstructionDataEncoder() {
|
|
|
8485
8592
|
);
|
|
8486
8593
|
}
|
|
8487
8594
|
function getSetDefaultMaxPercentageOfLeftoversInstructionDataDecoder() {
|
|
8488
|
-
return (0,
|
|
8489
|
-
["discriminator", (0,
|
|
8490
|
-
["maxPercentageOfLeftovers", (0,
|
|
8595
|
+
return (0, import_kit60.getStructDecoder)([
|
|
8596
|
+
["discriminator", (0, import_kit60.fixDecoderSize)((0, import_kit60.getBytesDecoder)(), 8)],
|
|
8597
|
+
["maxPercentageOfLeftovers", (0, import_kit60.getU32Decoder)()]
|
|
8491
8598
|
]);
|
|
8492
8599
|
}
|
|
8493
8600
|
function getSetDefaultMaxPercentageOfLeftoversInstructionDataCodec() {
|
|
8494
|
-
return (0,
|
|
8601
|
+
return (0, import_kit60.combineCodec)(
|
|
8495
8602
|
getSetDefaultMaxPercentageOfLeftoversInstructionDataEncoder(),
|
|
8496
8603
|
getSetDefaultMaxPercentageOfLeftoversInstructionDataDecoder()
|
|
8497
8604
|
);
|
|
@@ -8540,7 +8647,7 @@ function parseSetDefaultMaxPercentageOfLeftoversInstruction(instruction) {
|
|
|
8540
8647
|
}
|
|
8541
8648
|
|
|
8542
8649
|
// src/generated/instructions/setDefaultMaxSwapSlippage.ts
|
|
8543
|
-
var
|
|
8650
|
+
var import_kit61 = require("@solana/kit");
|
|
8544
8651
|
var SET_DEFAULT_MAX_SWAP_SLIPPAGE_DISCRIMINATOR = new Uint8Array([
|
|
8545
8652
|
122,
|
|
8546
8653
|
22,
|
|
@@ -8552,15 +8659,15 @@ var SET_DEFAULT_MAX_SWAP_SLIPPAGE_DISCRIMINATOR = new Uint8Array([
|
|
|
8552
8659
|
181
|
|
8553
8660
|
]);
|
|
8554
8661
|
function getSetDefaultMaxSwapSlippageDiscriminatorBytes() {
|
|
8555
|
-
return (0,
|
|
8662
|
+
return (0, import_kit61.fixEncoderSize)((0, import_kit61.getBytesEncoder)(), 8).encode(
|
|
8556
8663
|
SET_DEFAULT_MAX_SWAP_SLIPPAGE_DISCRIMINATOR
|
|
8557
8664
|
);
|
|
8558
8665
|
}
|
|
8559
8666
|
function getSetDefaultMaxSwapSlippageInstructionDataEncoder() {
|
|
8560
|
-
return (0,
|
|
8561
|
-
(0,
|
|
8562
|
-
["discriminator", (0,
|
|
8563
|
-
["maxSwapSlippage", (0,
|
|
8667
|
+
return (0, import_kit61.transformEncoder)(
|
|
8668
|
+
(0, import_kit61.getStructEncoder)([
|
|
8669
|
+
["discriminator", (0, import_kit61.fixEncoderSize)((0, import_kit61.getBytesEncoder)(), 8)],
|
|
8670
|
+
["maxSwapSlippage", (0, import_kit61.getU32Encoder)()]
|
|
8564
8671
|
]),
|
|
8565
8672
|
(value) => ({
|
|
8566
8673
|
...value,
|
|
@@ -8569,13 +8676,13 @@ function getSetDefaultMaxSwapSlippageInstructionDataEncoder() {
|
|
|
8569
8676
|
);
|
|
8570
8677
|
}
|
|
8571
8678
|
function getSetDefaultMaxSwapSlippageInstructionDataDecoder() {
|
|
8572
|
-
return (0,
|
|
8573
|
-
["discriminator", (0,
|
|
8574
|
-
["maxSwapSlippage", (0,
|
|
8679
|
+
return (0, import_kit61.getStructDecoder)([
|
|
8680
|
+
["discriminator", (0, import_kit61.fixDecoderSize)((0, import_kit61.getBytesDecoder)(), 8)],
|
|
8681
|
+
["maxSwapSlippage", (0, import_kit61.getU32Decoder)()]
|
|
8575
8682
|
]);
|
|
8576
8683
|
}
|
|
8577
8684
|
function getSetDefaultMaxSwapSlippageInstructionDataCodec() {
|
|
8578
|
-
return (0,
|
|
8685
|
+
return (0, import_kit61.combineCodec)(
|
|
8579
8686
|
getSetDefaultMaxSwapSlippageInstructionDataEncoder(),
|
|
8580
8687
|
getSetDefaultMaxSwapSlippageInstructionDataDecoder()
|
|
8581
8688
|
);
|
|
@@ -8624,18 +8731,18 @@ function parseSetDefaultMaxSwapSlippageInstruction(instruction) {
|
|
|
8624
8731
|
}
|
|
8625
8732
|
|
|
8626
8733
|
// src/generated/instructions/setDefaultOraclePriceDeviationThreshold.ts
|
|
8627
|
-
var
|
|
8734
|
+
var import_kit62 = require("@solana/kit");
|
|
8628
8735
|
var SET_DEFAULT_ORACLE_PRICE_DEVIATION_THRESHOLD_DISCRIMINATOR = new Uint8Array([142, 158, 143, 67, 206, 91, 139, 120]);
|
|
8629
8736
|
function getSetDefaultOraclePriceDeviationThresholdDiscriminatorBytes() {
|
|
8630
|
-
return (0,
|
|
8737
|
+
return (0, import_kit62.fixEncoderSize)((0, import_kit62.getBytesEncoder)(), 8).encode(
|
|
8631
8738
|
SET_DEFAULT_ORACLE_PRICE_DEVIATION_THRESHOLD_DISCRIMINATOR
|
|
8632
8739
|
);
|
|
8633
8740
|
}
|
|
8634
8741
|
function getSetDefaultOraclePriceDeviationThresholdInstructionDataEncoder() {
|
|
8635
|
-
return (0,
|
|
8636
|
-
(0,
|
|
8637
|
-
["discriminator", (0,
|
|
8638
|
-
["oraclePriceDeviationThreshold", (0,
|
|
8742
|
+
return (0, import_kit62.transformEncoder)(
|
|
8743
|
+
(0, import_kit62.getStructEncoder)([
|
|
8744
|
+
["discriminator", (0, import_kit62.fixEncoderSize)((0, import_kit62.getBytesEncoder)(), 8)],
|
|
8745
|
+
["oraclePriceDeviationThreshold", (0, import_kit62.getU32Encoder)()]
|
|
8639
8746
|
]),
|
|
8640
8747
|
(value) => ({
|
|
8641
8748
|
...value,
|
|
@@ -8644,13 +8751,13 @@ function getSetDefaultOraclePriceDeviationThresholdInstructionDataEncoder() {
|
|
|
8644
8751
|
);
|
|
8645
8752
|
}
|
|
8646
8753
|
function getSetDefaultOraclePriceDeviationThresholdInstructionDataDecoder() {
|
|
8647
|
-
return (0,
|
|
8648
|
-
["discriminator", (0,
|
|
8649
|
-
["oraclePriceDeviationThreshold", (0,
|
|
8754
|
+
return (0, import_kit62.getStructDecoder)([
|
|
8755
|
+
["discriminator", (0, import_kit62.fixDecoderSize)((0, import_kit62.getBytesDecoder)(), 8)],
|
|
8756
|
+
["oraclePriceDeviationThreshold", (0, import_kit62.getU32Decoder)()]
|
|
8650
8757
|
]);
|
|
8651
8758
|
}
|
|
8652
8759
|
function getSetDefaultOraclePriceDeviationThresholdInstructionDataCodec() {
|
|
8653
|
-
return (0,
|
|
8760
|
+
return (0, import_kit62.combineCodec)(
|
|
8654
8761
|
getSetDefaultOraclePriceDeviationThresholdInstructionDataEncoder(),
|
|
8655
8762
|
getSetDefaultOraclePriceDeviationThresholdInstructionDataDecoder()
|
|
8656
8763
|
);
|
|
@@ -8699,7 +8806,7 @@ function parseSetDefaultOraclePriceDeviationThresholdInstruction(instruction) {
|
|
|
8699
8806
|
}
|
|
8700
8807
|
|
|
8701
8808
|
// src/generated/instructions/setDefaultProtocolFeeRate.ts
|
|
8702
|
-
var
|
|
8809
|
+
var import_kit63 = require("@solana/kit");
|
|
8703
8810
|
var SET_DEFAULT_PROTOCOL_FEE_RATE_DISCRIMINATOR = new Uint8Array([
|
|
8704
8811
|
107,
|
|
8705
8812
|
205,
|
|
@@ -8711,15 +8818,15 @@ var SET_DEFAULT_PROTOCOL_FEE_RATE_DISCRIMINATOR = new Uint8Array([
|
|
|
8711
8818
|
0
|
|
8712
8819
|
]);
|
|
8713
8820
|
function getSetDefaultProtocolFeeRateDiscriminatorBytes() {
|
|
8714
|
-
return (0,
|
|
8821
|
+
return (0, import_kit63.fixEncoderSize)((0, import_kit63.getBytesEncoder)(), 8).encode(
|
|
8715
8822
|
SET_DEFAULT_PROTOCOL_FEE_RATE_DISCRIMINATOR
|
|
8716
8823
|
);
|
|
8717
8824
|
}
|
|
8718
8825
|
function getSetDefaultProtocolFeeRateInstructionDataEncoder() {
|
|
8719
|
-
return (0,
|
|
8720
|
-
(0,
|
|
8721
|
-
["discriminator", (0,
|
|
8722
|
-
["defaultProtocolFeeRate", (0,
|
|
8826
|
+
return (0, import_kit63.transformEncoder)(
|
|
8827
|
+
(0, import_kit63.getStructEncoder)([
|
|
8828
|
+
["discriminator", (0, import_kit63.fixEncoderSize)((0, import_kit63.getBytesEncoder)(), 8)],
|
|
8829
|
+
["defaultProtocolFeeRate", (0, import_kit63.getU16Encoder)()]
|
|
8723
8830
|
]),
|
|
8724
8831
|
(value) => ({
|
|
8725
8832
|
...value,
|
|
@@ -8728,13 +8835,13 @@ function getSetDefaultProtocolFeeRateInstructionDataEncoder() {
|
|
|
8728
8835
|
);
|
|
8729
8836
|
}
|
|
8730
8837
|
function getSetDefaultProtocolFeeRateInstructionDataDecoder() {
|
|
8731
|
-
return (0,
|
|
8732
|
-
["discriminator", (0,
|
|
8733
|
-
["defaultProtocolFeeRate", (0,
|
|
8838
|
+
return (0, import_kit63.getStructDecoder)([
|
|
8839
|
+
["discriminator", (0, import_kit63.fixDecoderSize)((0, import_kit63.getBytesDecoder)(), 8)],
|
|
8840
|
+
["defaultProtocolFeeRate", (0, import_kit63.getU16Decoder)()]
|
|
8734
8841
|
]);
|
|
8735
8842
|
}
|
|
8736
8843
|
function getSetDefaultProtocolFeeRateInstructionDataCodec() {
|
|
8737
|
-
return (0,
|
|
8844
|
+
return (0, import_kit63.combineCodec)(
|
|
8738
8845
|
getSetDefaultProtocolFeeRateInstructionDataEncoder(),
|
|
8739
8846
|
getSetDefaultProtocolFeeRateInstructionDataDecoder()
|
|
8740
8847
|
);
|
|
@@ -8783,7 +8890,7 @@ function parseSetDefaultProtocolFeeRateInstruction(instruction) {
|
|
|
8783
8890
|
}
|
|
8784
8891
|
|
|
8785
8892
|
// src/generated/instructions/setDefaultRebalanceFeeRate.ts
|
|
8786
|
-
var
|
|
8893
|
+
var import_kit64 = require("@solana/kit");
|
|
8787
8894
|
var SET_DEFAULT_REBALANCE_FEE_RATE_DISCRIMINATOR = new Uint8Array([
|
|
8788
8895
|
18,
|
|
8789
8896
|
134,
|
|
@@ -8795,15 +8902,15 @@ var SET_DEFAULT_REBALANCE_FEE_RATE_DISCRIMINATOR = new Uint8Array([
|
|
|
8795
8902
|
204
|
|
8796
8903
|
]);
|
|
8797
8904
|
function getSetDefaultRebalanceFeeRateDiscriminatorBytes() {
|
|
8798
|
-
return (0,
|
|
8905
|
+
return (0, import_kit64.fixEncoderSize)((0, import_kit64.getBytesEncoder)(), 8).encode(
|
|
8799
8906
|
SET_DEFAULT_REBALANCE_FEE_RATE_DISCRIMINATOR
|
|
8800
8907
|
);
|
|
8801
8908
|
}
|
|
8802
8909
|
function getSetDefaultRebalanceFeeRateInstructionDataEncoder() {
|
|
8803
|
-
return (0,
|
|
8804
|
-
(0,
|
|
8805
|
-
["discriminator", (0,
|
|
8806
|
-
["defaultRebalanceFeeRate", (0,
|
|
8910
|
+
return (0, import_kit64.transformEncoder)(
|
|
8911
|
+
(0, import_kit64.getStructEncoder)([
|
|
8912
|
+
["discriminator", (0, import_kit64.fixEncoderSize)((0, import_kit64.getBytesEncoder)(), 8)],
|
|
8913
|
+
["defaultRebalanceFeeRate", (0, import_kit64.getU32Encoder)()]
|
|
8807
8914
|
]),
|
|
8808
8915
|
(value) => ({
|
|
8809
8916
|
...value,
|
|
@@ -8812,13 +8919,13 @@ function getSetDefaultRebalanceFeeRateInstructionDataEncoder() {
|
|
|
8812
8919
|
);
|
|
8813
8920
|
}
|
|
8814
8921
|
function getSetDefaultRebalanceFeeRateInstructionDataDecoder() {
|
|
8815
|
-
return (0,
|
|
8816
|
-
["discriminator", (0,
|
|
8817
|
-
["defaultRebalanceFeeRate", (0,
|
|
8922
|
+
return (0, import_kit64.getStructDecoder)([
|
|
8923
|
+
["discriminator", (0, import_kit64.fixDecoderSize)((0, import_kit64.getBytesDecoder)(), 8)],
|
|
8924
|
+
["defaultRebalanceFeeRate", (0, import_kit64.getU32Decoder)()]
|
|
8818
8925
|
]);
|
|
8819
8926
|
}
|
|
8820
8927
|
function getSetDefaultRebalanceFeeRateInstructionDataCodec() {
|
|
8821
|
-
return (0,
|
|
8928
|
+
return (0, import_kit64.combineCodec)(
|
|
8822
8929
|
getSetDefaultRebalanceFeeRateInstructionDataEncoder(),
|
|
8823
8930
|
getSetDefaultRebalanceFeeRateInstructionDataDecoder()
|
|
8824
8931
|
);
|
|
@@ -8867,7 +8974,7 @@ function parseSetDefaultRebalanceFeeRateInstruction(instruction) {
|
|
|
8867
8974
|
}
|
|
8868
8975
|
|
|
8869
8976
|
// src/generated/instructions/setFeeRecipient.ts
|
|
8870
|
-
var
|
|
8977
|
+
var import_kit65 = require("@solana/kit");
|
|
8871
8978
|
var SET_FEE_RECIPIENT_DISCRIMINATOR = new Uint8Array([
|
|
8872
8979
|
227,
|
|
8873
8980
|
18,
|
|
@@ -8879,27 +8986,27 @@ var SET_FEE_RECIPIENT_DISCRIMINATOR = new Uint8Array([
|
|
|
8879
8986
|
66
|
|
8880
8987
|
]);
|
|
8881
8988
|
function getSetFeeRecipientDiscriminatorBytes() {
|
|
8882
|
-
return (0,
|
|
8989
|
+
return (0, import_kit65.fixEncoderSize)((0, import_kit65.getBytesEncoder)(), 8).encode(
|
|
8883
8990
|
SET_FEE_RECIPIENT_DISCRIMINATOR
|
|
8884
8991
|
);
|
|
8885
8992
|
}
|
|
8886
8993
|
function getSetFeeRecipientInstructionDataEncoder() {
|
|
8887
|
-
return (0,
|
|
8888
|
-
(0,
|
|
8889
|
-
["discriminator", (0,
|
|
8890
|
-
["feeRecipient", (0,
|
|
8994
|
+
return (0, import_kit65.transformEncoder)(
|
|
8995
|
+
(0, import_kit65.getStructEncoder)([
|
|
8996
|
+
["discriminator", (0, import_kit65.fixEncoderSize)((0, import_kit65.getBytesEncoder)(), 8)],
|
|
8997
|
+
["feeRecipient", (0, import_kit65.getAddressEncoder)()]
|
|
8891
8998
|
]),
|
|
8892
8999
|
(value) => ({ ...value, discriminator: SET_FEE_RECIPIENT_DISCRIMINATOR })
|
|
8893
9000
|
);
|
|
8894
9001
|
}
|
|
8895
9002
|
function getSetFeeRecipientInstructionDataDecoder() {
|
|
8896
|
-
return (0,
|
|
8897
|
-
["discriminator", (0,
|
|
8898
|
-
["feeRecipient", (0,
|
|
9003
|
+
return (0, import_kit65.getStructDecoder)([
|
|
9004
|
+
["discriminator", (0, import_kit65.fixDecoderSize)((0, import_kit65.getBytesDecoder)(), 8)],
|
|
9005
|
+
["feeRecipient", (0, import_kit65.getAddressDecoder)()]
|
|
8899
9006
|
]);
|
|
8900
9007
|
}
|
|
8901
9008
|
function getSetFeeRecipientInstructionDataCodec() {
|
|
8902
|
-
return (0,
|
|
9009
|
+
return (0, import_kit65.combineCodec)(
|
|
8903
9010
|
getSetFeeRecipientInstructionDataEncoder(),
|
|
8904
9011
|
getSetFeeRecipientInstructionDataDecoder()
|
|
8905
9012
|
);
|
|
@@ -8946,7 +9053,7 @@ function parseSetFeeRecipientInstruction(instruction) {
|
|
|
8946
9053
|
}
|
|
8947
9054
|
|
|
8948
9055
|
// src/generated/instructions/setLiquidatorAuthority.ts
|
|
8949
|
-
var
|
|
9056
|
+
var import_kit66 = require("@solana/kit");
|
|
8950
9057
|
var SET_LIQUIDATOR_AUTHORITY_DISCRIMINATOR = new Uint8Array([
|
|
8951
9058
|
246,
|
|
8952
9059
|
146,
|
|
@@ -8958,15 +9065,15 @@ var SET_LIQUIDATOR_AUTHORITY_DISCRIMINATOR = new Uint8Array([
|
|
|
8958
9065
|
143
|
|
8959
9066
|
]);
|
|
8960
9067
|
function getSetLiquidatorAuthorityDiscriminatorBytes() {
|
|
8961
|
-
return (0,
|
|
9068
|
+
return (0, import_kit66.fixEncoderSize)((0, import_kit66.getBytesEncoder)(), 8).encode(
|
|
8962
9069
|
SET_LIQUIDATOR_AUTHORITY_DISCRIMINATOR
|
|
8963
9070
|
);
|
|
8964
9071
|
}
|
|
8965
9072
|
function getSetLiquidatorAuthorityInstructionDataEncoder() {
|
|
8966
|
-
return (0,
|
|
8967
|
-
(0,
|
|
8968
|
-
["discriminator", (0,
|
|
8969
|
-
["liquidatorAuthority", (0,
|
|
9073
|
+
return (0, import_kit66.transformEncoder)(
|
|
9074
|
+
(0, import_kit66.getStructEncoder)([
|
|
9075
|
+
["discriminator", (0, import_kit66.fixEncoderSize)((0, import_kit66.getBytesEncoder)(), 8)],
|
|
9076
|
+
["liquidatorAuthority", (0, import_kit66.getAddressEncoder)()]
|
|
8970
9077
|
]),
|
|
8971
9078
|
(value) => ({
|
|
8972
9079
|
...value,
|
|
@@ -8975,13 +9082,13 @@ function getSetLiquidatorAuthorityInstructionDataEncoder() {
|
|
|
8975
9082
|
);
|
|
8976
9083
|
}
|
|
8977
9084
|
function getSetLiquidatorAuthorityInstructionDataDecoder() {
|
|
8978
|
-
return (0,
|
|
8979
|
-
["discriminator", (0,
|
|
8980
|
-
["liquidatorAuthority", (0,
|
|
9085
|
+
return (0, import_kit66.getStructDecoder)([
|
|
9086
|
+
["discriminator", (0, import_kit66.fixDecoderSize)((0, import_kit66.getBytesDecoder)(), 8)],
|
|
9087
|
+
["liquidatorAuthority", (0, import_kit66.getAddressDecoder)()]
|
|
8981
9088
|
]);
|
|
8982
9089
|
}
|
|
8983
9090
|
function getSetLiquidatorAuthorityInstructionDataCodec() {
|
|
8984
|
-
return (0,
|
|
9091
|
+
return (0, import_kit66.combineCodec)(
|
|
8985
9092
|
getSetLiquidatorAuthorityInstructionDataEncoder(),
|
|
8986
9093
|
getSetLiquidatorAuthorityInstructionDataDecoder()
|
|
8987
9094
|
);
|
|
@@ -9030,7 +9137,7 @@ function parseSetLiquidatorAuthorityInstruction(instruction) {
|
|
|
9030
9137
|
}
|
|
9031
9138
|
|
|
9032
9139
|
// src/generated/instructions/setOraclePriceUpdateAuthority.ts
|
|
9033
|
-
var
|
|
9140
|
+
var import_kit67 = require("@solana/kit");
|
|
9034
9141
|
var SET_ORACLE_PRICE_UPDATE_AUTHORITY_DISCRIMINATOR = new Uint8Array([
|
|
9035
9142
|
49,
|
|
9036
9143
|
159,
|
|
@@ -9042,15 +9149,15 @@ var SET_ORACLE_PRICE_UPDATE_AUTHORITY_DISCRIMINATOR = new Uint8Array([
|
|
|
9042
9149
|
82
|
|
9043
9150
|
]);
|
|
9044
9151
|
function getSetOraclePriceUpdateAuthorityDiscriminatorBytes() {
|
|
9045
|
-
return (0,
|
|
9152
|
+
return (0, import_kit67.fixEncoderSize)((0, import_kit67.getBytesEncoder)(), 8).encode(
|
|
9046
9153
|
SET_ORACLE_PRICE_UPDATE_AUTHORITY_DISCRIMINATOR
|
|
9047
9154
|
);
|
|
9048
9155
|
}
|
|
9049
9156
|
function getSetOraclePriceUpdateAuthorityInstructionDataEncoder() {
|
|
9050
|
-
return (0,
|
|
9051
|
-
(0,
|
|
9052
|
-
["discriminator", (0,
|
|
9053
|
-
["oraclePriceUpdateAuthority", (0,
|
|
9157
|
+
return (0, import_kit67.transformEncoder)(
|
|
9158
|
+
(0, import_kit67.getStructEncoder)([
|
|
9159
|
+
["discriminator", (0, import_kit67.fixEncoderSize)((0, import_kit67.getBytesEncoder)(), 8)],
|
|
9160
|
+
["oraclePriceUpdateAuthority", (0, import_kit67.getAddressEncoder)()]
|
|
9054
9161
|
]),
|
|
9055
9162
|
(value) => ({
|
|
9056
9163
|
...value,
|
|
@@ -9059,13 +9166,13 @@ function getSetOraclePriceUpdateAuthorityInstructionDataEncoder() {
|
|
|
9059
9166
|
);
|
|
9060
9167
|
}
|
|
9061
9168
|
function getSetOraclePriceUpdateAuthorityInstructionDataDecoder() {
|
|
9062
|
-
return (0,
|
|
9063
|
-
["discriminator", (0,
|
|
9064
|
-
["oraclePriceUpdateAuthority", (0,
|
|
9169
|
+
return (0, import_kit67.getStructDecoder)([
|
|
9170
|
+
["discriminator", (0, import_kit67.fixDecoderSize)((0, import_kit67.getBytesDecoder)(), 8)],
|
|
9171
|
+
["oraclePriceUpdateAuthority", (0, import_kit67.getAddressDecoder)()]
|
|
9065
9172
|
]);
|
|
9066
9173
|
}
|
|
9067
9174
|
function getSetOraclePriceUpdateAuthorityInstructionDataCodec() {
|
|
9068
|
-
return (0,
|
|
9175
|
+
return (0, import_kit67.combineCodec)(
|
|
9069
9176
|
getSetOraclePriceUpdateAuthorityInstructionDataEncoder(),
|
|
9070
9177
|
getSetOraclePriceUpdateAuthorityInstructionDataDecoder()
|
|
9071
9178
|
);
|
|
@@ -9114,7 +9221,7 @@ function parseSetOraclePriceUpdateAuthorityInstruction(instruction) {
|
|
|
9114
9221
|
}
|
|
9115
9222
|
|
|
9116
9223
|
// src/generated/instructions/setOwnerAuthority.ts
|
|
9117
|
-
var
|
|
9224
|
+
var import_kit68 = require("@solana/kit");
|
|
9118
9225
|
var SET_OWNER_AUTHORITY_DISCRIMINATOR = new Uint8Array([
|
|
9119
9226
|
128,
|
|
9120
9227
|
171,
|
|
@@ -9126,27 +9233,27 @@ var SET_OWNER_AUTHORITY_DISCRIMINATOR = new Uint8Array([
|
|
|
9126
9233
|
117
|
|
9127
9234
|
]);
|
|
9128
9235
|
function getSetOwnerAuthorityDiscriminatorBytes() {
|
|
9129
|
-
return (0,
|
|
9236
|
+
return (0, import_kit68.fixEncoderSize)((0, import_kit68.getBytesEncoder)(), 8).encode(
|
|
9130
9237
|
SET_OWNER_AUTHORITY_DISCRIMINATOR
|
|
9131
9238
|
);
|
|
9132
9239
|
}
|
|
9133
9240
|
function getSetOwnerAuthorityInstructionDataEncoder() {
|
|
9134
|
-
return (0,
|
|
9135
|
-
(0,
|
|
9136
|
-
["discriminator", (0,
|
|
9137
|
-
["ownerAuthority", (0,
|
|
9241
|
+
return (0, import_kit68.transformEncoder)(
|
|
9242
|
+
(0, import_kit68.getStructEncoder)([
|
|
9243
|
+
["discriminator", (0, import_kit68.fixEncoderSize)((0, import_kit68.getBytesEncoder)(), 8)],
|
|
9244
|
+
["ownerAuthority", (0, import_kit68.getAddressEncoder)()]
|
|
9138
9245
|
]),
|
|
9139
9246
|
(value) => ({ ...value, discriminator: SET_OWNER_AUTHORITY_DISCRIMINATOR })
|
|
9140
9247
|
);
|
|
9141
9248
|
}
|
|
9142
9249
|
function getSetOwnerAuthorityInstructionDataDecoder() {
|
|
9143
|
-
return (0,
|
|
9144
|
-
["discriminator", (0,
|
|
9145
|
-
["ownerAuthority", (0,
|
|
9250
|
+
return (0, import_kit68.getStructDecoder)([
|
|
9251
|
+
["discriminator", (0, import_kit68.fixDecoderSize)((0, import_kit68.getBytesDecoder)(), 8)],
|
|
9252
|
+
["ownerAuthority", (0, import_kit68.getAddressDecoder)()]
|
|
9146
9253
|
]);
|
|
9147
9254
|
}
|
|
9148
9255
|
function getSetOwnerAuthorityInstructionDataCodec() {
|
|
9149
|
-
return (0,
|
|
9256
|
+
return (0, import_kit68.combineCodec)(
|
|
9150
9257
|
getSetOwnerAuthorityInstructionDataEncoder(),
|
|
9151
9258
|
getSetOwnerAuthorityInstructionDataDecoder()
|
|
9152
9259
|
);
|
|
@@ -9193,7 +9300,7 @@ function parseSetOwnerAuthorityInstruction(instruction) {
|
|
|
9193
9300
|
}
|
|
9194
9301
|
|
|
9195
9302
|
// src/generated/instructions/setSuspendedState.ts
|
|
9196
|
-
var
|
|
9303
|
+
var import_kit69 = require("@solana/kit");
|
|
9197
9304
|
var SET_SUSPENDED_STATE_DISCRIMINATOR = new Uint8Array([
|
|
9198
9305
|
145,
|
|
9199
9306
|
13,
|
|
@@ -9205,33 +9312,33 @@ var SET_SUSPENDED_STATE_DISCRIMINATOR = new Uint8Array([
|
|
|
9205
9312
|
32
|
|
9206
9313
|
]);
|
|
9207
9314
|
function getSetSuspendedStateDiscriminatorBytes() {
|
|
9208
|
-
return (0,
|
|
9315
|
+
return (0, import_kit69.fixEncoderSize)((0, import_kit69.getBytesEncoder)(), 8).encode(
|
|
9209
9316
|
SET_SUSPENDED_STATE_DISCRIMINATOR
|
|
9210
9317
|
);
|
|
9211
9318
|
}
|
|
9212
9319
|
function getSetSuspendedStateInstructionDataEncoder() {
|
|
9213
|
-
return (0,
|
|
9214
|
-
(0,
|
|
9215
|
-
["discriminator", (0,
|
|
9216
|
-
["suspendLendingDeposits", (0,
|
|
9217
|
-
["suspendLendingWithdrawals", (0,
|
|
9218
|
-
["suspendAddLiquidity", (0,
|
|
9219
|
-
["suspendRemoveLiquidity", (0,
|
|
9320
|
+
return (0, import_kit69.transformEncoder)(
|
|
9321
|
+
(0, import_kit69.getStructEncoder)([
|
|
9322
|
+
["discriminator", (0, import_kit69.fixEncoderSize)((0, import_kit69.getBytesEncoder)(), 8)],
|
|
9323
|
+
["suspendLendingDeposits", (0, import_kit69.getBooleanEncoder)()],
|
|
9324
|
+
["suspendLendingWithdrawals", (0, import_kit69.getBooleanEncoder)()],
|
|
9325
|
+
["suspendAddLiquidity", (0, import_kit69.getBooleanEncoder)()],
|
|
9326
|
+
["suspendRemoveLiquidity", (0, import_kit69.getBooleanEncoder)()]
|
|
9220
9327
|
]),
|
|
9221
9328
|
(value) => ({ ...value, discriminator: SET_SUSPENDED_STATE_DISCRIMINATOR })
|
|
9222
9329
|
);
|
|
9223
9330
|
}
|
|
9224
9331
|
function getSetSuspendedStateInstructionDataDecoder() {
|
|
9225
|
-
return (0,
|
|
9226
|
-
["discriminator", (0,
|
|
9227
|
-
["suspendLendingDeposits", (0,
|
|
9228
|
-
["suspendLendingWithdrawals", (0,
|
|
9229
|
-
["suspendAddLiquidity", (0,
|
|
9230
|
-
["suspendRemoveLiquidity", (0,
|
|
9332
|
+
return (0, import_kit69.getStructDecoder)([
|
|
9333
|
+
["discriminator", (0, import_kit69.fixDecoderSize)((0, import_kit69.getBytesDecoder)(), 8)],
|
|
9334
|
+
["suspendLendingDeposits", (0, import_kit69.getBooleanDecoder)()],
|
|
9335
|
+
["suspendLendingWithdrawals", (0, import_kit69.getBooleanDecoder)()],
|
|
9336
|
+
["suspendAddLiquidity", (0, import_kit69.getBooleanDecoder)()],
|
|
9337
|
+
["suspendRemoveLiquidity", (0, import_kit69.getBooleanDecoder)()]
|
|
9231
9338
|
]);
|
|
9232
9339
|
}
|
|
9233
9340
|
function getSetSuspendedStateInstructionDataCodec() {
|
|
9234
|
-
return (0,
|
|
9341
|
+
return (0, import_kit69.combineCodec)(
|
|
9235
9342
|
getSetSuspendedStateInstructionDataEncoder(),
|
|
9236
9343
|
getSetSuspendedStateInstructionDataDecoder()
|
|
9237
9344
|
);
|
|
@@ -9278,7 +9385,7 @@ function parseSetSuspendedStateInstruction(instruction) {
|
|
|
9278
9385
|
}
|
|
9279
9386
|
|
|
9280
9387
|
// src/generated/instructions/setTunaLpPositionFlags.ts
|
|
9281
|
-
var
|
|
9388
|
+
var import_kit70 = require("@solana/kit");
|
|
9282
9389
|
var SET_TUNA_LP_POSITION_FLAGS_DISCRIMINATOR = new Uint8Array([
|
|
9283
9390
|
110,
|
|
9284
9391
|
73,
|
|
@@ -9290,15 +9397,15 @@ var SET_TUNA_LP_POSITION_FLAGS_DISCRIMINATOR = new Uint8Array([
|
|
|
9290
9397
|
57
|
|
9291
9398
|
]);
|
|
9292
9399
|
function getSetTunaLpPositionFlagsDiscriminatorBytes() {
|
|
9293
|
-
return (0,
|
|
9400
|
+
return (0, import_kit70.fixEncoderSize)((0, import_kit70.getBytesEncoder)(), 8).encode(
|
|
9294
9401
|
SET_TUNA_LP_POSITION_FLAGS_DISCRIMINATOR
|
|
9295
9402
|
);
|
|
9296
9403
|
}
|
|
9297
9404
|
function getSetTunaLpPositionFlagsInstructionDataEncoder() {
|
|
9298
|
-
return (0,
|
|
9299
|
-
(0,
|
|
9300
|
-
["discriminator", (0,
|
|
9301
|
-
["flags", (0,
|
|
9405
|
+
return (0, import_kit70.transformEncoder)(
|
|
9406
|
+
(0, import_kit70.getStructEncoder)([
|
|
9407
|
+
["discriminator", (0, import_kit70.fixEncoderSize)((0, import_kit70.getBytesEncoder)(), 8)],
|
|
9408
|
+
["flags", (0, import_kit70.getU32Encoder)()]
|
|
9302
9409
|
]),
|
|
9303
9410
|
(value) => ({
|
|
9304
9411
|
...value,
|
|
@@ -9307,13 +9414,13 @@ function getSetTunaLpPositionFlagsInstructionDataEncoder() {
|
|
|
9307
9414
|
);
|
|
9308
9415
|
}
|
|
9309
9416
|
function getSetTunaLpPositionFlagsInstructionDataDecoder() {
|
|
9310
|
-
return (0,
|
|
9311
|
-
["discriminator", (0,
|
|
9312
|
-
["flags", (0,
|
|
9417
|
+
return (0, import_kit70.getStructDecoder)([
|
|
9418
|
+
["discriminator", (0, import_kit70.fixDecoderSize)((0, import_kit70.getBytesDecoder)(), 8)],
|
|
9419
|
+
["flags", (0, import_kit70.getU32Decoder)()]
|
|
9313
9420
|
]);
|
|
9314
9421
|
}
|
|
9315
9422
|
function getSetTunaLpPositionFlagsInstructionDataCodec() {
|
|
9316
|
-
return (0,
|
|
9423
|
+
return (0, import_kit70.combineCodec)(
|
|
9317
9424
|
getSetTunaLpPositionFlagsInstructionDataEncoder(),
|
|
9318
9425
|
getSetTunaLpPositionFlagsInstructionDataDecoder()
|
|
9319
9426
|
);
|
|
@@ -9362,7 +9469,7 @@ function parseSetTunaLpPositionFlagsInstruction(instruction) {
|
|
|
9362
9469
|
}
|
|
9363
9470
|
|
|
9364
9471
|
// src/generated/instructions/setTunaLpPositionLimitOrders.ts
|
|
9365
|
-
var
|
|
9472
|
+
var import_kit71 = require("@solana/kit");
|
|
9366
9473
|
var SET_TUNA_LP_POSITION_LIMIT_ORDERS_DISCRIMINATOR = new Uint8Array([
|
|
9367
9474
|
65,
|
|
9368
9475
|
128,
|
|
@@ -9374,17 +9481,17 @@ var SET_TUNA_LP_POSITION_LIMIT_ORDERS_DISCRIMINATOR = new Uint8Array([
|
|
|
9374
9481
|
255
|
|
9375
9482
|
]);
|
|
9376
9483
|
function getSetTunaLpPositionLimitOrdersDiscriminatorBytes() {
|
|
9377
|
-
return (0,
|
|
9484
|
+
return (0, import_kit71.fixEncoderSize)((0, import_kit71.getBytesEncoder)(), 8).encode(
|
|
9378
9485
|
SET_TUNA_LP_POSITION_LIMIT_ORDERS_DISCRIMINATOR
|
|
9379
9486
|
);
|
|
9380
9487
|
}
|
|
9381
9488
|
function getSetTunaLpPositionLimitOrdersInstructionDataEncoder() {
|
|
9382
|
-
return (0,
|
|
9383
|
-
(0,
|
|
9384
|
-
["discriminator", (0,
|
|
9385
|
-
["lowerLimitOrderSqrtPrice", (0,
|
|
9386
|
-
["upperLimitOrderSqrtPrice", (0,
|
|
9387
|
-
["swapToTokenOnLimitOrder", (0,
|
|
9489
|
+
return (0, import_kit71.transformEncoder)(
|
|
9490
|
+
(0, import_kit71.getStructEncoder)([
|
|
9491
|
+
["discriminator", (0, import_kit71.fixEncoderSize)((0, import_kit71.getBytesEncoder)(), 8)],
|
|
9492
|
+
["lowerLimitOrderSqrtPrice", (0, import_kit71.getU128Encoder)()],
|
|
9493
|
+
["upperLimitOrderSqrtPrice", (0, import_kit71.getU128Encoder)()],
|
|
9494
|
+
["swapToTokenOnLimitOrder", (0, import_kit71.getU8Encoder)()]
|
|
9388
9495
|
]),
|
|
9389
9496
|
(value) => ({
|
|
9390
9497
|
...value,
|
|
@@ -9393,15 +9500,15 @@ function getSetTunaLpPositionLimitOrdersInstructionDataEncoder() {
|
|
|
9393
9500
|
);
|
|
9394
9501
|
}
|
|
9395
9502
|
function getSetTunaLpPositionLimitOrdersInstructionDataDecoder() {
|
|
9396
|
-
return (0,
|
|
9397
|
-
["discriminator", (0,
|
|
9398
|
-
["lowerLimitOrderSqrtPrice", (0,
|
|
9399
|
-
["upperLimitOrderSqrtPrice", (0,
|
|
9400
|
-
["swapToTokenOnLimitOrder", (0,
|
|
9503
|
+
return (0, import_kit71.getStructDecoder)([
|
|
9504
|
+
["discriminator", (0, import_kit71.fixDecoderSize)((0, import_kit71.getBytesDecoder)(), 8)],
|
|
9505
|
+
["lowerLimitOrderSqrtPrice", (0, import_kit71.getU128Decoder)()],
|
|
9506
|
+
["upperLimitOrderSqrtPrice", (0, import_kit71.getU128Decoder)()],
|
|
9507
|
+
["swapToTokenOnLimitOrder", (0, import_kit71.getU8Decoder)()]
|
|
9401
9508
|
]);
|
|
9402
9509
|
}
|
|
9403
9510
|
function getSetTunaLpPositionLimitOrdersInstructionDataCodec() {
|
|
9404
|
-
return (0,
|
|
9511
|
+
return (0, import_kit71.combineCodec)(
|
|
9405
9512
|
getSetTunaLpPositionLimitOrdersInstructionDataEncoder(),
|
|
9406
9513
|
getSetTunaLpPositionLimitOrdersInstructionDataDecoder()
|
|
9407
9514
|
);
|
|
@@ -9450,18 +9557,18 @@ function parseSetTunaLpPositionLimitOrdersInstruction(instruction) {
|
|
|
9450
9557
|
}
|
|
9451
9558
|
|
|
9452
9559
|
// src/generated/instructions/setTunaLpPositionRebalanceThreshold.ts
|
|
9453
|
-
var
|
|
9560
|
+
var import_kit72 = require("@solana/kit");
|
|
9454
9561
|
var SET_TUNA_LP_POSITION_REBALANCE_THRESHOLD_DISCRIMINATOR = new Uint8Array([244, 174, 185, 58, 90, 150, 162, 51]);
|
|
9455
9562
|
function getSetTunaLpPositionRebalanceThresholdDiscriminatorBytes() {
|
|
9456
|
-
return (0,
|
|
9563
|
+
return (0, import_kit72.fixEncoderSize)((0, import_kit72.getBytesEncoder)(), 8).encode(
|
|
9457
9564
|
SET_TUNA_LP_POSITION_REBALANCE_THRESHOLD_DISCRIMINATOR
|
|
9458
9565
|
);
|
|
9459
9566
|
}
|
|
9460
9567
|
function getSetTunaLpPositionRebalanceThresholdInstructionDataEncoder() {
|
|
9461
|
-
return (0,
|
|
9462
|
-
(0,
|
|
9463
|
-
["discriminator", (0,
|
|
9464
|
-
["rebalanceThresholdTicks", (0,
|
|
9568
|
+
return (0, import_kit72.transformEncoder)(
|
|
9569
|
+
(0, import_kit72.getStructEncoder)([
|
|
9570
|
+
["discriminator", (0, import_kit72.fixEncoderSize)((0, import_kit72.getBytesEncoder)(), 8)],
|
|
9571
|
+
["rebalanceThresholdTicks", (0, import_kit72.getU32Encoder)()]
|
|
9465
9572
|
]),
|
|
9466
9573
|
(value) => ({
|
|
9467
9574
|
...value,
|
|
@@ -9470,13 +9577,13 @@ function getSetTunaLpPositionRebalanceThresholdInstructionDataEncoder() {
|
|
|
9470
9577
|
);
|
|
9471
9578
|
}
|
|
9472
9579
|
function getSetTunaLpPositionRebalanceThresholdInstructionDataDecoder() {
|
|
9473
|
-
return (0,
|
|
9474
|
-
["discriminator", (0,
|
|
9475
|
-
["rebalanceThresholdTicks", (0,
|
|
9580
|
+
return (0, import_kit72.getStructDecoder)([
|
|
9581
|
+
["discriminator", (0, import_kit72.fixDecoderSize)((0, import_kit72.getBytesDecoder)(), 8)],
|
|
9582
|
+
["rebalanceThresholdTicks", (0, import_kit72.getU32Decoder)()]
|
|
9476
9583
|
]);
|
|
9477
9584
|
}
|
|
9478
9585
|
function getSetTunaLpPositionRebalanceThresholdInstructionDataCodec() {
|
|
9479
|
-
return (0,
|
|
9586
|
+
return (0, import_kit72.combineCodec)(
|
|
9480
9587
|
getSetTunaLpPositionRebalanceThresholdInstructionDataEncoder(),
|
|
9481
9588
|
getSetTunaLpPositionRebalanceThresholdInstructionDataDecoder()
|
|
9482
9589
|
);
|
|
@@ -9525,21 +9632,21 @@ function parseSetTunaLpPositionRebalanceThresholdInstruction(instruction) {
|
|
|
9525
9632
|
}
|
|
9526
9633
|
|
|
9527
9634
|
// src/generated/instructions/setTunaSpotPositionLimitOrders.ts
|
|
9528
|
-
var
|
|
9635
|
+
var import_kit73 = require("@solana/kit");
|
|
9529
9636
|
var SET_TUNA_SPOT_POSITION_LIMIT_ORDERS_DISCRIMINATOR = new Uint8Array(
|
|
9530
9637
|
[10, 180, 19, 205, 169, 133, 52, 118]
|
|
9531
9638
|
);
|
|
9532
9639
|
function getSetTunaSpotPositionLimitOrdersDiscriminatorBytes() {
|
|
9533
|
-
return (0,
|
|
9640
|
+
return (0, import_kit73.fixEncoderSize)((0, import_kit73.getBytesEncoder)(), 8).encode(
|
|
9534
9641
|
SET_TUNA_SPOT_POSITION_LIMIT_ORDERS_DISCRIMINATOR
|
|
9535
9642
|
);
|
|
9536
9643
|
}
|
|
9537
9644
|
function getSetTunaSpotPositionLimitOrdersInstructionDataEncoder() {
|
|
9538
|
-
return (0,
|
|
9539
|
-
(0,
|
|
9540
|
-
["discriminator", (0,
|
|
9541
|
-
["lowerLimitOrderSqrtPrice", (0,
|
|
9542
|
-
["upperLimitOrderSqrtPrice", (0,
|
|
9645
|
+
return (0, import_kit73.transformEncoder)(
|
|
9646
|
+
(0, import_kit73.getStructEncoder)([
|
|
9647
|
+
["discriminator", (0, import_kit73.fixEncoderSize)((0, import_kit73.getBytesEncoder)(), 8)],
|
|
9648
|
+
["lowerLimitOrderSqrtPrice", (0, import_kit73.getU128Encoder)()],
|
|
9649
|
+
["upperLimitOrderSqrtPrice", (0, import_kit73.getU128Encoder)()]
|
|
9543
9650
|
]),
|
|
9544
9651
|
(value) => ({
|
|
9545
9652
|
...value,
|
|
@@ -9548,14 +9655,14 @@ function getSetTunaSpotPositionLimitOrdersInstructionDataEncoder() {
|
|
|
9548
9655
|
);
|
|
9549
9656
|
}
|
|
9550
9657
|
function getSetTunaSpotPositionLimitOrdersInstructionDataDecoder() {
|
|
9551
|
-
return (0,
|
|
9552
|
-
["discriminator", (0,
|
|
9553
|
-
["lowerLimitOrderSqrtPrice", (0,
|
|
9554
|
-
["upperLimitOrderSqrtPrice", (0,
|
|
9658
|
+
return (0, import_kit73.getStructDecoder)([
|
|
9659
|
+
["discriminator", (0, import_kit73.fixDecoderSize)((0, import_kit73.getBytesDecoder)(), 8)],
|
|
9660
|
+
["lowerLimitOrderSqrtPrice", (0, import_kit73.getU128Decoder)()],
|
|
9661
|
+
["upperLimitOrderSqrtPrice", (0, import_kit73.getU128Decoder)()]
|
|
9555
9662
|
]);
|
|
9556
9663
|
}
|
|
9557
9664
|
function getSetTunaSpotPositionLimitOrdersInstructionDataCodec() {
|
|
9558
|
-
return (0,
|
|
9665
|
+
return (0, import_kit73.combineCodec)(
|
|
9559
9666
|
getSetTunaSpotPositionLimitOrdersInstructionDataEncoder(),
|
|
9560
9667
|
getSetTunaSpotPositionLimitOrdersInstructionDataDecoder()
|
|
9561
9668
|
);
|
|
@@ -9604,7 +9711,7 @@ function parseSetTunaSpotPositionLimitOrdersInstruction(instruction) {
|
|
|
9604
9711
|
}
|
|
9605
9712
|
|
|
9606
9713
|
// src/generated/instructions/updateMarket.ts
|
|
9607
|
-
var
|
|
9714
|
+
var import_kit74 = require("@solana/kit");
|
|
9608
9715
|
var UPDATE_MARKET_DISCRIMINATOR = new Uint8Array([
|
|
9609
9716
|
153,
|
|
9610
9717
|
39,
|
|
@@ -9616,53 +9723,53 @@ var UPDATE_MARKET_DISCRIMINATOR = new Uint8Array([
|
|
|
9616
9723
|
217
|
|
9617
9724
|
]);
|
|
9618
9725
|
function getUpdateMarketDiscriminatorBytes() {
|
|
9619
|
-
return (0,
|
|
9726
|
+
return (0, import_kit74.fixEncoderSize)((0, import_kit74.getBytesEncoder)(), 8).encode(
|
|
9620
9727
|
UPDATE_MARKET_DISCRIMINATOR
|
|
9621
9728
|
);
|
|
9622
9729
|
}
|
|
9623
9730
|
function getUpdateMarketInstructionDataEncoder() {
|
|
9624
|
-
return (0,
|
|
9625
|
-
(0,
|
|
9626
|
-
["discriminator", (0,
|
|
9627
|
-
["addressLookupTable", (0,
|
|
9628
|
-
["maxLeverage", (0,
|
|
9629
|
-
["protocolFee", (0,
|
|
9630
|
-
["protocolFeeOnCollateral", (0,
|
|
9631
|
-
["liquidationFee", (0,
|
|
9632
|
-
["liquidationThreshold", (0,
|
|
9633
|
-
["oraclePriceDeviationThreshold", (0,
|
|
9634
|
-
["disabled", (0,
|
|
9635
|
-
["borrowLimitA", (0,
|
|
9636
|
-
["borrowLimitB", (0,
|
|
9637
|
-
["maxSwapSlippage", (0,
|
|
9638
|
-
["rebalanceProtocolFee", (0,
|
|
9639
|
-
["spotPositionSizeLimitA", (0,
|
|
9640
|
-
["spotPositionSizeLimitB", (0,
|
|
9731
|
+
return (0, import_kit74.transformEncoder)(
|
|
9732
|
+
(0, import_kit74.getStructEncoder)([
|
|
9733
|
+
["discriminator", (0, import_kit74.fixEncoderSize)((0, import_kit74.getBytesEncoder)(), 8)],
|
|
9734
|
+
["addressLookupTable", (0, import_kit74.getAddressEncoder)()],
|
|
9735
|
+
["maxLeverage", (0, import_kit74.getU32Encoder)()],
|
|
9736
|
+
["protocolFee", (0, import_kit74.getU16Encoder)()],
|
|
9737
|
+
["protocolFeeOnCollateral", (0, import_kit74.getU16Encoder)()],
|
|
9738
|
+
["liquidationFee", (0, import_kit74.getU32Encoder)()],
|
|
9739
|
+
["liquidationThreshold", (0, import_kit74.getU32Encoder)()],
|
|
9740
|
+
["oraclePriceDeviationThreshold", (0, import_kit74.getU32Encoder)()],
|
|
9741
|
+
["disabled", (0, import_kit74.getBooleanEncoder)()],
|
|
9742
|
+
["borrowLimitA", (0, import_kit74.getU64Encoder)()],
|
|
9743
|
+
["borrowLimitB", (0, import_kit74.getU64Encoder)()],
|
|
9744
|
+
["maxSwapSlippage", (0, import_kit74.getU32Encoder)()],
|
|
9745
|
+
["rebalanceProtocolFee", (0, import_kit74.getU32Encoder)()],
|
|
9746
|
+
["spotPositionSizeLimitA", (0, import_kit74.getU64Encoder)()],
|
|
9747
|
+
["spotPositionSizeLimitB", (0, import_kit74.getU64Encoder)()]
|
|
9641
9748
|
]),
|
|
9642
9749
|
(value) => ({ ...value, discriminator: UPDATE_MARKET_DISCRIMINATOR })
|
|
9643
9750
|
);
|
|
9644
9751
|
}
|
|
9645
9752
|
function getUpdateMarketInstructionDataDecoder() {
|
|
9646
|
-
return (0,
|
|
9647
|
-
["discriminator", (0,
|
|
9648
|
-
["addressLookupTable", (0,
|
|
9649
|
-
["maxLeverage", (0,
|
|
9650
|
-
["protocolFee", (0,
|
|
9651
|
-
["protocolFeeOnCollateral", (0,
|
|
9652
|
-
["liquidationFee", (0,
|
|
9653
|
-
["liquidationThreshold", (0,
|
|
9654
|
-
["oraclePriceDeviationThreshold", (0,
|
|
9655
|
-
["disabled", (0,
|
|
9656
|
-
["borrowLimitA", (0,
|
|
9657
|
-
["borrowLimitB", (0,
|
|
9658
|
-
["maxSwapSlippage", (0,
|
|
9659
|
-
["rebalanceProtocolFee", (0,
|
|
9660
|
-
["spotPositionSizeLimitA", (0,
|
|
9661
|
-
["spotPositionSizeLimitB", (0,
|
|
9753
|
+
return (0, import_kit74.getStructDecoder)([
|
|
9754
|
+
["discriminator", (0, import_kit74.fixDecoderSize)((0, import_kit74.getBytesDecoder)(), 8)],
|
|
9755
|
+
["addressLookupTable", (0, import_kit74.getAddressDecoder)()],
|
|
9756
|
+
["maxLeverage", (0, import_kit74.getU32Decoder)()],
|
|
9757
|
+
["protocolFee", (0, import_kit74.getU16Decoder)()],
|
|
9758
|
+
["protocolFeeOnCollateral", (0, import_kit74.getU16Decoder)()],
|
|
9759
|
+
["liquidationFee", (0, import_kit74.getU32Decoder)()],
|
|
9760
|
+
["liquidationThreshold", (0, import_kit74.getU32Decoder)()],
|
|
9761
|
+
["oraclePriceDeviationThreshold", (0, import_kit74.getU32Decoder)()],
|
|
9762
|
+
["disabled", (0, import_kit74.getBooleanDecoder)()],
|
|
9763
|
+
["borrowLimitA", (0, import_kit74.getU64Decoder)()],
|
|
9764
|
+
["borrowLimitB", (0, import_kit74.getU64Decoder)()],
|
|
9765
|
+
["maxSwapSlippage", (0, import_kit74.getU32Decoder)()],
|
|
9766
|
+
["rebalanceProtocolFee", (0, import_kit74.getU32Decoder)()],
|
|
9767
|
+
["spotPositionSizeLimitA", (0, import_kit74.getU64Decoder)()],
|
|
9768
|
+
["spotPositionSizeLimitB", (0, import_kit74.getU64Decoder)()]
|
|
9662
9769
|
]);
|
|
9663
9770
|
}
|
|
9664
9771
|
function getUpdateMarketInstructionDataCodec() {
|
|
9665
|
-
return (0,
|
|
9772
|
+
return (0, import_kit74.combineCodec)(
|
|
9666
9773
|
getUpdateMarketInstructionDataEncoder(),
|
|
9667
9774
|
getUpdateMarketInstructionDataDecoder()
|
|
9668
9775
|
);
|
|
@@ -9712,7 +9819,7 @@ function parseUpdateMarketInstruction(instruction) {
|
|
|
9712
9819
|
}
|
|
9713
9820
|
|
|
9714
9821
|
// src/generated/instructions/updateOraclePrice.ts
|
|
9715
|
-
var
|
|
9822
|
+
var import_kit75 = require("@solana/kit");
|
|
9716
9823
|
var UPDATE_ORACLE_PRICE_DISCRIMINATOR = new Uint8Array([
|
|
9717
9824
|
14,
|
|
9718
9825
|
35,
|
|
@@ -9724,27 +9831,27 @@ var UPDATE_ORACLE_PRICE_DISCRIMINATOR = new Uint8Array([
|
|
|
9724
9831
|
154
|
|
9725
9832
|
]);
|
|
9726
9833
|
function getUpdateOraclePriceDiscriminatorBytes() {
|
|
9727
|
-
return (0,
|
|
9834
|
+
return (0, import_kit75.fixEncoderSize)((0, import_kit75.getBytesEncoder)(), 8).encode(
|
|
9728
9835
|
UPDATE_ORACLE_PRICE_DISCRIMINATOR
|
|
9729
9836
|
);
|
|
9730
9837
|
}
|
|
9731
9838
|
function getUpdateOraclePriceInstructionDataEncoder() {
|
|
9732
|
-
return (0,
|
|
9733
|
-
(0,
|
|
9734
|
-
["discriminator", (0,
|
|
9735
|
-
["priceUpdates", (0,
|
|
9839
|
+
return (0, import_kit75.transformEncoder)(
|
|
9840
|
+
(0, import_kit75.getStructEncoder)([
|
|
9841
|
+
["discriminator", (0, import_kit75.fixEncoderSize)((0, import_kit75.getBytesEncoder)(), 8)],
|
|
9842
|
+
["priceUpdates", (0, import_kit75.getArrayEncoder)(getOraclePriceUpdateEncoder())]
|
|
9736
9843
|
]),
|
|
9737
9844
|
(value) => ({ ...value, discriminator: UPDATE_ORACLE_PRICE_DISCRIMINATOR })
|
|
9738
9845
|
);
|
|
9739
9846
|
}
|
|
9740
9847
|
function getUpdateOraclePriceInstructionDataDecoder() {
|
|
9741
|
-
return (0,
|
|
9742
|
-
["discriminator", (0,
|
|
9743
|
-
["priceUpdates", (0,
|
|
9848
|
+
return (0, import_kit75.getStructDecoder)([
|
|
9849
|
+
["discriminator", (0, import_kit75.fixDecoderSize)((0, import_kit75.getBytesDecoder)(), 8)],
|
|
9850
|
+
["priceUpdates", (0, import_kit75.getArrayDecoder)(getOraclePriceUpdateDecoder())]
|
|
9744
9851
|
]);
|
|
9745
9852
|
}
|
|
9746
9853
|
function getUpdateOraclePriceInstructionDataCodec() {
|
|
9747
|
-
return (0,
|
|
9854
|
+
return (0, import_kit75.combineCodec)(
|
|
9748
9855
|
getUpdateOraclePriceInstructionDataEncoder(),
|
|
9749
9856
|
getUpdateOraclePriceInstructionDataDecoder()
|
|
9750
9857
|
);
|
|
@@ -9791,7 +9898,7 @@ function parseUpdateOraclePriceInstruction(instruction) {
|
|
|
9791
9898
|
}
|
|
9792
9899
|
|
|
9793
9900
|
// src/generated/instructions/updateVault.ts
|
|
9794
|
-
var
|
|
9901
|
+
var import_kit76 = require("@solana/kit");
|
|
9795
9902
|
var UPDATE_VAULT_DISCRIMINATOR = new Uint8Array([
|
|
9796
9903
|
67,
|
|
9797
9904
|
229,
|
|
@@ -9803,33 +9910,33 @@ var UPDATE_VAULT_DISCRIMINATOR = new Uint8Array([
|
|
|
9803
9910
|
60
|
|
9804
9911
|
]);
|
|
9805
9912
|
function getUpdateVaultDiscriminatorBytes() {
|
|
9806
|
-
return (0,
|
|
9913
|
+
return (0, import_kit76.fixEncoderSize)((0, import_kit76.getBytesEncoder)(), 8).encode(
|
|
9807
9914
|
UPDATE_VAULT_DISCRIMINATOR
|
|
9808
9915
|
);
|
|
9809
9916
|
}
|
|
9810
9917
|
function getUpdateVaultInstructionDataEncoder() {
|
|
9811
|
-
return (0,
|
|
9812
|
-
(0,
|
|
9813
|
-
["discriminator", (0,
|
|
9814
|
-
["interestRate", (0,
|
|
9815
|
-
["supplyLimit", (0,
|
|
9816
|
-
["oraclePriceUpdate", (0,
|
|
9817
|
-
["pythOracleFeedId", (0,
|
|
9918
|
+
return (0, import_kit76.transformEncoder)(
|
|
9919
|
+
(0, import_kit76.getStructEncoder)([
|
|
9920
|
+
["discriminator", (0, import_kit76.fixEncoderSize)((0, import_kit76.getBytesEncoder)(), 8)],
|
|
9921
|
+
["interestRate", (0, import_kit76.getU64Encoder)()],
|
|
9922
|
+
["supplyLimit", (0, import_kit76.getU64Encoder)()],
|
|
9923
|
+
["oraclePriceUpdate", (0, import_kit76.getAddressEncoder)()],
|
|
9924
|
+
["pythOracleFeedId", (0, import_kit76.getAddressEncoder)()]
|
|
9818
9925
|
]),
|
|
9819
9926
|
(value) => ({ ...value, discriminator: UPDATE_VAULT_DISCRIMINATOR })
|
|
9820
9927
|
);
|
|
9821
9928
|
}
|
|
9822
9929
|
function getUpdateVaultInstructionDataDecoder() {
|
|
9823
|
-
return (0,
|
|
9824
|
-
["discriminator", (0,
|
|
9825
|
-
["interestRate", (0,
|
|
9826
|
-
["supplyLimit", (0,
|
|
9827
|
-
["oraclePriceUpdate", (0,
|
|
9828
|
-
["pythOracleFeedId", (0,
|
|
9930
|
+
return (0, import_kit76.getStructDecoder)([
|
|
9931
|
+
["discriminator", (0, import_kit76.fixDecoderSize)((0, import_kit76.getBytesDecoder)(), 8)],
|
|
9932
|
+
["interestRate", (0, import_kit76.getU64Decoder)()],
|
|
9933
|
+
["supplyLimit", (0, import_kit76.getU64Decoder)()],
|
|
9934
|
+
["oraclePriceUpdate", (0, import_kit76.getAddressDecoder)()],
|
|
9935
|
+
["pythOracleFeedId", (0, import_kit76.getAddressDecoder)()]
|
|
9829
9936
|
]);
|
|
9830
9937
|
}
|
|
9831
9938
|
function getUpdateVaultInstructionDataCodec() {
|
|
9832
|
-
return (0,
|
|
9939
|
+
return (0, import_kit76.combineCodec)(
|
|
9833
9940
|
getUpdateVaultInstructionDataEncoder(),
|
|
9834
9941
|
getUpdateVaultInstructionDataDecoder()
|
|
9835
9942
|
);
|
|
@@ -9879,7 +9986,7 @@ function parseUpdateVaultInstruction(instruction) {
|
|
|
9879
9986
|
}
|
|
9880
9987
|
|
|
9881
9988
|
// src/generated/instructions/withdraw.ts
|
|
9882
|
-
var
|
|
9989
|
+
var import_kit77 = require("@solana/kit");
|
|
9883
9990
|
var WITHDRAW_DISCRIMINATOR = new Uint8Array([
|
|
9884
9991
|
183,
|
|
9885
9992
|
18,
|
|
@@ -9891,27 +9998,27 @@ var WITHDRAW_DISCRIMINATOR = new Uint8Array([
|
|
|
9891
9998
|
34
|
|
9892
9999
|
]);
|
|
9893
10000
|
function getWithdrawDiscriminatorBytes() {
|
|
9894
|
-
return (0,
|
|
10001
|
+
return (0, import_kit77.fixEncoderSize)((0, import_kit77.getBytesEncoder)(), 8).encode(WITHDRAW_DISCRIMINATOR);
|
|
9895
10002
|
}
|
|
9896
10003
|
function getWithdrawInstructionDataEncoder() {
|
|
9897
|
-
return (0,
|
|
9898
|
-
(0,
|
|
9899
|
-
["discriminator", (0,
|
|
9900
|
-
["funds", (0,
|
|
9901
|
-
["shares", (0,
|
|
10004
|
+
return (0, import_kit77.transformEncoder)(
|
|
10005
|
+
(0, import_kit77.getStructEncoder)([
|
|
10006
|
+
["discriminator", (0, import_kit77.fixEncoderSize)((0, import_kit77.getBytesEncoder)(), 8)],
|
|
10007
|
+
["funds", (0, import_kit77.getU64Encoder)()],
|
|
10008
|
+
["shares", (0, import_kit77.getU64Encoder)()]
|
|
9902
10009
|
]),
|
|
9903
10010
|
(value) => ({ ...value, discriminator: WITHDRAW_DISCRIMINATOR })
|
|
9904
10011
|
);
|
|
9905
10012
|
}
|
|
9906
10013
|
function getWithdrawInstructionDataDecoder() {
|
|
9907
|
-
return (0,
|
|
9908
|
-
["discriminator", (0,
|
|
9909
|
-
["funds", (0,
|
|
9910
|
-
["shares", (0,
|
|
10014
|
+
return (0, import_kit77.getStructDecoder)([
|
|
10015
|
+
["discriminator", (0, import_kit77.fixDecoderSize)((0, import_kit77.getBytesDecoder)(), 8)],
|
|
10016
|
+
["funds", (0, import_kit77.getU64Decoder)()],
|
|
10017
|
+
["shares", (0, import_kit77.getU64Decoder)()]
|
|
9911
10018
|
]);
|
|
9912
10019
|
}
|
|
9913
10020
|
function getWithdrawInstructionDataCodec() {
|
|
9914
|
-
return (0,
|
|
10021
|
+
return (0, import_kit77.combineCodec)(
|
|
9915
10022
|
getWithdrawInstructionDataEncoder(),
|
|
9916
10023
|
getWithdrawInstructionDataDecoder()
|
|
9917
10024
|
);
|
|
@@ -9982,12 +10089,12 @@ function parseWithdrawInstruction(instruction) {
|
|
|
9982
10089
|
}
|
|
9983
10090
|
|
|
9984
10091
|
// src/pda.ts
|
|
9985
|
-
var import_kit78 = require("@solana/kit");
|
|
9986
10092
|
var import_kit79 = require("@solana/kit");
|
|
10093
|
+
var import_kit80 = require("@solana/kit");
|
|
9987
10094
|
|
|
9988
10095
|
// src/consts.ts
|
|
9989
|
-
var
|
|
9990
|
-
var DEFAULT_ADDRESS = (0,
|
|
10096
|
+
var import_kit78 = require("@solana/kit");
|
|
10097
|
+
var DEFAULT_ADDRESS = (0, import_kit78.address)("11111111111111111111111111111111");
|
|
9991
10098
|
var HUNDRED_PERCENT = 1e6;
|
|
9992
10099
|
var HUNDRED_PERCENTn = 1000000n;
|
|
9993
10100
|
var LEVERAGE_ONE = HUNDRED_PERCENT;
|
|
@@ -10007,60 +10114,60 @@ var TUNA_POSITION_FLAGS_UPPER_LIMIT_ORDER_SWAP_TO_TOKEN_B = 1 << 3;
|
|
|
10007
10114
|
var TUNA_POSITION_FLAGS_AUTO_COMPOUND_YIELD = 1 << 4;
|
|
10008
10115
|
var TUNA_POSITION_FLAGS_AUTO_COMPOUND_YIELD_WITH_LEVERAGE = 1 << 5;
|
|
10009
10116
|
var TUNA_POSITION_FLAGS_ALLOW_REBALANCING = 1 << 6;
|
|
10010
|
-
var WP_NFT_UPDATE_AUTH = (0,
|
|
10011
|
-
var DEFAULT_PUSH_ORACLE_PROGRAM_ID = (0,
|
|
10012
|
-
var JUPITER_EVENT_AUTHORITY = (0,
|
|
10013
|
-
var JUPITER_PROGRAM_AUTHORITY = (0,
|
|
10117
|
+
var WP_NFT_UPDATE_AUTH = (0, import_kit78.address)("3axbTs2z5GBy6usVbNVoqEgZMng3vZvMnAoX29BFfwhr");
|
|
10118
|
+
var DEFAULT_PUSH_ORACLE_PROGRAM_ID = (0, import_kit78.address)("pythWSnswVUd12oZpeFP8e9CVaEqJg25g1Vtc2biRsT");
|
|
10119
|
+
var JUPITER_EVENT_AUTHORITY = (0, import_kit78.address)("D8cy77BBepLMngZx6ZukaTff5hCt1HrWyKk3Hnd9oitf");
|
|
10120
|
+
var JUPITER_PROGRAM_AUTHORITY = (0, import_kit78.address)("9nnLbotNTcUhvbrsA6Mdkx45Sm82G35zo28AqUvjExn8");
|
|
10014
10121
|
var MIN_SQRT_PRICE = 4295048016n;
|
|
10015
10122
|
var MAX_SQRT_PRICE = 79226673515401279992447579055n;
|
|
10016
10123
|
|
|
10017
10124
|
// src/pda.ts
|
|
10018
10125
|
async function getTunaConfigAddress() {
|
|
10019
|
-
return await (0,
|
|
10126
|
+
return await (0, import_kit80.getProgramDerivedAddress)({
|
|
10020
10127
|
programAddress: TUNA_PROGRAM_ADDRESS,
|
|
10021
10128
|
seeds: ["tuna_config"]
|
|
10022
10129
|
});
|
|
10023
10130
|
}
|
|
10024
10131
|
async function getMarketAddress(pool) {
|
|
10025
|
-
return await (0,
|
|
10132
|
+
return await (0, import_kit80.getProgramDerivedAddress)({
|
|
10026
10133
|
programAddress: TUNA_PROGRAM_ADDRESS,
|
|
10027
|
-
seeds: ["market", (0,
|
|
10134
|
+
seeds: ["market", (0, import_kit80.getAddressEncoder)().encode(pool)]
|
|
10028
10135
|
});
|
|
10029
10136
|
}
|
|
10030
10137
|
async function getLendingVaultAddress(mint) {
|
|
10031
|
-
return await (0,
|
|
10138
|
+
return await (0, import_kit80.getProgramDerivedAddress)({
|
|
10032
10139
|
programAddress: TUNA_PROGRAM_ADDRESS,
|
|
10033
|
-
seeds: ["vault", (0,
|
|
10140
|
+
seeds: ["vault", (0, import_kit80.getAddressEncoder)().encode(mint)]
|
|
10034
10141
|
});
|
|
10035
10142
|
}
|
|
10036
10143
|
async function getLendingVaultV2Address(mint, id) {
|
|
10037
|
-
return await (0,
|
|
10144
|
+
return await (0, import_kit80.getProgramDerivedAddress)({
|
|
10038
10145
|
programAddress: TUNA_PROGRAM_ADDRESS,
|
|
10039
|
-
seeds: ["vault", (0,
|
|
10146
|
+
seeds: ["vault", (0, import_kit80.getAddressEncoder)().encode(mint), (0, import_kit79.getU32Encoder)().encode(id)]
|
|
10040
10147
|
});
|
|
10041
10148
|
}
|
|
10042
10149
|
async function getLendingPositionAddress(authority, mintOrVault) {
|
|
10043
|
-
return await (0,
|
|
10150
|
+
return await (0, import_kit80.getProgramDerivedAddress)({
|
|
10044
10151
|
programAddress: TUNA_PROGRAM_ADDRESS,
|
|
10045
|
-
seeds: ["lending_position", (0,
|
|
10152
|
+
seeds: ["lending_position", (0, import_kit80.getAddressEncoder)().encode(authority), (0, import_kit80.getAddressEncoder)().encode(mintOrVault)]
|
|
10046
10153
|
});
|
|
10047
10154
|
}
|
|
10048
10155
|
async function getTunaLpPositionAddress(positionMint) {
|
|
10049
|
-
return await (0,
|
|
10156
|
+
return await (0, import_kit80.getProgramDerivedAddress)({
|
|
10050
10157
|
programAddress: TUNA_PROGRAM_ADDRESS,
|
|
10051
|
-
seeds: ["tuna_position", (0,
|
|
10158
|
+
seeds: ["tuna_position", (0, import_kit80.getAddressEncoder)().encode(positionMint)]
|
|
10052
10159
|
});
|
|
10053
10160
|
}
|
|
10054
10161
|
async function getTunaSpotPositionAddress(authority, pool) {
|
|
10055
|
-
return await (0,
|
|
10162
|
+
return await (0, import_kit80.getProgramDerivedAddress)({
|
|
10056
10163
|
programAddress: TUNA_PROGRAM_ADDRESS,
|
|
10057
|
-
seeds: ["tuna_spot_position", (0,
|
|
10164
|
+
seeds: ["tuna_spot_position", (0, import_kit80.getAddressEncoder)().encode(authority), (0, import_kit80.getAddressEncoder)().encode(pool)]
|
|
10058
10165
|
});
|
|
10059
10166
|
}
|
|
10060
10167
|
async function getTunaPriceUpdateAddress(mint) {
|
|
10061
|
-
return await (0,
|
|
10168
|
+
return await (0, import_kit80.getProgramDerivedAddress)({
|
|
10062
10169
|
programAddress: TUNA_PROGRAM_ADDRESS,
|
|
10063
|
-
seeds: ["tuna_price_update", (0,
|
|
10170
|
+
seeds: ["tuna_price_update", (0, import_kit80.getAddressEncoder)().encode(mint)]
|
|
10064
10171
|
});
|
|
10065
10172
|
}
|
|
10066
10173
|
async function getPythPriceUpdateAccountAddress(shardId, priceFeedId) {
|
|
@@ -10076,23 +10183,23 @@ async function getPythPriceUpdateAccountAddress(shardId, priceFeedId) {
|
|
|
10076
10183
|
}
|
|
10077
10184
|
const shardBuffer = Buffer.alloc(2);
|
|
10078
10185
|
shardBuffer.writeUint16LE(shardId, 0);
|
|
10079
|
-
return await (0,
|
|
10186
|
+
return await (0, import_kit80.getProgramDerivedAddress)({
|
|
10080
10187
|
programAddress: DEFAULT_PUSH_ORACLE_PROGRAM_ID,
|
|
10081
10188
|
seeds: [shardBuffer, priceFeedId]
|
|
10082
10189
|
});
|
|
10083
10190
|
}
|
|
10084
10191
|
|
|
10085
10192
|
// src/gpa/tunaLpPosition.ts
|
|
10086
|
-
var
|
|
10193
|
+
var import_kit82 = require("@solana/kit");
|
|
10087
10194
|
|
|
10088
10195
|
// src/gpa/utils.ts
|
|
10089
|
-
var
|
|
10196
|
+
var import_kit81 = require("@solana/kit");
|
|
10090
10197
|
async function fetchDecodedProgramAccounts(rpc, programAddress, filters, decoder) {
|
|
10091
10198
|
const accountInfos = await rpc.getProgramAccounts(programAddress, {
|
|
10092
10199
|
encoding: "base64",
|
|
10093
10200
|
filters
|
|
10094
10201
|
}).send();
|
|
10095
|
-
const encoder = (0,
|
|
10202
|
+
const encoder = (0, import_kit81.getBase64Encoder)();
|
|
10096
10203
|
const datas = accountInfos.map((x) => encoder.encode(x.account.data[0]));
|
|
10097
10204
|
const decoded = datas.map((x) => decoder.decode(x));
|
|
10098
10205
|
return decoded.map((data, i) => ({
|
|
@@ -10108,7 +10215,7 @@ function tunaLpPositionAuthorityFilter(address8) {
|
|
|
10108
10215
|
return {
|
|
10109
10216
|
memcmp: {
|
|
10110
10217
|
offset: 11n,
|
|
10111
|
-
bytes: (0,
|
|
10218
|
+
bytes: (0, import_kit82.getBase58Decoder)().decode((0, import_kit82.getAddressEncoder)().encode(address8)),
|
|
10112
10219
|
encoding: "base58"
|
|
10113
10220
|
}
|
|
10114
10221
|
};
|
|
@@ -10117,7 +10224,7 @@ function tunaLpPositionPoolFilter(address8) {
|
|
|
10117
10224
|
return {
|
|
10118
10225
|
memcmp: {
|
|
10119
10226
|
offset: 43n,
|
|
10120
|
-
bytes: (0,
|
|
10227
|
+
bytes: (0, import_kit82.getBase58Decoder)().decode((0, import_kit82.getAddressEncoder)().encode(address8)),
|
|
10121
10228
|
encoding: "base58"
|
|
10122
10229
|
}
|
|
10123
10230
|
};
|
|
@@ -10126,7 +10233,7 @@ function tunaLpPositionMintAFilter(address8) {
|
|
|
10126
10233
|
return {
|
|
10127
10234
|
memcmp: {
|
|
10128
10235
|
offset: 75n,
|
|
10129
|
-
bytes: (0,
|
|
10236
|
+
bytes: (0, import_kit82.getBase58Decoder)().decode((0, import_kit82.getAddressEncoder)().encode(address8)),
|
|
10130
10237
|
encoding: "base58"
|
|
10131
10238
|
}
|
|
10132
10239
|
};
|
|
@@ -10135,7 +10242,7 @@ function tunaLpPositionMintBFilter(address8) {
|
|
|
10135
10242
|
return {
|
|
10136
10243
|
memcmp: {
|
|
10137
10244
|
offset: 107n,
|
|
10138
|
-
bytes: (0,
|
|
10245
|
+
bytes: (0, import_kit82.getBase58Decoder)().decode((0, import_kit82.getAddressEncoder)().encode(address8)),
|
|
10139
10246
|
encoding: "base58"
|
|
10140
10247
|
}
|
|
10141
10248
|
};
|
|
@@ -10144,7 +10251,7 @@ function tunaLpPositionMintFilter(address8) {
|
|
|
10144
10251
|
return {
|
|
10145
10252
|
memcmp: {
|
|
10146
10253
|
offset: 139n,
|
|
10147
|
-
bytes: (0,
|
|
10254
|
+
bytes: (0, import_kit82.getBase58Decoder)().decode((0, import_kit82.getAddressEncoder)().encode(address8)),
|
|
10148
10255
|
encoding: "base58"
|
|
10149
10256
|
}
|
|
10150
10257
|
};
|
|
@@ -10153,13 +10260,13 @@ function tunaLpPositionMarketMakerFilter(marketMaker) {
|
|
|
10153
10260
|
return {
|
|
10154
10261
|
memcmp: {
|
|
10155
10262
|
offset: 277n,
|
|
10156
|
-
bytes: (0,
|
|
10263
|
+
bytes: (0, import_kit82.getBase58Decoder)().decode((0, import_kit82.getI8Encoder)().encode(marketMaker)),
|
|
10157
10264
|
encoding: "base58"
|
|
10158
10265
|
}
|
|
10159
10266
|
};
|
|
10160
10267
|
}
|
|
10161
10268
|
async function fetchAllTunaLpPositionWithFilter(rpc, ...filters) {
|
|
10162
|
-
const discriminator = (0,
|
|
10269
|
+
const discriminator = (0, import_kit82.getBase58Decoder)().decode(TUNA_LP_POSITION_DISCRIMINATOR);
|
|
10163
10270
|
const discriminatorFilter = {
|
|
10164
10271
|
memcmp: {
|
|
10165
10272
|
offset: 0n,
|
|
@@ -10176,12 +10283,12 @@ async function fetchAllTunaLpPositionWithFilter(rpc, ...filters) {
|
|
|
10176
10283
|
}
|
|
10177
10284
|
|
|
10178
10285
|
// src/gpa/tunaSpotPosition.ts
|
|
10179
|
-
var
|
|
10286
|
+
var import_kit83 = require("@solana/kit");
|
|
10180
10287
|
function tunaSpotPositionAuthorityFilter(address8) {
|
|
10181
10288
|
return {
|
|
10182
10289
|
memcmp: {
|
|
10183
10290
|
offset: 11n,
|
|
10184
|
-
bytes: (0,
|
|
10291
|
+
bytes: (0, import_kit83.getBase58Decoder)().decode((0, import_kit83.getAddressEncoder)().encode(address8)),
|
|
10185
10292
|
encoding: "base58"
|
|
10186
10293
|
}
|
|
10187
10294
|
};
|
|
@@ -10190,7 +10297,7 @@ function tunaSpotPositionPoolFilter(address8) {
|
|
|
10190
10297
|
return {
|
|
10191
10298
|
memcmp: {
|
|
10192
10299
|
offset: 43n,
|
|
10193
|
-
bytes: (0,
|
|
10300
|
+
bytes: (0, import_kit83.getBase58Decoder)().decode((0, import_kit83.getAddressEncoder)().encode(address8)),
|
|
10194
10301
|
encoding: "base58"
|
|
10195
10302
|
}
|
|
10196
10303
|
};
|
|
@@ -10199,7 +10306,7 @@ function tunaSpotPositionMintAFilter(address8) {
|
|
|
10199
10306
|
return {
|
|
10200
10307
|
memcmp: {
|
|
10201
10308
|
offset: 75n,
|
|
10202
|
-
bytes: (0,
|
|
10309
|
+
bytes: (0, import_kit83.getBase58Decoder)().decode((0, import_kit83.getAddressEncoder)().encode(address8)),
|
|
10203
10310
|
encoding: "base58"
|
|
10204
10311
|
}
|
|
10205
10312
|
};
|
|
@@ -10208,13 +10315,13 @@ function tunaSpotPositionMintBFilter(address8) {
|
|
|
10208
10315
|
return {
|
|
10209
10316
|
memcmp: {
|
|
10210
10317
|
offset: 107n,
|
|
10211
|
-
bytes: (0,
|
|
10318
|
+
bytes: (0, import_kit83.getBase58Decoder)().decode((0, import_kit83.getAddressEncoder)().encode(address8)),
|
|
10212
10319
|
encoding: "base58"
|
|
10213
10320
|
}
|
|
10214
10321
|
};
|
|
10215
10322
|
}
|
|
10216
10323
|
async function fetchAllTunaSpotPositionWithFilter(rpc, ...filters) {
|
|
10217
|
-
const discriminator = (0,
|
|
10324
|
+
const discriminator = (0, import_kit83.getBase58Decoder)().decode(TUNA_SPOT_POSITION_DISCRIMINATOR);
|
|
10218
10325
|
const discriminatorFilter = {
|
|
10219
10326
|
memcmp: {
|
|
10220
10327
|
offset: 0n,
|
|
@@ -10231,12 +10338,12 @@ async function fetchAllTunaSpotPositionWithFilter(rpc, ...filters) {
|
|
|
10231
10338
|
}
|
|
10232
10339
|
|
|
10233
10340
|
// src/gpa/lendingPosition.ts
|
|
10234
|
-
var
|
|
10341
|
+
var import_kit84 = require("@solana/kit");
|
|
10235
10342
|
function lendingPositionAuthorityFilter(address8) {
|
|
10236
10343
|
return {
|
|
10237
10344
|
memcmp: {
|
|
10238
10345
|
offset: 11n,
|
|
10239
|
-
bytes: (0,
|
|
10346
|
+
bytes: (0, import_kit84.getBase58Decoder)().decode((0, import_kit84.getAddressEncoder)().encode(address8)),
|
|
10240
10347
|
encoding: "base58"
|
|
10241
10348
|
}
|
|
10242
10349
|
};
|
|
@@ -10245,7 +10352,7 @@ function lendingPositionMintFilter(address8) {
|
|
|
10245
10352
|
return {
|
|
10246
10353
|
memcmp: {
|
|
10247
10354
|
offset: 43n,
|
|
10248
|
-
bytes: (0,
|
|
10355
|
+
bytes: (0, import_kit84.getBase58Decoder)().decode((0, import_kit84.getAddressEncoder)().encode(address8)),
|
|
10249
10356
|
encoding: "base58"
|
|
10250
10357
|
}
|
|
10251
10358
|
};
|
|
@@ -10254,13 +10361,13 @@ function lendingPositionVaultFilter(address8) {
|
|
|
10254
10361
|
return {
|
|
10255
10362
|
memcmp: {
|
|
10256
10363
|
offset: 91n,
|
|
10257
|
-
bytes: (0,
|
|
10364
|
+
bytes: (0, import_kit84.getBase58Decoder)().decode((0, import_kit84.getAddressEncoder)().encode(address8)),
|
|
10258
10365
|
encoding: "base58"
|
|
10259
10366
|
}
|
|
10260
10367
|
};
|
|
10261
10368
|
}
|
|
10262
10369
|
async function fetchAllLendingPositionWithFilter(rpc, ...filters) {
|
|
10263
|
-
const discriminator = (0,
|
|
10370
|
+
const discriminator = (0, import_kit84.getBase58Decoder)().decode(LENDING_POSITION_DISCRIMINATOR);
|
|
10264
10371
|
const discriminatorFilter = {
|
|
10265
10372
|
memcmp: {
|
|
10266
10373
|
offset: 0n,
|
|
@@ -10277,9 +10384,9 @@ async function fetchAllLendingPositionWithFilter(rpc, ...filters) {
|
|
|
10277
10384
|
}
|
|
10278
10385
|
|
|
10279
10386
|
// src/gpa/market.ts
|
|
10280
|
-
var
|
|
10387
|
+
var import_kit85 = require("@solana/kit");
|
|
10281
10388
|
async function fetchAllMarketWithFilter(rpc, ...filters) {
|
|
10282
|
-
const discriminator = (0,
|
|
10389
|
+
const discriminator = (0, import_kit85.getBase58Decoder)().decode(MARKET_DISCRIMINATOR);
|
|
10283
10390
|
const discriminatorFilter = {
|
|
10284
10391
|
memcmp: {
|
|
10285
10392
|
offset: 0n,
|
|
@@ -10381,11 +10488,11 @@ var FusionUtils = class {
|
|
|
10381
10488
|
};
|
|
10382
10489
|
|
|
10383
10490
|
// src/utils/token.ts
|
|
10384
|
-
var
|
|
10491
|
+
var import_kit86 = require("@solana/kit");
|
|
10385
10492
|
var import_system = require("@solana-program/system");
|
|
10386
10493
|
var import_token = require("@solana-program/token");
|
|
10387
10494
|
var import_token_2022 = require("@solana-program/token-2022");
|
|
10388
|
-
var NATIVE_MINT = (0,
|
|
10495
|
+
var NATIVE_MINT = (0, import_kit86.address)("So11111111111111111111111111111111111111112");
|
|
10389
10496
|
async function getCreateAtaInstruction(mint, owner, payer, tokenProgram = import_token.TOKEN_PROGRAM_ADDRESS) {
|
|
10390
10497
|
const ata = (await (0, import_token.findAssociatedTokenPda)({
|
|
10391
10498
|
mint,
|
|
@@ -10467,7 +10574,7 @@ async function createAddressLookupTableInstructions(authority, addresses, recent
|
|
|
10467
10574
|
// src/txbuilder/increaseTunaLpPositionOrca.ts
|
|
10468
10575
|
var import_whirlpools_client2 = require("@orca-so/whirlpools-client");
|
|
10469
10576
|
var import_whirlpools_core2 = require("@orca-so/whirlpools-core");
|
|
10470
|
-
var
|
|
10577
|
+
var import_kit87 = require("@solana/kit");
|
|
10471
10578
|
var import_memo = require("@solana-program/memo");
|
|
10472
10579
|
var import_token_20222 = require("@solana-program/token-2022");
|
|
10473
10580
|
var import_assert = __toESM(require("assert"), 1);
|
|
@@ -10624,16 +10731,16 @@ async function increaseTunaLpPositionOrcaInstruction(authority, tunaPosition, tu
|
|
|
10624
10731
|
tunaPosition.data.tickUpperIndex
|
|
10625
10732
|
);
|
|
10626
10733
|
const remainingAccounts = [
|
|
10627
|
-
{ address: swapTickArrays[0], role:
|
|
10628
|
-
{ address: swapTickArrays[1], role:
|
|
10629
|
-
{ address: swapTickArrays[2], role:
|
|
10630
|
-
{ address: swapTickArrays[3], role:
|
|
10631
|
-
{ address: swapTickArrays[4], role:
|
|
10632
|
-
{ address: lowerTickArrayAddress, role:
|
|
10633
|
-
{ address: upperTickArrayAddress, role:
|
|
10634
|
-
{ address: whirlpool.data.tokenVaultA, role:
|
|
10635
|
-
{ address: whirlpool.data.tokenVaultB, role:
|
|
10636
|
-
{ address: orcaOracleAddress, role:
|
|
10734
|
+
{ address: swapTickArrays[0], role: import_kit87.AccountRole.WRITABLE },
|
|
10735
|
+
{ address: swapTickArrays[1], role: import_kit87.AccountRole.WRITABLE },
|
|
10736
|
+
{ address: swapTickArrays[2], role: import_kit87.AccountRole.WRITABLE },
|
|
10737
|
+
{ address: swapTickArrays[3], role: import_kit87.AccountRole.WRITABLE },
|
|
10738
|
+
{ address: swapTickArrays[4], role: import_kit87.AccountRole.WRITABLE },
|
|
10739
|
+
{ address: lowerTickArrayAddress, role: import_kit87.AccountRole.WRITABLE },
|
|
10740
|
+
{ address: upperTickArrayAddress, role: import_kit87.AccountRole.WRITABLE },
|
|
10741
|
+
{ address: whirlpool.data.tokenVaultA, role: import_kit87.AccountRole.WRITABLE },
|
|
10742
|
+
{ address: whirlpool.data.tokenVaultB, role: import_kit87.AccountRole.WRITABLE },
|
|
10743
|
+
{ address: orcaOracleAddress, role: import_kit87.AccountRole.WRITABLE }
|
|
10637
10744
|
];
|
|
10638
10745
|
const remainingAccountsInfo = {
|
|
10639
10746
|
slices: [
|
|
@@ -10681,7 +10788,7 @@ async function increaseTunaLpPositionOrcaInstruction(authority, tunaPosition, tu
|
|
|
10681
10788
|
// src/txbuilder/increaseTunaLpPositionFusion.ts
|
|
10682
10789
|
var import_fusionamm_client2 = require("@crypticdot/fusionamm-client");
|
|
10683
10790
|
var import_fusionamm_core3 = require("@crypticdot/fusionamm-core");
|
|
10684
|
-
var
|
|
10791
|
+
var import_kit88 = require("@solana/kit");
|
|
10685
10792
|
var import_memo2 = require("@solana-program/memo");
|
|
10686
10793
|
var import_token_20223 = require("@solana-program/token-2022");
|
|
10687
10794
|
var import_assert2 = __toESM(require("assert"), 1);
|
|
@@ -10843,15 +10950,15 @@ async function increaseTunaLpPositionFusionInstruction(authority, tunaPosition,
|
|
|
10843
10950
|
tunaPosition.data.tickUpperIndex
|
|
10844
10951
|
);
|
|
10845
10952
|
const remainingAccounts = [
|
|
10846
|
-
{ address: swapTickArrays[0], role:
|
|
10847
|
-
{ address: swapTickArrays[1], role:
|
|
10848
|
-
{ address: swapTickArrays[2], role:
|
|
10849
|
-
{ address: swapTickArrays[3], role:
|
|
10850
|
-
{ address: swapTickArrays[4], role:
|
|
10851
|
-
{ address: lowerTickArrayAddress, role:
|
|
10852
|
-
{ address: upperTickArrayAddress, role:
|
|
10853
|
-
{ address: fusionPool.data.tokenVaultA, role:
|
|
10854
|
-
{ address: fusionPool.data.tokenVaultB, role:
|
|
10953
|
+
{ address: swapTickArrays[0], role: import_kit88.AccountRole.WRITABLE },
|
|
10954
|
+
{ address: swapTickArrays[1], role: import_kit88.AccountRole.WRITABLE },
|
|
10955
|
+
{ address: swapTickArrays[2], role: import_kit88.AccountRole.WRITABLE },
|
|
10956
|
+
{ address: swapTickArrays[3], role: import_kit88.AccountRole.WRITABLE },
|
|
10957
|
+
{ address: swapTickArrays[4], role: import_kit88.AccountRole.WRITABLE },
|
|
10958
|
+
{ address: lowerTickArrayAddress, role: import_kit88.AccountRole.WRITABLE },
|
|
10959
|
+
{ address: upperTickArrayAddress, role: import_kit88.AccountRole.WRITABLE },
|
|
10960
|
+
{ address: fusionPool.data.tokenVaultA, role: import_kit88.AccountRole.WRITABLE },
|
|
10961
|
+
{ address: fusionPool.data.tokenVaultB, role: import_kit88.AccountRole.WRITABLE }
|
|
10855
10962
|
];
|
|
10856
10963
|
const remainingAccountsInfo = {
|
|
10857
10964
|
slices: [
|
|
@@ -10989,7 +11096,7 @@ async function closeTunaLpPositionFusionInstruction(rpc, authority, positionMint
|
|
|
10989
11096
|
|
|
10990
11097
|
// src/txbuilder/collectAndCompoundFeesOrca.ts
|
|
10991
11098
|
var import_whirlpools_client4 = require("@orca-so/whirlpools-client");
|
|
10992
|
-
var
|
|
11099
|
+
var import_kit89 = require("@solana/kit");
|
|
10993
11100
|
var import_memo3 = require("@solana-program/memo");
|
|
10994
11101
|
var import_token_20226 = require("@solana-program/token-2022");
|
|
10995
11102
|
var import_assert5 = __toESM(require("assert"), 1);
|
|
@@ -11087,16 +11194,16 @@ async function collectAndCompoundFeesOrcaInstruction(authority, tunaConfig, tuna
|
|
|
11087
11194
|
tunaPosition.data.tickUpperIndex
|
|
11088
11195
|
);
|
|
11089
11196
|
const remainingAccounts = [
|
|
11090
|
-
{ address: swapTickArrays[0], role:
|
|
11091
|
-
{ address: swapTickArrays[1], role:
|
|
11092
|
-
{ address: swapTickArrays[2], role:
|
|
11093
|
-
{ address: swapTickArrays[3], role:
|
|
11094
|
-
{ address: swapTickArrays[4], role:
|
|
11095
|
-
{ address: lowerTickArrayAddress, role:
|
|
11096
|
-
{ address: upperTickArrayAddress, role:
|
|
11097
|
-
{ address: whirlpool.data.tokenVaultA, role:
|
|
11098
|
-
{ address: whirlpool.data.tokenVaultB, role:
|
|
11099
|
-
{ address: orcaOracleAddress, role:
|
|
11197
|
+
{ address: swapTickArrays[0], role: import_kit89.AccountRole.WRITABLE },
|
|
11198
|
+
{ address: swapTickArrays[1], role: import_kit89.AccountRole.WRITABLE },
|
|
11199
|
+
{ address: swapTickArrays[2], role: import_kit89.AccountRole.WRITABLE },
|
|
11200
|
+
{ address: swapTickArrays[3], role: import_kit89.AccountRole.WRITABLE },
|
|
11201
|
+
{ address: swapTickArrays[4], role: import_kit89.AccountRole.WRITABLE },
|
|
11202
|
+
{ address: lowerTickArrayAddress, role: import_kit89.AccountRole.WRITABLE },
|
|
11203
|
+
{ address: upperTickArrayAddress, role: import_kit89.AccountRole.WRITABLE },
|
|
11204
|
+
{ address: whirlpool.data.tokenVaultA, role: import_kit89.AccountRole.WRITABLE },
|
|
11205
|
+
{ address: whirlpool.data.tokenVaultB, role: import_kit89.AccountRole.WRITABLE },
|
|
11206
|
+
{ address: orcaOracleAddress, role: import_kit89.AccountRole.WRITABLE }
|
|
11100
11207
|
];
|
|
11101
11208
|
const remainingAccountsInfo = {
|
|
11102
11209
|
slices: [
|
|
@@ -11141,7 +11248,7 @@ async function collectAndCompoundFeesOrcaInstruction(authority, tunaConfig, tuna
|
|
|
11141
11248
|
|
|
11142
11249
|
// src/txbuilder/collectAndCompoundFeesFusion.ts
|
|
11143
11250
|
var import_fusionamm_client4 = require("@crypticdot/fusionamm-client");
|
|
11144
|
-
var
|
|
11251
|
+
var import_kit90 = require("@solana/kit");
|
|
11145
11252
|
var import_memo4 = require("@solana-program/memo");
|
|
11146
11253
|
var import_token_20227 = require("@solana-program/token-2022");
|
|
11147
11254
|
var import_assert6 = __toESM(require("assert"), 1);
|
|
@@ -11238,15 +11345,15 @@ async function collectAndCompoundFeesFusionInstruction(authority, tunaConfig, tu
|
|
|
11238
11345
|
tunaPosition.data.tickUpperIndex
|
|
11239
11346
|
);
|
|
11240
11347
|
const remainingAccounts = [
|
|
11241
|
-
{ address: swapTickArrays[0], role:
|
|
11242
|
-
{ address: swapTickArrays[1], role:
|
|
11243
|
-
{ address: swapTickArrays[2], role:
|
|
11244
|
-
{ address: swapTickArrays[3], role:
|
|
11245
|
-
{ address: swapTickArrays[4], role:
|
|
11246
|
-
{ address: lowerTickArrayAddress, role:
|
|
11247
|
-
{ address: upperTickArrayAddress, role:
|
|
11248
|
-
{ address: fusionPool.data.tokenVaultA, role:
|
|
11249
|
-
{ address: fusionPool.data.tokenVaultB, role:
|
|
11348
|
+
{ address: swapTickArrays[0], role: import_kit90.AccountRole.WRITABLE },
|
|
11349
|
+
{ address: swapTickArrays[1], role: import_kit90.AccountRole.WRITABLE },
|
|
11350
|
+
{ address: swapTickArrays[2], role: import_kit90.AccountRole.WRITABLE },
|
|
11351
|
+
{ address: swapTickArrays[3], role: import_kit90.AccountRole.WRITABLE },
|
|
11352
|
+
{ address: swapTickArrays[4], role: import_kit90.AccountRole.WRITABLE },
|
|
11353
|
+
{ address: lowerTickArrayAddress, role: import_kit90.AccountRole.WRITABLE },
|
|
11354
|
+
{ address: upperTickArrayAddress, role: import_kit90.AccountRole.WRITABLE },
|
|
11355
|
+
{ address: fusionPool.data.tokenVaultA, role: import_kit90.AccountRole.WRITABLE },
|
|
11356
|
+
{ address: fusionPool.data.tokenVaultB, role: import_kit90.AccountRole.WRITABLE }
|
|
11250
11357
|
];
|
|
11251
11358
|
const remainingAccountsInfo = {
|
|
11252
11359
|
slices: [
|
|
@@ -11290,7 +11397,7 @@ async function collectAndCompoundFeesFusionInstruction(authority, tunaConfig, tu
|
|
|
11290
11397
|
|
|
11291
11398
|
// src/txbuilder/collectFeesOrca.ts
|
|
11292
11399
|
var import_whirlpools_client5 = require("@orca-so/whirlpools-client");
|
|
11293
|
-
var
|
|
11400
|
+
var import_kit91 = require("@solana/kit");
|
|
11294
11401
|
var import_memo5 = require("@solana-program/memo");
|
|
11295
11402
|
var import_token_20228 = require("@solana-program/token-2022");
|
|
11296
11403
|
var import_assert7 = __toESM(require("assert"), 1);
|
|
@@ -11366,10 +11473,10 @@ async function collectFeesOrcaInstruction(authority, tunaPosition, mintA, mintB,
|
|
|
11366
11473
|
tunaPosition.data.tickUpperIndex
|
|
11367
11474
|
);
|
|
11368
11475
|
const remainingAccounts = [
|
|
11369
|
-
{ address: lowerTickArrayAddress, role:
|
|
11370
|
-
{ address: upperTickArrayAddress, role:
|
|
11371
|
-
{ address: whirlpool.data.tokenVaultA, role:
|
|
11372
|
-
{ address: whirlpool.data.tokenVaultB, role:
|
|
11476
|
+
{ address: lowerTickArrayAddress, role: import_kit91.AccountRole.WRITABLE },
|
|
11477
|
+
{ address: upperTickArrayAddress, role: import_kit91.AccountRole.WRITABLE },
|
|
11478
|
+
{ address: whirlpool.data.tokenVaultA, role: import_kit91.AccountRole.WRITABLE },
|
|
11479
|
+
{ address: whirlpool.data.tokenVaultB, role: import_kit91.AccountRole.WRITABLE }
|
|
11373
11480
|
];
|
|
11374
11481
|
const remainingAccountsInfo = {
|
|
11375
11482
|
slices: [
|
|
@@ -11404,7 +11511,7 @@ async function collectFeesOrcaInstruction(authority, tunaPosition, mintA, mintB,
|
|
|
11404
11511
|
|
|
11405
11512
|
// src/txbuilder/collectFeesFusion.ts
|
|
11406
11513
|
var import_fusionamm_client5 = require("@crypticdot/fusionamm-client");
|
|
11407
|
-
var
|
|
11514
|
+
var import_kit92 = require("@solana/kit");
|
|
11408
11515
|
var import_memo6 = require("@solana-program/memo");
|
|
11409
11516
|
var import_token_20229 = require("@solana-program/token-2022");
|
|
11410
11517
|
var import_assert8 = __toESM(require("assert"), 1);
|
|
@@ -11480,10 +11587,10 @@ async function collectFeesFusionInstruction(authority, tunaPosition, mintA, mint
|
|
|
11480
11587
|
tunaPosition.data.tickUpperIndex
|
|
11481
11588
|
);
|
|
11482
11589
|
const remainingAccounts = [
|
|
11483
|
-
{ address: lowerTickArrayAddress, role:
|
|
11484
|
-
{ address: upperTickArrayAddress, role:
|
|
11485
|
-
{ address: fusionPool.data.tokenVaultA, role:
|
|
11486
|
-
{ address: fusionPool.data.tokenVaultB, role:
|
|
11590
|
+
{ address: lowerTickArrayAddress, role: import_kit92.AccountRole.WRITABLE },
|
|
11591
|
+
{ address: upperTickArrayAddress, role: import_kit92.AccountRole.WRITABLE },
|
|
11592
|
+
{ address: fusionPool.data.tokenVaultA, role: import_kit92.AccountRole.WRITABLE },
|
|
11593
|
+
{ address: fusionPool.data.tokenVaultB, role: import_kit92.AccountRole.WRITABLE }
|
|
11487
11594
|
];
|
|
11488
11595
|
const remainingAccountsInfo = {
|
|
11489
11596
|
slices: [
|
|
@@ -11619,7 +11726,7 @@ async function openLendingPositionAndDepositInstructions(rpc, authority, mintAdd
|
|
|
11619
11726
|
// src/txbuilder/closeActiveTunaLpPositionOrca.ts
|
|
11620
11727
|
var import_whirlpools_client6 = require("@orca-so/whirlpools-client");
|
|
11621
11728
|
var import_whirlpools_core3 = require("@orca-so/whirlpools-core");
|
|
11622
|
-
var
|
|
11729
|
+
var import_kit93 = require("@solana/kit");
|
|
11623
11730
|
var import_token_202211 = require("@solana-program/token-2022");
|
|
11624
11731
|
var import_assert9 = __toESM(require("assert"), 1);
|
|
11625
11732
|
async function closeActiveTunaLpPositionOrcaInstructions(rpc, authority, positionMint, args) {
|
|
@@ -11640,7 +11747,7 @@ async function closeActiveTunaLpPositionOrcaInstructions(rpc, authority, positio
|
|
|
11640
11747
|
const allMints = [mintA, mintB, ...rewardMints];
|
|
11641
11748
|
(0, import_assert9.default)(mintA.exists, "Token A account not found");
|
|
11642
11749
|
(0, import_assert9.default)(mintB.exists, "Token B account not found");
|
|
11643
|
-
(0,
|
|
11750
|
+
(0, import_kit93.assertAccountsExist)(rewardMints);
|
|
11644
11751
|
const lowerTickArrayStartIndex = (0, import_whirlpools_core3.getTickArrayStartTickIndex)(
|
|
11645
11752
|
tunaPosition.data.tickLowerIndex,
|
|
11646
11753
|
whirlpool.data.tickSpacing
|
|
@@ -11816,7 +11923,7 @@ async function closeActiveTunaLpPositionFusionInstructions(rpc, authority, posit
|
|
|
11816
11923
|
|
|
11817
11924
|
// src/txbuilder/modifyTunaSpotPositionOrca.ts
|
|
11818
11925
|
var import_whirlpools_client7 = require("@orca-so/whirlpools-client");
|
|
11819
|
-
var
|
|
11926
|
+
var import_kit94 = require("@solana/kit");
|
|
11820
11927
|
var import_memo8 = require("@solana-program/memo");
|
|
11821
11928
|
var import_token_202213 = require("@solana-program/token-2022");
|
|
11822
11929
|
var import_assert11 = __toESM(require("assert"), 1);
|
|
@@ -11943,14 +12050,14 @@ async function modifyTunaSpotPositionOrcaInstruction(authority, tunaConfig, mint
|
|
|
11943
12050
|
}))[0];
|
|
11944
12051
|
const swapTickArrays = await OrcaUtils.getSwapTickArrayAddresses(pool);
|
|
11945
12052
|
const remainingAccounts = [
|
|
11946
|
-
{ address: swapTickArrays[0], role:
|
|
11947
|
-
{ address: swapTickArrays[1], role:
|
|
11948
|
-
{ address: swapTickArrays[2], role:
|
|
11949
|
-
{ address: swapTickArrays[3], role:
|
|
11950
|
-
{ address: swapTickArrays[4], role:
|
|
11951
|
-
{ address: pool.data.tokenVaultA, role:
|
|
11952
|
-
{ address: pool.data.tokenVaultB, role:
|
|
11953
|
-
{ address: orcaOracleAddress, role:
|
|
12053
|
+
{ address: swapTickArrays[0], role: import_kit94.AccountRole.WRITABLE },
|
|
12054
|
+
{ address: swapTickArrays[1], role: import_kit94.AccountRole.WRITABLE },
|
|
12055
|
+
{ address: swapTickArrays[2], role: import_kit94.AccountRole.WRITABLE },
|
|
12056
|
+
{ address: swapTickArrays[3], role: import_kit94.AccountRole.WRITABLE },
|
|
12057
|
+
{ address: swapTickArrays[4], role: import_kit94.AccountRole.WRITABLE },
|
|
12058
|
+
{ address: pool.data.tokenVaultA, role: import_kit94.AccountRole.WRITABLE },
|
|
12059
|
+
{ address: pool.data.tokenVaultB, role: import_kit94.AccountRole.WRITABLE },
|
|
12060
|
+
{ address: orcaOracleAddress, role: import_kit94.AccountRole.WRITABLE }
|
|
11954
12061
|
];
|
|
11955
12062
|
const remainingAccountsInfo = {
|
|
11956
12063
|
slices: [
|
|
@@ -11993,7 +12100,7 @@ async function modifyTunaSpotPositionOrcaInstruction(authority, tunaConfig, mint
|
|
|
11993
12100
|
|
|
11994
12101
|
// src/txbuilder/modifyTunaSpotPositionFusion.ts
|
|
11995
12102
|
var import_fusionamm_client7 = require("@crypticdot/fusionamm-client");
|
|
11996
|
-
var
|
|
12103
|
+
var import_kit95 = require("@solana/kit");
|
|
11997
12104
|
var import_memo9 = require("@solana-program/memo");
|
|
11998
12105
|
var import_token_202214 = require("@solana-program/token-2022");
|
|
11999
12106
|
var import_assert12 = __toESM(require("assert"), 1);
|
|
@@ -12119,13 +12226,13 @@ async function modifyTunaSpotPositionFusionInstruction(authority, tunaConfig, mi
|
|
|
12119
12226
|
}))[0];
|
|
12120
12227
|
const swapTickArrays = await FusionUtils.getSwapTickArrayAddresses(pool);
|
|
12121
12228
|
const remainingAccounts = [
|
|
12122
|
-
{ address: swapTickArrays[0], role:
|
|
12123
|
-
{ address: swapTickArrays[1], role:
|
|
12124
|
-
{ address: swapTickArrays[2], role:
|
|
12125
|
-
{ address: swapTickArrays[3], role:
|
|
12126
|
-
{ address: swapTickArrays[4], role:
|
|
12127
|
-
{ address: pool.data.tokenVaultA, role:
|
|
12128
|
-
{ address: pool.data.tokenVaultB, role:
|
|
12229
|
+
{ address: swapTickArrays[0], role: import_kit95.AccountRole.WRITABLE },
|
|
12230
|
+
{ address: swapTickArrays[1], role: import_kit95.AccountRole.WRITABLE },
|
|
12231
|
+
{ address: swapTickArrays[2], role: import_kit95.AccountRole.WRITABLE },
|
|
12232
|
+
{ address: swapTickArrays[3], role: import_kit95.AccountRole.WRITABLE },
|
|
12233
|
+
{ address: swapTickArrays[4], role: import_kit95.AccountRole.WRITABLE },
|
|
12234
|
+
{ address: pool.data.tokenVaultA, role: import_kit95.AccountRole.WRITABLE },
|
|
12235
|
+
{ address: pool.data.tokenVaultB, role: import_kit95.AccountRole.WRITABLE }
|
|
12129
12236
|
];
|
|
12130
12237
|
const remainingAccountsInfo = {
|
|
12131
12238
|
slices: [
|
|
@@ -12169,7 +12276,6 @@ async function modifyTunaSpotPositionFusionInstruction(authority, tunaConfig, mi
|
|
|
12169
12276
|
var import_fusionamm_client8 = require("@crypticdot/fusionamm-client");
|
|
12170
12277
|
|
|
12171
12278
|
// ../../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
|
|
12172
|
-
var import_kit95 = require("@solana/kit");
|
|
12173
12279
|
var import_kit96 = require("@solana/kit");
|
|
12174
12280
|
var import_kit97 = require("@solana/kit");
|
|
12175
12281
|
var import_kit98 = require("@solana/kit");
|
|
@@ -12203,6 +12309,7 @@ var import_kit125 = require("@solana/kit");
|
|
|
12203
12309
|
var import_kit126 = require("@solana/kit");
|
|
12204
12310
|
var import_kit127 = require("@solana/kit");
|
|
12205
12311
|
var import_kit128 = require("@solana/kit");
|
|
12312
|
+
var import_kit129 = require("@solana/kit");
|
|
12206
12313
|
var TOKEN_LEDGER_DISCRIMINATOR = new Uint8Array([
|
|
12207
12314
|
156,
|
|
12208
12315
|
247,
|
|
@@ -12702,7 +12809,7 @@ async function createVaultV2Instructions(authority, vault, mint, args) {
|
|
|
12702
12809
|
|
|
12703
12810
|
// src/txbuilder/liquidateTunaLpPositionOrca.ts
|
|
12704
12811
|
var import_whirlpools_client9 = require("@orca-so/whirlpools-client");
|
|
12705
|
-
var
|
|
12812
|
+
var import_kit130 = require("@solana/kit");
|
|
12706
12813
|
var import_memo11 = require("@solana-program/memo");
|
|
12707
12814
|
var import_token_202219 = require("@solana-program/token-2022");
|
|
12708
12815
|
async function liquidateTunaLpPositionOrcaInstructions(authority, tunaPosition, tunaConfig, mintA, mintB, vaultA, vaultB, whirlpool, decreasePercent) {
|
|
@@ -12789,16 +12896,16 @@ async function liquidateTunaLpPositionOrcaInstruction(authority, tunaPosition, t
|
|
|
12789
12896
|
tunaPosition.data.tickUpperIndex
|
|
12790
12897
|
);
|
|
12791
12898
|
const remainingAccounts = [
|
|
12792
|
-
{ address: swapTickArrays[0], role:
|
|
12793
|
-
{ address: swapTickArrays[1], role:
|
|
12794
|
-
{ address: swapTickArrays[2], role:
|
|
12795
|
-
{ address: swapTickArrays[3], role:
|
|
12796
|
-
{ address: swapTickArrays[4], role:
|
|
12797
|
-
{ address: lowerTickArrayAddress, role:
|
|
12798
|
-
{ address: upperTickArrayAddress, role:
|
|
12799
|
-
{ address: whirlpool.data.tokenVaultA, role:
|
|
12800
|
-
{ address: whirlpool.data.tokenVaultB, role:
|
|
12801
|
-
{ address: orcaOracleAddress, role:
|
|
12899
|
+
{ address: swapTickArrays[0], role: import_kit130.AccountRole.WRITABLE },
|
|
12900
|
+
{ address: swapTickArrays[1], role: import_kit130.AccountRole.WRITABLE },
|
|
12901
|
+
{ address: swapTickArrays[2], role: import_kit130.AccountRole.WRITABLE },
|
|
12902
|
+
{ address: swapTickArrays[3], role: import_kit130.AccountRole.WRITABLE },
|
|
12903
|
+
{ address: swapTickArrays[4], role: import_kit130.AccountRole.WRITABLE },
|
|
12904
|
+
{ address: lowerTickArrayAddress, role: import_kit130.AccountRole.WRITABLE },
|
|
12905
|
+
{ address: upperTickArrayAddress, role: import_kit130.AccountRole.WRITABLE },
|
|
12906
|
+
{ address: whirlpool.data.tokenVaultA, role: import_kit130.AccountRole.WRITABLE },
|
|
12907
|
+
{ address: whirlpool.data.tokenVaultB, role: import_kit130.AccountRole.WRITABLE },
|
|
12908
|
+
{ address: orcaOracleAddress, role: import_kit130.AccountRole.WRITABLE }
|
|
12802
12909
|
];
|
|
12803
12910
|
const remainingAccountsInfo = {
|
|
12804
12911
|
slices: [
|
|
@@ -12843,7 +12950,7 @@ async function liquidateTunaLpPositionOrcaInstruction(authority, tunaPosition, t
|
|
|
12843
12950
|
|
|
12844
12951
|
// src/txbuilder/liquidateTunaLpPositionFusion.ts
|
|
12845
12952
|
var import_fusionamm_client9 = require("@crypticdot/fusionamm-client");
|
|
12846
|
-
var
|
|
12953
|
+
var import_kit131 = require("@solana/kit");
|
|
12847
12954
|
var import_memo12 = require("@solana-program/memo");
|
|
12848
12955
|
var import_token_202220 = require("@solana-program/token-2022");
|
|
12849
12956
|
async function liquidateTunaLpPositionFusionInstructions(authority, tunaPosition, tunaConfig, mintA, mintB, vaultA, vaultB, whirlpool, decreasePercent) {
|
|
@@ -12929,15 +13036,15 @@ async function liquidateTunaLpPositionFusionInstruction(authority, tunaPosition,
|
|
|
12929
13036
|
tunaPosition.data.tickUpperIndex
|
|
12930
13037
|
);
|
|
12931
13038
|
const remainingAccounts = [
|
|
12932
|
-
{ address: swapTickArrays[0], role:
|
|
12933
|
-
{ address: swapTickArrays[1], role:
|
|
12934
|
-
{ address: swapTickArrays[2], role:
|
|
12935
|
-
{ address: swapTickArrays[3], role:
|
|
12936
|
-
{ address: swapTickArrays[4], role:
|
|
12937
|
-
{ address: lowerTickArrayAddress, role:
|
|
12938
|
-
{ address: upperTickArrayAddress, role:
|
|
12939
|
-
{ address: fusionPool.data.tokenVaultA, role:
|
|
12940
|
-
{ address: fusionPool.data.tokenVaultB, role:
|
|
13039
|
+
{ address: swapTickArrays[0], role: import_kit131.AccountRole.WRITABLE },
|
|
13040
|
+
{ address: swapTickArrays[1], role: import_kit131.AccountRole.WRITABLE },
|
|
13041
|
+
{ address: swapTickArrays[2], role: import_kit131.AccountRole.WRITABLE },
|
|
13042
|
+
{ address: swapTickArrays[3], role: import_kit131.AccountRole.WRITABLE },
|
|
13043
|
+
{ address: swapTickArrays[4], role: import_kit131.AccountRole.WRITABLE },
|
|
13044
|
+
{ address: lowerTickArrayAddress, role: import_kit131.AccountRole.WRITABLE },
|
|
13045
|
+
{ address: upperTickArrayAddress, role: import_kit131.AccountRole.WRITABLE },
|
|
13046
|
+
{ address: fusionPool.data.tokenVaultA, role: import_kit131.AccountRole.WRITABLE },
|
|
13047
|
+
{ address: fusionPool.data.tokenVaultB, role: import_kit131.AccountRole.WRITABLE }
|
|
12941
13048
|
];
|
|
12942
13049
|
const remainingAccountsInfo = {
|
|
12943
13050
|
slices: [
|
|
@@ -12981,7 +13088,7 @@ async function liquidateTunaLpPositionFusionInstruction(authority, tunaPosition,
|
|
|
12981
13088
|
|
|
12982
13089
|
// src/txbuilder/liquidateTunaSpotPositionFusion.ts
|
|
12983
13090
|
var import_fusionamm_client10 = require("@crypticdot/fusionamm-client");
|
|
12984
|
-
var
|
|
13091
|
+
var import_kit132 = require("@solana/kit");
|
|
12985
13092
|
var import_memo13 = require("@solana-program/memo");
|
|
12986
13093
|
var import_token_202221 = require("@solana-program/token-2022");
|
|
12987
13094
|
async function liquidateTunaSpotPositionFusionInstructions(authority, tunaPosition, tunaConfig, mintA, mintB, vaultA, vaultB, fusionPool, decreasePercent) {
|
|
@@ -13072,13 +13179,13 @@ async function liquidateTunaSpotPositionFusionInstruction(authority, tunaPositio
|
|
|
13072
13179
|
}))[0];
|
|
13073
13180
|
const swapTickArrays = await FusionUtils.getSwapTickArrayAddresses(fusionPool);
|
|
13074
13181
|
const remainingAccounts = [
|
|
13075
|
-
{ address: swapTickArrays[0], role:
|
|
13076
|
-
{ address: swapTickArrays[1], role:
|
|
13077
|
-
{ address: swapTickArrays[2], role:
|
|
13078
|
-
{ address: swapTickArrays[3], role:
|
|
13079
|
-
{ address: swapTickArrays[4], role:
|
|
13080
|
-
{ address: fusionPool.data.tokenVaultA, role:
|
|
13081
|
-
{ address: fusionPool.data.tokenVaultB, role:
|
|
13182
|
+
{ address: swapTickArrays[0], role: import_kit132.AccountRole.WRITABLE },
|
|
13183
|
+
{ address: swapTickArrays[1], role: import_kit132.AccountRole.WRITABLE },
|
|
13184
|
+
{ address: swapTickArrays[2], role: import_kit132.AccountRole.WRITABLE },
|
|
13185
|
+
{ address: swapTickArrays[3], role: import_kit132.AccountRole.WRITABLE },
|
|
13186
|
+
{ address: swapTickArrays[4], role: import_kit132.AccountRole.WRITABLE },
|
|
13187
|
+
{ address: fusionPool.data.tokenVaultA, role: import_kit132.AccountRole.WRITABLE },
|
|
13188
|
+
{ address: fusionPool.data.tokenVaultB, role: import_kit132.AccountRole.WRITABLE }
|
|
13082
13189
|
];
|
|
13083
13190
|
const remainingAccountsInfo = {
|
|
13084
13191
|
slices: [
|
|
@@ -13264,7 +13371,7 @@ async function liquidateTunaSpotPositionJupiterInstruction(authority, tunaPositi
|
|
|
13264
13371
|
|
|
13265
13372
|
// src/txbuilder/liquidateTunaSpotPositionOrca.ts
|
|
13266
13373
|
var import_whirlpools_client10 = require("@orca-so/whirlpools-client");
|
|
13267
|
-
var
|
|
13374
|
+
var import_kit133 = require("@solana/kit");
|
|
13268
13375
|
var import_memo15 = require("@solana-program/memo");
|
|
13269
13376
|
var import_token_202223 = require("@solana-program/token-2022");
|
|
13270
13377
|
async function liquidateTunaSpotPositionOrcaInstructions(authority, tunaPosition, tunaConfig, mintA, mintB, vaultA, vaultB, whirlpool, decreasePercent) {
|
|
@@ -13356,14 +13463,14 @@ async function liquidateTunaSpotPositionOrcaInstruction(authority, tunaPosition,
|
|
|
13356
13463
|
}))[0];
|
|
13357
13464
|
const swapTickArrays = await OrcaUtils.getSwapTickArrayAddresses(whirlpool);
|
|
13358
13465
|
const remainingAccounts = [
|
|
13359
|
-
{ address: swapTickArrays[0], role:
|
|
13360
|
-
{ address: swapTickArrays[1], role:
|
|
13361
|
-
{ address: swapTickArrays[2], role:
|
|
13362
|
-
{ address: swapTickArrays[3], role:
|
|
13363
|
-
{ address: swapTickArrays[4], role:
|
|
13364
|
-
{ address: whirlpool.data.tokenVaultA, role:
|
|
13365
|
-
{ address: whirlpool.data.tokenVaultB, role:
|
|
13366
|
-
{ address: orcaOracleAddress, role:
|
|
13466
|
+
{ address: swapTickArrays[0], role: import_kit133.AccountRole.WRITABLE },
|
|
13467
|
+
{ address: swapTickArrays[1], role: import_kit133.AccountRole.WRITABLE },
|
|
13468
|
+
{ address: swapTickArrays[2], role: import_kit133.AccountRole.WRITABLE },
|
|
13469
|
+
{ address: swapTickArrays[3], role: import_kit133.AccountRole.WRITABLE },
|
|
13470
|
+
{ address: swapTickArrays[4], role: import_kit133.AccountRole.WRITABLE },
|
|
13471
|
+
{ address: whirlpool.data.tokenVaultA, role: import_kit133.AccountRole.WRITABLE },
|
|
13472
|
+
{ address: whirlpool.data.tokenVaultB, role: import_kit133.AccountRole.WRITABLE },
|
|
13473
|
+
{ address: orcaOracleAddress, role: import_kit133.AccountRole.WRITABLE }
|
|
13367
13474
|
];
|
|
13368
13475
|
const remainingAccountsInfo = {
|
|
13369
13476
|
slices: [
|
|
@@ -13407,7 +13514,7 @@ async function liquidateTunaSpotPositionOrcaInstruction(authority, tunaPosition,
|
|
|
13407
13514
|
|
|
13408
13515
|
// src/txbuilder/openTunaLpPositionOrca.ts
|
|
13409
13516
|
var import_whirlpools_client11 = require("@orca-so/whirlpools-client");
|
|
13410
|
-
var
|
|
13517
|
+
var import_kit134 = require("@solana/kit");
|
|
13411
13518
|
var import_token_202224 = require("@solana-program/token-2022");
|
|
13412
13519
|
var import_assert15 = __toESM(require("assert"), 1);
|
|
13413
13520
|
async function openTunaLpPositionOrcaInstruction(rpc, authority, positionMint, whirlpoolAddress, args) {
|
|
@@ -13480,75 +13587,75 @@ function getOpenTunaLpPositionOrcaInstructionWithEphemeralSigner(input) {
|
|
|
13480
13587
|
accounts: [
|
|
13481
13588
|
{
|
|
13482
13589
|
address: input.authority.address,
|
|
13483
|
-
role:
|
|
13590
|
+
role: import_kit134.AccountRole.WRITABLE_SIGNER
|
|
13484
13591
|
},
|
|
13485
13592
|
{
|
|
13486
13593
|
address: input.mintA,
|
|
13487
|
-
role:
|
|
13594
|
+
role: import_kit134.AccountRole.READONLY
|
|
13488
13595
|
},
|
|
13489
13596
|
{
|
|
13490
13597
|
address: input.mintB,
|
|
13491
|
-
role:
|
|
13598
|
+
role: import_kit134.AccountRole.READONLY
|
|
13492
13599
|
},
|
|
13493
13600
|
{
|
|
13494
13601
|
address: input.tokenProgramA,
|
|
13495
|
-
role:
|
|
13602
|
+
role: import_kit134.AccountRole.READONLY
|
|
13496
13603
|
},
|
|
13497
13604
|
{
|
|
13498
13605
|
address: input.tokenProgramB,
|
|
13499
|
-
role:
|
|
13606
|
+
role: import_kit134.AccountRole.READONLY
|
|
13500
13607
|
},
|
|
13501
13608
|
{
|
|
13502
13609
|
address: input.market,
|
|
13503
|
-
role:
|
|
13610
|
+
role: import_kit134.AccountRole.READONLY
|
|
13504
13611
|
},
|
|
13505
13612
|
{
|
|
13506
13613
|
address: input.tunaPosition,
|
|
13507
|
-
role:
|
|
13614
|
+
role: import_kit134.AccountRole.WRITABLE
|
|
13508
13615
|
},
|
|
13509
13616
|
{
|
|
13510
13617
|
address: input.tunaPositionMint,
|
|
13511
|
-
role:
|
|
13618
|
+
role: import_kit134.AccountRole.WRITABLE_SIGNER
|
|
13512
13619
|
},
|
|
13513
13620
|
{
|
|
13514
13621
|
address: input.tunaPositionAta,
|
|
13515
|
-
role:
|
|
13622
|
+
role: import_kit134.AccountRole.WRITABLE
|
|
13516
13623
|
},
|
|
13517
13624
|
{
|
|
13518
13625
|
address: input.tunaPositionAtaA,
|
|
13519
|
-
role:
|
|
13626
|
+
role: import_kit134.AccountRole.WRITABLE
|
|
13520
13627
|
},
|
|
13521
13628
|
{
|
|
13522
13629
|
address: input.tunaPositionAtaB,
|
|
13523
|
-
role:
|
|
13630
|
+
role: import_kit134.AccountRole.WRITABLE
|
|
13524
13631
|
},
|
|
13525
13632
|
{
|
|
13526
13633
|
address: input.whirlpoolProgram,
|
|
13527
|
-
role:
|
|
13634
|
+
role: import_kit134.AccountRole.READONLY
|
|
13528
13635
|
},
|
|
13529
13636
|
{
|
|
13530
13637
|
address: input.whirlpool,
|
|
13531
|
-
role:
|
|
13638
|
+
role: import_kit134.AccountRole.READONLY
|
|
13532
13639
|
},
|
|
13533
13640
|
{
|
|
13534
13641
|
address: input.orcaPosition,
|
|
13535
|
-
role:
|
|
13642
|
+
role: import_kit134.AccountRole.WRITABLE
|
|
13536
13643
|
},
|
|
13537
13644
|
{
|
|
13538
13645
|
address: input.metadataUpdateAuth,
|
|
13539
|
-
role:
|
|
13646
|
+
role: import_kit134.AccountRole.READONLY
|
|
13540
13647
|
},
|
|
13541
13648
|
{
|
|
13542
13649
|
address: input.token2022Program,
|
|
13543
|
-
role:
|
|
13650
|
+
role: import_kit134.AccountRole.READONLY
|
|
13544
13651
|
},
|
|
13545
13652
|
{
|
|
13546
|
-
address: input.systemProgram ?? (0,
|
|
13547
|
-
role:
|
|
13653
|
+
address: input.systemProgram ?? (0, import_kit134.address)("11111111111111111111111111111111"),
|
|
13654
|
+
role: import_kit134.AccountRole.READONLY
|
|
13548
13655
|
},
|
|
13549
13656
|
{
|
|
13550
13657
|
address: input.associatedTokenProgram,
|
|
13551
|
-
role:
|
|
13658
|
+
role: import_kit134.AccountRole.READONLY
|
|
13552
13659
|
}
|
|
13553
13660
|
],
|
|
13554
13661
|
programAddress: TUNA_PROGRAM_ADDRESS,
|
|
@@ -13559,7 +13666,7 @@ function getOpenTunaLpPositionOrcaInstructionWithEphemeralSigner(input) {
|
|
|
13559
13666
|
// src/txbuilder/openTunaLpPositionFusion.ts
|
|
13560
13667
|
var import_fusionamm_client11 = require("@crypticdot/fusionamm-client");
|
|
13561
13668
|
var import_fusionamm_client12 = require("@crypticdot/fusionamm-client");
|
|
13562
|
-
var
|
|
13669
|
+
var import_kit135 = require("@solana/kit");
|
|
13563
13670
|
var import_token_202225 = require("@solana-program/token-2022");
|
|
13564
13671
|
var import_assert16 = __toESM(require("assert"), 1);
|
|
13565
13672
|
async function openTunaLpPositionFusionInstruction(rpc, authority, positionMint, fusionPoolAddress, args) {
|
|
@@ -13632,75 +13739,75 @@ function getOpenTunaLpPositionFusionInstructionWithEphemeralSigner(input) {
|
|
|
13632
13739
|
accounts: [
|
|
13633
13740
|
{
|
|
13634
13741
|
address: input.authority.address,
|
|
13635
|
-
role:
|
|
13742
|
+
role: import_kit135.AccountRole.WRITABLE_SIGNER
|
|
13636
13743
|
},
|
|
13637
13744
|
{
|
|
13638
13745
|
address: input.mintA,
|
|
13639
|
-
role:
|
|
13746
|
+
role: import_kit135.AccountRole.READONLY
|
|
13640
13747
|
},
|
|
13641
13748
|
{
|
|
13642
13749
|
address: input.mintB,
|
|
13643
|
-
role:
|
|
13750
|
+
role: import_kit135.AccountRole.READONLY
|
|
13644
13751
|
},
|
|
13645
13752
|
{
|
|
13646
13753
|
address: input.tokenProgramA,
|
|
13647
|
-
role:
|
|
13754
|
+
role: import_kit135.AccountRole.READONLY
|
|
13648
13755
|
},
|
|
13649
13756
|
{
|
|
13650
13757
|
address: input.tokenProgramB,
|
|
13651
|
-
role:
|
|
13758
|
+
role: import_kit135.AccountRole.READONLY
|
|
13652
13759
|
},
|
|
13653
13760
|
{
|
|
13654
13761
|
address: input.market,
|
|
13655
|
-
role:
|
|
13762
|
+
role: import_kit135.AccountRole.READONLY
|
|
13656
13763
|
},
|
|
13657
13764
|
{
|
|
13658
13765
|
address: input.tunaPosition,
|
|
13659
|
-
role:
|
|
13766
|
+
role: import_kit135.AccountRole.WRITABLE
|
|
13660
13767
|
},
|
|
13661
13768
|
{
|
|
13662
13769
|
address: input.tunaPositionMint,
|
|
13663
|
-
role:
|
|
13770
|
+
role: import_kit135.AccountRole.WRITABLE_SIGNER
|
|
13664
13771
|
},
|
|
13665
13772
|
{
|
|
13666
13773
|
address: input.tunaPositionAta,
|
|
13667
|
-
role:
|
|
13774
|
+
role: import_kit135.AccountRole.WRITABLE
|
|
13668
13775
|
},
|
|
13669
13776
|
{
|
|
13670
13777
|
address: input.tunaPositionAtaA,
|
|
13671
|
-
role:
|
|
13778
|
+
role: import_kit135.AccountRole.WRITABLE
|
|
13672
13779
|
},
|
|
13673
13780
|
{
|
|
13674
13781
|
address: input.tunaPositionAtaB,
|
|
13675
|
-
role:
|
|
13782
|
+
role: import_kit135.AccountRole.WRITABLE
|
|
13676
13783
|
},
|
|
13677
13784
|
{
|
|
13678
13785
|
address: input.fusionammProgram,
|
|
13679
|
-
role:
|
|
13786
|
+
role: import_kit135.AccountRole.READONLY
|
|
13680
13787
|
},
|
|
13681
13788
|
{
|
|
13682
13789
|
address: input.fusionPool,
|
|
13683
|
-
role:
|
|
13790
|
+
role: import_kit135.AccountRole.READONLY
|
|
13684
13791
|
},
|
|
13685
13792
|
{
|
|
13686
13793
|
address: input.fusionPosition,
|
|
13687
|
-
role:
|
|
13794
|
+
role: import_kit135.AccountRole.WRITABLE
|
|
13688
13795
|
},
|
|
13689
13796
|
{
|
|
13690
13797
|
address: input.metadataUpdateAuth,
|
|
13691
|
-
role:
|
|
13798
|
+
role: import_kit135.AccountRole.READONLY
|
|
13692
13799
|
},
|
|
13693
13800
|
{
|
|
13694
13801
|
address: input.token2022Program,
|
|
13695
|
-
role:
|
|
13802
|
+
role: import_kit135.AccountRole.READONLY
|
|
13696
13803
|
},
|
|
13697
13804
|
{
|
|
13698
|
-
address: input.systemProgram ?? (0,
|
|
13699
|
-
role:
|
|
13805
|
+
address: input.systemProgram ?? (0, import_kit135.address)("11111111111111111111111111111111"),
|
|
13806
|
+
role: import_kit135.AccountRole.READONLY
|
|
13700
13807
|
},
|
|
13701
13808
|
{
|
|
13702
13809
|
address: input.associatedTokenProgram,
|
|
13703
|
-
role:
|
|
13810
|
+
role: import_kit135.AccountRole.READONLY
|
|
13704
13811
|
}
|
|
13705
13812
|
],
|
|
13706
13813
|
programAddress: TUNA_PROGRAM_ADDRESS,
|
|
@@ -13713,7 +13820,7 @@ function getOpenTunaLpPositionFusionInstructionWithEphemeralSigner(input) {
|
|
|
13713
13820
|
// src/txbuilder/openAndIncreaseTunaLpPositionOrca.ts
|
|
13714
13821
|
var import_whirlpools_client12 = require("@orca-so/whirlpools-client");
|
|
13715
13822
|
var import_whirlpools_core4 = require("@orca-so/whirlpools-core");
|
|
13716
|
-
var
|
|
13823
|
+
var import_kit136 = require("@solana/kit");
|
|
13717
13824
|
var import_sysvars = require("@solana/sysvars");
|
|
13718
13825
|
var import_memo16 = require("@solana-program/memo");
|
|
13719
13826
|
var import_token_202226 = require("@solana-program/token-2022");
|
|
@@ -13825,7 +13932,7 @@ async function openAndIncreaseTunaLpPositionOrcaInstructions(rpc, authority, pos
|
|
|
13825
13932
|
cleanupInstructions.push(...createUserAtaBInstructions.cleanup);
|
|
13826
13933
|
return {
|
|
13827
13934
|
instructions,
|
|
13828
|
-
initializationCost: (0,
|
|
13935
|
+
initializationCost: (0, import_kit136.lamports)(nonRefundableRent)
|
|
13829
13936
|
};
|
|
13830
13937
|
}
|
|
13831
13938
|
async function openAndIncreaseTunaLpPositionOrcaInstruction(authority, positionMint, tunaConfig, mintA, mintB, vaultA, vaultB, whirlpool, args) {
|
|
@@ -13883,16 +13990,16 @@ async function openAndIncreaseTunaLpPositionOrcaInstruction(authority, positionM
|
|
|
13883
13990
|
const lowerTickArrayAddress = await OrcaUtils.getTickArrayAddressFromTickIndex(whirlpool, args.tickLowerIndex);
|
|
13884
13991
|
const upperTickArrayAddress = await OrcaUtils.getTickArrayAddressFromTickIndex(whirlpool, args.tickUpperIndex);
|
|
13885
13992
|
const remainingAccounts = [
|
|
13886
|
-
{ address: swapTickArrays[0], role:
|
|
13887
|
-
{ address: swapTickArrays[1], role:
|
|
13888
|
-
{ address: swapTickArrays[2], role:
|
|
13889
|
-
{ address: swapTickArrays[3], role:
|
|
13890
|
-
{ address: swapTickArrays[4], role:
|
|
13891
|
-
{ address: lowerTickArrayAddress, role:
|
|
13892
|
-
{ address: upperTickArrayAddress, role:
|
|
13893
|
-
{ address: whirlpool.data.tokenVaultA, role:
|
|
13894
|
-
{ address: whirlpool.data.tokenVaultB, role:
|
|
13895
|
-
{ address: orcaOracleAddress, role:
|
|
13993
|
+
{ address: swapTickArrays[0], role: import_kit136.AccountRole.WRITABLE },
|
|
13994
|
+
{ address: swapTickArrays[1], role: import_kit136.AccountRole.WRITABLE },
|
|
13995
|
+
{ address: swapTickArrays[2], role: import_kit136.AccountRole.WRITABLE },
|
|
13996
|
+
{ address: swapTickArrays[3], role: import_kit136.AccountRole.WRITABLE },
|
|
13997
|
+
{ address: swapTickArrays[4], role: import_kit136.AccountRole.WRITABLE },
|
|
13998
|
+
{ address: lowerTickArrayAddress, role: import_kit136.AccountRole.WRITABLE },
|
|
13999
|
+
{ address: upperTickArrayAddress, role: import_kit136.AccountRole.WRITABLE },
|
|
14000
|
+
{ address: whirlpool.data.tokenVaultA, role: import_kit136.AccountRole.WRITABLE },
|
|
14001
|
+
{ address: whirlpool.data.tokenVaultB, role: import_kit136.AccountRole.WRITABLE },
|
|
14002
|
+
{ address: orcaOracleAddress, role: import_kit136.AccountRole.WRITABLE }
|
|
13896
14003
|
];
|
|
13897
14004
|
const remainingAccountsInfo = {
|
|
13898
14005
|
slices: [
|
|
@@ -13977,123 +14084,123 @@ function getOpenAndIncreaseTunaLpPositionOrcaInstructionWithEphemeralSigner(inpu
|
|
|
13977
14084
|
accounts: [
|
|
13978
14085
|
{
|
|
13979
14086
|
address: input.authority.address,
|
|
13980
|
-
role:
|
|
14087
|
+
role: import_kit136.AccountRole.WRITABLE_SIGNER
|
|
13981
14088
|
},
|
|
13982
14089
|
{
|
|
13983
14090
|
address: input.tunaConfig,
|
|
13984
|
-
role:
|
|
14091
|
+
role: import_kit136.AccountRole.READONLY
|
|
13985
14092
|
},
|
|
13986
14093
|
{
|
|
13987
14094
|
address: input.mintA,
|
|
13988
|
-
role:
|
|
14095
|
+
role: import_kit136.AccountRole.READONLY
|
|
13989
14096
|
},
|
|
13990
14097
|
{
|
|
13991
14098
|
address: input.mintB,
|
|
13992
|
-
role:
|
|
14099
|
+
role: import_kit136.AccountRole.READONLY
|
|
13993
14100
|
},
|
|
13994
14101
|
{
|
|
13995
14102
|
address: input.market,
|
|
13996
|
-
role:
|
|
14103
|
+
role: import_kit136.AccountRole.WRITABLE
|
|
13997
14104
|
},
|
|
13998
14105
|
{
|
|
13999
14106
|
address: input.vaultA,
|
|
14000
|
-
role:
|
|
14107
|
+
role: import_kit136.AccountRole.WRITABLE
|
|
14001
14108
|
},
|
|
14002
14109
|
{
|
|
14003
14110
|
address: input.vaultB,
|
|
14004
|
-
role:
|
|
14111
|
+
role: import_kit136.AccountRole.WRITABLE
|
|
14005
14112
|
},
|
|
14006
14113
|
{
|
|
14007
14114
|
address: input.vaultAAta,
|
|
14008
|
-
role:
|
|
14115
|
+
role: import_kit136.AccountRole.WRITABLE
|
|
14009
14116
|
},
|
|
14010
14117
|
{
|
|
14011
14118
|
address: input.vaultBAta,
|
|
14012
|
-
role:
|
|
14119
|
+
role: import_kit136.AccountRole.WRITABLE
|
|
14013
14120
|
},
|
|
14014
14121
|
{
|
|
14015
14122
|
address: input.tunaPosition,
|
|
14016
|
-
role:
|
|
14123
|
+
role: import_kit136.AccountRole.WRITABLE
|
|
14017
14124
|
},
|
|
14018
14125
|
{
|
|
14019
14126
|
address: input.tunaPositionMint,
|
|
14020
|
-
role:
|
|
14127
|
+
role: import_kit136.AccountRole.WRITABLE
|
|
14021
14128
|
},
|
|
14022
14129
|
{
|
|
14023
14130
|
address: input.tunaPositionAta,
|
|
14024
|
-
role:
|
|
14131
|
+
role: import_kit136.AccountRole.WRITABLE
|
|
14025
14132
|
},
|
|
14026
14133
|
{
|
|
14027
14134
|
address: input.tunaPositionAtaA,
|
|
14028
|
-
role:
|
|
14135
|
+
role: import_kit136.AccountRole.WRITABLE
|
|
14029
14136
|
},
|
|
14030
14137
|
{
|
|
14031
14138
|
address: input.tunaPositionAtaB,
|
|
14032
|
-
role:
|
|
14139
|
+
role: import_kit136.AccountRole.WRITABLE
|
|
14033
14140
|
},
|
|
14034
14141
|
{
|
|
14035
14142
|
address: input.tunaPositionOwnerAtaA,
|
|
14036
|
-
role:
|
|
14143
|
+
role: import_kit136.AccountRole.WRITABLE
|
|
14037
14144
|
},
|
|
14038
14145
|
{
|
|
14039
14146
|
address: input.tunaPositionOwnerAtaB,
|
|
14040
|
-
role:
|
|
14147
|
+
role: import_kit136.AccountRole.WRITABLE
|
|
14041
14148
|
},
|
|
14042
14149
|
{
|
|
14043
14150
|
address: input.feeRecipientAtaA,
|
|
14044
|
-
role:
|
|
14151
|
+
role: import_kit136.AccountRole.WRITABLE
|
|
14045
14152
|
},
|
|
14046
14153
|
{
|
|
14047
14154
|
address: input.feeRecipientAtaB,
|
|
14048
|
-
role:
|
|
14155
|
+
role: import_kit136.AccountRole.WRITABLE
|
|
14049
14156
|
},
|
|
14050
14157
|
{
|
|
14051
14158
|
address: input.oraclePriceUpdateA,
|
|
14052
|
-
role:
|
|
14159
|
+
role: import_kit136.AccountRole.READONLY
|
|
14053
14160
|
},
|
|
14054
14161
|
{
|
|
14055
14162
|
address: input.oraclePriceUpdateB,
|
|
14056
|
-
role:
|
|
14163
|
+
role: import_kit136.AccountRole.READONLY
|
|
14057
14164
|
},
|
|
14058
14165
|
{
|
|
14059
14166
|
address: input.whirlpoolProgram,
|
|
14060
|
-
role:
|
|
14167
|
+
role: import_kit136.AccountRole.READONLY
|
|
14061
14168
|
},
|
|
14062
14169
|
{
|
|
14063
14170
|
address: input.whirlpool,
|
|
14064
|
-
role:
|
|
14171
|
+
role: import_kit136.AccountRole.WRITABLE
|
|
14065
14172
|
},
|
|
14066
14173
|
{
|
|
14067
14174
|
address: input.orcaPosition,
|
|
14068
|
-
role:
|
|
14175
|
+
role: import_kit136.AccountRole.WRITABLE
|
|
14069
14176
|
},
|
|
14070
14177
|
{
|
|
14071
14178
|
address: input.tokenProgramA,
|
|
14072
|
-
role:
|
|
14179
|
+
role: import_kit136.AccountRole.READONLY
|
|
14073
14180
|
},
|
|
14074
14181
|
{
|
|
14075
14182
|
address: input.tokenProgramB,
|
|
14076
|
-
role:
|
|
14183
|
+
role: import_kit136.AccountRole.READONLY
|
|
14077
14184
|
},
|
|
14078
14185
|
{
|
|
14079
14186
|
address: input.metadataUpdateAuth,
|
|
14080
|
-
role:
|
|
14187
|
+
role: import_kit136.AccountRole.READONLY
|
|
14081
14188
|
},
|
|
14082
14189
|
{
|
|
14083
14190
|
address: input.memoProgram,
|
|
14084
|
-
role:
|
|
14191
|
+
role: import_kit136.AccountRole.READONLY
|
|
14085
14192
|
},
|
|
14086
14193
|
{
|
|
14087
14194
|
address: input.token2022Program,
|
|
14088
|
-
role:
|
|
14195
|
+
role: import_kit136.AccountRole.READONLY
|
|
14089
14196
|
},
|
|
14090
14197
|
{
|
|
14091
|
-
address: input.systemProgram ?? (0,
|
|
14092
|
-
role:
|
|
14198
|
+
address: input.systemProgram ?? (0, import_kit136.address)("11111111111111111111111111111111"),
|
|
14199
|
+
role: import_kit136.AccountRole.READONLY
|
|
14093
14200
|
},
|
|
14094
14201
|
{
|
|
14095
14202
|
address: input.associatedTokenProgram,
|
|
14096
|
-
role:
|
|
14203
|
+
role: import_kit136.AccountRole.READONLY
|
|
14097
14204
|
}
|
|
14098
14205
|
],
|
|
14099
14206
|
programAddress: TUNA_PROGRAM_ADDRESS,
|
|
@@ -14106,7 +14213,7 @@ function getOpenAndIncreaseTunaLpPositionOrcaInstructionWithEphemeralSigner(inpu
|
|
|
14106
14213
|
// src/txbuilder/openAndIncreaseTunaLpPositionFusion.ts
|
|
14107
14214
|
var import_fusionamm_client13 = require("@crypticdot/fusionamm-client");
|
|
14108
14215
|
var import_fusionamm_core4 = require("@crypticdot/fusionamm-core");
|
|
14109
|
-
var
|
|
14216
|
+
var import_kit137 = require("@solana/kit");
|
|
14110
14217
|
var import_sysvars2 = require("@solana/sysvars");
|
|
14111
14218
|
var import_memo17 = require("@solana-program/memo");
|
|
14112
14219
|
var import_token_202227 = require("@solana-program/token-2022");
|
|
@@ -14205,7 +14312,7 @@ async function openAndIncreaseTunaLpPositionFusionInstructions(rpc, authority, p
|
|
|
14205
14312
|
cleanupInstructions.push(...createUserAtaBInstructions.cleanup);
|
|
14206
14313
|
return {
|
|
14207
14314
|
instructions,
|
|
14208
|
-
initializationCost: (0,
|
|
14315
|
+
initializationCost: (0, import_kit137.lamports)(nonRefundableRent)
|
|
14209
14316
|
};
|
|
14210
14317
|
}
|
|
14211
14318
|
async function openAndIncreaseTunaLpPositionFusionInstruction(authority, positionMint, tunaConfig, mintA, mintB, vaultA, vaultB, fusionPool, args) {
|
|
@@ -14262,15 +14369,15 @@ async function openAndIncreaseTunaLpPositionFusionInstruction(authority, positio
|
|
|
14262
14369
|
const lowerTickArrayAddress = await FusionUtils.getTickArrayAddressFromTickIndex(fusionPool, args.tickLowerIndex);
|
|
14263
14370
|
const upperTickArrayAddress = await FusionUtils.getTickArrayAddressFromTickIndex(fusionPool, args.tickUpperIndex);
|
|
14264
14371
|
const remainingAccounts = [
|
|
14265
|
-
{ address: swapTickArrays[0], role:
|
|
14266
|
-
{ address: swapTickArrays[1], role:
|
|
14267
|
-
{ address: swapTickArrays[2], role:
|
|
14268
|
-
{ address: swapTickArrays[3], role:
|
|
14269
|
-
{ address: swapTickArrays[4], role:
|
|
14270
|
-
{ address: lowerTickArrayAddress, role:
|
|
14271
|
-
{ address: upperTickArrayAddress, role:
|
|
14272
|
-
{ address: fusionPool.data.tokenVaultA, role:
|
|
14273
|
-
{ address: fusionPool.data.tokenVaultB, role:
|
|
14372
|
+
{ address: swapTickArrays[0], role: import_kit137.AccountRole.WRITABLE },
|
|
14373
|
+
{ address: swapTickArrays[1], role: import_kit137.AccountRole.WRITABLE },
|
|
14374
|
+
{ address: swapTickArrays[2], role: import_kit137.AccountRole.WRITABLE },
|
|
14375
|
+
{ address: swapTickArrays[3], role: import_kit137.AccountRole.WRITABLE },
|
|
14376
|
+
{ address: swapTickArrays[4], role: import_kit137.AccountRole.WRITABLE },
|
|
14377
|
+
{ address: lowerTickArrayAddress, role: import_kit137.AccountRole.WRITABLE },
|
|
14378
|
+
{ address: upperTickArrayAddress, role: import_kit137.AccountRole.WRITABLE },
|
|
14379
|
+
{ address: fusionPool.data.tokenVaultA, role: import_kit137.AccountRole.WRITABLE },
|
|
14380
|
+
{ address: fusionPool.data.tokenVaultB, role: import_kit137.AccountRole.WRITABLE }
|
|
14274
14381
|
];
|
|
14275
14382
|
const remainingAccountsInfo = {
|
|
14276
14383
|
slices: [
|
|
@@ -14354,123 +14461,123 @@ function getOpenAndIncreaseTunaLpPositionFusionInstructionWithEphemeralSigner(in
|
|
|
14354
14461
|
accounts: [
|
|
14355
14462
|
{
|
|
14356
14463
|
address: input.authority.address,
|
|
14357
|
-
role:
|
|
14464
|
+
role: import_kit137.AccountRole.WRITABLE_SIGNER
|
|
14358
14465
|
},
|
|
14359
14466
|
{
|
|
14360
14467
|
address: input.tunaConfig,
|
|
14361
|
-
role:
|
|
14468
|
+
role: import_kit137.AccountRole.READONLY
|
|
14362
14469
|
},
|
|
14363
14470
|
{
|
|
14364
14471
|
address: input.mintA,
|
|
14365
|
-
role:
|
|
14472
|
+
role: import_kit137.AccountRole.READONLY
|
|
14366
14473
|
},
|
|
14367
14474
|
{
|
|
14368
14475
|
address: input.mintB,
|
|
14369
|
-
role:
|
|
14476
|
+
role: import_kit137.AccountRole.READONLY
|
|
14370
14477
|
},
|
|
14371
14478
|
{
|
|
14372
14479
|
address: input.tokenProgramA,
|
|
14373
|
-
role:
|
|
14480
|
+
role: import_kit137.AccountRole.READONLY
|
|
14374
14481
|
},
|
|
14375
14482
|
{
|
|
14376
14483
|
address: input.tokenProgramB,
|
|
14377
|
-
role:
|
|
14484
|
+
role: import_kit137.AccountRole.READONLY
|
|
14378
14485
|
},
|
|
14379
14486
|
{
|
|
14380
14487
|
address: input.market,
|
|
14381
|
-
role:
|
|
14488
|
+
role: import_kit137.AccountRole.WRITABLE
|
|
14382
14489
|
},
|
|
14383
14490
|
{
|
|
14384
14491
|
address: input.vaultA,
|
|
14385
|
-
role:
|
|
14492
|
+
role: import_kit137.AccountRole.WRITABLE
|
|
14386
14493
|
},
|
|
14387
14494
|
{
|
|
14388
14495
|
address: input.vaultB,
|
|
14389
|
-
role:
|
|
14496
|
+
role: import_kit137.AccountRole.WRITABLE
|
|
14390
14497
|
},
|
|
14391
14498
|
{
|
|
14392
14499
|
address: input.vaultAAta,
|
|
14393
|
-
role:
|
|
14500
|
+
role: import_kit137.AccountRole.WRITABLE
|
|
14394
14501
|
},
|
|
14395
14502
|
{
|
|
14396
14503
|
address: input.vaultBAta,
|
|
14397
|
-
role:
|
|
14504
|
+
role: import_kit137.AccountRole.WRITABLE
|
|
14398
14505
|
},
|
|
14399
14506
|
{
|
|
14400
14507
|
address: input.tunaPosition,
|
|
14401
|
-
role:
|
|
14508
|
+
role: import_kit137.AccountRole.WRITABLE
|
|
14402
14509
|
},
|
|
14403
14510
|
{
|
|
14404
14511
|
address: input.tunaPositionMint,
|
|
14405
|
-
role:
|
|
14512
|
+
role: import_kit137.AccountRole.WRITABLE
|
|
14406
14513
|
},
|
|
14407
14514
|
{
|
|
14408
14515
|
address: input.tunaPositionAta,
|
|
14409
|
-
role:
|
|
14516
|
+
role: import_kit137.AccountRole.WRITABLE
|
|
14410
14517
|
},
|
|
14411
14518
|
{
|
|
14412
14519
|
address: input.tunaPositionAtaA,
|
|
14413
|
-
role:
|
|
14520
|
+
role: import_kit137.AccountRole.WRITABLE
|
|
14414
14521
|
},
|
|
14415
14522
|
{
|
|
14416
14523
|
address: input.tunaPositionAtaB,
|
|
14417
|
-
role:
|
|
14524
|
+
role: import_kit137.AccountRole.WRITABLE
|
|
14418
14525
|
},
|
|
14419
14526
|
{
|
|
14420
14527
|
address: input.tunaPositionOwnerAtaA,
|
|
14421
|
-
role:
|
|
14528
|
+
role: import_kit137.AccountRole.WRITABLE
|
|
14422
14529
|
},
|
|
14423
14530
|
{
|
|
14424
14531
|
address: input.tunaPositionOwnerAtaB,
|
|
14425
|
-
role:
|
|
14532
|
+
role: import_kit137.AccountRole.WRITABLE
|
|
14426
14533
|
},
|
|
14427
14534
|
{
|
|
14428
14535
|
address: input.feeRecipientAtaA,
|
|
14429
|
-
role:
|
|
14536
|
+
role: import_kit137.AccountRole.WRITABLE
|
|
14430
14537
|
},
|
|
14431
14538
|
{
|
|
14432
14539
|
address: input.feeRecipientAtaB,
|
|
14433
|
-
role:
|
|
14540
|
+
role: import_kit137.AccountRole.WRITABLE
|
|
14434
14541
|
},
|
|
14435
14542
|
{
|
|
14436
14543
|
address: input.oraclePriceUpdateA,
|
|
14437
|
-
role:
|
|
14544
|
+
role: import_kit137.AccountRole.READONLY
|
|
14438
14545
|
},
|
|
14439
14546
|
{
|
|
14440
14547
|
address: input.oraclePriceUpdateB,
|
|
14441
|
-
role:
|
|
14548
|
+
role: import_kit137.AccountRole.READONLY
|
|
14442
14549
|
},
|
|
14443
14550
|
{
|
|
14444
14551
|
address: input.fusionammProgram,
|
|
14445
|
-
role:
|
|
14552
|
+
role: import_kit137.AccountRole.READONLY
|
|
14446
14553
|
},
|
|
14447
14554
|
{
|
|
14448
14555
|
address: input.fusionPool,
|
|
14449
|
-
role:
|
|
14556
|
+
role: import_kit137.AccountRole.WRITABLE
|
|
14450
14557
|
},
|
|
14451
14558
|
{
|
|
14452
14559
|
address: input.fusionPosition,
|
|
14453
|
-
role:
|
|
14560
|
+
role: import_kit137.AccountRole.WRITABLE
|
|
14454
14561
|
},
|
|
14455
14562
|
{
|
|
14456
14563
|
address: input.metadataUpdateAuth,
|
|
14457
|
-
role:
|
|
14564
|
+
role: import_kit137.AccountRole.READONLY
|
|
14458
14565
|
},
|
|
14459
14566
|
{
|
|
14460
14567
|
address: input.memoProgram,
|
|
14461
|
-
role:
|
|
14568
|
+
role: import_kit137.AccountRole.READONLY
|
|
14462
14569
|
},
|
|
14463
14570
|
{
|
|
14464
14571
|
address: input.token2022Program,
|
|
14465
|
-
role:
|
|
14572
|
+
role: import_kit137.AccountRole.READONLY
|
|
14466
14573
|
},
|
|
14467
14574
|
{
|
|
14468
|
-
address: input.systemProgram ?? (0,
|
|
14469
|
-
role:
|
|
14575
|
+
address: input.systemProgram ?? (0, import_kit137.address)("11111111111111111111111111111111"),
|
|
14576
|
+
role: import_kit137.AccountRole.READONLY
|
|
14470
14577
|
},
|
|
14471
14578
|
{
|
|
14472
14579
|
address: input.associatedTokenProgram,
|
|
14473
|
-
role:
|
|
14580
|
+
role: import_kit137.AccountRole.READONLY
|
|
14474
14581
|
}
|
|
14475
14582
|
],
|
|
14476
14583
|
programAddress: TUNA_PROGRAM_ADDRESS,
|
|
@@ -14483,17 +14590,17 @@ function getOpenAndIncreaseTunaLpPositionFusionInstructionWithEphemeralSigner(in
|
|
|
14483
14590
|
// src/txbuilder/openTunaSpotPosition.ts
|
|
14484
14591
|
var import_fusionamm_client14 = require("@crypticdot/fusionamm-client");
|
|
14485
14592
|
var import_whirlpools_client13 = require("@orca-so/whirlpools-client");
|
|
14486
|
-
var
|
|
14593
|
+
var import_kit138 = require("@solana/kit");
|
|
14487
14594
|
var import_token_202228 = require("@solana-program/token-2022");
|
|
14488
14595
|
var import_assert19 = __toESM(require("assert"), 1);
|
|
14489
14596
|
async function openTunaSpotPositionInstructions(rpc, authority, poolAddress, args) {
|
|
14490
|
-
const poolAccount = await (0,
|
|
14597
|
+
const poolAccount = await (0, import_kit138.fetchEncodedAccount)(rpc, poolAddress);
|
|
14491
14598
|
(0, import_assert19.default)(poolAccount.exists, "Pool account not found");
|
|
14492
14599
|
let pool;
|
|
14493
14600
|
if (poolAccount.programAddress == import_fusionamm_client14.FUSIONAMM_PROGRAM_ADDRESS) {
|
|
14494
|
-
pool = (0,
|
|
14601
|
+
pool = (0, import_kit138.decodeAccount)(poolAccount, (0, import_fusionamm_client14.getFusionPoolDecoder)());
|
|
14495
14602
|
} else if (poolAccount.programAddress == import_whirlpools_client13.WHIRLPOOL_PROGRAM_ADDRESS) {
|
|
14496
|
-
pool = (0,
|
|
14603
|
+
pool = (0, import_kit138.decodeAccount)(poolAccount, (0, import_whirlpools_client13.getWhirlpoolDecoder)());
|
|
14497
14604
|
} else {
|
|
14498
14605
|
throw new Error("Incorrect Fusion or Orca pool account");
|
|
14499
14606
|
}
|
|
@@ -14533,7 +14640,7 @@ async function openTunaSpotPositionInstruction(authority, mintA, mintB, poolAddr
|
|
|
14533
14640
|
// src/txbuilder/decreaseTunaLpPositionOrca.ts
|
|
14534
14641
|
var import_whirlpools_client14 = require("@orca-so/whirlpools-client");
|
|
14535
14642
|
var import_whirlpools_core5 = require("@orca-so/whirlpools-core");
|
|
14536
|
-
var
|
|
14643
|
+
var import_kit139 = require("@solana/kit");
|
|
14537
14644
|
var import_memo18 = require("@solana-program/memo");
|
|
14538
14645
|
var import_token_202229 = require("@solana-program/token-2022");
|
|
14539
14646
|
var import_assert20 = __toESM(require("assert"), 1);
|
|
@@ -14555,7 +14662,7 @@ async function decreaseTunaLpPositionOrcaInstructions(rpc, authority, positionMi
|
|
|
14555
14662
|
const allMints = [mintA, mintB, ...rewardMints];
|
|
14556
14663
|
(0, import_assert20.default)(mintA.exists, "Token A account not found");
|
|
14557
14664
|
(0, import_assert20.default)(mintB.exists, "Token B account not found");
|
|
14558
|
-
(0,
|
|
14665
|
+
(0, import_kit139.assertAccountsExist)(rewardMints);
|
|
14559
14666
|
const lowerTickArrayStartIndex = (0, import_whirlpools_core5.getTickArrayStartTickIndex)(
|
|
14560
14667
|
tunaPosition.data.tickLowerIndex,
|
|
14561
14668
|
whirlpool.data.tickSpacing
|
|
@@ -14667,16 +14774,16 @@ async function decreaseTunaLpPositionOrcaInstruction(authority, tunaPosition, mi
|
|
|
14667
14774
|
tunaPosition.data.tickUpperIndex
|
|
14668
14775
|
);
|
|
14669
14776
|
const remainingAccounts = [
|
|
14670
|
-
{ address: swapTickArrays[0], role:
|
|
14671
|
-
{ address: swapTickArrays[1], role:
|
|
14672
|
-
{ address: swapTickArrays[2], role:
|
|
14673
|
-
{ address: swapTickArrays[3], role:
|
|
14674
|
-
{ address: swapTickArrays[4], role:
|
|
14675
|
-
{ address: lowerTickArrayAddress, role:
|
|
14676
|
-
{ address: upperTickArrayAddress, role:
|
|
14677
|
-
{ address: whirlpool.data.tokenVaultA, role:
|
|
14678
|
-
{ address: whirlpool.data.tokenVaultB, role:
|
|
14679
|
-
{ address: orcaOracleAddress, role:
|
|
14777
|
+
{ address: swapTickArrays[0], role: import_kit139.AccountRole.WRITABLE },
|
|
14778
|
+
{ address: swapTickArrays[1], role: import_kit139.AccountRole.WRITABLE },
|
|
14779
|
+
{ address: swapTickArrays[2], role: import_kit139.AccountRole.WRITABLE },
|
|
14780
|
+
{ address: swapTickArrays[3], role: import_kit139.AccountRole.WRITABLE },
|
|
14781
|
+
{ address: swapTickArrays[4], role: import_kit139.AccountRole.WRITABLE },
|
|
14782
|
+
{ address: lowerTickArrayAddress, role: import_kit139.AccountRole.WRITABLE },
|
|
14783
|
+
{ address: upperTickArrayAddress, role: import_kit139.AccountRole.WRITABLE },
|
|
14784
|
+
{ address: whirlpool.data.tokenVaultA, role: import_kit139.AccountRole.WRITABLE },
|
|
14785
|
+
{ address: whirlpool.data.tokenVaultB, role: import_kit139.AccountRole.WRITABLE },
|
|
14786
|
+
{ address: orcaOracleAddress, role: import_kit139.AccountRole.WRITABLE }
|
|
14680
14787
|
];
|
|
14681
14788
|
for (const rewardIndex of rewardIndicesToClaim) {
|
|
14682
14789
|
const rewardInfo = whirlpool.data.rewardInfos[rewardIndex];
|
|
@@ -14687,10 +14794,10 @@ async function decreaseTunaLpPositionOrcaInstruction(authority, tunaPosition, mi
|
|
|
14687
14794
|
mint: rewardMint.address,
|
|
14688
14795
|
tokenProgram: rewardMint.programAddress
|
|
14689
14796
|
});
|
|
14690
|
-
remainingAccounts.push({ address: rewardMint.address, role:
|
|
14691
|
-
remainingAccounts.push({ address: rewardMint.programAddress, role:
|
|
14692
|
-
remainingAccounts.push({ address: ownerAta[0], role:
|
|
14693
|
-
remainingAccounts.push({ address: rewardInfo.vault, role:
|
|
14797
|
+
remainingAccounts.push({ address: rewardMint.address, role: import_kit139.AccountRole.READONLY });
|
|
14798
|
+
remainingAccounts.push({ address: rewardMint.programAddress, role: import_kit139.AccountRole.READONLY });
|
|
14799
|
+
remainingAccounts.push({ address: ownerAta[0], role: import_kit139.AccountRole.WRITABLE });
|
|
14800
|
+
remainingAccounts.push({ address: rewardInfo.vault, role: import_kit139.AccountRole.WRITABLE });
|
|
14694
14801
|
}
|
|
14695
14802
|
const remainingAccountsInfo = {
|
|
14696
14803
|
slices: [
|
|
@@ -14738,7 +14845,7 @@ async function decreaseTunaLpPositionOrcaInstruction(authority, tunaPosition, mi
|
|
|
14738
14845
|
|
|
14739
14846
|
// src/txbuilder/decreaseTunaLpPositionFusion.ts
|
|
14740
14847
|
var import_fusionamm_client15 = require("@crypticdot/fusionamm-client");
|
|
14741
|
-
var
|
|
14848
|
+
var import_kit140 = require("@solana/kit");
|
|
14742
14849
|
var import_memo19 = require("@solana-program/memo");
|
|
14743
14850
|
var import_token_202230 = require("@solana-program/token-2022");
|
|
14744
14851
|
var import_assert21 = __toESM(require("assert"), 1);
|
|
@@ -14838,15 +14945,15 @@ async function decreaseTunaLpPositionFusionInstruction(authority, tunaPosition,
|
|
|
14838
14945
|
tunaPosition.data.tickUpperIndex
|
|
14839
14946
|
);
|
|
14840
14947
|
const remainingAccounts = [
|
|
14841
|
-
{ address: swapTickArrays[0], role:
|
|
14842
|
-
{ address: swapTickArrays[1], role:
|
|
14843
|
-
{ address: swapTickArrays[2], role:
|
|
14844
|
-
{ address: swapTickArrays[3], role:
|
|
14845
|
-
{ address: swapTickArrays[4], role:
|
|
14846
|
-
{ address: lowerTickArrayAddress, role:
|
|
14847
|
-
{ address: upperTickArrayAddress, role:
|
|
14848
|
-
{ address: fusionPool.data.tokenVaultA, role:
|
|
14849
|
-
{ address: fusionPool.data.tokenVaultB, role:
|
|
14948
|
+
{ address: swapTickArrays[0], role: import_kit140.AccountRole.WRITABLE },
|
|
14949
|
+
{ address: swapTickArrays[1], role: import_kit140.AccountRole.WRITABLE },
|
|
14950
|
+
{ address: swapTickArrays[2], role: import_kit140.AccountRole.WRITABLE },
|
|
14951
|
+
{ address: swapTickArrays[3], role: import_kit140.AccountRole.WRITABLE },
|
|
14952
|
+
{ address: swapTickArrays[4], role: import_kit140.AccountRole.WRITABLE },
|
|
14953
|
+
{ address: lowerTickArrayAddress, role: import_kit140.AccountRole.WRITABLE },
|
|
14954
|
+
{ address: upperTickArrayAddress, role: import_kit140.AccountRole.WRITABLE },
|
|
14955
|
+
{ address: fusionPool.data.tokenVaultA, role: import_kit140.AccountRole.WRITABLE },
|
|
14956
|
+
{ address: fusionPool.data.tokenVaultB, role: import_kit140.AccountRole.WRITABLE }
|
|
14850
14957
|
];
|
|
14851
14958
|
const remainingAccountsInfo = {
|
|
14852
14959
|
slices: [
|
|
@@ -15058,7 +15165,7 @@ async function withdrawInstruction(authority, mint, vault, funds, shares) {
|
|
|
15058
15165
|
// src/txbuilder/createMarketLookupTable.ts
|
|
15059
15166
|
var import_fusionamm_client16 = require("@crypticdot/fusionamm-client");
|
|
15060
15167
|
var import_whirlpools_client15 = require("@orca-so/whirlpools-client");
|
|
15061
|
-
var
|
|
15168
|
+
var import_kit141 = require("@solana/kit");
|
|
15062
15169
|
var import_address_lookup_table2 = require("@solana-program/address-lookup-table");
|
|
15063
15170
|
var import_memo22 = require("@solana-program/memo");
|
|
15064
15171
|
var import_system2 = require("@solana-program/system");
|
|
@@ -15098,7 +15205,7 @@ async function getAddressesForMarketLookupTable(rpc, poolAddress, marketMaker) {
|
|
|
15098
15205
|
}))[0];
|
|
15099
15206
|
const addresses = [
|
|
15100
15207
|
import_system2.SYSTEM_PROGRAM_ADDRESS,
|
|
15101
|
-
(0,
|
|
15208
|
+
(0, import_kit141.address)("SysvarRent111111111111111111111111111111111"),
|
|
15102
15209
|
import_token_202234.ASSOCIATED_TOKEN_PROGRAM_ADDRESS,
|
|
15103
15210
|
import_token2.TOKEN_PROGRAM_ADDRESS,
|
|
15104
15211
|
import_token_202234.TOKEN_2022_PROGRAM_ADDRESS,
|
|
@@ -15258,7 +15365,7 @@ async function repayTunaLpPositionDebtInstruction(authority, positionMint, mintA
|
|
|
15258
15365
|
|
|
15259
15366
|
// src/txbuilder/rebalanceTunaLpPositionOrca.ts
|
|
15260
15367
|
var import_whirlpools_client16 = require("@orca-so/whirlpools-client");
|
|
15261
|
-
var
|
|
15368
|
+
var import_kit142 = require("@solana/kit");
|
|
15262
15369
|
var import_sysvars3 = require("@solana/sysvars");
|
|
15263
15370
|
var import_memo24 = require("@solana-program/memo");
|
|
15264
15371
|
var import_token_202236 = require("@solana-program/token-2022");
|
|
@@ -15341,7 +15448,7 @@ async function rebalanceTunaLpPositionOrcaInstructions(rpc, authority, positionM
|
|
|
15341
15448
|
cleanupInstructions.push(...internalCleanupInstructions);
|
|
15342
15449
|
return {
|
|
15343
15450
|
instructions,
|
|
15344
|
-
initializationCost: (0,
|
|
15451
|
+
initializationCost: (0, import_kit142.lamports)(nonRefundableRent)
|
|
15345
15452
|
};
|
|
15346
15453
|
}
|
|
15347
15454
|
async function rebalanceTunaLpPositionOrcaInstruction(authority, tunaPosition, tunaConfig, mintA, mintB, vaultA, vaultB, whirlpool) {
|
|
@@ -15385,18 +15492,18 @@ async function rebalanceTunaLpPositionOrcaInstruction(authority, tunaPosition, t
|
|
|
15385
15492
|
);
|
|
15386
15493
|
const secondaryTickArrays = await OrcaUtils.getTickArraysForRebalancedPosition(whirlpool, tunaPosition);
|
|
15387
15494
|
const remainingAccounts = [
|
|
15388
|
-
{ address: swapTickArrays[0], role:
|
|
15389
|
-
{ address: swapTickArrays[1], role:
|
|
15390
|
-
{ address: swapTickArrays[2], role:
|
|
15391
|
-
{ address: swapTickArrays[3], role:
|
|
15392
|
-
{ address: swapTickArrays[4], role:
|
|
15393
|
-
{ address: lowerTickArrayAddress, role:
|
|
15394
|
-
{ address: upperTickArrayAddress, role:
|
|
15395
|
-
{ address: secondaryTickArrays.lowerTickArrayAddress, role:
|
|
15396
|
-
{ address: secondaryTickArrays.upperTickArrayAddress, role:
|
|
15397
|
-
{ address: whirlpool.data.tokenVaultA, role:
|
|
15398
|
-
{ address: whirlpool.data.tokenVaultB, role:
|
|
15399
|
-
{ address: orcaOracleAddress, role:
|
|
15495
|
+
{ address: swapTickArrays[0], role: import_kit142.AccountRole.WRITABLE },
|
|
15496
|
+
{ address: swapTickArrays[1], role: import_kit142.AccountRole.WRITABLE },
|
|
15497
|
+
{ address: swapTickArrays[2], role: import_kit142.AccountRole.WRITABLE },
|
|
15498
|
+
{ address: swapTickArrays[3], role: import_kit142.AccountRole.WRITABLE },
|
|
15499
|
+
{ address: swapTickArrays[4], role: import_kit142.AccountRole.WRITABLE },
|
|
15500
|
+
{ address: lowerTickArrayAddress, role: import_kit142.AccountRole.WRITABLE },
|
|
15501
|
+
{ address: upperTickArrayAddress, role: import_kit142.AccountRole.WRITABLE },
|
|
15502
|
+
{ address: secondaryTickArrays.lowerTickArrayAddress, role: import_kit142.AccountRole.WRITABLE },
|
|
15503
|
+
{ address: secondaryTickArrays.upperTickArrayAddress, role: import_kit142.AccountRole.WRITABLE },
|
|
15504
|
+
{ address: whirlpool.data.tokenVaultA, role: import_kit142.AccountRole.WRITABLE },
|
|
15505
|
+
{ address: whirlpool.data.tokenVaultB, role: import_kit142.AccountRole.WRITABLE },
|
|
15506
|
+
{ address: orcaOracleAddress, role: import_kit142.AccountRole.WRITABLE }
|
|
15400
15507
|
];
|
|
15401
15508
|
const remainingAccountsInfo = {
|
|
15402
15509
|
slices: [
|
|
@@ -15440,7 +15547,7 @@ async function rebalanceTunaLpPositionOrcaInstruction(authority, tunaPosition, t
|
|
|
15440
15547
|
|
|
15441
15548
|
// src/txbuilder/rebalanceTunaLpPositionFusion.ts
|
|
15442
15549
|
var import_fusionamm_client17 = require("@crypticdot/fusionamm-client");
|
|
15443
|
-
var
|
|
15550
|
+
var import_kit143 = require("@solana/kit");
|
|
15444
15551
|
var import_sysvars4 = require("@solana/sysvars");
|
|
15445
15552
|
var import_memo25 = require("@solana-program/memo");
|
|
15446
15553
|
var import_token_202237 = require("@solana-program/token-2022");
|
|
@@ -15519,7 +15626,7 @@ async function rebalanceTunaLpPositionFusionInstructions(rpc, authority, positio
|
|
|
15519
15626
|
instructions.push(ix);
|
|
15520
15627
|
return {
|
|
15521
15628
|
instructions,
|
|
15522
|
-
initializationCost: (0,
|
|
15629
|
+
initializationCost: (0, import_kit143.lamports)(nonRefundableRent)
|
|
15523
15630
|
};
|
|
15524
15631
|
}
|
|
15525
15632
|
async function rebalanceTunaLpPositionFusionInstruction(authority, tunaPosition, tunaConfig, mintA, mintB, vaultA, vaultB, fusionPool) {
|
|
@@ -15562,17 +15669,17 @@ async function rebalanceTunaLpPositionFusionInstruction(authority, tunaPosition,
|
|
|
15562
15669
|
);
|
|
15563
15670
|
const secondaryTickArrays = await FusionUtils.getTickArraysForRebalancedPosition(fusionPool, tunaPosition);
|
|
15564
15671
|
const remainingAccounts = [
|
|
15565
|
-
{ address: swapTickArrays[0], role:
|
|
15566
|
-
{ address: swapTickArrays[1], role:
|
|
15567
|
-
{ address: swapTickArrays[2], role:
|
|
15568
|
-
{ address: swapTickArrays[3], role:
|
|
15569
|
-
{ address: swapTickArrays[4], role:
|
|
15570
|
-
{ address: lowerTickArrayAddress, role:
|
|
15571
|
-
{ address: upperTickArrayAddress, role:
|
|
15572
|
-
{ address: secondaryTickArrays.lowerTickArrayAddress, role:
|
|
15573
|
-
{ address: secondaryTickArrays.upperTickArrayAddress, role:
|
|
15574
|
-
{ address: fusionPool.data.tokenVaultA, role:
|
|
15575
|
-
{ address: fusionPool.data.tokenVaultB, role:
|
|
15672
|
+
{ address: swapTickArrays[0], role: import_kit143.AccountRole.WRITABLE },
|
|
15673
|
+
{ address: swapTickArrays[1], role: import_kit143.AccountRole.WRITABLE },
|
|
15674
|
+
{ address: swapTickArrays[2], role: import_kit143.AccountRole.WRITABLE },
|
|
15675
|
+
{ address: swapTickArrays[3], role: import_kit143.AccountRole.WRITABLE },
|
|
15676
|
+
{ address: swapTickArrays[4], role: import_kit143.AccountRole.WRITABLE },
|
|
15677
|
+
{ address: lowerTickArrayAddress, role: import_kit143.AccountRole.WRITABLE },
|
|
15678
|
+
{ address: upperTickArrayAddress, role: import_kit143.AccountRole.WRITABLE },
|
|
15679
|
+
{ address: secondaryTickArrays.lowerTickArrayAddress, role: import_kit143.AccountRole.WRITABLE },
|
|
15680
|
+
{ address: secondaryTickArrays.upperTickArrayAddress, role: import_kit143.AccountRole.WRITABLE },
|
|
15681
|
+
{ address: fusionPool.data.tokenVaultA, role: import_kit143.AccountRole.WRITABLE },
|
|
15682
|
+
{ address: fusionPool.data.tokenVaultB, role: import_kit143.AccountRole.WRITABLE }
|
|
15576
15683
|
];
|
|
15577
15684
|
const remainingAccountsInfo = {
|
|
15578
15685
|
slices: [
|
|
@@ -15677,6 +15784,7 @@ async function rebalanceTunaLpPositionFusionInstruction(authority, tunaPosition,
|
|
|
15677
15784
|
REBALANCE_TUNA_LP_POSITION_ORCA_DISCRIMINATOR,
|
|
15678
15785
|
REPAY_BAD_DEBT_DISCRIMINATOR,
|
|
15679
15786
|
REPAY_TUNA_LP_POSITION_DEBT_DISCRIMINATOR,
|
|
15787
|
+
RESET_MARKET_BAD_DEBT_DISCRIMINATOR,
|
|
15680
15788
|
RESET_TUNA_SPOT_POSITION_DISCRIMINATOR,
|
|
15681
15789
|
SET_ADMIN_AUTHORITY_DISCRIMINATOR,
|
|
15682
15790
|
SET_DEFAULT_LIQUIDATION_FEE_RATE_DISCRIMINATOR,
|
|
@@ -16077,6 +16185,11 @@ async function rebalanceTunaLpPositionFusionInstruction(authority, tunaPosition,
|
|
|
16077
16185
|
getRepayTunaLpPositionDebtInstructionDataCodec,
|
|
16078
16186
|
getRepayTunaLpPositionDebtInstructionDataDecoder,
|
|
16079
16187
|
getRepayTunaLpPositionDebtInstructionDataEncoder,
|
|
16188
|
+
getResetMarketBadDebtDiscriminatorBytes,
|
|
16189
|
+
getResetMarketBadDebtInstruction,
|
|
16190
|
+
getResetMarketBadDebtInstructionDataCodec,
|
|
16191
|
+
getResetMarketBadDebtInstructionDataDecoder,
|
|
16192
|
+
getResetMarketBadDebtInstructionDataEncoder,
|
|
16080
16193
|
getResetTunaSpotPositionDiscriminatorBytes,
|
|
16081
16194
|
getResetTunaSpotPositionInstruction,
|
|
16082
16195
|
getResetTunaSpotPositionInstructionDataCodec,
|
|
@@ -16291,6 +16404,7 @@ async function rebalanceTunaLpPositionFusionInstruction(authority, tunaPosition,
|
|
|
16291
16404
|
parseRebalanceTunaLpPositionOrcaInstruction,
|
|
16292
16405
|
parseRepayBadDebtInstruction,
|
|
16293
16406
|
parseRepayTunaLpPositionDebtInstruction,
|
|
16407
|
+
parseResetMarketBadDebtInstruction,
|
|
16294
16408
|
parseResetTunaSpotPositionInstruction,
|
|
16295
16409
|
parseSetAdminAuthorityInstruction,
|
|
16296
16410
|
parseSetDefaultLiquidationFeeRateInstruction,
|