@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.
- package/dist/helpers/drift/accounts/index.d.ts +10 -0
- package/dist/helpers/drift/accounts/index.js +26 -0
- package/dist/helpers/drift/accounts/spotMarket.d.ts +541 -0
- package/dist/helpers/drift/accounts/spotMarket.js +213 -0
- package/dist/helpers/drift/accounts/user.d.ts +193 -0
- package/dist/helpers/drift/accounts/user.js +147 -0
- package/dist/helpers/drift/accounts/userStats.d.ts +165 -0
- package/dist/helpers/drift/accounts/userStats.js +137 -0
- package/dist/helpers/drift/index.d.ts +10 -0
- package/dist/helpers/drift/index.js +26 -0
- package/dist/helpers/drift/mappers.d.ts +14 -0
- package/dist/helpers/drift/mappers.js +137 -0
- package/dist/helpers/drift/types/aMM.d.ts +656 -0
- package/dist/helpers/drift/types/aMM.js +199 -0
- package/dist/helpers/drift/types/addAmmConstituentMappingDatum.d.ts +21 -0
- package/dist/helpers/drift/types/addAmmConstituentMappingDatum.js +30 -0
- package/dist/helpers/drift/types/ammCacheFixed.d.ts +17 -0
- package/dist/helpers/drift/types/ammCacheFixed.js +30 -0
- package/dist/helpers/drift/types/ammConstituentDatum.d.ts +27 -0
- package/dist/helpers/drift/types/ammConstituentDatum.js +34 -0
- package/dist/helpers/drift/types/ammConstituentMappingFixed.d.ts +18 -0
- package/dist/helpers/drift/types/ammConstituentMappingFixed.js +32 -0
- package/dist/helpers/drift/types/assetTier.d.ts +19 -0
- package/dist/helpers/drift/types/assetTier.js +31 -0
- package/dist/helpers/drift/types/assetType.d.ts +16 -0
- package/dist/helpers/drift/types/assetType.js +28 -0
- package/dist/helpers/drift/types/builderInfo.d.ts +17 -0
- package/dist/helpers/drift/types/builderInfo.js +30 -0
- package/dist/helpers/drift/types/cacheInfo.d.ts +59 -0
- package/dist/helpers/drift/types/cacheInfo.js +66 -0
- package/dist/helpers/drift/types/constituentCorrelationsFixed.d.ts +19 -0
- package/dist/helpers/drift/types/constituentCorrelationsFixed.js +32 -0
- package/dist/helpers/drift/types/constituentLpOperation.d.ts +17 -0
- package/dist/helpers/drift/types/constituentLpOperation.js +29 -0
- package/dist/helpers/drift/types/constituentSpotBalance.d.ts +48 -0
- package/dist/helpers/drift/types/constituentSpotBalance.js +35 -0
- package/dist/helpers/drift/types/constituentStatus.d.ts +16 -0
- package/dist/helpers/drift/types/constituentStatus.js +28 -0
- package/dist/helpers/drift/types/constituentTargetBaseFixed.d.ts +19 -0
- package/dist/helpers/drift/types/constituentTargetBaseFixed.js +32 -0
- package/dist/helpers/drift/types/contractTier.d.ts +20 -0
- package/dist/helpers/drift/types/contractTier.js +32 -0
- package/dist/helpers/drift/types/contractType.d.ts +17 -0
- package/dist/helpers/drift/types/contractType.js +29 -0
- package/dist/helpers/drift/types/depositDirection.d.ts +16 -0
- package/dist/helpers/drift/types/depositDirection.js +28 -0
- package/dist/helpers/drift/types/depositExplanation.d.ts +19 -0
- package/dist/helpers/drift/types/depositExplanation.js +31 -0
- package/dist/helpers/drift/types/driftAction.d.ts +29 -0
- package/dist/helpers/drift/types/driftAction.js +41 -0
- package/dist/helpers/drift/types/exchangeStatus.d.ts +22 -0
- package/dist/helpers/drift/types/exchangeStatus.js +34 -0
- package/dist/helpers/drift/types/featureBitFlags.d.ts +18 -0
- package/dist/helpers/drift/types/featureBitFlags.js +30 -0
- package/dist/helpers/drift/types/feeStructure.d.ts +24 -0
- package/dist/helpers/drift/types/feeStructure.js +33 -0
- package/dist/helpers/drift/types/feeTier.d.ts +22 -0
- package/dist/helpers/drift/types/feeTier.js +40 -0
- package/dist/helpers/drift/types/fillMode.d.ts +29 -0
- package/dist/helpers/drift/types/fillMode.js +52 -0
- package/dist/helpers/drift/types/fuelOverflowStatus.d.ts +15 -0
- package/dist/helpers/drift/types/fuelOverflowStatus.js +27 -0
- package/dist/helpers/drift/types/historicalIndexData.d.ts +35 -0
- package/dist/helpers/drift/types/historicalIndexData.js +34 -0
- package/dist/helpers/drift/types/historicalOracleData.d.ts +39 -0
- package/dist/helpers/drift/types/historicalOracleData.js +36 -0
- package/dist/helpers/drift/types/ifRebalanceConfigParams.d.ts +31 -0
- package/dist/helpers/drift/types/ifRebalanceConfigParams.js +40 -0
- package/dist/helpers/drift/types/index.d.ts +114 -0
- package/dist/helpers/drift/types/index.js +130 -0
- package/dist/helpers/drift/types/insuranceClaim.d.ts +63 -0
- package/dist/helpers/drift/types/insuranceClaim.js +34 -0
- package/dist/helpers/drift/types/insuranceFund.d.ts +33 -0
- package/dist/helpers/drift/types/insuranceFund.js +42 -0
- package/dist/helpers/drift/types/insuranceFundOperation.d.ts +18 -0
- package/dist/helpers/drift/types/insuranceFundOperation.js +30 -0
- package/dist/helpers/drift/types/lPAction.d.ts +18 -0
- package/dist/helpers/drift/types/lPAction.js +30 -0
- package/dist/helpers/drift/types/liquidateBorrowForPerpPnlRecord.d.ts +27 -0
- package/dist/helpers/drift/types/liquidateBorrowForPerpPnlRecord.js +36 -0
- package/dist/helpers/drift/types/liquidatePerpPnlForDepositRecord.d.ts +27 -0
- package/dist/helpers/drift/types/liquidatePerpPnlForDepositRecord.js +36 -0
- package/dist/helpers/drift/types/liquidatePerpRecord.d.ts +41 -0
- package/dist/helpers/drift/types/liquidatePerpRecord.js +44 -0
- package/dist/helpers/drift/types/liquidateSpotRecord.d.ts +33 -0
- package/dist/helpers/drift/types/liquidateSpotRecord.js +38 -0
- package/dist/helpers/drift/types/liquidationBitFlag.d.ts +15 -0
- package/dist/helpers/drift/types/liquidationBitFlag.js +27 -0
- package/dist/helpers/drift/types/liquidationMultiplierType.d.ts +16 -0
- package/dist/helpers/drift/types/liquidationMultiplierType.js +28 -0
- package/dist/helpers/drift/types/liquidationType.d.ts +20 -0
- package/dist/helpers/drift/types/liquidationType.js +32 -0
- package/dist/helpers/drift/types/logMode.d.ts +19 -0
- package/dist/helpers/drift/types/logMode.js +31 -0
- package/dist/helpers/drift/types/lpPoolFeatureBitFlags.d.ts +17 -0
- package/dist/helpers/drift/types/lpPoolFeatureBitFlags.js +29 -0
- package/dist/helpers/drift/types/lpStatus.d.ts +17 -0
- package/dist/helpers/drift/types/lpStatus.js +29 -0
- package/dist/helpers/drift/types/marginCalculationMode.d.ts +29 -0
- package/dist/helpers/drift/types/marginCalculationMode.js +55 -0
- package/dist/helpers/drift/types/marginMode.d.ts +17 -0
- package/dist/helpers/drift/types/marginMode.js +29 -0
- package/dist/helpers/drift/types/marginRequirementType.d.ts +17 -0
- package/dist/helpers/drift/types/marginRequirementType.js +29 -0
- package/dist/helpers/drift/types/marketIdentifier.d.ts +20 -0
- package/dist/helpers/drift/types/marketIdentifier.js +29 -0
- package/dist/helpers/drift/types/marketStatus.d.ts +23 -0
- package/dist/helpers/drift/types/marketStatus.js +35 -0
- package/dist/helpers/drift/types/marketType.d.ts +16 -0
- package/dist/helpers/drift/types/marketType.js +28 -0
- package/dist/helpers/drift/types/modifyOrderId.d.ts +24 -0
- package/dist/helpers/drift/types/modifyOrderId.js +50 -0
- package/dist/helpers/drift/types/modifyOrderParams.d.ts +44 -0
- package/dist/helpers/drift/types/modifyOrderParams.js +53 -0
- package/dist/helpers/drift/types/modifyOrderPolicy.d.ts +16 -0
- package/dist/helpers/drift/types/modifyOrderPolicy.js +28 -0
- package/dist/helpers/drift/types/oracleGuardRails.d.ts +20 -0
- package/dist/helpers/drift/types/oracleGuardRails.js +29 -0
- package/dist/helpers/drift/types/oracleSource.d.ts +30 -0
- package/dist/helpers/drift/types/oracleSource.js +42 -0
- package/dist/helpers/drift/types/oracleValidity.d.ts +39 -0
- package/dist/helpers/drift/types/oracleValidity.js +60 -0
- package/dist/helpers/drift/types/order.d.ts +178 -0
- package/dist/helpers/drift/types/order.js +77 -0
- package/dist/helpers/drift/types/orderAction.d.ts +19 -0
- package/dist/helpers/drift/types/orderAction.js +31 -0
- package/dist/helpers/drift/types/orderActionExplanation.d.ts +35 -0
- package/dist/helpers/drift/types/orderActionExplanation.js +47 -0
- package/dist/helpers/drift/types/orderBitFlag.d.ts +20 -0
- package/dist/helpers/drift/types/orderBitFlag.js +32 -0
- package/dist/helpers/drift/types/orderFillerRewardStructure.d.ts +21 -0
- package/dist/helpers/drift/types/orderFillerRewardStructure.js +30 -0
- package/dist/helpers/drift/types/orderParams.d.ts +50 -0
- package/dist/helpers/drift/types/orderParams.js +59 -0
- package/dist/helpers/drift/types/orderParamsBitFlag.d.ts +16 -0
- package/dist/helpers/drift/types/orderParamsBitFlag.js +28 -0
- package/dist/helpers/drift/types/orderStatus.d.ts +18 -0
- package/dist/helpers/drift/types/orderStatus.js +30 -0
- package/dist/helpers/drift/types/orderTriggerCondition.d.ts +18 -0
- package/dist/helpers/drift/types/orderTriggerCondition.js +30 -0
- package/dist/helpers/drift/types/orderType.d.ts +19 -0
- package/dist/helpers/drift/types/orderType.js +31 -0
- package/dist/helpers/drift/types/perpBankruptcyRecord.d.ts +27 -0
- package/dist/helpers/drift/types/perpBankruptcyRecord.js +36 -0
- package/dist/helpers/drift/types/perpFulfillmentMethod.d.ts +30 -0
- package/dist/helpers/drift/types/perpFulfillmentMethod.js +72 -0
- package/dist/helpers/drift/types/perpLpOperation.d.ts +16 -0
- package/dist/helpers/drift/types/perpLpOperation.js +28 -0
- package/dist/helpers/drift/types/perpOperation.d.ts +22 -0
- package/dist/helpers/drift/types/perpOperation.js +34 -0
- package/dist/helpers/drift/types/perpPosition.d.ts +149 -0
- package/dist/helpers/drift/types/perpPosition.js +56 -0
- package/dist/helpers/drift/types/placeAndTakeOrderSuccessCondition.d.ts +16 -0
- package/dist/helpers/drift/types/placeAndTakeOrderSuccessCondition.js +28 -0
- package/dist/helpers/drift/types/poolBalance.d.ts +33 -0
- package/dist/helpers/drift/types/poolBalance.js +30 -0
- package/dist/helpers/drift/types/positionDirection.d.ts +16 -0
- package/dist/helpers/drift/types/positionDirection.js +28 -0
- package/dist/helpers/drift/types/positionFlag.d.ts +17 -0
- package/dist/helpers/drift/types/positionFlag.js +29 -0
- package/dist/helpers/drift/types/positionUpdateType.d.ts +19 -0
- package/dist/helpers/drift/types/positionUpdateType.js +31 -0
- package/dist/helpers/drift/types/postOnlyParam.d.ts +18 -0
- package/dist/helpers/drift/types/postOnlyParam.js +30 -0
- package/dist/helpers/drift/types/prelaunchOracleParams.d.ts +21 -0
- package/dist/helpers/drift/types/prelaunchOracleParams.js +30 -0
- package/dist/helpers/drift/types/priceDivergenceGuardRails.d.ts +19 -0
- package/dist/helpers/drift/types/priceDivergenceGuardRails.js +28 -0
- package/dist/helpers/drift/types/referrerStatus.d.ts +17 -0
- package/dist/helpers/drift/types/referrerStatus.js +29 -0
- package/dist/helpers/drift/types/revenueShareEscrowFixed.d.ts +21 -0
- package/dist/helpers/drift/types/revenueShareEscrowFixed.js +38 -0
- package/dist/helpers/drift/types/revenueShareOrder.d.ts +80 -0
- package/dist/helpers/drift/types/revenueShareOrder.js +45 -0
- package/dist/helpers/drift/types/revenueShareOrderBitFlag.d.ts +18 -0
- package/dist/helpers/drift/types/revenueShareOrderBitFlag.js +30 -0
- package/dist/helpers/drift/types/settlePnlExplanation.d.ts +16 -0
- package/dist/helpers/drift/types/settlePnlExplanation.js +28 -0
- package/dist/helpers/drift/types/settlePnlMode.d.ts +16 -0
- package/dist/helpers/drift/types/settlePnlMode.js +28 -0
- package/dist/helpers/drift/types/settlementDirection.d.ts +17 -0
- package/dist/helpers/drift/types/settlementDirection.js +29 -0
- package/dist/helpers/drift/types/signatureVerificationError.d.ts +26 -0
- package/dist/helpers/drift/types/signatureVerificationError.js +38 -0
- package/dist/helpers/drift/types/signedMsgOrderId.d.ts +23 -0
- package/dist/helpers/drift/types/signedMsgOrderId.js +32 -0
- package/dist/helpers/drift/types/signedMsgOrderParamsDelegateMessage.d.ts +36 -0
- package/dist/helpers/drift/types/signedMsgOrderParamsDelegateMessage.js +57 -0
- package/dist/helpers/drift/types/signedMsgOrderParamsMessage.d.ts +36 -0
- package/dist/helpers/drift/types/signedMsgOrderParamsMessage.js +57 -0
- package/dist/helpers/drift/types/signedMsgTriggerOrderParams.d.ts +19 -0
- package/dist/helpers/drift/types/signedMsgTriggerOrderParams.js +28 -0
- package/dist/helpers/drift/types/signedMsgUserOrdersFixed.d.ts +17 -0
- package/dist/helpers/drift/types/signedMsgUserOrdersFixed.js +30 -0
- package/dist/helpers/drift/types/spotBalanceType.d.ts +16 -0
- package/dist/helpers/drift/types/spotBalanceType.js +28 -0
- package/dist/helpers/drift/types/spotBankruptcyRecord.d.ts +23 -0
- package/dist/helpers/drift/types/spotBankruptcyRecord.js +32 -0
- package/dist/helpers/drift/types/spotFulfillmentConfigStatus.d.ts +16 -0
- package/dist/helpers/drift/types/spotFulfillmentConfigStatus.js +28 -0
- package/dist/helpers/drift/types/spotFulfillmentMethod.d.ts +23 -0
- package/dist/helpers/drift/types/spotFulfillmentMethod.js +48 -0
- package/dist/helpers/drift/types/spotFulfillmentType.d.ts +18 -0
- package/dist/helpers/drift/types/spotFulfillmentType.js +30 -0
- package/dist/helpers/drift/types/spotOperation.d.ts +19 -0
- package/dist/helpers/drift/types/spotOperation.js +31 -0
- package/dist/helpers/drift/types/spotPosition.d.ts +72 -0
- package/dist/helpers/drift/types/spotPosition.js +41 -0
- package/dist/helpers/drift/types/stakeAction.d.ts +21 -0
- package/dist/helpers/drift/types/stakeAction.js +33 -0
- package/dist/helpers/drift/types/swapDirection.d.ts +16 -0
- package/dist/helpers/drift/types/swapDirection.js +28 -0
- package/dist/helpers/drift/types/swapReduceOnly.d.ts +16 -0
- package/dist/helpers/drift/types/swapReduceOnly.js +28 -0
- package/dist/helpers/drift/types/targetsDatum.d.ts +25 -0
- package/dist/helpers/drift/types/targetsDatum.js +34 -0
- package/dist/helpers/drift/types/tokenProgramFlag.d.ts +16 -0
- package/dist/helpers/drift/types/tokenProgramFlag.js +28 -0
- package/dist/helpers/drift/types/twapPeriod.d.ts +16 -0
- package/dist/helpers/drift/types/twapPeriod.js +28 -0
- package/dist/helpers/drift/types/userFees.d.ts +75 -0
- package/dist/helpers/drift/types/userFees.js +36 -0
- package/dist/helpers/drift/types/userStatsPausedOperations.d.ts +17 -0
- package/dist/helpers/drift/types/userStatsPausedOperations.js +29 -0
- package/dist/helpers/drift/types/userStatus.d.ts +19 -0
- package/dist/helpers/drift/types/userStatus.js +31 -0
- package/dist/helpers/drift/types/validityGuardRails.d.ts +23 -0
- package/dist/helpers/drift/types/validityGuardRails.js +32 -0
- package/dist/helpers/index.d.ts +1 -0
- package/dist/helpers/index.js +17 -0
- package/dist/stablecoins/UsdcPlusStablecoin.d.ts +2 -1
- package/dist/stablecoins/UsdcPlusStablecoin.js +19 -23
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -2
|
@@ -0,0 +1,178 @@
|
|
|
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, type ReadonlyUint8Array } from "@solana/kit";
|
|
9
|
+
import { type MarketType, type MarketTypeArgs, type OrderStatus, type OrderStatusArgs, type OrderTriggerCondition, type OrderTriggerConditionArgs, type OrderType, type OrderTypeArgs, type PositionDirection, type PositionDirectionArgs } from ".";
|
|
10
|
+
export type Order = {
|
|
11
|
+
/** The slot the order was placed */
|
|
12
|
+
slot: bigint;
|
|
13
|
+
/**
|
|
14
|
+
* The limit price for the order (can be 0 for market orders)
|
|
15
|
+
* For orders with an auction, this price isn't used until the auction is complete
|
|
16
|
+
* precision: PRICE_PRECISION
|
|
17
|
+
*/
|
|
18
|
+
price: bigint;
|
|
19
|
+
/**
|
|
20
|
+
* The size of the order
|
|
21
|
+
* precision for perps: BASE_PRECISION
|
|
22
|
+
* precision for spot: token mint precision
|
|
23
|
+
*/
|
|
24
|
+
baseAssetAmount: bigint;
|
|
25
|
+
/**
|
|
26
|
+
* The amount of the order filled
|
|
27
|
+
* precision for perps: BASE_PRECISION
|
|
28
|
+
* precision for spot: token mint precision
|
|
29
|
+
*/
|
|
30
|
+
baseAssetAmountFilled: bigint;
|
|
31
|
+
/**
|
|
32
|
+
* The amount of quote filled for the order
|
|
33
|
+
* precision: QUOTE_PRECISION
|
|
34
|
+
*/
|
|
35
|
+
quoteAssetAmountFilled: bigint;
|
|
36
|
+
/**
|
|
37
|
+
* At what price the order will be triggered. Only relevant for trigger orders
|
|
38
|
+
* precision: PRICE_PRECISION
|
|
39
|
+
*/
|
|
40
|
+
triggerPrice: bigint;
|
|
41
|
+
/**
|
|
42
|
+
* The start price for the auction. Only relevant for market/oracle orders
|
|
43
|
+
* precision: PRICE_PRECISION
|
|
44
|
+
*/
|
|
45
|
+
auctionStartPrice: bigint;
|
|
46
|
+
/**
|
|
47
|
+
* The end price for the auction. Only relevant for market/oracle orders
|
|
48
|
+
* precision: PRICE_PRECISION
|
|
49
|
+
*/
|
|
50
|
+
auctionEndPrice: bigint;
|
|
51
|
+
/** The time when the order will expire */
|
|
52
|
+
maxTs: bigint;
|
|
53
|
+
/**
|
|
54
|
+
* If set, the order limit price is the oracle price + this offset
|
|
55
|
+
* precision: PRICE_PRECISION
|
|
56
|
+
*/
|
|
57
|
+
oraclePriceOffset: number;
|
|
58
|
+
/** The id for the order. Each users has their own order id space */
|
|
59
|
+
orderId: number;
|
|
60
|
+
/** The perp/spot market index */
|
|
61
|
+
marketIndex: number;
|
|
62
|
+
/** Whether the order is open or unused */
|
|
63
|
+
status: OrderStatus;
|
|
64
|
+
/** The type of order */
|
|
65
|
+
orderType: OrderType;
|
|
66
|
+
/** Whether market is spot or perp */
|
|
67
|
+
marketType: MarketType;
|
|
68
|
+
/** User generated order id. Can make it easier to place/cancel orders */
|
|
69
|
+
userOrderId: number;
|
|
70
|
+
/** What the users position was when the order was placed */
|
|
71
|
+
existingPositionDirection: PositionDirection;
|
|
72
|
+
/** Whether the user is going long or short. LONG = bid, SHORT = ask */
|
|
73
|
+
direction: PositionDirection;
|
|
74
|
+
/** Whether the order is allowed to only reduce position size */
|
|
75
|
+
reduceOnly: boolean;
|
|
76
|
+
/** Whether the order must be a maker */
|
|
77
|
+
postOnly: boolean;
|
|
78
|
+
/** Whether the order must be canceled the same slot it is placed */
|
|
79
|
+
immediateOrCancel: boolean;
|
|
80
|
+
/** Whether the order is triggered above or below the trigger price. Only relevant for trigger orders */
|
|
81
|
+
triggerCondition: OrderTriggerCondition;
|
|
82
|
+
/** How many slots the auction lasts */
|
|
83
|
+
auctionDuration: number;
|
|
84
|
+
/** Last 8 bits of the slot the order was posted on-chain (not order slot for signed msg orders) */
|
|
85
|
+
postedSlotTail: number;
|
|
86
|
+
/**
|
|
87
|
+
* Bitflags for further classification
|
|
88
|
+
* 0: is_signed_message
|
|
89
|
+
*/
|
|
90
|
+
bitFlags: number;
|
|
91
|
+
padding: ReadonlyUint8Array;
|
|
92
|
+
};
|
|
93
|
+
export type OrderArgs = {
|
|
94
|
+
/** The slot the order was placed */
|
|
95
|
+
slot: number | bigint;
|
|
96
|
+
/**
|
|
97
|
+
* The limit price for the order (can be 0 for market orders)
|
|
98
|
+
* For orders with an auction, this price isn't used until the auction is complete
|
|
99
|
+
* precision: PRICE_PRECISION
|
|
100
|
+
*/
|
|
101
|
+
price: number | bigint;
|
|
102
|
+
/**
|
|
103
|
+
* The size of the order
|
|
104
|
+
* precision for perps: BASE_PRECISION
|
|
105
|
+
* precision for spot: token mint precision
|
|
106
|
+
*/
|
|
107
|
+
baseAssetAmount: number | bigint;
|
|
108
|
+
/**
|
|
109
|
+
* The amount of the order filled
|
|
110
|
+
* precision for perps: BASE_PRECISION
|
|
111
|
+
* precision for spot: token mint precision
|
|
112
|
+
*/
|
|
113
|
+
baseAssetAmountFilled: number | bigint;
|
|
114
|
+
/**
|
|
115
|
+
* The amount of quote filled for the order
|
|
116
|
+
* precision: QUOTE_PRECISION
|
|
117
|
+
*/
|
|
118
|
+
quoteAssetAmountFilled: number | bigint;
|
|
119
|
+
/**
|
|
120
|
+
* At what price the order will be triggered. Only relevant for trigger orders
|
|
121
|
+
* precision: PRICE_PRECISION
|
|
122
|
+
*/
|
|
123
|
+
triggerPrice: number | bigint;
|
|
124
|
+
/**
|
|
125
|
+
* The start price for the auction. Only relevant for market/oracle orders
|
|
126
|
+
* precision: PRICE_PRECISION
|
|
127
|
+
*/
|
|
128
|
+
auctionStartPrice: number | bigint;
|
|
129
|
+
/**
|
|
130
|
+
* The end price for the auction. Only relevant for market/oracle orders
|
|
131
|
+
* precision: PRICE_PRECISION
|
|
132
|
+
*/
|
|
133
|
+
auctionEndPrice: number | bigint;
|
|
134
|
+
/** The time when the order will expire */
|
|
135
|
+
maxTs: number | bigint;
|
|
136
|
+
/**
|
|
137
|
+
* If set, the order limit price is the oracle price + this offset
|
|
138
|
+
* precision: PRICE_PRECISION
|
|
139
|
+
*/
|
|
140
|
+
oraclePriceOffset: number;
|
|
141
|
+
/** The id for the order. Each users has their own order id space */
|
|
142
|
+
orderId: number;
|
|
143
|
+
/** The perp/spot market index */
|
|
144
|
+
marketIndex: number;
|
|
145
|
+
/** Whether the order is open or unused */
|
|
146
|
+
status: OrderStatusArgs;
|
|
147
|
+
/** The type of order */
|
|
148
|
+
orderType: OrderTypeArgs;
|
|
149
|
+
/** Whether market is spot or perp */
|
|
150
|
+
marketType: MarketTypeArgs;
|
|
151
|
+
/** User generated order id. Can make it easier to place/cancel orders */
|
|
152
|
+
userOrderId: number;
|
|
153
|
+
/** What the users position was when the order was placed */
|
|
154
|
+
existingPositionDirection: PositionDirectionArgs;
|
|
155
|
+
/** Whether the user is going long or short. LONG = bid, SHORT = ask */
|
|
156
|
+
direction: PositionDirectionArgs;
|
|
157
|
+
/** Whether the order is allowed to only reduce position size */
|
|
158
|
+
reduceOnly: boolean;
|
|
159
|
+
/** Whether the order must be a maker */
|
|
160
|
+
postOnly: boolean;
|
|
161
|
+
/** Whether the order must be canceled the same slot it is placed */
|
|
162
|
+
immediateOrCancel: boolean;
|
|
163
|
+
/** Whether the order is triggered above or below the trigger price. Only relevant for trigger orders */
|
|
164
|
+
triggerCondition: OrderTriggerConditionArgs;
|
|
165
|
+
/** How many slots the auction lasts */
|
|
166
|
+
auctionDuration: number;
|
|
167
|
+
/** Last 8 bits of the slot the order was posted on-chain (not order slot for signed msg orders) */
|
|
168
|
+
postedSlotTail: number;
|
|
169
|
+
/**
|
|
170
|
+
* Bitflags for further classification
|
|
171
|
+
* 0: is_signed_message
|
|
172
|
+
*/
|
|
173
|
+
bitFlags: number;
|
|
174
|
+
padding: ReadonlyUint8Array;
|
|
175
|
+
};
|
|
176
|
+
export declare function getOrderEncoder(): FixedSizeEncoder<OrderArgs>;
|
|
177
|
+
export declare function getOrderDecoder(): FixedSizeDecoder<Order>;
|
|
178
|
+
export declare function getOrderCodec(): FixedSizeCodec<OrderArgs, Order>;
|
|
@@ -0,0 +1,77 @@
|
|
|
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.getOrderEncoder = getOrderEncoder;
|
|
11
|
+
exports.getOrderDecoder = getOrderDecoder;
|
|
12
|
+
exports.getOrderCodec = getOrderCodec;
|
|
13
|
+
const kit_1 = require("@solana/kit");
|
|
14
|
+
const _1 = require(".");
|
|
15
|
+
function getOrderEncoder() {
|
|
16
|
+
return (0, kit_1.getStructEncoder)([
|
|
17
|
+
["slot", (0, kit_1.getU64Encoder)()],
|
|
18
|
+
["price", (0, kit_1.getU64Encoder)()],
|
|
19
|
+
["baseAssetAmount", (0, kit_1.getU64Encoder)()],
|
|
20
|
+
["baseAssetAmountFilled", (0, kit_1.getU64Encoder)()],
|
|
21
|
+
["quoteAssetAmountFilled", (0, kit_1.getU64Encoder)()],
|
|
22
|
+
["triggerPrice", (0, kit_1.getU64Encoder)()],
|
|
23
|
+
["auctionStartPrice", (0, kit_1.getI64Encoder)()],
|
|
24
|
+
["auctionEndPrice", (0, kit_1.getI64Encoder)()],
|
|
25
|
+
["maxTs", (0, kit_1.getI64Encoder)()],
|
|
26
|
+
["oraclePriceOffset", (0, kit_1.getI32Encoder)()],
|
|
27
|
+
["orderId", (0, kit_1.getU32Encoder)()],
|
|
28
|
+
["marketIndex", (0, kit_1.getU16Encoder)()],
|
|
29
|
+
["status", (0, _1.getOrderStatusEncoder)()],
|
|
30
|
+
["orderType", (0, _1.getOrderTypeEncoder)()],
|
|
31
|
+
["marketType", (0, _1.getMarketTypeEncoder)()],
|
|
32
|
+
["userOrderId", (0, kit_1.getU8Encoder)()],
|
|
33
|
+
["existingPositionDirection", (0, _1.getPositionDirectionEncoder)()],
|
|
34
|
+
["direction", (0, _1.getPositionDirectionEncoder)()],
|
|
35
|
+
["reduceOnly", (0, kit_1.getBooleanEncoder)()],
|
|
36
|
+
["postOnly", (0, kit_1.getBooleanEncoder)()],
|
|
37
|
+
["immediateOrCancel", (0, kit_1.getBooleanEncoder)()],
|
|
38
|
+
["triggerCondition", (0, _1.getOrderTriggerConditionEncoder)()],
|
|
39
|
+
["auctionDuration", (0, kit_1.getU8Encoder)()],
|
|
40
|
+
["postedSlotTail", (0, kit_1.getU8Encoder)()],
|
|
41
|
+
["bitFlags", (0, kit_1.getU8Encoder)()],
|
|
42
|
+
["padding", (0, kit_1.fixEncoderSize)((0, kit_1.getBytesEncoder)(), 1)],
|
|
43
|
+
]);
|
|
44
|
+
}
|
|
45
|
+
function getOrderDecoder() {
|
|
46
|
+
return (0, kit_1.getStructDecoder)([
|
|
47
|
+
["slot", (0, kit_1.getU64Decoder)()],
|
|
48
|
+
["price", (0, kit_1.getU64Decoder)()],
|
|
49
|
+
["baseAssetAmount", (0, kit_1.getU64Decoder)()],
|
|
50
|
+
["baseAssetAmountFilled", (0, kit_1.getU64Decoder)()],
|
|
51
|
+
["quoteAssetAmountFilled", (0, kit_1.getU64Decoder)()],
|
|
52
|
+
["triggerPrice", (0, kit_1.getU64Decoder)()],
|
|
53
|
+
["auctionStartPrice", (0, kit_1.getI64Decoder)()],
|
|
54
|
+
["auctionEndPrice", (0, kit_1.getI64Decoder)()],
|
|
55
|
+
["maxTs", (0, kit_1.getI64Decoder)()],
|
|
56
|
+
["oraclePriceOffset", (0, kit_1.getI32Decoder)()],
|
|
57
|
+
["orderId", (0, kit_1.getU32Decoder)()],
|
|
58
|
+
["marketIndex", (0, kit_1.getU16Decoder)()],
|
|
59
|
+
["status", (0, _1.getOrderStatusDecoder)()],
|
|
60
|
+
["orderType", (0, _1.getOrderTypeDecoder)()],
|
|
61
|
+
["marketType", (0, _1.getMarketTypeDecoder)()],
|
|
62
|
+
["userOrderId", (0, kit_1.getU8Decoder)()],
|
|
63
|
+
["existingPositionDirection", (0, _1.getPositionDirectionDecoder)()],
|
|
64
|
+
["direction", (0, _1.getPositionDirectionDecoder)()],
|
|
65
|
+
["reduceOnly", (0, kit_1.getBooleanDecoder)()],
|
|
66
|
+
["postOnly", (0, kit_1.getBooleanDecoder)()],
|
|
67
|
+
["immediateOrCancel", (0, kit_1.getBooleanDecoder)()],
|
|
68
|
+
["triggerCondition", (0, _1.getOrderTriggerConditionDecoder)()],
|
|
69
|
+
["auctionDuration", (0, kit_1.getU8Decoder)()],
|
|
70
|
+
["postedSlotTail", (0, kit_1.getU8Decoder)()],
|
|
71
|
+
["bitFlags", (0, kit_1.getU8Decoder)()],
|
|
72
|
+
["padding", (0, kit_1.fixDecoderSize)((0, kit_1.getBytesDecoder)(), 1)],
|
|
73
|
+
]);
|
|
74
|
+
}
|
|
75
|
+
function getOrderCodec() {
|
|
76
|
+
return (0, kit_1.combineCodec)(getOrderEncoder(), getOrderDecoder());
|
|
77
|
+
}
|
|
@@ -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 OrderAction {
|
|
10
|
+
Place = 0,
|
|
11
|
+
Cancel = 1,
|
|
12
|
+
Fill = 2,
|
|
13
|
+
Trigger = 3,
|
|
14
|
+
Expire = 4
|
|
15
|
+
}
|
|
16
|
+
export type OrderActionArgs = OrderAction;
|
|
17
|
+
export declare function getOrderActionEncoder(): FixedSizeEncoder<OrderActionArgs>;
|
|
18
|
+
export declare function getOrderActionDecoder(): FixedSizeDecoder<OrderAction>;
|
|
19
|
+
export declare function getOrderActionCodec(): FixedSizeCodec<OrderActionArgs, OrderAction>;
|
|
@@ -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.OrderAction = void 0;
|
|
11
|
+
exports.getOrderActionEncoder = getOrderActionEncoder;
|
|
12
|
+
exports.getOrderActionDecoder = getOrderActionDecoder;
|
|
13
|
+
exports.getOrderActionCodec = getOrderActionCodec;
|
|
14
|
+
const kit_1 = require("@solana/kit");
|
|
15
|
+
var OrderAction;
|
|
16
|
+
(function (OrderAction) {
|
|
17
|
+
OrderAction[OrderAction["Place"] = 0] = "Place";
|
|
18
|
+
OrderAction[OrderAction["Cancel"] = 1] = "Cancel";
|
|
19
|
+
OrderAction[OrderAction["Fill"] = 2] = "Fill";
|
|
20
|
+
OrderAction[OrderAction["Trigger"] = 3] = "Trigger";
|
|
21
|
+
OrderAction[OrderAction["Expire"] = 4] = "Expire";
|
|
22
|
+
})(OrderAction || (exports.OrderAction = OrderAction = {}));
|
|
23
|
+
function getOrderActionEncoder() {
|
|
24
|
+
return (0, kit_1.getEnumEncoder)(OrderAction);
|
|
25
|
+
}
|
|
26
|
+
function getOrderActionDecoder() {
|
|
27
|
+
return (0, kit_1.getEnumDecoder)(OrderAction);
|
|
28
|
+
}
|
|
29
|
+
function getOrderActionCodec() {
|
|
30
|
+
return (0, kit_1.combineCodec)(getOrderActionEncoder(), getOrderActionDecoder());
|
|
31
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
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 OrderActionExplanation {
|
|
10
|
+
None = 0,
|
|
11
|
+
InsufficientFreeCollateral = 1,
|
|
12
|
+
OraclePriceBreachedLimitPrice = 2,
|
|
13
|
+
MarketOrderFilledToLimitPrice = 3,
|
|
14
|
+
OrderExpired = 4,
|
|
15
|
+
Liquidation = 5,
|
|
16
|
+
OrderFilledWithAMM = 6,
|
|
17
|
+
OrderFilledWithAMMJit = 7,
|
|
18
|
+
OrderFilledWithMatch = 8,
|
|
19
|
+
OrderFilledWithMatchJit = 9,
|
|
20
|
+
MarketExpired = 10,
|
|
21
|
+
RiskingIncreasingOrder = 11,
|
|
22
|
+
ReduceOnlyOrderIncreasedPosition = 12,
|
|
23
|
+
OrderFillWithSerum = 13,
|
|
24
|
+
NoBorrowLiquidity = 14,
|
|
25
|
+
OrderFillWithPhoenix = 15,
|
|
26
|
+
OrderFilledWithAMMJitLPSplit = 16,
|
|
27
|
+
OrderFilledWithLPJit = 17,
|
|
28
|
+
DeriskLp = 18,
|
|
29
|
+
OrderFilledWithOpenbookV2 = 19,
|
|
30
|
+
TransferPerpPosition = 20
|
|
31
|
+
}
|
|
32
|
+
export type OrderActionExplanationArgs = OrderActionExplanation;
|
|
33
|
+
export declare function getOrderActionExplanationEncoder(): FixedSizeEncoder<OrderActionExplanationArgs>;
|
|
34
|
+
export declare function getOrderActionExplanationDecoder(): FixedSizeDecoder<OrderActionExplanation>;
|
|
35
|
+
export declare function getOrderActionExplanationCodec(): FixedSizeCodec<OrderActionExplanationArgs, OrderActionExplanation>;
|
|
@@ -0,0 +1,47 @@
|
|
|
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.OrderActionExplanation = void 0;
|
|
11
|
+
exports.getOrderActionExplanationEncoder = getOrderActionExplanationEncoder;
|
|
12
|
+
exports.getOrderActionExplanationDecoder = getOrderActionExplanationDecoder;
|
|
13
|
+
exports.getOrderActionExplanationCodec = getOrderActionExplanationCodec;
|
|
14
|
+
const kit_1 = require("@solana/kit");
|
|
15
|
+
var OrderActionExplanation;
|
|
16
|
+
(function (OrderActionExplanation) {
|
|
17
|
+
OrderActionExplanation[OrderActionExplanation["None"] = 0] = "None";
|
|
18
|
+
OrderActionExplanation[OrderActionExplanation["InsufficientFreeCollateral"] = 1] = "InsufficientFreeCollateral";
|
|
19
|
+
OrderActionExplanation[OrderActionExplanation["OraclePriceBreachedLimitPrice"] = 2] = "OraclePriceBreachedLimitPrice";
|
|
20
|
+
OrderActionExplanation[OrderActionExplanation["MarketOrderFilledToLimitPrice"] = 3] = "MarketOrderFilledToLimitPrice";
|
|
21
|
+
OrderActionExplanation[OrderActionExplanation["OrderExpired"] = 4] = "OrderExpired";
|
|
22
|
+
OrderActionExplanation[OrderActionExplanation["Liquidation"] = 5] = "Liquidation";
|
|
23
|
+
OrderActionExplanation[OrderActionExplanation["OrderFilledWithAMM"] = 6] = "OrderFilledWithAMM";
|
|
24
|
+
OrderActionExplanation[OrderActionExplanation["OrderFilledWithAMMJit"] = 7] = "OrderFilledWithAMMJit";
|
|
25
|
+
OrderActionExplanation[OrderActionExplanation["OrderFilledWithMatch"] = 8] = "OrderFilledWithMatch";
|
|
26
|
+
OrderActionExplanation[OrderActionExplanation["OrderFilledWithMatchJit"] = 9] = "OrderFilledWithMatchJit";
|
|
27
|
+
OrderActionExplanation[OrderActionExplanation["MarketExpired"] = 10] = "MarketExpired";
|
|
28
|
+
OrderActionExplanation[OrderActionExplanation["RiskingIncreasingOrder"] = 11] = "RiskingIncreasingOrder";
|
|
29
|
+
OrderActionExplanation[OrderActionExplanation["ReduceOnlyOrderIncreasedPosition"] = 12] = "ReduceOnlyOrderIncreasedPosition";
|
|
30
|
+
OrderActionExplanation[OrderActionExplanation["OrderFillWithSerum"] = 13] = "OrderFillWithSerum";
|
|
31
|
+
OrderActionExplanation[OrderActionExplanation["NoBorrowLiquidity"] = 14] = "NoBorrowLiquidity";
|
|
32
|
+
OrderActionExplanation[OrderActionExplanation["OrderFillWithPhoenix"] = 15] = "OrderFillWithPhoenix";
|
|
33
|
+
OrderActionExplanation[OrderActionExplanation["OrderFilledWithAMMJitLPSplit"] = 16] = "OrderFilledWithAMMJitLPSplit";
|
|
34
|
+
OrderActionExplanation[OrderActionExplanation["OrderFilledWithLPJit"] = 17] = "OrderFilledWithLPJit";
|
|
35
|
+
OrderActionExplanation[OrderActionExplanation["DeriskLp"] = 18] = "DeriskLp";
|
|
36
|
+
OrderActionExplanation[OrderActionExplanation["OrderFilledWithOpenbookV2"] = 19] = "OrderFilledWithOpenbookV2";
|
|
37
|
+
OrderActionExplanation[OrderActionExplanation["TransferPerpPosition"] = 20] = "TransferPerpPosition";
|
|
38
|
+
})(OrderActionExplanation || (exports.OrderActionExplanation = OrderActionExplanation = {}));
|
|
39
|
+
function getOrderActionExplanationEncoder() {
|
|
40
|
+
return (0, kit_1.getEnumEncoder)(OrderActionExplanation);
|
|
41
|
+
}
|
|
42
|
+
function getOrderActionExplanationDecoder() {
|
|
43
|
+
return (0, kit_1.getEnumDecoder)(OrderActionExplanation);
|
|
44
|
+
}
|
|
45
|
+
function getOrderActionExplanationCodec() {
|
|
46
|
+
return (0, kit_1.combineCodec)(getOrderActionExplanationEncoder(), getOrderActionExplanationDecoder());
|
|
47
|
+
}
|
|
@@ -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 OrderBitFlag {
|
|
10
|
+
SignedMessage = 0,
|
|
11
|
+
OracleTriggerMarket = 1,
|
|
12
|
+
SafeTriggerOrder = 2,
|
|
13
|
+
NewTriggerReduceOnly = 3,
|
|
14
|
+
HasBuilder = 4,
|
|
15
|
+
IsIsolatedPosition = 5
|
|
16
|
+
}
|
|
17
|
+
export type OrderBitFlagArgs = OrderBitFlag;
|
|
18
|
+
export declare function getOrderBitFlagEncoder(): FixedSizeEncoder<OrderBitFlagArgs>;
|
|
19
|
+
export declare function getOrderBitFlagDecoder(): FixedSizeDecoder<OrderBitFlag>;
|
|
20
|
+
export declare function getOrderBitFlagCodec(): FixedSizeCodec<OrderBitFlagArgs, OrderBitFlag>;
|
|
@@ -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.OrderBitFlag = void 0;
|
|
11
|
+
exports.getOrderBitFlagEncoder = getOrderBitFlagEncoder;
|
|
12
|
+
exports.getOrderBitFlagDecoder = getOrderBitFlagDecoder;
|
|
13
|
+
exports.getOrderBitFlagCodec = getOrderBitFlagCodec;
|
|
14
|
+
const kit_1 = require("@solana/kit");
|
|
15
|
+
var OrderBitFlag;
|
|
16
|
+
(function (OrderBitFlag) {
|
|
17
|
+
OrderBitFlag[OrderBitFlag["SignedMessage"] = 0] = "SignedMessage";
|
|
18
|
+
OrderBitFlag[OrderBitFlag["OracleTriggerMarket"] = 1] = "OracleTriggerMarket";
|
|
19
|
+
OrderBitFlag[OrderBitFlag["SafeTriggerOrder"] = 2] = "SafeTriggerOrder";
|
|
20
|
+
OrderBitFlag[OrderBitFlag["NewTriggerReduceOnly"] = 3] = "NewTriggerReduceOnly";
|
|
21
|
+
OrderBitFlag[OrderBitFlag["HasBuilder"] = 4] = "HasBuilder";
|
|
22
|
+
OrderBitFlag[OrderBitFlag["IsIsolatedPosition"] = 5] = "IsIsolatedPosition";
|
|
23
|
+
})(OrderBitFlag || (exports.OrderBitFlag = OrderBitFlag = {}));
|
|
24
|
+
function getOrderBitFlagEncoder() {
|
|
25
|
+
return (0, kit_1.getEnumEncoder)(OrderBitFlag);
|
|
26
|
+
}
|
|
27
|
+
function getOrderBitFlagDecoder() {
|
|
28
|
+
return (0, kit_1.getEnumDecoder)(OrderBitFlag);
|
|
29
|
+
}
|
|
30
|
+
function getOrderBitFlagCodec() {
|
|
31
|
+
return (0, kit_1.combineCodec)(getOrderBitFlagEncoder(), getOrderBitFlagDecoder());
|
|
32
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
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 OrderFillerRewardStructure = {
|
|
10
|
+
rewardNumerator: number;
|
|
11
|
+
rewardDenominator: number;
|
|
12
|
+
timeBasedRewardLowerBound: bigint;
|
|
13
|
+
};
|
|
14
|
+
export type OrderFillerRewardStructureArgs = {
|
|
15
|
+
rewardNumerator: number;
|
|
16
|
+
rewardDenominator: number;
|
|
17
|
+
timeBasedRewardLowerBound: number | bigint;
|
|
18
|
+
};
|
|
19
|
+
export declare function getOrderFillerRewardStructureEncoder(): FixedSizeEncoder<OrderFillerRewardStructureArgs>;
|
|
20
|
+
export declare function getOrderFillerRewardStructureDecoder(): FixedSizeDecoder<OrderFillerRewardStructure>;
|
|
21
|
+
export declare function getOrderFillerRewardStructureCodec(): FixedSizeCodec<OrderFillerRewardStructureArgs, OrderFillerRewardStructure>;
|
|
@@ -0,0 +1,30 @@
|
|
|
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.getOrderFillerRewardStructureEncoder = getOrderFillerRewardStructureEncoder;
|
|
11
|
+
exports.getOrderFillerRewardStructureDecoder = getOrderFillerRewardStructureDecoder;
|
|
12
|
+
exports.getOrderFillerRewardStructureCodec = getOrderFillerRewardStructureCodec;
|
|
13
|
+
const kit_1 = require("@solana/kit");
|
|
14
|
+
function getOrderFillerRewardStructureEncoder() {
|
|
15
|
+
return (0, kit_1.getStructEncoder)([
|
|
16
|
+
["rewardNumerator", (0, kit_1.getU32Encoder)()],
|
|
17
|
+
["rewardDenominator", (0, kit_1.getU32Encoder)()],
|
|
18
|
+
["timeBasedRewardLowerBound", (0, kit_1.getU128Encoder)()],
|
|
19
|
+
]);
|
|
20
|
+
}
|
|
21
|
+
function getOrderFillerRewardStructureDecoder() {
|
|
22
|
+
return (0, kit_1.getStructDecoder)([
|
|
23
|
+
["rewardNumerator", (0, kit_1.getU32Decoder)()],
|
|
24
|
+
["rewardDenominator", (0, kit_1.getU32Decoder)()],
|
|
25
|
+
["timeBasedRewardLowerBound", (0, kit_1.getU128Decoder)()],
|
|
26
|
+
]);
|
|
27
|
+
}
|
|
28
|
+
function getOrderFillerRewardStructureCodec() {
|
|
29
|
+
return (0, kit_1.combineCodec)(getOrderFillerRewardStructureEncoder(), getOrderFillerRewardStructureDecoder());
|
|
30
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
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 Option, type OptionOrNullable } from "@solana/kit";
|
|
9
|
+
import { type MarketType, type MarketTypeArgs, type OrderTriggerCondition, type OrderTriggerConditionArgs, type OrderType, type OrderTypeArgs, type PositionDirection, type PositionDirectionArgs, type PostOnlyParam, type PostOnlyParamArgs } from ".";
|
|
10
|
+
export type OrderParams = {
|
|
11
|
+
orderType: OrderType;
|
|
12
|
+
marketType: MarketType;
|
|
13
|
+
direction: PositionDirection;
|
|
14
|
+
userOrderId: number;
|
|
15
|
+
baseAssetAmount: bigint;
|
|
16
|
+
price: bigint;
|
|
17
|
+
marketIndex: number;
|
|
18
|
+
reduceOnly: boolean;
|
|
19
|
+
postOnly: PostOnlyParam;
|
|
20
|
+
bitFlags: number;
|
|
21
|
+
maxTs: Option<bigint>;
|
|
22
|
+
triggerPrice: Option<bigint>;
|
|
23
|
+
triggerCondition: OrderTriggerCondition;
|
|
24
|
+
oraclePriceOffset: Option<number>;
|
|
25
|
+
auctionDuration: Option<number>;
|
|
26
|
+
auctionStartPrice: Option<bigint>;
|
|
27
|
+
auctionEndPrice: Option<bigint>;
|
|
28
|
+
};
|
|
29
|
+
export type OrderParamsArgs = {
|
|
30
|
+
orderType: OrderTypeArgs;
|
|
31
|
+
marketType: MarketTypeArgs;
|
|
32
|
+
direction: PositionDirectionArgs;
|
|
33
|
+
userOrderId: number;
|
|
34
|
+
baseAssetAmount: number | bigint;
|
|
35
|
+
price: number | bigint;
|
|
36
|
+
marketIndex: number;
|
|
37
|
+
reduceOnly: boolean;
|
|
38
|
+
postOnly: PostOnlyParamArgs;
|
|
39
|
+
bitFlags: number;
|
|
40
|
+
maxTs: OptionOrNullable<number | bigint>;
|
|
41
|
+
triggerPrice: OptionOrNullable<number | bigint>;
|
|
42
|
+
triggerCondition: OrderTriggerConditionArgs;
|
|
43
|
+
oraclePriceOffset: OptionOrNullable<number>;
|
|
44
|
+
auctionDuration: OptionOrNullable<number>;
|
|
45
|
+
auctionStartPrice: OptionOrNullable<number | bigint>;
|
|
46
|
+
auctionEndPrice: OptionOrNullable<number | bigint>;
|
|
47
|
+
};
|
|
48
|
+
export declare function getOrderParamsEncoder(): Encoder<OrderParamsArgs>;
|
|
49
|
+
export declare function getOrderParamsDecoder(): Decoder<OrderParams>;
|
|
50
|
+
export declare function getOrderParamsCodec(): Codec<OrderParamsArgs, OrderParams>;
|
|
@@ -0,0 +1,59 @@
|
|
|
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.getOrderParamsEncoder = getOrderParamsEncoder;
|
|
11
|
+
exports.getOrderParamsDecoder = getOrderParamsDecoder;
|
|
12
|
+
exports.getOrderParamsCodec = getOrderParamsCodec;
|
|
13
|
+
const kit_1 = require("@solana/kit");
|
|
14
|
+
const _1 = require(".");
|
|
15
|
+
function getOrderParamsEncoder() {
|
|
16
|
+
return (0, kit_1.getStructEncoder)([
|
|
17
|
+
["orderType", (0, _1.getOrderTypeEncoder)()],
|
|
18
|
+
["marketType", (0, _1.getMarketTypeEncoder)()],
|
|
19
|
+
["direction", (0, _1.getPositionDirectionEncoder)()],
|
|
20
|
+
["userOrderId", (0, kit_1.getU8Encoder)()],
|
|
21
|
+
["baseAssetAmount", (0, kit_1.getU64Encoder)()],
|
|
22
|
+
["price", (0, kit_1.getU64Encoder)()],
|
|
23
|
+
["marketIndex", (0, kit_1.getU16Encoder)()],
|
|
24
|
+
["reduceOnly", (0, kit_1.getBooleanEncoder)()],
|
|
25
|
+
["postOnly", (0, _1.getPostOnlyParamEncoder)()],
|
|
26
|
+
["bitFlags", (0, kit_1.getU8Encoder)()],
|
|
27
|
+
["maxTs", (0, kit_1.getOptionEncoder)((0, kit_1.getI64Encoder)())],
|
|
28
|
+
["triggerPrice", (0, kit_1.getOptionEncoder)((0, kit_1.getU64Encoder)())],
|
|
29
|
+
["triggerCondition", (0, _1.getOrderTriggerConditionEncoder)()],
|
|
30
|
+
["oraclePriceOffset", (0, kit_1.getOptionEncoder)((0, kit_1.getI32Encoder)())],
|
|
31
|
+
["auctionDuration", (0, kit_1.getOptionEncoder)((0, kit_1.getU8Encoder)())],
|
|
32
|
+
["auctionStartPrice", (0, kit_1.getOptionEncoder)((0, kit_1.getI64Encoder)())],
|
|
33
|
+
["auctionEndPrice", (0, kit_1.getOptionEncoder)((0, kit_1.getI64Encoder)())],
|
|
34
|
+
]);
|
|
35
|
+
}
|
|
36
|
+
function getOrderParamsDecoder() {
|
|
37
|
+
return (0, kit_1.getStructDecoder)([
|
|
38
|
+
["orderType", (0, _1.getOrderTypeDecoder)()],
|
|
39
|
+
["marketType", (0, _1.getMarketTypeDecoder)()],
|
|
40
|
+
["direction", (0, _1.getPositionDirectionDecoder)()],
|
|
41
|
+
["userOrderId", (0, kit_1.getU8Decoder)()],
|
|
42
|
+
["baseAssetAmount", (0, kit_1.getU64Decoder)()],
|
|
43
|
+
["price", (0, kit_1.getU64Decoder)()],
|
|
44
|
+
["marketIndex", (0, kit_1.getU16Decoder)()],
|
|
45
|
+
["reduceOnly", (0, kit_1.getBooleanDecoder)()],
|
|
46
|
+
["postOnly", (0, _1.getPostOnlyParamDecoder)()],
|
|
47
|
+
["bitFlags", (0, kit_1.getU8Decoder)()],
|
|
48
|
+
["maxTs", (0, kit_1.getOptionDecoder)((0, kit_1.getI64Decoder)())],
|
|
49
|
+
["triggerPrice", (0, kit_1.getOptionDecoder)((0, kit_1.getU64Decoder)())],
|
|
50
|
+
["triggerCondition", (0, _1.getOrderTriggerConditionDecoder)()],
|
|
51
|
+
["oraclePriceOffset", (0, kit_1.getOptionDecoder)((0, kit_1.getI32Decoder)())],
|
|
52
|
+
["auctionDuration", (0, kit_1.getOptionDecoder)((0, kit_1.getU8Decoder)())],
|
|
53
|
+
["auctionStartPrice", (0, kit_1.getOptionDecoder)((0, kit_1.getI64Decoder)())],
|
|
54
|
+
["auctionEndPrice", (0, kit_1.getOptionDecoder)((0, kit_1.getI64Decoder)())],
|
|
55
|
+
]);
|
|
56
|
+
}
|
|
57
|
+
function getOrderParamsCodec() {
|
|
58
|
+
return (0, kit_1.combineCodec)(getOrderParamsEncoder(), getOrderParamsDecoder());
|
|
59
|
+
}
|
|
@@ -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 OrderParamsBitFlag {
|
|
10
|
+
ImmediateOrCancel = 0,
|
|
11
|
+
UpdateHighLeverageMode = 1
|
|
12
|
+
}
|
|
13
|
+
export type OrderParamsBitFlagArgs = OrderParamsBitFlag;
|
|
14
|
+
export declare function getOrderParamsBitFlagEncoder(): FixedSizeEncoder<OrderParamsBitFlagArgs>;
|
|
15
|
+
export declare function getOrderParamsBitFlagDecoder(): FixedSizeDecoder<OrderParamsBitFlag>;
|
|
16
|
+
export declare function getOrderParamsBitFlagCodec(): FixedSizeCodec<OrderParamsBitFlagArgs, OrderParamsBitFlag>;
|
|
@@ -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.OrderParamsBitFlag = void 0;
|
|
11
|
+
exports.getOrderParamsBitFlagEncoder = getOrderParamsBitFlagEncoder;
|
|
12
|
+
exports.getOrderParamsBitFlagDecoder = getOrderParamsBitFlagDecoder;
|
|
13
|
+
exports.getOrderParamsBitFlagCodec = getOrderParamsBitFlagCodec;
|
|
14
|
+
const kit_1 = require("@solana/kit");
|
|
15
|
+
var OrderParamsBitFlag;
|
|
16
|
+
(function (OrderParamsBitFlag) {
|
|
17
|
+
OrderParamsBitFlag[OrderParamsBitFlag["ImmediateOrCancel"] = 0] = "ImmediateOrCancel";
|
|
18
|
+
OrderParamsBitFlag[OrderParamsBitFlag["UpdateHighLeverageMode"] = 1] = "UpdateHighLeverageMode";
|
|
19
|
+
})(OrderParamsBitFlag || (exports.OrderParamsBitFlag = OrderParamsBitFlag = {}));
|
|
20
|
+
function getOrderParamsBitFlagEncoder() {
|
|
21
|
+
return (0, kit_1.getEnumEncoder)(OrderParamsBitFlag);
|
|
22
|
+
}
|
|
23
|
+
function getOrderParamsBitFlagDecoder() {
|
|
24
|
+
return (0, kit_1.getEnumDecoder)(OrderParamsBitFlag);
|
|
25
|
+
}
|
|
26
|
+
function getOrderParamsBitFlagCodec() {
|
|
27
|
+
return (0, kit_1.combineCodec)(getOrderParamsBitFlagEncoder(), getOrderParamsBitFlagDecoder());
|
|
28
|
+
}
|