@epicentral/sos-sdk 0.13.0-beta → 0.13.2-beta
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.
|
@@ -52,192 +52,194 @@ export const OPTION_PROGRAM_ERROR__STALE_ORACLE_PRICE = 0x1780; // 6016
|
|
|
52
52
|
export const OPTION_PROGRAM_ERROR__LOW_ORACLE_PRICE_CONFIDENCE = 0x1781; // 6017
|
|
53
53
|
/** InvalidOracleAccount: Invalid oracle account - cannot parse price feed */
|
|
54
54
|
export const OPTION_PROGRAM_ERROR__INVALID_ORACLE_ACCOUNT = 0x1782; // 6018
|
|
55
|
+
/** VolatilityQuoteUnavailable: Authority volatility quote unavailable or stale */
|
|
56
|
+
export const OPTION_PROGRAM_ERROR__VOLATILITY_QUOTE_UNAVAILABLE = 0x1783; // 6019
|
|
55
57
|
/** InvalidSwitchboardQuoteAccount: Invalid Switchboard quote account */
|
|
56
|
-
export const OPTION_PROGRAM_ERROR__INVALID_SWITCHBOARD_QUOTE_ACCOUNT =
|
|
58
|
+
export const OPTION_PROGRAM_ERROR__INVALID_SWITCHBOARD_QUOTE_ACCOUNT = 0x1784; // 6020
|
|
57
59
|
/** InvalidSwitchboardUpdateProof: Switchboard quote update proof missing or invalid */
|
|
58
|
-
export const OPTION_PROGRAM_ERROR__INVALID_SWITCHBOARD_UPDATE_PROOF =
|
|
60
|
+
export const OPTION_PROGRAM_ERROR__INVALID_SWITCHBOARD_UPDATE_PROOF = 0x1785; // 6021
|
|
59
61
|
/** OraclePriceUnavailable: Oracle price is unavailable */
|
|
60
|
-
export const OPTION_PROGRAM_ERROR__ORACLE_PRICE_UNAVAILABLE =
|
|
62
|
+
export const OPTION_PROGRAM_ERROR__ORACLE_PRICE_UNAVAILABLE = 0x1786; // 6022
|
|
61
63
|
/** InvalidOraclePrice: Invalid oracle price - must be positive */
|
|
62
|
-
export const OPTION_PROGRAM_ERROR__INVALID_ORACLE_PRICE =
|
|
64
|
+
export const OPTION_PROGRAM_ERROR__INVALID_ORACLE_PRICE = 0x1787; // 6023
|
|
63
65
|
/** InsufficientBalance: Insufficient balance for premium payment */
|
|
64
|
-
export const OPTION_PROGRAM_ERROR__INSUFFICIENT_BALANCE =
|
|
66
|
+
export const OPTION_PROGRAM_ERROR__INSUFFICIENT_BALANCE = 0x1788; // 6024
|
|
65
67
|
/** PositionNotFound: Position not found */
|
|
66
|
-
export const OPTION_PROGRAM_ERROR__POSITION_NOT_FOUND =
|
|
68
|
+
export const OPTION_PROGRAM_ERROR__POSITION_NOT_FOUND = 0x1789; // 6025
|
|
67
69
|
/** OptionAccountMismatch: Option account mismatch */
|
|
68
|
-
export const OPTION_PROGRAM_ERROR__OPTION_ACCOUNT_MISMATCH =
|
|
70
|
+
export const OPTION_PROGRAM_ERROR__OPTION_ACCOUNT_MISMATCH = 0x178a; // 6026
|
|
69
71
|
/** ArithmeticOverflow: Arithmetic overflow occurred */
|
|
70
|
-
export const OPTION_PROGRAM_ERROR__ARITHMETIC_OVERFLOW =
|
|
72
|
+
export const OPTION_PROGRAM_ERROR__ARITHMETIC_OVERFLOW = 0x178b; // 6027
|
|
71
73
|
/** ArithmeticUnderflow: Arithmetic underflow occurred */
|
|
72
|
-
export const OPTION_PROGRAM_ERROR__ARITHMETIC_UNDERFLOW =
|
|
74
|
+
export const OPTION_PROGRAM_ERROR__ARITHMETIC_UNDERFLOW = 0x178c; // 6028
|
|
73
75
|
/** DivisionByZero: Division by zero */
|
|
74
|
-
export const OPTION_PROGRAM_ERROR__DIVISION_BY_ZERO =
|
|
76
|
+
export const OPTION_PROGRAM_ERROR__DIVISION_BY_ZERO = 0x178d; // 6029
|
|
75
77
|
/** PremiumCalculationFailed: Premium calculation failed */
|
|
76
|
-
export const OPTION_PROGRAM_ERROR__PREMIUM_CALCULATION_FAILED =
|
|
78
|
+
export const OPTION_PROGRAM_ERROR__PREMIUM_CALCULATION_FAILED = 0x178e; // 6030
|
|
77
79
|
/** GreeksCalculationFailed: Greeks calculation failed */
|
|
78
|
-
export const OPTION_PROGRAM_ERROR__GREEKS_CALCULATION_FAILED =
|
|
80
|
+
export const OPTION_PROGRAM_ERROR__GREEKS_CALCULATION_FAILED = 0x178f; // 6031
|
|
79
81
|
/** InvalidEscrowAuthority: Invalid escrow authority */
|
|
80
|
-
export const OPTION_PROGRAM_ERROR__INVALID_ESCROW_AUTHORITY =
|
|
82
|
+
export const OPTION_PROGRAM_ERROR__INVALID_ESCROW_AUTHORITY = 0x1790; // 6032
|
|
81
83
|
/** EscrowAccountFrozen: Escrow account is frozen */
|
|
82
|
-
export const OPTION_PROGRAM_ERROR__ESCROW_ACCOUNT_FROZEN =
|
|
84
|
+
export const OPTION_PROGRAM_ERROR__ESCROW_ACCOUNT_FROZEN = 0x1791; // 6033
|
|
83
85
|
/** MarketClosed: Market is closed */
|
|
84
|
-
export const OPTION_PROGRAM_ERROR__MARKET_CLOSED =
|
|
86
|
+
export const OPTION_PROGRAM_ERROR__MARKET_CLOSED = 0x1792; // 6034
|
|
85
87
|
/** MaxPositionsReached: Maximum positions limit reached */
|
|
86
|
-
export const OPTION_PROGRAM_ERROR__MAX_POSITIONS_REACHED =
|
|
88
|
+
export const OPTION_PROGRAM_ERROR__MAX_POSITIONS_REACHED = 0x1793; // 6035
|
|
87
89
|
/** MinimumPositionSizeNotMet: Minimum position size not met */
|
|
88
|
-
export const OPTION_PROGRAM_ERROR__MINIMUM_POSITION_SIZE_NOT_MET =
|
|
90
|
+
export const OPTION_PROGRAM_ERROR__MINIMUM_POSITION_SIZE_NOT_MET = 0x1794; // 6036
|
|
89
91
|
/** MaximumPositionSizeExceeded: Maximum position size exceeded */
|
|
90
|
-
export const OPTION_PROGRAM_ERROR__MAXIMUM_POSITION_SIZE_EXCEEDED =
|
|
92
|
+
export const OPTION_PROGRAM_ERROR__MAXIMUM_POSITION_SIZE_EXCEEDED = 0x1795; // 6037
|
|
91
93
|
/** InvalidMakerAuthority: Invalid maker authority */
|
|
92
|
-
export const OPTION_PROGRAM_ERROR__INVALID_MAKER_AUTHORITY =
|
|
94
|
+
export const OPTION_PROGRAM_ERROR__INVALID_MAKER_AUTHORITY = 0x1796; // 6038
|
|
93
95
|
/** InvalidBuyerAuthority: Invalid buyer authority */
|
|
94
|
-
export const OPTION_PROGRAM_ERROR__INVALID_BUYER_AUTHORITY =
|
|
96
|
+
export const OPTION_PROGRAM_ERROR__INVALID_BUYER_AUTHORITY = 0x1797; // 6039
|
|
95
97
|
/** OptionChainFull: Option chain is full */
|
|
96
|
-
export const OPTION_PROGRAM_ERROR__OPTION_CHAIN_FULL =
|
|
98
|
+
export const OPTION_PROGRAM_ERROR__OPTION_CHAIN_FULL = 0x1798; // 6040
|
|
97
99
|
/** DuplicateOption: Duplicate option exists */
|
|
98
|
-
export const OPTION_PROGRAM_ERROR__DUPLICATE_OPTION =
|
|
100
|
+
export const OPTION_PROGRAM_ERROR__DUPLICATE_OPTION = 0x1799; // 6041
|
|
99
101
|
/** PriceImpactTooHigh: Price impact too high */
|
|
100
|
-
export const OPTION_PROGRAM_ERROR__PRICE_IMPACT_TOO_HIGH =
|
|
102
|
+
export const OPTION_PROGRAM_ERROR__PRICE_IMPACT_TOO_HIGH = 0x179a; // 6042
|
|
101
103
|
/** SlippageToleranceExceeded: Slippage tolerance exceeded */
|
|
102
|
-
export const OPTION_PROGRAM_ERROR__SLIPPAGE_TOLERANCE_EXCEEDED =
|
|
104
|
+
export const OPTION_PROGRAM_ERROR__SLIPPAGE_TOLERANCE_EXCEEDED = 0x179b; // 6043
|
|
103
105
|
/** InsufficientPoolLiquidity: Insufficient pool liquidity available */
|
|
104
|
-
export const OPTION_PROGRAM_ERROR__INSUFFICIENT_POOL_LIQUIDITY =
|
|
106
|
+
export const OPTION_PROGRAM_ERROR__INSUFFICIENT_POOL_LIQUIDITY = 0x179c; // 6044
|
|
105
107
|
/** InsufficientPoolAggregateLiquidity: Insufficient aggregate pool liquidity for requested quantity */
|
|
106
|
-
export const OPTION_PROGRAM_ERROR__INSUFFICIENT_POOL_AGGREGATE_LIQUIDITY =
|
|
108
|
+
export const OPTION_PROGRAM_ERROR__INSUFFICIENT_POOL_AGGREGATE_LIQUIDITY = 0x179d; // 6045
|
|
107
109
|
/** InsufficientWriterPositionLiquidity: Insufficient active writer liquidity to fill requested quantity */
|
|
108
|
-
export const OPTION_PROGRAM_ERROR__INSUFFICIENT_WRITER_POSITION_LIQUIDITY =
|
|
110
|
+
export const OPTION_PROGRAM_ERROR__INSUFFICIENT_WRITER_POSITION_LIQUIDITY = 0x179e; // 6046
|
|
109
111
|
/** InsufficientUserBalance: Insufficient user balance for withdrawal */
|
|
110
|
-
export const OPTION_PROGRAM_ERROR__INSUFFICIENT_USER_BALANCE =
|
|
112
|
+
export const OPTION_PROGRAM_ERROR__INSUFFICIENT_USER_BALANCE = 0x179f; // 6047
|
|
111
113
|
/** UnhealthyPosition: Health ratio below liquidation threshold */
|
|
112
|
-
export const OPTION_PROGRAM_ERROR__UNHEALTHY_POSITION =
|
|
114
|
+
export const OPTION_PROGRAM_ERROR__UNHEALTHY_POSITION = 0x17a0; // 6048
|
|
113
115
|
/** UnauthorizedOmlp: Unauthorized to perform this OMLP action */
|
|
114
|
-
export const OPTION_PROGRAM_ERROR__UNAUTHORIZED_OMLP =
|
|
116
|
+
export const OPTION_PROGRAM_ERROR__UNAUTHORIZED_OMLP = 0x17a1; // 6049
|
|
115
117
|
/** InvalidTenor: Invalid loan tenor */
|
|
116
|
-
export const OPTION_PROGRAM_ERROR__INVALID_TENOR =
|
|
118
|
+
export const OPTION_PROGRAM_ERROR__INVALID_TENOR = 0x17a2; // 6050
|
|
117
119
|
/** InvalidRate: Invalid interest rate */
|
|
118
|
-
export const OPTION_PROGRAM_ERROR__INVALID_RATE =
|
|
120
|
+
export const OPTION_PROGRAM_ERROR__INVALID_RATE = 0x17a3; // 6051
|
|
119
121
|
/** NotForeclosable: Loan is not eligible for foreclosure */
|
|
120
|
-
export const OPTION_PROGRAM_ERROR__NOT_FORECLOSABLE =
|
|
122
|
+
export const OPTION_PROGRAM_ERROR__NOT_FORECLOSABLE = 0x17a4; // 6052
|
|
121
123
|
/** InsufficientVaultLiquidity: Vault has insufficient liquidity */
|
|
122
|
-
export const OPTION_PROGRAM_ERROR__INSUFFICIENT_VAULT_LIQUIDITY =
|
|
124
|
+
export const OPTION_PROGRAM_ERROR__INSUFFICIENT_VAULT_LIQUIDITY = 0x17a5; // 6053
|
|
123
125
|
/** InsufficientLoanCollateral: Collateral insufficient for loan */
|
|
124
|
-
export const OPTION_PROGRAM_ERROR__INSUFFICIENT_LOAN_COLLATERAL =
|
|
126
|
+
export const OPTION_PROGRAM_ERROR__INSUFFICIENT_LOAN_COLLATERAL = 0x17a6; // 6054
|
|
125
127
|
/** OracleTooStale: Oracle price is stale - cannot validate */
|
|
126
|
-
export const OPTION_PROGRAM_ERROR__ORACLE_TOO_STALE =
|
|
128
|
+
export const OPTION_PROGRAM_ERROR__ORACLE_TOO_STALE = 0x17a7; // 6055
|
|
127
129
|
/** ValidationRequired: Must call option_validate before borrow/settlement */
|
|
128
|
-
export const OPTION_PROGRAM_ERROR__VALIDATION_REQUIRED =
|
|
130
|
+
export const OPTION_PROGRAM_ERROR__VALIDATION_REQUIRED = 0x17a8; // 6056
|
|
129
131
|
/** HealthCalculationFailed: Health ratio calculation failed */
|
|
130
|
-
export const OPTION_PROGRAM_ERROR__HEALTH_CALCULATION_FAILED =
|
|
132
|
+
export const OPTION_PROGRAM_ERROR__HEALTH_CALCULATION_FAILED = 0x17a9; // 6057
|
|
131
133
|
/** ContractAlreadySettled: Contract already settled */
|
|
132
|
-
export const OPTION_PROGRAM_ERROR__CONTRACT_ALREADY_SETTLED =
|
|
134
|
+
export const OPTION_PROGRAM_ERROR__CONTRACT_ALREADY_SETTLED = 0x17aa; // 6058
|
|
133
135
|
/** NoYieldAvailable: No yield available to claim */
|
|
134
|
-
export const OPTION_PROGRAM_ERROR__NO_YIELD_AVAILABLE =
|
|
136
|
+
export const OPTION_PROGRAM_ERROR__NO_YIELD_AVAILABLE = 0x17ab; // 6059
|
|
135
137
|
/** UnauthorizedAccess: Unauthorized access - you don't own this resource */
|
|
136
|
-
export const OPTION_PROGRAM_ERROR__UNAUTHORIZED_ACCESS =
|
|
138
|
+
export const OPTION_PROGRAM_ERROR__UNAUTHORIZED_ACCESS = 0x17ac; // 6060
|
|
137
139
|
/** InsufficientQuantity: Insufficient quantity available in ask position */
|
|
138
|
-
export const OPTION_PROGRAM_ERROR__INSUFFICIENT_QUANTITY =
|
|
140
|
+
export const OPTION_PROGRAM_ERROR__INSUFFICIENT_QUANTITY = 0x17ad; // 6061
|
|
139
141
|
/** NothingToClaim: Nothing to claim - no unclaimed premium */
|
|
140
|
-
export const OPTION_PROGRAM_ERROR__NOTHING_TO_CLAIM =
|
|
142
|
+
export const OPTION_PROGRAM_ERROR__NOTHING_TO_CLAIM = 0x17ae; // 6062
|
|
141
143
|
/** PoolNotActive: Pool is not active */
|
|
142
|
-
export const OPTION_PROGRAM_ERROR__POOL_NOT_ACTIVE =
|
|
144
|
+
export const OPTION_PROGRAM_ERROR__POOL_NOT_ACTIVE = 0x17af; // 6063
|
|
143
145
|
/** PoolAlreadyExists: Pool already exists for this option */
|
|
144
|
-
export const OPTION_PROGRAM_ERROR__POOL_ALREADY_EXISTS =
|
|
146
|
+
export const OPTION_PROGRAM_ERROR__POOL_ALREADY_EXISTS = 0x17b0; // 6064
|
|
145
147
|
/** PoolNotExercised: Pool has not been exercised yet */
|
|
146
|
-
export const OPTION_PROGRAM_ERROR__POOL_NOT_EXERCISED =
|
|
148
|
+
export const OPTION_PROGRAM_ERROR__POOL_NOT_EXERCISED = 0x17b1; // 6065
|
|
147
149
|
/** AlreadySettled: Maker's collateral share has already been settled */
|
|
148
|
-
export const OPTION_PROGRAM_ERROR__ALREADY_SETTLED =
|
|
150
|
+
export const OPTION_PROGRAM_ERROR__ALREADY_SETTLED = 0x17b2; // 6066
|
|
149
151
|
/** InsufficientPoolCollateral: Insufficient collateral in pool for exercise */
|
|
150
|
-
export const OPTION_PROGRAM_ERROR__INSUFFICIENT_POOL_COLLATERAL =
|
|
152
|
+
export const OPTION_PROGRAM_ERROR__INSUFFICIENT_POOL_COLLATERAL = 0x17b3; // 6067
|
|
151
153
|
/** CollateralPoolNotFound: Collateral pool does not exist */
|
|
152
|
-
export const OPTION_PROGRAM_ERROR__COLLATERAL_POOL_NOT_FOUND =
|
|
154
|
+
export const OPTION_PROGRAM_ERROR__COLLATERAL_POOL_NOT_FOUND = 0x17b4; // 6068
|
|
153
155
|
/** NoCollateralToWithdraw: No collateral to withdraw */
|
|
154
|
-
export const OPTION_PROGRAM_ERROR__NO_COLLATERAL_TO_WITHDRAW =
|
|
156
|
+
export const OPTION_PROGRAM_ERROR__NO_COLLATERAL_TO_WITHDRAW = 0x17b5; // 6069
|
|
155
157
|
/** OptionNotExpired: Option has not expired yet - cannot settle */
|
|
156
|
-
export const OPTION_PROGRAM_ERROR__OPTION_NOT_EXPIRED =
|
|
158
|
+
export const OPTION_PROGRAM_ERROR__OPTION_NOT_EXPIRED = 0x17b6; // 6070
|
|
157
159
|
/** LenderRepaymentNotComplete: Lender repayment phase is not complete */
|
|
158
|
-
export const OPTION_PROGRAM_ERROR__LENDER_REPAYMENT_NOT_COMPLETE =
|
|
160
|
+
export const OPTION_PROGRAM_ERROR__LENDER_REPAYMENT_NOT_COMPLETE = 0x17b7; // 6071
|
|
159
161
|
/** BuyerPayoutNotComplete: Buyer payout phase is not complete */
|
|
160
|
-
export const OPTION_PROGRAM_ERROR__BUYER_PAYOUT_NOT_COMPLETE =
|
|
162
|
+
export const OPTION_PROGRAM_ERROR__BUYER_PAYOUT_NOT_COMPLETE = 0x17b8; // 6072
|
|
161
163
|
/** SettlementClaimAlreadyPrepared: Settlement claim has already been prepared */
|
|
162
|
-
export const OPTION_PROGRAM_ERROR__SETTLEMENT_CLAIM_ALREADY_PREPARED =
|
|
164
|
+
export const OPTION_PROGRAM_ERROR__SETTLEMENT_CLAIM_ALREADY_PREPARED = 0x17b9; // 6073
|
|
163
165
|
/** SettlementClaimNotPrepared: Settlement claim has not been prepared */
|
|
164
|
-
export const OPTION_PROGRAM_ERROR__SETTLEMENT_CLAIM_NOT_PREPARED =
|
|
166
|
+
export const OPTION_PROGRAM_ERROR__SETTLEMENT_CLAIM_NOT_PREPARED = 0x17ba; // 6074
|
|
165
167
|
/** SettlementClaimAlreadyClaimed: Settlement claim has already been claimed */
|
|
166
|
-
export const OPTION_PROGRAM_ERROR__SETTLEMENT_CLAIM_ALREADY_CLAIMED =
|
|
168
|
+
export const OPTION_PROGRAM_ERROR__SETTLEMENT_CLAIM_ALREADY_CLAIMED = 0x17bb; // 6075
|
|
167
169
|
/** MakerLiquidated: Maker was liquidated and is excluded from expiry settlement */
|
|
168
|
-
export const OPTION_PROGRAM_ERROR__MAKER_LIQUIDATED =
|
|
170
|
+
export const OPTION_PROGRAM_ERROR__MAKER_LIQUIDATED = 0x17bc; // 6076
|
|
169
171
|
/** SupplyLimitExceeded: Deposit would exceed vault supply limit */
|
|
170
|
-
export const OPTION_PROGRAM_ERROR__SUPPLY_LIMIT_EXCEEDED =
|
|
172
|
+
export const OPTION_PROGRAM_ERROR__SUPPLY_LIMIT_EXCEEDED = 0x17bd; // 6077
|
|
171
173
|
/** InvalidFeeWallet: Invalid fee wallet - must match protocol constant */
|
|
172
|
-
export const OPTION_PROGRAM_ERROR__INVALID_FEE_WALLET =
|
|
174
|
+
export const OPTION_PROGRAM_ERROR__INVALID_FEE_WALLET = 0x17be; // 6078
|
|
173
175
|
/** InvalidProtocolFee: Invalid protocol fee rate */
|
|
174
|
-
export const OPTION_PROGRAM_ERROR__INVALID_PROTOCOL_FEE =
|
|
176
|
+
export const OPTION_PROGRAM_ERROR__INVALID_PROTOCOL_FEE = 0x17bf; // 6079
|
|
175
177
|
/** UnderlyingAssetMismatch: Underlying asset mismatch - market data or mint does not match option */
|
|
176
|
-
export const OPTION_PROGRAM_ERROR__UNDERLYING_ASSET_MISMATCH =
|
|
178
|
+
export const OPTION_PROGRAM_ERROR__UNDERLYING_ASSET_MISMATCH = 0x17c0; // 6080
|
|
177
179
|
/** InvalidMint: Invalid token mint - does not match expected underlying asset */
|
|
178
|
-
export const OPTION_PROGRAM_ERROR__INVALID_MINT =
|
|
180
|
+
export const OPTION_PROGRAM_ERROR__INVALID_MINT = 0x17c1; // 6081
|
|
179
181
|
/** BatchSizeExceeded: Batch size exceeds maximum allowed (10 positions) */
|
|
180
|
-
export const OPTION_PROGRAM_ERROR__BATCH_SIZE_EXCEEDED =
|
|
182
|
+
export const OPTION_PROGRAM_ERROR__BATCH_SIZE_EXCEEDED = 0x17c2; // 6082
|
|
181
183
|
/** NoPositionsProvided: No positions provided in batch */
|
|
182
|
-
export const OPTION_PROGRAM_ERROR__NO_POSITIONS_PROVIDED =
|
|
184
|
+
export const OPTION_PROGRAM_ERROR__NO_POSITIONS_PROVIDED = 0x17c3; // 6083
|
|
183
185
|
/** PositionOptionMismatch: Position account does not belong to this option */
|
|
184
|
-
export const OPTION_PROGRAM_ERROR__POSITION_OPTION_MISMATCH =
|
|
186
|
+
export const OPTION_PROGRAM_ERROR__POSITION_OPTION_MISMATCH = 0x17c4; // 6084
|
|
185
187
|
/** OptionPoolMismatch: Option account does not match the option pool's option account */
|
|
186
|
-
export const OPTION_PROGRAM_ERROR__OPTION_POOL_MISMATCH =
|
|
188
|
+
export const OPTION_PROGRAM_ERROR__OPTION_POOL_MISMATCH = 0x17c5; // 6085
|
|
187
189
|
/** InvalidSeed: Invalid seed - must be exactly 32 bytes */
|
|
188
|
-
export const OPTION_PROGRAM_ERROR__INVALID_SEED =
|
|
190
|
+
export const OPTION_PROGRAM_ERROR__INVALID_SEED = 0x17c6; // 6086
|
|
189
191
|
/** InvalidAuthority: Invalid authority - does not match escrow authority */
|
|
190
|
-
export const OPTION_PROGRAM_ERROR__INVALID_AUTHORITY =
|
|
192
|
+
export const OPTION_PROGRAM_ERROR__INVALID_AUTHORITY = 0x17c7; // 6087
|
|
191
193
|
/** EscrowAccountRequired: Escrow accounts required when borrowed_amount > 0 */
|
|
192
|
-
export const OPTION_PROGRAM_ERROR__ESCROW_ACCOUNT_REQUIRED =
|
|
194
|
+
export const OPTION_PROGRAM_ERROR__ESCROW_ACCOUNT_REQUIRED = 0x17c8; // 6088
|
|
193
195
|
/** InvalidEscrowMaker: Escrow state maker does not match instruction maker */
|
|
194
|
-
export const OPTION_PROGRAM_ERROR__INVALID_ESCROW_MAKER =
|
|
196
|
+
export const OPTION_PROGRAM_ERROR__INVALID_ESCROW_MAKER = 0x17c9; // 6089
|
|
195
197
|
/** EscrowMintMismatch: Escrow collateral mint does not match collateral pool mint */
|
|
196
|
-
export const OPTION_PROGRAM_ERROR__ESCROW_MINT_MISMATCH =
|
|
198
|
+
export const OPTION_PROGRAM_ERROR__ESCROW_MINT_MISMATCH = 0x17ca; // 6090
|
|
197
199
|
/** InsufficientEscrowBalance: Insufficient balance in escrow token account */
|
|
198
|
-
export const OPTION_PROGRAM_ERROR__INSUFFICIENT_ESCROW_BALANCE =
|
|
200
|
+
export const OPTION_PROGRAM_ERROR__INSUFFICIENT_ESCROW_BALANCE = 0x17cb; // 6091
|
|
199
201
|
/** InvalidEscrowOwner: Escrow token account owner mismatch */
|
|
200
|
-
export const OPTION_PROGRAM_ERROR__INVALID_ESCROW_OWNER =
|
|
202
|
+
export const OPTION_PROGRAM_ERROR__INVALID_ESCROW_OWNER = 0x17cc; // 6092
|
|
201
203
|
/** InvalidEscrowMint: Escrow token account mint mismatch */
|
|
202
|
-
export const OPTION_PROGRAM_ERROR__INVALID_ESCROW_MINT =
|
|
204
|
+
export const OPTION_PROGRAM_ERROR__INVALID_ESCROW_MINT = 0x17cd; // 6093
|
|
203
205
|
/** AccountFrozen: Token account is frozen and cannot be burned */
|
|
204
|
-
export const OPTION_PROGRAM_ERROR__ACCOUNT_FROZEN =
|
|
206
|
+
export const OPTION_PROGRAM_ERROR__ACCOUNT_FROZEN = 0x17ce; // 6094
|
|
205
207
|
/** InvalidAccount: Invalid account - does not match expected account */
|
|
206
|
-
export const OPTION_PROGRAM_ERROR__INVALID_ACCOUNT =
|
|
208
|
+
export const OPTION_PROGRAM_ERROR__INVALID_ACCOUNT = 0x17cf; // 6095
|
|
207
209
|
/** UnwindRepayAccountsMissing: Unwind repayment accounts are required when active pool loans exist */
|
|
208
|
-
export const OPTION_PROGRAM_ERROR__UNWIND_REPAY_ACCOUNTS_MISSING =
|
|
210
|
+
export const OPTION_PROGRAM_ERROR__UNWIND_REPAY_ACCOUNTS_MISSING = 0x17d0; // 6096
|
|
209
211
|
/** InsufficientCollateralVault: Collateral vault has insufficient funds for unwind collateral return */
|
|
210
|
-
export const OPTION_PROGRAM_ERROR__INSUFFICIENT_COLLATERAL_VAULT =
|
|
212
|
+
export const OPTION_PROGRAM_ERROR__INSUFFICIENT_COLLATERAL_VAULT = 0x17d1; // 6097
|
|
211
213
|
/** InvalidVaultMint: Invalid vault mint - does not match expected collateral mint */
|
|
212
|
-
export const OPTION_PROGRAM_ERROR__INVALID_VAULT_MINT =
|
|
214
|
+
export const OPTION_PROGRAM_ERROR__INVALID_VAULT_MINT = 0x17d2; // 6098
|
|
213
215
|
/** InvalidCollateralMint: Invalid collateral mint - not supported or no vault exists */
|
|
214
|
-
export const OPTION_PROGRAM_ERROR__INVALID_COLLATERAL_MINT =
|
|
216
|
+
export const OPTION_PROGRAM_ERROR__INVALID_COLLATERAL_MINT = 0x17d3; // 6099
|
|
215
217
|
/** CollateralMismatch: Collateral mint mismatch - position uses different collateral type */
|
|
216
|
-
export const OPTION_PROGRAM_ERROR__COLLATERAL_MISMATCH =
|
|
218
|
+
export const OPTION_PROGRAM_ERROR__COLLATERAL_MISMATCH = 0x17d4; // 6100
|
|
217
219
|
/** BuyRemainingAccountsUnsorted: buy_from_pool remaining_accounts are not sorted by (created_at asc, pubkey asc) */
|
|
218
|
-
export const OPTION_PROGRAM_ERROR__BUY_REMAINING_ACCOUNTS_UNSORTED =
|
|
220
|
+
export const OPTION_PROGRAM_ERROR__BUY_REMAINING_ACCOUNTS_UNSORTED = 0x17d5; // 6101
|
|
219
221
|
/** CloseLongWritersIncomplete: close_long_to_pool requires a complete set of active WriterPositions: sum(sold_qty) must equal pool.total_sold_qty */
|
|
220
|
-
export const OPTION_PROGRAM_ERROR__CLOSE_LONG_WRITERS_INCOMPLETE =
|
|
222
|
+
export const OPTION_PROGRAM_ERROR__CLOSE_LONG_WRITERS_INCOMPLETE = 0x17d6; // 6102
|
|
221
223
|
/** CloseLongNoSoldInventory: close_long_to_pool cannot run because no writer has sold inventory for this pool */
|
|
222
|
-
export const OPTION_PROGRAM_ERROR__CLOSE_LONG_NO_SOLD_INVENTORY =
|
|
224
|
+
export const OPTION_PROGRAM_ERROR__CLOSE_LONG_NO_SOLD_INVENTORY = 0x17d7; // 6103
|
|
223
225
|
/** CloseLongDuplicateWriter: close_long_to_pool remaining_accounts contain duplicate WriterPosition entries */
|
|
224
|
-
export const OPTION_PROGRAM_ERROR__CLOSE_LONG_DUPLICATE_WRITER =
|
|
226
|
+
export const OPTION_PROGRAM_ERROR__CLOSE_LONG_DUPLICATE_WRITER = 0x17d8; // 6104
|
|
225
227
|
/** MaintenanceBufferBreached: Writer position breaches maintenance buffer: free_collateral + claimable_theta < accrued_interest + fees + buffer */
|
|
226
|
-
export const OPTION_PROGRAM_ERROR__MAINTENANCE_BUFFER_BREACHED =
|
|
228
|
+
export const OPTION_PROGRAM_ERROR__MAINTENANCE_BUFFER_BREACHED = 0x17d9; // 6105
|
|
227
229
|
/** LiquidationInsufficientCollateralForDebt: Liquidation cannot cover full debt (principal + interest + fees) from writer's collateral + theta; call rescue path instead */
|
|
228
|
-
export const OPTION_PROGRAM_ERROR__LIQUIDATION_INSUFFICIENT_COLLATERAL_FOR_DEBT =
|
|
230
|
+
export const OPTION_PROGRAM_ERROR__LIQUIDATION_INSUFFICIENT_COLLATERAL_FOR_DEBT = 0x17da; // 6106
|
|
229
231
|
/** ThetaClaimDisabled: claim_theta instruction has been removed; theta is now auto-realized on unwind or forfeited on liquidation */
|
|
230
|
-
export const OPTION_PROGRAM_ERROR__THETA_CLAIM_DISABLED =
|
|
232
|
+
export const OPTION_PROGRAM_ERROR__THETA_CLAIM_DISABLED = 0x17db; // 6107
|
|
231
233
|
/** PoolLoanWriterMismatch: PoolLoan.writer_position does not match the WriterPosition in this instruction */
|
|
232
|
-
export const OPTION_PROGRAM_ERROR__POOL_LOAN_WRITER_MISMATCH =
|
|
234
|
+
export const OPTION_PROGRAM_ERROR__POOL_LOAN_WRITER_MISMATCH = 0x17dc; // 6108
|
|
233
235
|
/** MaintenanceLoansIncomplete: Maintenance debt sync remaining_accounts must contain every active PoolLoan for this writer */
|
|
234
|
-
export const OPTION_PROGRAM_ERROR__MAINTENANCE_LOANS_INCOMPLETE =
|
|
236
|
+
export const OPTION_PROGRAM_ERROR__MAINTENANCE_LOANS_INCOMPLETE = 0x17dd; // 6109
|
|
235
237
|
/** RescueUnauthorized: Rescue liquidation is gated to the vault keeper */
|
|
236
|
-
export const OPTION_PROGRAM_ERROR__RESCUE_UNAUTHORIZED =
|
|
238
|
+
export const OPTION_PROGRAM_ERROR__RESCUE_UNAUTHORIZED = 0x17de; // 6110
|
|
237
239
|
/** InvalidLoanRepayment: Loan repayment amount exceeds synced balances (principal/interest/fees) */
|
|
238
|
-
export const OPTION_PROGRAM_ERROR__INVALID_LOAN_REPAYMENT =
|
|
240
|
+
export const OPTION_PROGRAM_ERROR__INVALID_LOAN_REPAYMENT = 0x17df; // 6111
|
|
239
241
|
/** RescuePreconditionsNotMet: Rescue preconditions not met: collateral_vault must be short of the remaining debt after theta forfeiture */
|
|
240
|
-
export const OPTION_PROGRAM_ERROR__RESCUE_PRECONDITIONS_NOT_MET =
|
|
242
|
+
export const OPTION_PROGRAM_ERROR__RESCUE_PRECONDITIONS_NOT_MET = 0x17e0; // 6112
|
|
241
243
|
|
|
242
244
|
export type OptionProgramError =
|
|
243
245
|
| typeof OPTION_PROGRAM_ERROR__ACCOUNT_FROZEN
|
|
@@ -351,7 +353,8 @@ export type OptionProgramError =
|
|
|
351
353
|
| typeof OPTION_PROGRAM_ERROR__UNDERLYING_ASSET_MISMATCH
|
|
352
354
|
| typeof OPTION_PROGRAM_ERROR__UNHEALTHY_POSITION
|
|
353
355
|
| typeof OPTION_PROGRAM_ERROR__UNWIND_REPAY_ACCOUNTS_MISSING
|
|
354
|
-
| typeof OPTION_PROGRAM_ERROR__VALIDATION_REQUIRED
|
|
356
|
+
| typeof OPTION_PROGRAM_ERROR__VALIDATION_REQUIRED
|
|
357
|
+
| typeof OPTION_PROGRAM_ERROR__VOLATILITY_QUOTE_UNAVAILABLE;
|
|
355
358
|
|
|
356
359
|
let optionProgramErrorMessages: Record<OptionProgramError, string> | undefined;
|
|
357
360
|
if (process.env.NODE_ENV !== "production") {
|
|
@@ -468,6 +471,7 @@ if (process.env.NODE_ENV !== "production") {
|
|
|
468
471
|
[OPTION_PROGRAM_ERROR__UNHEALTHY_POSITION]: `Health ratio below liquidation threshold`,
|
|
469
472
|
[OPTION_PROGRAM_ERROR__UNWIND_REPAY_ACCOUNTS_MISSING]: `Unwind repayment accounts are required when active pool loans exist`,
|
|
470
473
|
[OPTION_PROGRAM_ERROR__VALIDATION_REQUIRED]: `Must call option_validate before borrow/settlement`,
|
|
474
|
+
[OPTION_PROGRAM_ERROR__VOLATILITY_QUOTE_UNAVAILABLE]: `Authority volatility quote unavailable or stale`,
|
|
471
475
|
};
|
|
472
476
|
}
|
|
473
477
|
|
|
@@ -7,13 +7,62 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import {
|
|
10
|
+
assertIsInstructionWithAccounts,
|
|
10
11
|
containsBytes,
|
|
11
12
|
fixEncoderSize,
|
|
12
13
|
getBytesEncoder,
|
|
13
14
|
type Address,
|
|
15
|
+
type Instruction,
|
|
16
|
+
type InstructionWithData,
|
|
14
17
|
type ReadonlyUint8Array,
|
|
15
18
|
} from "@solana/kit";
|
|
16
19
|
import {
|
|
20
|
+
parseAcceptAdminInstruction,
|
|
21
|
+
parseAutoExerciseAllExpiredInstruction,
|
|
22
|
+
parseAutoExerciseExpiredInstruction,
|
|
23
|
+
parseBorrowFromPoolInstruction,
|
|
24
|
+
parseBuyFromPoolInstruction,
|
|
25
|
+
parseClaimBuyerSettlementInstruction,
|
|
26
|
+
parseClaimMakerRemainingInstruction,
|
|
27
|
+
parseClaimMakerSettlementInstruction,
|
|
28
|
+
parseCloseLongToPoolInstruction,
|
|
29
|
+
parseCloseOptionInstruction,
|
|
30
|
+
parseCreateEscrowV2Instruction,
|
|
31
|
+
parseDepositCollateralInstruction,
|
|
32
|
+
parseDepositToPositionInstruction,
|
|
33
|
+
parseInitCollateralPoolInstruction,
|
|
34
|
+
parseInitConfigInstruction,
|
|
35
|
+
parseInitializeMarketDataInstruction,
|
|
36
|
+
parseInitOptionPoolInstruction,
|
|
37
|
+
parseLiquidateWriterPositionInstruction,
|
|
38
|
+
parseLiquidateWriterPositionRescueInstruction,
|
|
39
|
+
parseMigrateCollateralPoolV1ToV2Instruction,
|
|
40
|
+
parseMigrateMarketDataVolOracleInstruction,
|
|
41
|
+
parseOmlpCreateVaultInstruction,
|
|
42
|
+
parseOmlpUpdateFeeWalletInstruction,
|
|
43
|
+
parseOmlpUpdateInterestModelInstruction,
|
|
44
|
+
parseOmlpUpdateLiquidationThresholdInstruction,
|
|
45
|
+
parseOmlpUpdateMaintenanceBufferInstruction,
|
|
46
|
+
parseOmlpUpdateMaxBorrowCapInstruction,
|
|
47
|
+
parseOmlpUpdateMaxLeverageInstruction,
|
|
48
|
+
parseOmlpUpdateProtocolFeeInstruction,
|
|
49
|
+
parseOmlpUpdateSupplyLimitInstruction,
|
|
50
|
+
parseOptionExerciseInstruction,
|
|
51
|
+
parseOptionMintInstruction,
|
|
52
|
+
parseOptionValidateInstruction,
|
|
53
|
+
parsePrepareBuyerSettlementInstruction,
|
|
54
|
+
parsePrepareMakerSettlementInstruction,
|
|
55
|
+
parseRepayPoolLoanFromCollateralInstruction,
|
|
56
|
+
parseRepayPoolLoanFromWalletInstruction,
|
|
57
|
+
parseRepayPoolLoanInstruction,
|
|
58
|
+
parseSettleMakerCollateralInstruction,
|
|
59
|
+
parseSyncWriterPositionInstruction,
|
|
60
|
+
parseTransferAdminInstruction,
|
|
61
|
+
parseUnwindWriterUnsoldInstruction,
|
|
62
|
+
parseUpdateImpliedVolatilityInstruction,
|
|
63
|
+
parseUpdateMarketDataInstruction,
|
|
64
|
+
parseWithdrawFromPositionInstruction,
|
|
65
|
+
parseWriteToPoolInstruction,
|
|
17
66
|
type ParsedAcceptAdminInstruction,
|
|
18
67
|
type ParsedAutoExerciseAllExpiredInstruction,
|
|
19
68
|
type ParsedAutoExerciseExpiredInstruction,
|
|
@@ -950,3 +999,338 @@ export type ParsedOptionProgramInstruction<
|
|
|
950
999
|
| ({
|
|
951
1000
|
instructionType: OptionProgramInstruction.WriteToPool;
|
|
952
1001
|
} & ParsedWriteToPoolInstruction<TProgram>);
|
|
1002
|
+
|
|
1003
|
+
export function parseOptionProgramInstruction<TProgram extends string>(
|
|
1004
|
+
instruction: Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array>,
|
|
1005
|
+
): ParsedOptionProgramInstruction<TProgram> {
|
|
1006
|
+
const instructionType = identifyOptionProgramInstruction(instruction);
|
|
1007
|
+
switch (instructionType) {
|
|
1008
|
+
case OptionProgramInstruction.AcceptAdmin: {
|
|
1009
|
+
assertIsInstructionWithAccounts(instruction);
|
|
1010
|
+
return {
|
|
1011
|
+
instructionType: OptionProgramInstruction.AcceptAdmin,
|
|
1012
|
+
...parseAcceptAdminInstruction(instruction),
|
|
1013
|
+
};
|
|
1014
|
+
}
|
|
1015
|
+
case OptionProgramInstruction.AutoExerciseAllExpired: {
|
|
1016
|
+
assertIsInstructionWithAccounts(instruction);
|
|
1017
|
+
return {
|
|
1018
|
+
instructionType: OptionProgramInstruction.AutoExerciseAllExpired,
|
|
1019
|
+
...parseAutoExerciseAllExpiredInstruction(instruction),
|
|
1020
|
+
};
|
|
1021
|
+
}
|
|
1022
|
+
case OptionProgramInstruction.AutoExerciseExpired: {
|
|
1023
|
+
assertIsInstructionWithAccounts(instruction);
|
|
1024
|
+
return {
|
|
1025
|
+
instructionType: OptionProgramInstruction.AutoExerciseExpired,
|
|
1026
|
+
...parseAutoExerciseExpiredInstruction(instruction),
|
|
1027
|
+
};
|
|
1028
|
+
}
|
|
1029
|
+
case OptionProgramInstruction.BorrowFromPool: {
|
|
1030
|
+
assertIsInstructionWithAccounts(instruction);
|
|
1031
|
+
return {
|
|
1032
|
+
instructionType: OptionProgramInstruction.BorrowFromPool,
|
|
1033
|
+
...parseBorrowFromPoolInstruction(instruction),
|
|
1034
|
+
};
|
|
1035
|
+
}
|
|
1036
|
+
case OptionProgramInstruction.BuyFromPool: {
|
|
1037
|
+
assertIsInstructionWithAccounts(instruction);
|
|
1038
|
+
return {
|
|
1039
|
+
instructionType: OptionProgramInstruction.BuyFromPool,
|
|
1040
|
+
...parseBuyFromPoolInstruction(instruction),
|
|
1041
|
+
};
|
|
1042
|
+
}
|
|
1043
|
+
case OptionProgramInstruction.ClaimBuyerSettlement: {
|
|
1044
|
+
assertIsInstructionWithAccounts(instruction);
|
|
1045
|
+
return {
|
|
1046
|
+
instructionType: OptionProgramInstruction.ClaimBuyerSettlement,
|
|
1047
|
+
...parseClaimBuyerSettlementInstruction(instruction),
|
|
1048
|
+
};
|
|
1049
|
+
}
|
|
1050
|
+
case OptionProgramInstruction.ClaimMakerRemaining: {
|
|
1051
|
+
assertIsInstructionWithAccounts(instruction);
|
|
1052
|
+
return {
|
|
1053
|
+
instructionType: OptionProgramInstruction.ClaimMakerRemaining,
|
|
1054
|
+
...parseClaimMakerRemainingInstruction(instruction),
|
|
1055
|
+
};
|
|
1056
|
+
}
|
|
1057
|
+
case OptionProgramInstruction.ClaimMakerSettlement: {
|
|
1058
|
+
assertIsInstructionWithAccounts(instruction);
|
|
1059
|
+
return {
|
|
1060
|
+
instructionType: OptionProgramInstruction.ClaimMakerSettlement,
|
|
1061
|
+
...parseClaimMakerSettlementInstruction(instruction),
|
|
1062
|
+
};
|
|
1063
|
+
}
|
|
1064
|
+
case OptionProgramInstruction.CloseLongToPool: {
|
|
1065
|
+
assertIsInstructionWithAccounts(instruction);
|
|
1066
|
+
return {
|
|
1067
|
+
instructionType: OptionProgramInstruction.CloseLongToPool,
|
|
1068
|
+
...parseCloseLongToPoolInstruction(instruction),
|
|
1069
|
+
};
|
|
1070
|
+
}
|
|
1071
|
+
case OptionProgramInstruction.CloseOption: {
|
|
1072
|
+
assertIsInstructionWithAccounts(instruction);
|
|
1073
|
+
return {
|
|
1074
|
+
instructionType: OptionProgramInstruction.CloseOption,
|
|
1075
|
+
...parseCloseOptionInstruction(instruction),
|
|
1076
|
+
};
|
|
1077
|
+
}
|
|
1078
|
+
case OptionProgramInstruction.CreateEscrowV2: {
|
|
1079
|
+
assertIsInstructionWithAccounts(instruction);
|
|
1080
|
+
return {
|
|
1081
|
+
instructionType: OptionProgramInstruction.CreateEscrowV2,
|
|
1082
|
+
...parseCreateEscrowV2Instruction(instruction),
|
|
1083
|
+
};
|
|
1084
|
+
}
|
|
1085
|
+
case OptionProgramInstruction.DepositCollateral: {
|
|
1086
|
+
assertIsInstructionWithAccounts(instruction);
|
|
1087
|
+
return {
|
|
1088
|
+
instructionType: OptionProgramInstruction.DepositCollateral,
|
|
1089
|
+
...parseDepositCollateralInstruction(instruction),
|
|
1090
|
+
};
|
|
1091
|
+
}
|
|
1092
|
+
case OptionProgramInstruction.DepositToPosition: {
|
|
1093
|
+
assertIsInstructionWithAccounts(instruction);
|
|
1094
|
+
return {
|
|
1095
|
+
instructionType: OptionProgramInstruction.DepositToPosition,
|
|
1096
|
+
...parseDepositToPositionInstruction(instruction),
|
|
1097
|
+
};
|
|
1098
|
+
}
|
|
1099
|
+
case OptionProgramInstruction.InitCollateralPool: {
|
|
1100
|
+
assertIsInstructionWithAccounts(instruction);
|
|
1101
|
+
return {
|
|
1102
|
+
instructionType: OptionProgramInstruction.InitCollateralPool,
|
|
1103
|
+
...parseInitCollateralPoolInstruction(instruction),
|
|
1104
|
+
};
|
|
1105
|
+
}
|
|
1106
|
+
case OptionProgramInstruction.InitConfig: {
|
|
1107
|
+
assertIsInstructionWithAccounts(instruction);
|
|
1108
|
+
return {
|
|
1109
|
+
instructionType: OptionProgramInstruction.InitConfig,
|
|
1110
|
+
...parseInitConfigInstruction(instruction),
|
|
1111
|
+
};
|
|
1112
|
+
}
|
|
1113
|
+
case OptionProgramInstruction.InitOptionPool: {
|
|
1114
|
+
assertIsInstructionWithAccounts(instruction);
|
|
1115
|
+
return {
|
|
1116
|
+
instructionType: OptionProgramInstruction.InitOptionPool,
|
|
1117
|
+
...parseInitOptionPoolInstruction(instruction),
|
|
1118
|
+
};
|
|
1119
|
+
}
|
|
1120
|
+
case OptionProgramInstruction.InitializeMarketData: {
|
|
1121
|
+
assertIsInstructionWithAccounts(instruction);
|
|
1122
|
+
return {
|
|
1123
|
+
instructionType: OptionProgramInstruction.InitializeMarketData,
|
|
1124
|
+
...parseInitializeMarketDataInstruction(instruction),
|
|
1125
|
+
};
|
|
1126
|
+
}
|
|
1127
|
+
case OptionProgramInstruction.LiquidateWriterPosition: {
|
|
1128
|
+
assertIsInstructionWithAccounts(instruction);
|
|
1129
|
+
return {
|
|
1130
|
+
instructionType: OptionProgramInstruction.LiquidateWriterPosition,
|
|
1131
|
+
...parseLiquidateWriterPositionInstruction(instruction),
|
|
1132
|
+
};
|
|
1133
|
+
}
|
|
1134
|
+
case OptionProgramInstruction.LiquidateWriterPositionRescue: {
|
|
1135
|
+
assertIsInstructionWithAccounts(instruction);
|
|
1136
|
+
return {
|
|
1137
|
+
instructionType: OptionProgramInstruction.LiquidateWriterPositionRescue,
|
|
1138
|
+
...parseLiquidateWriterPositionRescueInstruction(instruction),
|
|
1139
|
+
};
|
|
1140
|
+
}
|
|
1141
|
+
case OptionProgramInstruction.MigrateCollateralPoolV1ToV2: {
|
|
1142
|
+
assertIsInstructionWithAccounts(instruction);
|
|
1143
|
+
return {
|
|
1144
|
+
instructionType: OptionProgramInstruction.MigrateCollateralPoolV1ToV2,
|
|
1145
|
+
...parseMigrateCollateralPoolV1ToV2Instruction(instruction),
|
|
1146
|
+
};
|
|
1147
|
+
}
|
|
1148
|
+
case OptionProgramInstruction.MigrateMarketDataVolOracle: {
|
|
1149
|
+
assertIsInstructionWithAccounts(instruction);
|
|
1150
|
+
return {
|
|
1151
|
+
instructionType: OptionProgramInstruction.MigrateMarketDataVolOracle,
|
|
1152
|
+
...parseMigrateMarketDataVolOracleInstruction(instruction),
|
|
1153
|
+
};
|
|
1154
|
+
}
|
|
1155
|
+
case OptionProgramInstruction.OmlpCreateVault: {
|
|
1156
|
+
assertIsInstructionWithAccounts(instruction);
|
|
1157
|
+
return {
|
|
1158
|
+
instructionType: OptionProgramInstruction.OmlpCreateVault,
|
|
1159
|
+
...parseOmlpCreateVaultInstruction(instruction),
|
|
1160
|
+
};
|
|
1161
|
+
}
|
|
1162
|
+
case OptionProgramInstruction.OmlpUpdateFeeWallet: {
|
|
1163
|
+
assertIsInstructionWithAccounts(instruction);
|
|
1164
|
+
return {
|
|
1165
|
+
instructionType: OptionProgramInstruction.OmlpUpdateFeeWallet,
|
|
1166
|
+
...parseOmlpUpdateFeeWalletInstruction(instruction),
|
|
1167
|
+
};
|
|
1168
|
+
}
|
|
1169
|
+
case OptionProgramInstruction.OmlpUpdateInterestModel: {
|
|
1170
|
+
assertIsInstructionWithAccounts(instruction);
|
|
1171
|
+
return {
|
|
1172
|
+
instructionType: OptionProgramInstruction.OmlpUpdateInterestModel,
|
|
1173
|
+
...parseOmlpUpdateInterestModelInstruction(instruction),
|
|
1174
|
+
};
|
|
1175
|
+
}
|
|
1176
|
+
case OptionProgramInstruction.OmlpUpdateLiquidationThreshold: {
|
|
1177
|
+
assertIsInstructionWithAccounts(instruction);
|
|
1178
|
+
return {
|
|
1179
|
+
instructionType:
|
|
1180
|
+
OptionProgramInstruction.OmlpUpdateLiquidationThreshold,
|
|
1181
|
+
...parseOmlpUpdateLiquidationThresholdInstruction(instruction),
|
|
1182
|
+
};
|
|
1183
|
+
}
|
|
1184
|
+
case OptionProgramInstruction.OmlpUpdateMaintenanceBuffer: {
|
|
1185
|
+
assertIsInstructionWithAccounts(instruction);
|
|
1186
|
+
return {
|
|
1187
|
+
instructionType: OptionProgramInstruction.OmlpUpdateMaintenanceBuffer,
|
|
1188
|
+
...parseOmlpUpdateMaintenanceBufferInstruction(instruction),
|
|
1189
|
+
};
|
|
1190
|
+
}
|
|
1191
|
+
case OptionProgramInstruction.OmlpUpdateMaxBorrowCap: {
|
|
1192
|
+
assertIsInstructionWithAccounts(instruction);
|
|
1193
|
+
return {
|
|
1194
|
+
instructionType: OptionProgramInstruction.OmlpUpdateMaxBorrowCap,
|
|
1195
|
+
...parseOmlpUpdateMaxBorrowCapInstruction(instruction),
|
|
1196
|
+
};
|
|
1197
|
+
}
|
|
1198
|
+
case OptionProgramInstruction.OmlpUpdateMaxLeverage: {
|
|
1199
|
+
assertIsInstructionWithAccounts(instruction);
|
|
1200
|
+
return {
|
|
1201
|
+
instructionType: OptionProgramInstruction.OmlpUpdateMaxLeverage,
|
|
1202
|
+
...parseOmlpUpdateMaxLeverageInstruction(instruction),
|
|
1203
|
+
};
|
|
1204
|
+
}
|
|
1205
|
+
case OptionProgramInstruction.OmlpUpdateProtocolFee: {
|
|
1206
|
+
assertIsInstructionWithAccounts(instruction);
|
|
1207
|
+
return {
|
|
1208
|
+
instructionType: OptionProgramInstruction.OmlpUpdateProtocolFee,
|
|
1209
|
+
...parseOmlpUpdateProtocolFeeInstruction(instruction),
|
|
1210
|
+
};
|
|
1211
|
+
}
|
|
1212
|
+
case OptionProgramInstruction.OmlpUpdateSupplyLimit: {
|
|
1213
|
+
assertIsInstructionWithAccounts(instruction);
|
|
1214
|
+
return {
|
|
1215
|
+
instructionType: OptionProgramInstruction.OmlpUpdateSupplyLimit,
|
|
1216
|
+
...parseOmlpUpdateSupplyLimitInstruction(instruction),
|
|
1217
|
+
};
|
|
1218
|
+
}
|
|
1219
|
+
case OptionProgramInstruction.OptionExercise: {
|
|
1220
|
+
assertIsInstructionWithAccounts(instruction);
|
|
1221
|
+
return {
|
|
1222
|
+
instructionType: OptionProgramInstruction.OptionExercise,
|
|
1223
|
+
...parseOptionExerciseInstruction(instruction),
|
|
1224
|
+
};
|
|
1225
|
+
}
|
|
1226
|
+
case OptionProgramInstruction.OptionMint: {
|
|
1227
|
+
assertIsInstructionWithAccounts(instruction);
|
|
1228
|
+
return {
|
|
1229
|
+
instructionType: OptionProgramInstruction.OptionMint,
|
|
1230
|
+
...parseOptionMintInstruction(instruction),
|
|
1231
|
+
};
|
|
1232
|
+
}
|
|
1233
|
+
case OptionProgramInstruction.OptionValidate: {
|
|
1234
|
+
assertIsInstructionWithAccounts(instruction);
|
|
1235
|
+
return {
|
|
1236
|
+
instructionType: OptionProgramInstruction.OptionValidate,
|
|
1237
|
+
...parseOptionValidateInstruction(instruction),
|
|
1238
|
+
};
|
|
1239
|
+
}
|
|
1240
|
+
case OptionProgramInstruction.PrepareBuyerSettlement: {
|
|
1241
|
+
assertIsInstructionWithAccounts(instruction);
|
|
1242
|
+
return {
|
|
1243
|
+
instructionType: OptionProgramInstruction.PrepareBuyerSettlement,
|
|
1244
|
+
...parsePrepareBuyerSettlementInstruction(instruction),
|
|
1245
|
+
};
|
|
1246
|
+
}
|
|
1247
|
+
case OptionProgramInstruction.PrepareMakerSettlement: {
|
|
1248
|
+
assertIsInstructionWithAccounts(instruction);
|
|
1249
|
+
return {
|
|
1250
|
+
instructionType: OptionProgramInstruction.PrepareMakerSettlement,
|
|
1251
|
+
...parsePrepareMakerSettlementInstruction(instruction),
|
|
1252
|
+
};
|
|
1253
|
+
}
|
|
1254
|
+
case OptionProgramInstruction.RepayPoolLoan: {
|
|
1255
|
+
assertIsInstructionWithAccounts(instruction);
|
|
1256
|
+
return {
|
|
1257
|
+
instructionType: OptionProgramInstruction.RepayPoolLoan,
|
|
1258
|
+
...parseRepayPoolLoanInstruction(instruction),
|
|
1259
|
+
};
|
|
1260
|
+
}
|
|
1261
|
+
case OptionProgramInstruction.RepayPoolLoanFromCollateral: {
|
|
1262
|
+
assertIsInstructionWithAccounts(instruction);
|
|
1263
|
+
return {
|
|
1264
|
+
instructionType: OptionProgramInstruction.RepayPoolLoanFromCollateral,
|
|
1265
|
+
...parseRepayPoolLoanFromCollateralInstruction(instruction),
|
|
1266
|
+
};
|
|
1267
|
+
}
|
|
1268
|
+
case OptionProgramInstruction.RepayPoolLoanFromWallet: {
|
|
1269
|
+
assertIsInstructionWithAccounts(instruction);
|
|
1270
|
+
return {
|
|
1271
|
+
instructionType: OptionProgramInstruction.RepayPoolLoanFromWallet,
|
|
1272
|
+
...parseRepayPoolLoanFromWalletInstruction(instruction),
|
|
1273
|
+
};
|
|
1274
|
+
}
|
|
1275
|
+
case OptionProgramInstruction.SettleMakerCollateral: {
|
|
1276
|
+
assertIsInstructionWithAccounts(instruction);
|
|
1277
|
+
return {
|
|
1278
|
+
instructionType: OptionProgramInstruction.SettleMakerCollateral,
|
|
1279
|
+
...parseSettleMakerCollateralInstruction(instruction),
|
|
1280
|
+
};
|
|
1281
|
+
}
|
|
1282
|
+
case OptionProgramInstruction.SyncWriterPosition: {
|
|
1283
|
+
assertIsInstructionWithAccounts(instruction);
|
|
1284
|
+
return {
|
|
1285
|
+
instructionType: OptionProgramInstruction.SyncWriterPosition,
|
|
1286
|
+
...parseSyncWriterPositionInstruction(instruction),
|
|
1287
|
+
};
|
|
1288
|
+
}
|
|
1289
|
+
case OptionProgramInstruction.TransferAdmin: {
|
|
1290
|
+
assertIsInstructionWithAccounts(instruction);
|
|
1291
|
+
return {
|
|
1292
|
+
instructionType: OptionProgramInstruction.TransferAdmin,
|
|
1293
|
+
...parseTransferAdminInstruction(instruction),
|
|
1294
|
+
};
|
|
1295
|
+
}
|
|
1296
|
+
case OptionProgramInstruction.UnwindWriterUnsold: {
|
|
1297
|
+
assertIsInstructionWithAccounts(instruction);
|
|
1298
|
+
return {
|
|
1299
|
+
instructionType: OptionProgramInstruction.UnwindWriterUnsold,
|
|
1300
|
+
...parseUnwindWriterUnsoldInstruction(instruction),
|
|
1301
|
+
};
|
|
1302
|
+
}
|
|
1303
|
+
case OptionProgramInstruction.UpdateImpliedVolatility: {
|
|
1304
|
+
assertIsInstructionWithAccounts(instruction);
|
|
1305
|
+
return {
|
|
1306
|
+
instructionType: OptionProgramInstruction.UpdateImpliedVolatility,
|
|
1307
|
+
...parseUpdateImpliedVolatilityInstruction(instruction),
|
|
1308
|
+
};
|
|
1309
|
+
}
|
|
1310
|
+
case OptionProgramInstruction.UpdateMarketData: {
|
|
1311
|
+
assertIsInstructionWithAccounts(instruction);
|
|
1312
|
+
return {
|
|
1313
|
+
instructionType: OptionProgramInstruction.UpdateMarketData,
|
|
1314
|
+
...parseUpdateMarketDataInstruction(instruction),
|
|
1315
|
+
};
|
|
1316
|
+
}
|
|
1317
|
+
case OptionProgramInstruction.WithdrawFromPosition: {
|
|
1318
|
+
assertIsInstructionWithAccounts(instruction);
|
|
1319
|
+
return {
|
|
1320
|
+
instructionType: OptionProgramInstruction.WithdrawFromPosition,
|
|
1321
|
+
...parseWithdrawFromPositionInstruction(instruction),
|
|
1322
|
+
};
|
|
1323
|
+
}
|
|
1324
|
+
case OptionProgramInstruction.WriteToPool: {
|
|
1325
|
+
assertIsInstructionWithAccounts(instruction);
|
|
1326
|
+
return {
|
|
1327
|
+
instructionType: OptionProgramInstruction.WriteToPool,
|
|
1328
|
+
...parseWriteToPoolInstruction(instruction),
|
|
1329
|
+
};
|
|
1330
|
+
}
|
|
1331
|
+
default:
|
|
1332
|
+
throw new Error(
|
|
1333
|
+
`Unrecognized instruction type: ${instructionType as string}`,
|
|
1334
|
+
);
|
|
1335
|
+
}
|
|
1336
|
+
}
|
package/package.json
CHANGED