@reflectmoney/stable.ts 2.8.4 → 2.9.0

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.
Files changed (234) hide show
  1. package/dist/helpers/drift/accounts/index.d.ts +10 -0
  2. package/dist/helpers/drift/accounts/index.js +26 -0
  3. package/dist/helpers/drift/accounts/spotMarket.d.ts +541 -0
  4. package/dist/helpers/drift/accounts/spotMarket.js +213 -0
  5. package/dist/helpers/drift/accounts/user.d.ts +193 -0
  6. package/dist/helpers/drift/accounts/user.js +147 -0
  7. package/dist/helpers/drift/accounts/userStats.d.ts +165 -0
  8. package/dist/helpers/drift/accounts/userStats.js +137 -0
  9. package/dist/helpers/drift/index.d.ts +10 -0
  10. package/dist/helpers/drift/index.js +26 -0
  11. package/dist/helpers/drift/mappers.d.ts +14 -0
  12. package/dist/helpers/drift/mappers.js +137 -0
  13. package/dist/helpers/drift/types/aMM.d.ts +656 -0
  14. package/dist/helpers/drift/types/aMM.js +199 -0
  15. package/dist/helpers/drift/types/addAmmConstituentMappingDatum.d.ts +21 -0
  16. package/dist/helpers/drift/types/addAmmConstituentMappingDatum.js +30 -0
  17. package/dist/helpers/drift/types/ammCacheFixed.d.ts +17 -0
  18. package/dist/helpers/drift/types/ammCacheFixed.js +30 -0
  19. package/dist/helpers/drift/types/ammConstituentDatum.d.ts +27 -0
  20. package/dist/helpers/drift/types/ammConstituentDatum.js +34 -0
  21. package/dist/helpers/drift/types/ammConstituentMappingFixed.d.ts +18 -0
  22. package/dist/helpers/drift/types/ammConstituentMappingFixed.js +32 -0
  23. package/dist/helpers/drift/types/assetTier.d.ts +19 -0
  24. package/dist/helpers/drift/types/assetTier.js +31 -0
  25. package/dist/helpers/drift/types/assetType.d.ts +16 -0
  26. package/dist/helpers/drift/types/assetType.js +28 -0
  27. package/dist/helpers/drift/types/builderInfo.d.ts +17 -0
  28. package/dist/helpers/drift/types/builderInfo.js +30 -0
  29. package/dist/helpers/drift/types/cacheInfo.d.ts +59 -0
  30. package/dist/helpers/drift/types/cacheInfo.js +66 -0
  31. package/dist/helpers/drift/types/constituentCorrelationsFixed.d.ts +19 -0
  32. package/dist/helpers/drift/types/constituentCorrelationsFixed.js +32 -0
  33. package/dist/helpers/drift/types/constituentLpOperation.d.ts +17 -0
  34. package/dist/helpers/drift/types/constituentLpOperation.js +29 -0
  35. package/dist/helpers/drift/types/constituentSpotBalance.d.ts +48 -0
  36. package/dist/helpers/drift/types/constituentSpotBalance.js +35 -0
  37. package/dist/helpers/drift/types/constituentStatus.d.ts +16 -0
  38. package/dist/helpers/drift/types/constituentStatus.js +28 -0
  39. package/dist/helpers/drift/types/constituentTargetBaseFixed.d.ts +19 -0
  40. package/dist/helpers/drift/types/constituentTargetBaseFixed.js +32 -0
  41. package/dist/helpers/drift/types/contractTier.d.ts +20 -0
  42. package/dist/helpers/drift/types/contractTier.js +32 -0
  43. package/dist/helpers/drift/types/contractType.d.ts +17 -0
  44. package/dist/helpers/drift/types/contractType.js +29 -0
  45. package/dist/helpers/drift/types/depositDirection.d.ts +16 -0
  46. package/dist/helpers/drift/types/depositDirection.js +28 -0
  47. package/dist/helpers/drift/types/depositExplanation.d.ts +19 -0
  48. package/dist/helpers/drift/types/depositExplanation.js +31 -0
  49. package/dist/helpers/drift/types/driftAction.d.ts +29 -0
  50. package/dist/helpers/drift/types/driftAction.js +41 -0
  51. package/dist/helpers/drift/types/exchangeStatus.d.ts +22 -0
  52. package/dist/helpers/drift/types/exchangeStatus.js +34 -0
  53. package/dist/helpers/drift/types/featureBitFlags.d.ts +18 -0
  54. package/dist/helpers/drift/types/featureBitFlags.js +30 -0
  55. package/dist/helpers/drift/types/feeStructure.d.ts +24 -0
  56. package/dist/helpers/drift/types/feeStructure.js +33 -0
  57. package/dist/helpers/drift/types/feeTier.d.ts +22 -0
  58. package/dist/helpers/drift/types/feeTier.js +40 -0
  59. package/dist/helpers/drift/types/fillMode.d.ts +29 -0
  60. package/dist/helpers/drift/types/fillMode.js +52 -0
  61. package/dist/helpers/drift/types/fuelOverflowStatus.d.ts +15 -0
  62. package/dist/helpers/drift/types/fuelOverflowStatus.js +27 -0
  63. package/dist/helpers/drift/types/historicalIndexData.d.ts +35 -0
  64. package/dist/helpers/drift/types/historicalIndexData.js +34 -0
  65. package/dist/helpers/drift/types/historicalOracleData.d.ts +39 -0
  66. package/dist/helpers/drift/types/historicalOracleData.js +36 -0
  67. package/dist/helpers/drift/types/ifRebalanceConfigParams.d.ts +31 -0
  68. package/dist/helpers/drift/types/ifRebalanceConfigParams.js +40 -0
  69. package/dist/helpers/drift/types/index.d.ts +114 -0
  70. package/dist/helpers/drift/types/index.js +130 -0
  71. package/dist/helpers/drift/types/insuranceClaim.d.ts +63 -0
  72. package/dist/helpers/drift/types/insuranceClaim.js +34 -0
  73. package/dist/helpers/drift/types/insuranceFund.d.ts +33 -0
  74. package/dist/helpers/drift/types/insuranceFund.js +42 -0
  75. package/dist/helpers/drift/types/insuranceFundOperation.d.ts +18 -0
  76. package/dist/helpers/drift/types/insuranceFundOperation.js +30 -0
  77. package/dist/helpers/drift/types/lPAction.d.ts +18 -0
  78. package/dist/helpers/drift/types/lPAction.js +30 -0
  79. package/dist/helpers/drift/types/liquidateBorrowForPerpPnlRecord.d.ts +27 -0
  80. package/dist/helpers/drift/types/liquidateBorrowForPerpPnlRecord.js +36 -0
  81. package/dist/helpers/drift/types/liquidatePerpPnlForDepositRecord.d.ts +27 -0
  82. package/dist/helpers/drift/types/liquidatePerpPnlForDepositRecord.js +36 -0
  83. package/dist/helpers/drift/types/liquidatePerpRecord.d.ts +41 -0
  84. package/dist/helpers/drift/types/liquidatePerpRecord.js +44 -0
  85. package/dist/helpers/drift/types/liquidateSpotRecord.d.ts +33 -0
  86. package/dist/helpers/drift/types/liquidateSpotRecord.js +38 -0
  87. package/dist/helpers/drift/types/liquidationBitFlag.d.ts +15 -0
  88. package/dist/helpers/drift/types/liquidationBitFlag.js +27 -0
  89. package/dist/helpers/drift/types/liquidationMultiplierType.d.ts +16 -0
  90. package/dist/helpers/drift/types/liquidationMultiplierType.js +28 -0
  91. package/dist/helpers/drift/types/liquidationType.d.ts +20 -0
  92. package/dist/helpers/drift/types/liquidationType.js +32 -0
  93. package/dist/helpers/drift/types/logMode.d.ts +19 -0
  94. package/dist/helpers/drift/types/logMode.js +31 -0
  95. package/dist/helpers/drift/types/lpPoolFeatureBitFlags.d.ts +17 -0
  96. package/dist/helpers/drift/types/lpPoolFeatureBitFlags.js +29 -0
  97. package/dist/helpers/drift/types/lpStatus.d.ts +17 -0
  98. package/dist/helpers/drift/types/lpStatus.js +29 -0
  99. package/dist/helpers/drift/types/marginCalculationMode.d.ts +29 -0
  100. package/dist/helpers/drift/types/marginCalculationMode.js +55 -0
  101. package/dist/helpers/drift/types/marginMode.d.ts +17 -0
  102. package/dist/helpers/drift/types/marginMode.js +29 -0
  103. package/dist/helpers/drift/types/marginRequirementType.d.ts +17 -0
  104. package/dist/helpers/drift/types/marginRequirementType.js +29 -0
  105. package/dist/helpers/drift/types/marketIdentifier.d.ts +20 -0
  106. package/dist/helpers/drift/types/marketIdentifier.js +29 -0
  107. package/dist/helpers/drift/types/marketStatus.d.ts +23 -0
  108. package/dist/helpers/drift/types/marketStatus.js +35 -0
  109. package/dist/helpers/drift/types/marketType.d.ts +16 -0
  110. package/dist/helpers/drift/types/marketType.js +28 -0
  111. package/dist/helpers/drift/types/modifyOrderId.d.ts +24 -0
  112. package/dist/helpers/drift/types/modifyOrderId.js +50 -0
  113. package/dist/helpers/drift/types/modifyOrderParams.d.ts +44 -0
  114. package/dist/helpers/drift/types/modifyOrderParams.js +53 -0
  115. package/dist/helpers/drift/types/modifyOrderPolicy.d.ts +16 -0
  116. package/dist/helpers/drift/types/modifyOrderPolicy.js +28 -0
  117. package/dist/helpers/drift/types/oracleGuardRails.d.ts +20 -0
  118. package/dist/helpers/drift/types/oracleGuardRails.js +29 -0
  119. package/dist/helpers/drift/types/oracleSource.d.ts +30 -0
  120. package/dist/helpers/drift/types/oracleSource.js +42 -0
  121. package/dist/helpers/drift/types/oracleValidity.d.ts +39 -0
  122. package/dist/helpers/drift/types/oracleValidity.js +60 -0
  123. package/dist/helpers/drift/types/order.d.ts +178 -0
  124. package/dist/helpers/drift/types/order.js +77 -0
  125. package/dist/helpers/drift/types/orderAction.d.ts +19 -0
  126. package/dist/helpers/drift/types/orderAction.js +31 -0
  127. package/dist/helpers/drift/types/orderActionExplanation.d.ts +35 -0
  128. package/dist/helpers/drift/types/orderActionExplanation.js +47 -0
  129. package/dist/helpers/drift/types/orderBitFlag.d.ts +20 -0
  130. package/dist/helpers/drift/types/orderBitFlag.js +32 -0
  131. package/dist/helpers/drift/types/orderFillerRewardStructure.d.ts +21 -0
  132. package/dist/helpers/drift/types/orderFillerRewardStructure.js +30 -0
  133. package/dist/helpers/drift/types/orderParams.d.ts +50 -0
  134. package/dist/helpers/drift/types/orderParams.js +59 -0
  135. package/dist/helpers/drift/types/orderParamsBitFlag.d.ts +16 -0
  136. package/dist/helpers/drift/types/orderParamsBitFlag.js +28 -0
  137. package/dist/helpers/drift/types/orderStatus.d.ts +18 -0
  138. package/dist/helpers/drift/types/orderStatus.js +30 -0
  139. package/dist/helpers/drift/types/orderTriggerCondition.d.ts +18 -0
  140. package/dist/helpers/drift/types/orderTriggerCondition.js +30 -0
  141. package/dist/helpers/drift/types/orderType.d.ts +19 -0
  142. package/dist/helpers/drift/types/orderType.js +31 -0
  143. package/dist/helpers/drift/types/perpBankruptcyRecord.d.ts +27 -0
  144. package/dist/helpers/drift/types/perpBankruptcyRecord.js +36 -0
  145. package/dist/helpers/drift/types/perpFulfillmentMethod.d.ts +30 -0
  146. package/dist/helpers/drift/types/perpFulfillmentMethod.js +72 -0
  147. package/dist/helpers/drift/types/perpLpOperation.d.ts +16 -0
  148. package/dist/helpers/drift/types/perpLpOperation.js +28 -0
  149. package/dist/helpers/drift/types/perpOperation.d.ts +22 -0
  150. package/dist/helpers/drift/types/perpOperation.js +34 -0
  151. package/dist/helpers/drift/types/perpPosition.d.ts +149 -0
  152. package/dist/helpers/drift/types/perpPosition.js +56 -0
  153. package/dist/helpers/drift/types/placeAndTakeOrderSuccessCondition.d.ts +16 -0
  154. package/dist/helpers/drift/types/placeAndTakeOrderSuccessCondition.js +28 -0
  155. package/dist/helpers/drift/types/poolBalance.d.ts +33 -0
  156. package/dist/helpers/drift/types/poolBalance.js +30 -0
  157. package/dist/helpers/drift/types/positionDirection.d.ts +16 -0
  158. package/dist/helpers/drift/types/positionDirection.js +28 -0
  159. package/dist/helpers/drift/types/positionFlag.d.ts +17 -0
  160. package/dist/helpers/drift/types/positionFlag.js +29 -0
  161. package/dist/helpers/drift/types/positionUpdateType.d.ts +19 -0
  162. package/dist/helpers/drift/types/positionUpdateType.js +31 -0
  163. package/dist/helpers/drift/types/postOnlyParam.d.ts +18 -0
  164. package/dist/helpers/drift/types/postOnlyParam.js +30 -0
  165. package/dist/helpers/drift/types/prelaunchOracleParams.d.ts +21 -0
  166. package/dist/helpers/drift/types/prelaunchOracleParams.js +30 -0
  167. package/dist/helpers/drift/types/priceDivergenceGuardRails.d.ts +19 -0
  168. package/dist/helpers/drift/types/priceDivergenceGuardRails.js +28 -0
  169. package/dist/helpers/drift/types/referrerStatus.d.ts +17 -0
  170. package/dist/helpers/drift/types/referrerStatus.js +29 -0
  171. package/dist/helpers/drift/types/revenueShareEscrowFixed.d.ts +21 -0
  172. package/dist/helpers/drift/types/revenueShareEscrowFixed.js +38 -0
  173. package/dist/helpers/drift/types/revenueShareOrder.d.ts +80 -0
  174. package/dist/helpers/drift/types/revenueShareOrder.js +45 -0
  175. package/dist/helpers/drift/types/revenueShareOrderBitFlag.d.ts +18 -0
  176. package/dist/helpers/drift/types/revenueShareOrderBitFlag.js +30 -0
  177. package/dist/helpers/drift/types/settlePnlExplanation.d.ts +16 -0
  178. package/dist/helpers/drift/types/settlePnlExplanation.js +28 -0
  179. package/dist/helpers/drift/types/settlePnlMode.d.ts +16 -0
  180. package/dist/helpers/drift/types/settlePnlMode.js +28 -0
  181. package/dist/helpers/drift/types/settlementDirection.d.ts +17 -0
  182. package/dist/helpers/drift/types/settlementDirection.js +29 -0
  183. package/dist/helpers/drift/types/signatureVerificationError.d.ts +26 -0
  184. package/dist/helpers/drift/types/signatureVerificationError.js +38 -0
  185. package/dist/helpers/drift/types/signedMsgOrderId.d.ts +23 -0
  186. package/dist/helpers/drift/types/signedMsgOrderId.js +32 -0
  187. package/dist/helpers/drift/types/signedMsgOrderParamsDelegateMessage.d.ts +36 -0
  188. package/dist/helpers/drift/types/signedMsgOrderParamsDelegateMessage.js +57 -0
  189. package/dist/helpers/drift/types/signedMsgOrderParamsMessage.d.ts +36 -0
  190. package/dist/helpers/drift/types/signedMsgOrderParamsMessage.js +57 -0
  191. package/dist/helpers/drift/types/signedMsgTriggerOrderParams.d.ts +19 -0
  192. package/dist/helpers/drift/types/signedMsgTriggerOrderParams.js +28 -0
  193. package/dist/helpers/drift/types/signedMsgUserOrdersFixed.d.ts +17 -0
  194. package/dist/helpers/drift/types/signedMsgUserOrdersFixed.js +30 -0
  195. package/dist/helpers/drift/types/spotBalanceType.d.ts +16 -0
  196. package/dist/helpers/drift/types/spotBalanceType.js +28 -0
  197. package/dist/helpers/drift/types/spotBankruptcyRecord.d.ts +23 -0
  198. package/dist/helpers/drift/types/spotBankruptcyRecord.js +32 -0
  199. package/dist/helpers/drift/types/spotFulfillmentConfigStatus.d.ts +16 -0
  200. package/dist/helpers/drift/types/spotFulfillmentConfigStatus.js +28 -0
  201. package/dist/helpers/drift/types/spotFulfillmentMethod.d.ts +23 -0
  202. package/dist/helpers/drift/types/spotFulfillmentMethod.js +48 -0
  203. package/dist/helpers/drift/types/spotFulfillmentType.d.ts +18 -0
  204. package/dist/helpers/drift/types/spotFulfillmentType.js +30 -0
  205. package/dist/helpers/drift/types/spotOperation.d.ts +19 -0
  206. package/dist/helpers/drift/types/spotOperation.js +31 -0
  207. package/dist/helpers/drift/types/spotPosition.d.ts +72 -0
  208. package/dist/helpers/drift/types/spotPosition.js +41 -0
  209. package/dist/helpers/drift/types/stakeAction.d.ts +21 -0
  210. package/dist/helpers/drift/types/stakeAction.js +33 -0
  211. package/dist/helpers/drift/types/swapDirection.d.ts +16 -0
  212. package/dist/helpers/drift/types/swapDirection.js +28 -0
  213. package/dist/helpers/drift/types/swapReduceOnly.d.ts +16 -0
  214. package/dist/helpers/drift/types/swapReduceOnly.js +28 -0
  215. package/dist/helpers/drift/types/targetsDatum.d.ts +25 -0
  216. package/dist/helpers/drift/types/targetsDatum.js +34 -0
  217. package/dist/helpers/drift/types/tokenProgramFlag.d.ts +16 -0
  218. package/dist/helpers/drift/types/tokenProgramFlag.js +28 -0
  219. package/dist/helpers/drift/types/twapPeriod.d.ts +16 -0
  220. package/dist/helpers/drift/types/twapPeriod.js +28 -0
  221. package/dist/helpers/drift/types/userFees.d.ts +75 -0
  222. package/dist/helpers/drift/types/userFees.js +36 -0
  223. package/dist/helpers/drift/types/userStatsPausedOperations.d.ts +17 -0
  224. package/dist/helpers/drift/types/userStatsPausedOperations.js +29 -0
  225. package/dist/helpers/drift/types/userStatus.d.ts +19 -0
  226. package/dist/helpers/drift/types/userStatus.js +31 -0
  227. package/dist/helpers/drift/types/validityGuardRails.d.ts +23 -0
  228. package/dist/helpers/drift/types/validityGuardRails.js +32 -0
  229. package/dist/helpers/index.d.ts +1 -0
  230. package/dist/helpers/index.js +17 -0
  231. package/dist/stablecoins/UsdcPlusStablecoin.d.ts +2 -1
  232. package/dist/stablecoins/UsdcPlusStablecoin.js +19 -23
  233. package/dist/tsconfig.tsbuildinfo +1 -1
  234. package/package.json +3 -2
@@ -0,0 +1,41 @@
1
+ /**
2
+ * This code was AUTOGENERATED using the Codama library.
3
+ * Please DO NOT EDIT THIS FILE, instead use visitors
4
+ * to add features, then rerun Codama to update it.
5
+ *
6
+ * @see https://github.com/codama-idl/codama
7
+ */
8
+ import { type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder } from "@solana/kit";
9
+ export type LiquidatePerpRecord = {
10
+ marketIndex: number;
11
+ oraclePrice: bigint;
12
+ baseAssetAmount: bigint;
13
+ quoteAssetAmount: bigint;
14
+ /** precision: AMM_RESERVE_PRECISION */
15
+ lpShares: bigint;
16
+ fillRecordId: bigint;
17
+ userOrderId: number;
18
+ liquidatorOrderId: number;
19
+ /** precision: QUOTE_PRECISION */
20
+ liquidatorFee: bigint;
21
+ /** precision: QUOTE_PRECISION */
22
+ ifFee: bigint;
23
+ };
24
+ export type LiquidatePerpRecordArgs = {
25
+ marketIndex: number;
26
+ oraclePrice: number | bigint;
27
+ baseAssetAmount: number | bigint;
28
+ quoteAssetAmount: number | bigint;
29
+ /** precision: AMM_RESERVE_PRECISION */
30
+ lpShares: number | bigint;
31
+ fillRecordId: number | bigint;
32
+ userOrderId: number;
33
+ liquidatorOrderId: number;
34
+ /** precision: QUOTE_PRECISION */
35
+ liquidatorFee: number | bigint;
36
+ /** precision: QUOTE_PRECISION */
37
+ ifFee: number | bigint;
38
+ };
39
+ export declare function getLiquidatePerpRecordEncoder(): FixedSizeEncoder<LiquidatePerpRecordArgs>;
40
+ export declare function getLiquidatePerpRecordDecoder(): FixedSizeDecoder<LiquidatePerpRecord>;
41
+ export declare function getLiquidatePerpRecordCodec(): FixedSizeCodec<LiquidatePerpRecordArgs, LiquidatePerpRecord>;
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ /**
3
+ * This code was AUTOGENERATED using the Codama library.
4
+ * Please DO NOT EDIT THIS FILE, instead use visitors
5
+ * to add features, then rerun Codama to update it.
6
+ *
7
+ * @see https://github.com/codama-idl/codama
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.getLiquidatePerpRecordEncoder = getLiquidatePerpRecordEncoder;
11
+ exports.getLiquidatePerpRecordDecoder = getLiquidatePerpRecordDecoder;
12
+ exports.getLiquidatePerpRecordCodec = getLiquidatePerpRecordCodec;
13
+ const kit_1 = require("@solana/kit");
14
+ function getLiquidatePerpRecordEncoder() {
15
+ return (0, kit_1.getStructEncoder)([
16
+ ["marketIndex", (0, kit_1.getU16Encoder)()],
17
+ ["oraclePrice", (0, kit_1.getI64Encoder)()],
18
+ ["baseAssetAmount", (0, kit_1.getI64Encoder)()],
19
+ ["quoteAssetAmount", (0, kit_1.getI64Encoder)()],
20
+ ["lpShares", (0, kit_1.getU64Encoder)()],
21
+ ["fillRecordId", (0, kit_1.getU64Encoder)()],
22
+ ["userOrderId", (0, kit_1.getU32Encoder)()],
23
+ ["liquidatorOrderId", (0, kit_1.getU32Encoder)()],
24
+ ["liquidatorFee", (0, kit_1.getU64Encoder)()],
25
+ ["ifFee", (0, kit_1.getU64Encoder)()],
26
+ ]);
27
+ }
28
+ function getLiquidatePerpRecordDecoder() {
29
+ return (0, kit_1.getStructDecoder)([
30
+ ["marketIndex", (0, kit_1.getU16Decoder)()],
31
+ ["oraclePrice", (0, kit_1.getI64Decoder)()],
32
+ ["baseAssetAmount", (0, kit_1.getI64Decoder)()],
33
+ ["quoteAssetAmount", (0, kit_1.getI64Decoder)()],
34
+ ["lpShares", (0, kit_1.getU64Decoder)()],
35
+ ["fillRecordId", (0, kit_1.getU64Decoder)()],
36
+ ["userOrderId", (0, kit_1.getU32Decoder)()],
37
+ ["liquidatorOrderId", (0, kit_1.getU32Decoder)()],
38
+ ["liquidatorFee", (0, kit_1.getU64Decoder)()],
39
+ ["ifFee", (0, kit_1.getU64Decoder)()],
40
+ ]);
41
+ }
42
+ function getLiquidatePerpRecordCodec() {
43
+ return (0, kit_1.combineCodec)(getLiquidatePerpRecordEncoder(), getLiquidatePerpRecordDecoder());
44
+ }
@@ -0,0 +1,33 @@
1
+ /**
2
+ * This code was AUTOGENERATED using the Codama library.
3
+ * Please DO NOT EDIT THIS FILE, instead use visitors
4
+ * to add features, then rerun Codama to update it.
5
+ *
6
+ * @see https://github.com/codama-idl/codama
7
+ */
8
+ import { type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder } from "@solana/kit";
9
+ export type LiquidateSpotRecord = {
10
+ assetMarketIndex: number;
11
+ assetPrice: bigint;
12
+ assetTransfer: bigint;
13
+ liabilityMarketIndex: number;
14
+ liabilityPrice: bigint;
15
+ /** precision: token mint precision */
16
+ liabilityTransfer: bigint;
17
+ /** precision: token mint precision */
18
+ ifFee: bigint;
19
+ };
20
+ export type LiquidateSpotRecordArgs = {
21
+ assetMarketIndex: number;
22
+ assetPrice: number | bigint;
23
+ assetTransfer: number | bigint;
24
+ liabilityMarketIndex: number;
25
+ liabilityPrice: number | bigint;
26
+ /** precision: token mint precision */
27
+ liabilityTransfer: number | bigint;
28
+ /** precision: token mint precision */
29
+ ifFee: number | bigint;
30
+ };
31
+ export declare function getLiquidateSpotRecordEncoder(): FixedSizeEncoder<LiquidateSpotRecordArgs>;
32
+ export declare function getLiquidateSpotRecordDecoder(): FixedSizeDecoder<LiquidateSpotRecord>;
33
+ export declare function getLiquidateSpotRecordCodec(): FixedSizeCodec<LiquidateSpotRecordArgs, LiquidateSpotRecord>;
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ /**
3
+ * This code was AUTOGENERATED using the Codama library.
4
+ * Please DO NOT EDIT THIS FILE, instead use visitors
5
+ * to add features, then rerun Codama to update it.
6
+ *
7
+ * @see https://github.com/codama-idl/codama
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.getLiquidateSpotRecordEncoder = getLiquidateSpotRecordEncoder;
11
+ exports.getLiquidateSpotRecordDecoder = getLiquidateSpotRecordDecoder;
12
+ exports.getLiquidateSpotRecordCodec = getLiquidateSpotRecordCodec;
13
+ const kit_1 = require("@solana/kit");
14
+ function getLiquidateSpotRecordEncoder() {
15
+ return (0, kit_1.getStructEncoder)([
16
+ ["assetMarketIndex", (0, kit_1.getU16Encoder)()],
17
+ ["assetPrice", (0, kit_1.getI64Encoder)()],
18
+ ["assetTransfer", (0, kit_1.getU128Encoder)()],
19
+ ["liabilityMarketIndex", (0, kit_1.getU16Encoder)()],
20
+ ["liabilityPrice", (0, kit_1.getI64Encoder)()],
21
+ ["liabilityTransfer", (0, kit_1.getU128Encoder)()],
22
+ ["ifFee", (0, kit_1.getU64Encoder)()],
23
+ ]);
24
+ }
25
+ function getLiquidateSpotRecordDecoder() {
26
+ return (0, kit_1.getStructDecoder)([
27
+ ["assetMarketIndex", (0, kit_1.getU16Decoder)()],
28
+ ["assetPrice", (0, kit_1.getI64Decoder)()],
29
+ ["assetTransfer", (0, kit_1.getU128Decoder)()],
30
+ ["liabilityMarketIndex", (0, kit_1.getU16Decoder)()],
31
+ ["liabilityPrice", (0, kit_1.getI64Decoder)()],
32
+ ["liabilityTransfer", (0, kit_1.getU128Decoder)()],
33
+ ["ifFee", (0, kit_1.getU64Decoder)()],
34
+ ]);
35
+ }
36
+ function getLiquidateSpotRecordCodec() {
37
+ return (0, kit_1.combineCodec)(getLiquidateSpotRecordEncoder(), getLiquidateSpotRecordDecoder());
38
+ }
@@ -0,0 +1,15 @@
1
+ /**
2
+ * This code was AUTOGENERATED using the Codama library.
3
+ * Please DO NOT EDIT THIS FILE, instead use visitors
4
+ * to add features, then rerun Codama to update it.
5
+ *
6
+ * @see https://github.com/codama-idl/codama
7
+ */
8
+ import { type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder } from "@solana/kit";
9
+ export declare enum LiquidationBitFlag {
10
+ IsolatedPosition = 0
11
+ }
12
+ export type LiquidationBitFlagArgs = LiquidationBitFlag;
13
+ export declare function getLiquidationBitFlagEncoder(): FixedSizeEncoder<LiquidationBitFlagArgs>;
14
+ export declare function getLiquidationBitFlagDecoder(): FixedSizeDecoder<LiquidationBitFlag>;
15
+ export declare function getLiquidationBitFlagCodec(): FixedSizeCodec<LiquidationBitFlagArgs, LiquidationBitFlag>;
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ /**
3
+ * This code was AUTOGENERATED using the Codama library.
4
+ * Please DO NOT EDIT THIS FILE, instead use visitors
5
+ * to add features, then rerun Codama to update it.
6
+ *
7
+ * @see https://github.com/codama-idl/codama
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.LiquidationBitFlag = void 0;
11
+ exports.getLiquidationBitFlagEncoder = getLiquidationBitFlagEncoder;
12
+ exports.getLiquidationBitFlagDecoder = getLiquidationBitFlagDecoder;
13
+ exports.getLiquidationBitFlagCodec = getLiquidationBitFlagCodec;
14
+ const kit_1 = require("@solana/kit");
15
+ var LiquidationBitFlag;
16
+ (function (LiquidationBitFlag) {
17
+ LiquidationBitFlag[LiquidationBitFlag["IsolatedPosition"] = 0] = "IsolatedPosition";
18
+ })(LiquidationBitFlag || (exports.LiquidationBitFlag = LiquidationBitFlag = {}));
19
+ function getLiquidationBitFlagEncoder() {
20
+ return (0, kit_1.getEnumEncoder)(LiquidationBitFlag);
21
+ }
22
+ function getLiquidationBitFlagDecoder() {
23
+ return (0, kit_1.getEnumDecoder)(LiquidationBitFlag);
24
+ }
25
+ function getLiquidationBitFlagCodec() {
26
+ return (0, kit_1.combineCodec)(getLiquidationBitFlagEncoder(), getLiquidationBitFlagDecoder());
27
+ }
@@ -0,0 +1,16 @@
1
+ /**
2
+ * This code was AUTOGENERATED using the Codama library.
3
+ * Please DO NOT EDIT THIS FILE, instead use visitors
4
+ * to add features, then rerun Codama to update it.
5
+ *
6
+ * @see https://github.com/codama-idl/codama
7
+ */
8
+ import { type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder } from "@solana/kit";
9
+ export declare enum LiquidationMultiplierType {
10
+ Discount = 0,
11
+ Premium = 1
12
+ }
13
+ export type LiquidationMultiplierTypeArgs = LiquidationMultiplierType;
14
+ export declare function getLiquidationMultiplierTypeEncoder(): FixedSizeEncoder<LiquidationMultiplierTypeArgs>;
15
+ export declare function getLiquidationMultiplierTypeDecoder(): FixedSizeDecoder<LiquidationMultiplierType>;
16
+ export declare function getLiquidationMultiplierTypeCodec(): FixedSizeCodec<LiquidationMultiplierTypeArgs, LiquidationMultiplierType>;
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ /**
3
+ * This code was AUTOGENERATED using the Codama library.
4
+ * Please DO NOT EDIT THIS FILE, instead use visitors
5
+ * to add features, then rerun Codama to update it.
6
+ *
7
+ * @see https://github.com/codama-idl/codama
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.LiquidationMultiplierType = void 0;
11
+ exports.getLiquidationMultiplierTypeEncoder = getLiquidationMultiplierTypeEncoder;
12
+ exports.getLiquidationMultiplierTypeDecoder = getLiquidationMultiplierTypeDecoder;
13
+ exports.getLiquidationMultiplierTypeCodec = getLiquidationMultiplierTypeCodec;
14
+ const kit_1 = require("@solana/kit");
15
+ var LiquidationMultiplierType;
16
+ (function (LiquidationMultiplierType) {
17
+ LiquidationMultiplierType[LiquidationMultiplierType["Discount"] = 0] = "Discount";
18
+ LiquidationMultiplierType[LiquidationMultiplierType["Premium"] = 1] = "Premium";
19
+ })(LiquidationMultiplierType || (exports.LiquidationMultiplierType = LiquidationMultiplierType = {}));
20
+ function getLiquidationMultiplierTypeEncoder() {
21
+ return (0, kit_1.getEnumEncoder)(LiquidationMultiplierType);
22
+ }
23
+ function getLiquidationMultiplierTypeDecoder() {
24
+ return (0, kit_1.getEnumDecoder)(LiquidationMultiplierType);
25
+ }
26
+ function getLiquidationMultiplierTypeCodec() {
27
+ return (0, kit_1.combineCodec)(getLiquidationMultiplierTypeEncoder(), getLiquidationMultiplierTypeDecoder());
28
+ }
@@ -0,0 +1,20 @@
1
+ /**
2
+ * This code was AUTOGENERATED using the Codama library.
3
+ * Please DO NOT EDIT THIS FILE, instead use visitors
4
+ * to add features, then rerun Codama to update it.
5
+ *
6
+ * @see https://github.com/codama-idl/codama
7
+ */
8
+ import { type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder } from "@solana/kit";
9
+ export declare enum LiquidationType {
10
+ LiquidatePerp = 0,
11
+ LiquidateSpot = 1,
12
+ LiquidateBorrowForPerpPnl = 2,
13
+ LiquidatePerpPnlForDeposit = 3,
14
+ PerpBankruptcy = 4,
15
+ SpotBankruptcy = 5
16
+ }
17
+ export type LiquidationTypeArgs = LiquidationType;
18
+ export declare function getLiquidationTypeEncoder(): FixedSizeEncoder<LiquidationTypeArgs>;
19
+ export declare function getLiquidationTypeDecoder(): FixedSizeDecoder<LiquidationType>;
20
+ export declare function getLiquidationTypeCodec(): FixedSizeCodec<LiquidationTypeArgs, LiquidationType>;
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ /**
3
+ * This code was AUTOGENERATED using the Codama library.
4
+ * Please DO NOT EDIT THIS FILE, instead use visitors
5
+ * to add features, then rerun Codama to update it.
6
+ *
7
+ * @see https://github.com/codama-idl/codama
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.LiquidationType = void 0;
11
+ exports.getLiquidationTypeEncoder = getLiquidationTypeEncoder;
12
+ exports.getLiquidationTypeDecoder = getLiquidationTypeDecoder;
13
+ exports.getLiquidationTypeCodec = getLiquidationTypeCodec;
14
+ const kit_1 = require("@solana/kit");
15
+ var LiquidationType;
16
+ (function (LiquidationType) {
17
+ LiquidationType[LiquidationType["LiquidatePerp"] = 0] = "LiquidatePerp";
18
+ LiquidationType[LiquidationType["LiquidateSpot"] = 1] = "LiquidateSpot";
19
+ LiquidationType[LiquidationType["LiquidateBorrowForPerpPnl"] = 2] = "LiquidateBorrowForPerpPnl";
20
+ LiquidationType[LiquidationType["LiquidatePerpPnlForDeposit"] = 3] = "LiquidatePerpPnlForDeposit";
21
+ LiquidationType[LiquidationType["PerpBankruptcy"] = 4] = "PerpBankruptcy";
22
+ LiquidationType[LiquidationType["SpotBankruptcy"] = 5] = "SpotBankruptcy";
23
+ })(LiquidationType || (exports.LiquidationType = LiquidationType = {}));
24
+ function getLiquidationTypeEncoder() {
25
+ return (0, kit_1.getEnumEncoder)(LiquidationType);
26
+ }
27
+ function getLiquidationTypeDecoder() {
28
+ return (0, kit_1.getEnumDecoder)(LiquidationType);
29
+ }
30
+ function getLiquidationTypeCodec() {
31
+ return (0, kit_1.combineCodec)(getLiquidationTypeEncoder(), getLiquidationTypeDecoder());
32
+ }
@@ -0,0 +1,19 @@
1
+ /**
2
+ * This code was AUTOGENERATED using the Codama library.
3
+ * Please DO NOT EDIT THIS FILE, instead use visitors
4
+ * to add features, then rerun Codama to update it.
5
+ *
6
+ * @see https://github.com/codama-idl/codama
7
+ */
8
+ import { type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder } from "@solana/kit";
9
+ export declare enum LogMode {
10
+ None = 0,
11
+ ExchangeOracle = 1,
12
+ MMOracle = 2,
13
+ SafeMMOracle = 3,
14
+ Margin = 4
15
+ }
16
+ export type LogModeArgs = LogMode;
17
+ export declare function getLogModeEncoder(): FixedSizeEncoder<LogModeArgs>;
18
+ export declare function getLogModeDecoder(): FixedSizeDecoder<LogMode>;
19
+ export declare function getLogModeCodec(): FixedSizeCodec<LogModeArgs, LogMode>;
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ /**
3
+ * This code was AUTOGENERATED using the Codama library.
4
+ * Please DO NOT EDIT THIS FILE, instead use visitors
5
+ * to add features, then rerun Codama to update it.
6
+ *
7
+ * @see https://github.com/codama-idl/codama
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.LogMode = void 0;
11
+ exports.getLogModeEncoder = getLogModeEncoder;
12
+ exports.getLogModeDecoder = getLogModeDecoder;
13
+ exports.getLogModeCodec = getLogModeCodec;
14
+ const kit_1 = require("@solana/kit");
15
+ var LogMode;
16
+ (function (LogMode) {
17
+ LogMode[LogMode["None"] = 0] = "None";
18
+ LogMode[LogMode["ExchangeOracle"] = 1] = "ExchangeOracle";
19
+ LogMode[LogMode["MMOracle"] = 2] = "MMOracle";
20
+ LogMode[LogMode["SafeMMOracle"] = 3] = "SafeMMOracle";
21
+ LogMode[LogMode["Margin"] = 4] = "Margin";
22
+ })(LogMode || (exports.LogMode = LogMode = {}));
23
+ function getLogModeEncoder() {
24
+ return (0, kit_1.getEnumEncoder)(LogMode);
25
+ }
26
+ function getLogModeDecoder() {
27
+ return (0, kit_1.getEnumDecoder)(LogMode);
28
+ }
29
+ function getLogModeCodec() {
30
+ return (0, kit_1.combineCodec)(getLogModeEncoder(), getLogModeDecoder());
31
+ }
@@ -0,0 +1,17 @@
1
+ /**
2
+ * This code was AUTOGENERATED using the Codama library.
3
+ * Please DO NOT EDIT THIS FILE, instead use visitors
4
+ * to add features, then rerun Codama to update it.
5
+ *
6
+ * @see https://github.com/codama-idl/codama
7
+ */
8
+ import { type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder } from "@solana/kit";
9
+ export declare enum LpPoolFeatureBitFlags {
10
+ SettleLpPool = 0,
11
+ SwapLpPool = 1,
12
+ MintRedeemLpPool = 2
13
+ }
14
+ export type LpPoolFeatureBitFlagsArgs = LpPoolFeatureBitFlags;
15
+ export declare function getLpPoolFeatureBitFlagsEncoder(): FixedSizeEncoder<LpPoolFeatureBitFlagsArgs>;
16
+ export declare function getLpPoolFeatureBitFlagsDecoder(): FixedSizeDecoder<LpPoolFeatureBitFlags>;
17
+ export declare function getLpPoolFeatureBitFlagsCodec(): FixedSizeCodec<LpPoolFeatureBitFlagsArgs, LpPoolFeatureBitFlags>;
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ /**
3
+ * This code was AUTOGENERATED using the Codama library.
4
+ * Please DO NOT EDIT THIS FILE, instead use visitors
5
+ * to add features, then rerun Codama to update it.
6
+ *
7
+ * @see https://github.com/codama-idl/codama
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.LpPoolFeatureBitFlags = void 0;
11
+ exports.getLpPoolFeatureBitFlagsEncoder = getLpPoolFeatureBitFlagsEncoder;
12
+ exports.getLpPoolFeatureBitFlagsDecoder = getLpPoolFeatureBitFlagsDecoder;
13
+ exports.getLpPoolFeatureBitFlagsCodec = getLpPoolFeatureBitFlagsCodec;
14
+ const kit_1 = require("@solana/kit");
15
+ var LpPoolFeatureBitFlags;
16
+ (function (LpPoolFeatureBitFlags) {
17
+ LpPoolFeatureBitFlags[LpPoolFeatureBitFlags["SettleLpPool"] = 0] = "SettleLpPool";
18
+ LpPoolFeatureBitFlags[LpPoolFeatureBitFlags["SwapLpPool"] = 1] = "SwapLpPool";
19
+ LpPoolFeatureBitFlags[LpPoolFeatureBitFlags["MintRedeemLpPool"] = 2] = "MintRedeemLpPool";
20
+ })(LpPoolFeatureBitFlags || (exports.LpPoolFeatureBitFlags = LpPoolFeatureBitFlags = {}));
21
+ function getLpPoolFeatureBitFlagsEncoder() {
22
+ return (0, kit_1.getEnumEncoder)(LpPoolFeatureBitFlags);
23
+ }
24
+ function getLpPoolFeatureBitFlagsDecoder() {
25
+ return (0, kit_1.getEnumDecoder)(LpPoolFeatureBitFlags);
26
+ }
27
+ function getLpPoolFeatureBitFlagsCodec() {
28
+ return (0, kit_1.combineCodec)(getLpPoolFeatureBitFlagsEncoder(), getLpPoolFeatureBitFlagsDecoder());
29
+ }
@@ -0,0 +1,17 @@
1
+ /**
2
+ * This code was AUTOGENERATED using the Codama library.
3
+ * Please DO NOT EDIT THIS FILE, instead use visitors
4
+ * to add features, then rerun Codama to update it.
5
+ *
6
+ * @see https://github.com/codama-idl/codama
7
+ */
8
+ import { type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder } from "@solana/kit";
9
+ export declare enum LpStatus {
10
+ Uncollateralized = 0,
11
+ Active = 1,
12
+ Decommissioning = 2
13
+ }
14
+ export type LpStatusArgs = LpStatus;
15
+ export declare function getLpStatusEncoder(): FixedSizeEncoder<LpStatusArgs>;
16
+ export declare function getLpStatusDecoder(): FixedSizeDecoder<LpStatus>;
17
+ export declare function getLpStatusCodec(): FixedSizeCodec<LpStatusArgs, LpStatus>;
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ /**
3
+ * This code was AUTOGENERATED using the Codama library.
4
+ * Please DO NOT EDIT THIS FILE, instead use visitors
5
+ * to add features, then rerun Codama to update it.
6
+ *
7
+ * @see https://github.com/codama-idl/codama
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.LpStatus = void 0;
11
+ exports.getLpStatusEncoder = getLpStatusEncoder;
12
+ exports.getLpStatusDecoder = getLpStatusDecoder;
13
+ exports.getLpStatusCodec = getLpStatusCodec;
14
+ const kit_1 = require("@solana/kit");
15
+ var LpStatus;
16
+ (function (LpStatus) {
17
+ LpStatus[LpStatus["Uncollateralized"] = 0] = "Uncollateralized";
18
+ LpStatus[LpStatus["Active"] = 1] = "Active";
19
+ LpStatus[LpStatus["Decommissioning"] = 2] = "Decommissioning";
20
+ })(LpStatus || (exports.LpStatus = LpStatus = {}));
21
+ function getLpStatusEncoder() {
22
+ return (0, kit_1.getEnumEncoder)(LpStatus);
23
+ }
24
+ function getLpStatusDecoder() {
25
+ return (0, kit_1.getEnumDecoder)(LpStatus);
26
+ }
27
+ function getLpStatusCodec() {
28
+ return (0, kit_1.combineCodec)(getLpStatusEncoder(), getLpStatusDecoder());
29
+ }
@@ -0,0 +1,29 @@
1
+ /**
2
+ * This code was AUTOGENERATED using the Codama library.
3
+ * Please DO NOT EDIT THIS FILE, instead use visitors
4
+ * to add features, then rerun Codama to update it.
5
+ *
6
+ * @see https://github.com/codama-idl/codama
7
+ */
8
+ import { type Codec, type Decoder, type Encoder, type GetDiscriminatedUnionVariant, type GetDiscriminatedUnionVariantContent, type Option, type OptionOrNullable } from "@solana/kit";
9
+ import { type MarketIdentifier, type MarketIdentifierArgs } from ".";
10
+ export type MarginCalculationMode = {
11
+ __kind: "Standard";
12
+ } | {
13
+ __kind: "Liquidation";
14
+ marketToTrackMarginRequirement: Option<MarketIdentifier>;
15
+ };
16
+ export type MarginCalculationModeArgs = {
17
+ __kind: "Standard";
18
+ } | {
19
+ __kind: "Liquidation";
20
+ marketToTrackMarginRequirement: OptionOrNullable<MarketIdentifierArgs>;
21
+ };
22
+ export declare function getMarginCalculationModeEncoder(): Encoder<MarginCalculationModeArgs>;
23
+ export declare function getMarginCalculationModeDecoder(): Decoder<MarginCalculationMode>;
24
+ export declare function getMarginCalculationModeCodec(): Codec<MarginCalculationModeArgs, MarginCalculationMode>;
25
+ export declare function marginCalculationMode(kind: "Standard"): GetDiscriminatedUnionVariant<MarginCalculationModeArgs, "__kind", "Standard">;
26
+ export declare function marginCalculationMode(kind: "Liquidation", data: GetDiscriminatedUnionVariantContent<MarginCalculationModeArgs, "__kind", "Liquidation">): GetDiscriminatedUnionVariant<MarginCalculationModeArgs, "__kind", "Liquidation">;
27
+ export declare function isMarginCalculationMode<K extends MarginCalculationMode["__kind"]>(kind: K, value: MarginCalculationMode): value is MarginCalculationMode & {
28
+ __kind: K;
29
+ };
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ /**
3
+ * This code was AUTOGENERATED using the Codama library.
4
+ * Please DO NOT EDIT THIS FILE, instead use visitors
5
+ * to add features, then rerun Codama to update it.
6
+ *
7
+ * @see https://github.com/codama-idl/codama
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.getMarginCalculationModeEncoder = getMarginCalculationModeEncoder;
11
+ exports.getMarginCalculationModeDecoder = getMarginCalculationModeDecoder;
12
+ exports.getMarginCalculationModeCodec = getMarginCalculationModeCodec;
13
+ exports.marginCalculationMode = marginCalculationMode;
14
+ exports.isMarginCalculationMode = isMarginCalculationMode;
15
+ const kit_1 = require("@solana/kit");
16
+ const _1 = require(".");
17
+ function getMarginCalculationModeEncoder() {
18
+ return (0, kit_1.getDiscriminatedUnionEncoder)([
19
+ ["Standard", (0, kit_1.getUnitEncoder)()],
20
+ [
21
+ "Liquidation",
22
+ (0, kit_1.getStructEncoder)([
23
+ [
24
+ "marketToTrackMarginRequirement",
25
+ (0, kit_1.getOptionEncoder)((0, _1.getMarketIdentifierEncoder)()),
26
+ ],
27
+ ]),
28
+ ],
29
+ ]);
30
+ }
31
+ function getMarginCalculationModeDecoder() {
32
+ return (0, kit_1.getDiscriminatedUnionDecoder)([
33
+ ["Standard", (0, kit_1.getUnitDecoder)()],
34
+ [
35
+ "Liquidation",
36
+ (0, kit_1.getStructDecoder)([
37
+ [
38
+ "marketToTrackMarginRequirement",
39
+ (0, kit_1.getOptionDecoder)((0, _1.getMarketIdentifierDecoder)()),
40
+ ],
41
+ ]),
42
+ ],
43
+ ]);
44
+ }
45
+ function getMarginCalculationModeCodec() {
46
+ return (0, kit_1.combineCodec)(getMarginCalculationModeEncoder(), getMarginCalculationModeDecoder());
47
+ }
48
+ function marginCalculationMode(kind, data) {
49
+ return Array.isArray(data)
50
+ ? { __kind: kind, fields: data }
51
+ : Object.assign({ __kind: kind }, (data !== null && data !== void 0 ? data : {}));
52
+ }
53
+ function isMarginCalculationMode(kind, value) {
54
+ return value.__kind === kind;
55
+ }
@@ -0,0 +1,17 @@
1
+ /**
2
+ * This code was AUTOGENERATED using the Codama library.
3
+ * Please DO NOT EDIT THIS FILE, instead use visitors
4
+ * to add features, then rerun Codama to update it.
5
+ *
6
+ * @see https://github.com/codama-idl/codama
7
+ */
8
+ import { type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder } from "@solana/kit";
9
+ export declare enum MarginMode {
10
+ Default = 0,
11
+ HighLeverage = 1,
12
+ HighLeverageMaintenance = 2
13
+ }
14
+ export type MarginModeArgs = MarginMode;
15
+ export declare function getMarginModeEncoder(): FixedSizeEncoder<MarginModeArgs>;
16
+ export declare function getMarginModeDecoder(): FixedSizeDecoder<MarginMode>;
17
+ export declare function getMarginModeCodec(): FixedSizeCodec<MarginModeArgs, MarginMode>;
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ /**
3
+ * This code was AUTOGENERATED using the Codama library.
4
+ * Please DO NOT EDIT THIS FILE, instead use visitors
5
+ * to add features, then rerun Codama to update it.
6
+ *
7
+ * @see https://github.com/codama-idl/codama
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.MarginMode = void 0;
11
+ exports.getMarginModeEncoder = getMarginModeEncoder;
12
+ exports.getMarginModeDecoder = getMarginModeDecoder;
13
+ exports.getMarginModeCodec = getMarginModeCodec;
14
+ const kit_1 = require("@solana/kit");
15
+ var MarginMode;
16
+ (function (MarginMode) {
17
+ MarginMode[MarginMode["Default"] = 0] = "Default";
18
+ MarginMode[MarginMode["HighLeverage"] = 1] = "HighLeverage";
19
+ MarginMode[MarginMode["HighLeverageMaintenance"] = 2] = "HighLeverageMaintenance";
20
+ })(MarginMode || (exports.MarginMode = MarginMode = {}));
21
+ function getMarginModeEncoder() {
22
+ return (0, kit_1.getEnumEncoder)(MarginMode);
23
+ }
24
+ function getMarginModeDecoder() {
25
+ return (0, kit_1.getEnumDecoder)(MarginMode);
26
+ }
27
+ function getMarginModeCodec() {
28
+ return (0, kit_1.combineCodec)(getMarginModeEncoder(), getMarginModeDecoder());
29
+ }
@@ -0,0 +1,17 @@
1
+ /**
2
+ * This code was AUTOGENERATED using the Codama library.
3
+ * Please DO NOT EDIT THIS FILE, instead use visitors
4
+ * to add features, then rerun Codama to update it.
5
+ *
6
+ * @see https://github.com/codama-idl/codama
7
+ */
8
+ import { type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder } from "@solana/kit";
9
+ export declare enum MarginRequirementType {
10
+ Initial = 0,
11
+ Fill = 1,
12
+ Maintenance = 2
13
+ }
14
+ export type MarginRequirementTypeArgs = MarginRequirementType;
15
+ export declare function getMarginRequirementTypeEncoder(): FixedSizeEncoder<MarginRequirementTypeArgs>;
16
+ export declare function getMarginRequirementTypeDecoder(): FixedSizeDecoder<MarginRequirementType>;
17
+ export declare function getMarginRequirementTypeCodec(): FixedSizeCodec<MarginRequirementTypeArgs, MarginRequirementType>;
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ /**
3
+ * This code was AUTOGENERATED using the Codama library.
4
+ * Please DO NOT EDIT THIS FILE, instead use visitors
5
+ * to add features, then rerun Codama to update it.
6
+ *
7
+ * @see https://github.com/codama-idl/codama
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.MarginRequirementType = void 0;
11
+ exports.getMarginRequirementTypeEncoder = getMarginRequirementTypeEncoder;
12
+ exports.getMarginRequirementTypeDecoder = getMarginRequirementTypeDecoder;
13
+ exports.getMarginRequirementTypeCodec = getMarginRequirementTypeCodec;
14
+ const kit_1 = require("@solana/kit");
15
+ var MarginRequirementType;
16
+ (function (MarginRequirementType) {
17
+ MarginRequirementType[MarginRequirementType["Initial"] = 0] = "Initial";
18
+ MarginRequirementType[MarginRequirementType["Fill"] = 1] = "Fill";
19
+ MarginRequirementType[MarginRequirementType["Maintenance"] = 2] = "Maintenance";
20
+ })(MarginRequirementType || (exports.MarginRequirementType = MarginRequirementType = {}));
21
+ function getMarginRequirementTypeEncoder() {
22
+ return (0, kit_1.getEnumEncoder)(MarginRequirementType);
23
+ }
24
+ function getMarginRequirementTypeDecoder() {
25
+ return (0, kit_1.getEnumDecoder)(MarginRequirementType);
26
+ }
27
+ function getMarginRequirementTypeCodec() {
28
+ return (0, kit_1.combineCodec)(getMarginRequirementTypeEncoder(), getMarginRequirementTypeDecoder());
29
+ }