@epicentral/sos-sdk 0.10.4-beta → 0.10.5-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.
- package/accounts/fetchers.ts +18 -0
- package/accounts/pdas.ts +28 -0
- package/generated/accounts/buyerSettlementClaim.ts +227 -0
- package/generated/accounts/index.ts +2 -0
- package/generated/accounts/makerSettlementClaim.ts +233 -0
- package/generated/errors/optionProgram.ts +49 -37
- package/generated/instructions/claimBuyerSettlement.ts +568 -0
- package/generated/instructions/claimMakerSettlement.ts +574 -0
- package/generated/instructions/index.ts +4 -0
- package/generated/instructions/prepareBuyerSettlement.ts +577 -0
- package/generated/instructions/prepareMakerSettlement.ts +415 -0
- package/generated/programs/optionProgram.ts +125 -0
- package/package.json +1 -1
- package/short/builders.ts +124 -0
|
@@ -158,80 +158,86 @@ export const OPTION_PROGRAM_ERROR__OPTION_NOT_EXPIRED = 0x17b5; // 6069
|
|
|
158
158
|
export const OPTION_PROGRAM_ERROR__LENDER_REPAYMENT_NOT_COMPLETE = 0x17b6; // 6070
|
|
159
159
|
/** BuyerPayoutNotComplete: Buyer payout phase is not complete */
|
|
160
160
|
export const OPTION_PROGRAM_ERROR__BUYER_PAYOUT_NOT_COMPLETE = 0x17b7; // 6071
|
|
161
|
+
/** SettlementClaimAlreadyPrepared: Settlement claim has already been prepared */
|
|
162
|
+
export const OPTION_PROGRAM_ERROR__SETTLEMENT_CLAIM_ALREADY_PREPARED = 0x17b8; // 6072
|
|
163
|
+
/** SettlementClaimNotPrepared: Settlement claim has not been prepared */
|
|
164
|
+
export const OPTION_PROGRAM_ERROR__SETTLEMENT_CLAIM_NOT_PREPARED = 0x17b9; // 6073
|
|
165
|
+
/** SettlementClaimAlreadyClaimed: Settlement claim has already been claimed */
|
|
166
|
+
export const OPTION_PROGRAM_ERROR__SETTLEMENT_CLAIM_ALREADY_CLAIMED = 0x17ba; // 6074
|
|
161
167
|
/** MakerLiquidated: Maker was liquidated and is excluded from expiry settlement */
|
|
162
|
-
export const OPTION_PROGRAM_ERROR__MAKER_LIQUIDATED =
|
|
168
|
+
export const OPTION_PROGRAM_ERROR__MAKER_LIQUIDATED = 0x17bb; // 6075
|
|
163
169
|
/** SupplyLimitExceeded: Deposit would exceed vault supply limit */
|
|
164
|
-
export const OPTION_PROGRAM_ERROR__SUPPLY_LIMIT_EXCEEDED =
|
|
170
|
+
export const OPTION_PROGRAM_ERROR__SUPPLY_LIMIT_EXCEEDED = 0x17bc; // 6076
|
|
165
171
|
/** InvalidFeeWallet: Invalid fee wallet - must match protocol constant */
|
|
166
|
-
export const OPTION_PROGRAM_ERROR__INVALID_FEE_WALLET =
|
|
172
|
+
export const OPTION_PROGRAM_ERROR__INVALID_FEE_WALLET = 0x17bd; // 6077
|
|
167
173
|
/** InvalidProtocolFee: Invalid protocol fee rate */
|
|
168
|
-
export const OPTION_PROGRAM_ERROR__INVALID_PROTOCOL_FEE =
|
|
174
|
+
export const OPTION_PROGRAM_ERROR__INVALID_PROTOCOL_FEE = 0x17be; // 6078
|
|
169
175
|
/** UnderlyingAssetMismatch: Underlying asset mismatch - market data or mint does not match option */
|
|
170
|
-
export const OPTION_PROGRAM_ERROR__UNDERLYING_ASSET_MISMATCH =
|
|
176
|
+
export const OPTION_PROGRAM_ERROR__UNDERLYING_ASSET_MISMATCH = 0x17bf; // 6079
|
|
171
177
|
/** InvalidMint: Invalid token mint - does not match expected underlying asset */
|
|
172
|
-
export const OPTION_PROGRAM_ERROR__INVALID_MINT =
|
|
178
|
+
export const OPTION_PROGRAM_ERROR__INVALID_MINT = 0x17c0; // 6080
|
|
173
179
|
/** BatchSizeExceeded: Batch size exceeds maximum allowed (10 positions) */
|
|
174
|
-
export const OPTION_PROGRAM_ERROR__BATCH_SIZE_EXCEEDED =
|
|
180
|
+
export const OPTION_PROGRAM_ERROR__BATCH_SIZE_EXCEEDED = 0x17c1; // 6081
|
|
175
181
|
/** NoPositionsProvided: No positions provided in batch */
|
|
176
|
-
export const OPTION_PROGRAM_ERROR__NO_POSITIONS_PROVIDED =
|
|
182
|
+
export const OPTION_PROGRAM_ERROR__NO_POSITIONS_PROVIDED = 0x17c2; // 6082
|
|
177
183
|
/** PositionOptionMismatch: Position account does not belong to this option */
|
|
178
|
-
export const OPTION_PROGRAM_ERROR__POSITION_OPTION_MISMATCH =
|
|
184
|
+
export const OPTION_PROGRAM_ERROR__POSITION_OPTION_MISMATCH = 0x17c3; // 6083
|
|
179
185
|
/** OptionPoolMismatch: Option account does not match the option pool's option account */
|
|
180
|
-
export const OPTION_PROGRAM_ERROR__OPTION_POOL_MISMATCH =
|
|
186
|
+
export const OPTION_PROGRAM_ERROR__OPTION_POOL_MISMATCH = 0x17c4; // 6084
|
|
181
187
|
/** InvalidSeed: Invalid seed - must be exactly 32 bytes */
|
|
182
|
-
export const OPTION_PROGRAM_ERROR__INVALID_SEED =
|
|
188
|
+
export const OPTION_PROGRAM_ERROR__INVALID_SEED = 0x17c5; // 6085
|
|
183
189
|
/** InvalidAuthority: Invalid authority - does not match escrow authority */
|
|
184
|
-
export const OPTION_PROGRAM_ERROR__INVALID_AUTHORITY =
|
|
190
|
+
export const OPTION_PROGRAM_ERROR__INVALID_AUTHORITY = 0x17c6; // 6086
|
|
185
191
|
/** EscrowAccountRequired: Escrow accounts required when borrowed_amount > 0 */
|
|
186
|
-
export const OPTION_PROGRAM_ERROR__ESCROW_ACCOUNT_REQUIRED =
|
|
192
|
+
export const OPTION_PROGRAM_ERROR__ESCROW_ACCOUNT_REQUIRED = 0x17c7; // 6087
|
|
187
193
|
/** InvalidEscrowMaker: Escrow state maker does not match instruction maker */
|
|
188
|
-
export const OPTION_PROGRAM_ERROR__INVALID_ESCROW_MAKER =
|
|
194
|
+
export const OPTION_PROGRAM_ERROR__INVALID_ESCROW_MAKER = 0x17c8; // 6088
|
|
189
195
|
/** EscrowMintMismatch: Escrow collateral mint does not match collateral pool mint */
|
|
190
|
-
export const OPTION_PROGRAM_ERROR__ESCROW_MINT_MISMATCH =
|
|
196
|
+
export const OPTION_PROGRAM_ERROR__ESCROW_MINT_MISMATCH = 0x17c9; // 6089
|
|
191
197
|
/** InsufficientEscrowBalance: Insufficient balance in escrow token account */
|
|
192
|
-
export const OPTION_PROGRAM_ERROR__INSUFFICIENT_ESCROW_BALANCE =
|
|
198
|
+
export const OPTION_PROGRAM_ERROR__INSUFFICIENT_ESCROW_BALANCE = 0x17ca; // 6090
|
|
193
199
|
/** InvalidEscrowOwner: Escrow token account owner mismatch */
|
|
194
|
-
export const OPTION_PROGRAM_ERROR__INVALID_ESCROW_OWNER =
|
|
200
|
+
export const OPTION_PROGRAM_ERROR__INVALID_ESCROW_OWNER = 0x17cb; // 6091
|
|
195
201
|
/** InvalidEscrowMint: Escrow token account mint mismatch */
|
|
196
|
-
export const OPTION_PROGRAM_ERROR__INVALID_ESCROW_MINT =
|
|
202
|
+
export const OPTION_PROGRAM_ERROR__INVALID_ESCROW_MINT = 0x17cc; // 6092
|
|
197
203
|
/** AccountFrozen: Token account is frozen and cannot be burned */
|
|
198
|
-
export const OPTION_PROGRAM_ERROR__ACCOUNT_FROZEN =
|
|
204
|
+
export const OPTION_PROGRAM_ERROR__ACCOUNT_FROZEN = 0x17cd; // 6093
|
|
199
205
|
/** InvalidAccount: Invalid account - does not match expected account */
|
|
200
|
-
export const OPTION_PROGRAM_ERROR__INVALID_ACCOUNT =
|
|
206
|
+
export const OPTION_PROGRAM_ERROR__INVALID_ACCOUNT = 0x17ce; // 6094
|
|
201
207
|
/** UnwindRepayAccountsMissing: Unwind repayment accounts are required when active pool loans exist */
|
|
202
|
-
export const OPTION_PROGRAM_ERROR__UNWIND_REPAY_ACCOUNTS_MISSING =
|
|
208
|
+
export const OPTION_PROGRAM_ERROR__UNWIND_REPAY_ACCOUNTS_MISSING = 0x17cf; // 6095
|
|
203
209
|
/** InsufficientCollateralVault: Collateral vault has insufficient funds for unwind collateral return */
|
|
204
|
-
export const OPTION_PROGRAM_ERROR__INSUFFICIENT_COLLATERAL_VAULT =
|
|
210
|
+
export const OPTION_PROGRAM_ERROR__INSUFFICIENT_COLLATERAL_VAULT = 0x17d0; // 6096
|
|
205
211
|
/** InvalidVaultMint: Invalid vault mint - does not match expected collateral mint */
|
|
206
|
-
export const OPTION_PROGRAM_ERROR__INVALID_VAULT_MINT =
|
|
212
|
+
export const OPTION_PROGRAM_ERROR__INVALID_VAULT_MINT = 0x17d1; // 6097
|
|
207
213
|
/** InvalidCollateralMint: Invalid collateral mint - not supported or no vault exists */
|
|
208
|
-
export const OPTION_PROGRAM_ERROR__INVALID_COLLATERAL_MINT =
|
|
214
|
+
export const OPTION_PROGRAM_ERROR__INVALID_COLLATERAL_MINT = 0x17d2; // 6098
|
|
209
215
|
/** CollateralMismatch: Collateral mint mismatch - position uses different collateral type */
|
|
210
|
-
export const OPTION_PROGRAM_ERROR__COLLATERAL_MISMATCH =
|
|
216
|
+
export const OPTION_PROGRAM_ERROR__COLLATERAL_MISMATCH = 0x17d3; // 6099
|
|
211
217
|
/** BuyRemainingAccountsUnsorted: buy_from_pool remaining_accounts are not sorted by (created_at asc, pubkey asc) */
|
|
212
|
-
export const OPTION_PROGRAM_ERROR__BUY_REMAINING_ACCOUNTS_UNSORTED =
|
|
218
|
+
export const OPTION_PROGRAM_ERROR__BUY_REMAINING_ACCOUNTS_UNSORTED = 0x17d4; // 6100
|
|
213
219
|
/** CloseLongWritersIncomplete: close_long_to_pool requires a complete set of active WriterPositions: sum(sold_qty) must equal pool.total_sold_qty */
|
|
214
|
-
export const OPTION_PROGRAM_ERROR__CLOSE_LONG_WRITERS_INCOMPLETE =
|
|
220
|
+
export const OPTION_PROGRAM_ERROR__CLOSE_LONG_WRITERS_INCOMPLETE = 0x17d5; // 6101
|
|
215
221
|
/** CloseLongNoSoldInventory: close_long_to_pool cannot run because no writer has sold inventory for this pool */
|
|
216
|
-
export const OPTION_PROGRAM_ERROR__CLOSE_LONG_NO_SOLD_INVENTORY =
|
|
222
|
+
export const OPTION_PROGRAM_ERROR__CLOSE_LONG_NO_SOLD_INVENTORY = 0x17d6; // 6102
|
|
217
223
|
/** CloseLongDuplicateWriter: close_long_to_pool remaining_accounts contain duplicate WriterPosition entries */
|
|
218
|
-
export const OPTION_PROGRAM_ERROR__CLOSE_LONG_DUPLICATE_WRITER =
|
|
224
|
+
export const OPTION_PROGRAM_ERROR__CLOSE_LONG_DUPLICATE_WRITER = 0x17d7; // 6103
|
|
219
225
|
/** MaintenanceBufferBreached: Writer position breaches maintenance buffer: free_collateral + claimable_theta < accrued_interest + fees + buffer */
|
|
220
|
-
export const OPTION_PROGRAM_ERROR__MAINTENANCE_BUFFER_BREACHED =
|
|
226
|
+
export const OPTION_PROGRAM_ERROR__MAINTENANCE_BUFFER_BREACHED = 0x17d8; // 6104
|
|
221
227
|
/** LiquidationInsufficientCollateralForDebt: Liquidation cannot cover full debt (principal + interest + fees) from writer's collateral + theta; call rescue path instead */
|
|
222
|
-
export const OPTION_PROGRAM_ERROR__LIQUIDATION_INSUFFICIENT_COLLATERAL_FOR_DEBT =
|
|
228
|
+
export const OPTION_PROGRAM_ERROR__LIQUIDATION_INSUFFICIENT_COLLATERAL_FOR_DEBT = 0x17d9; // 6105
|
|
223
229
|
/** ThetaClaimDisabled: claim_theta instruction has been removed; theta is now auto-realized on unwind or forfeited on liquidation */
|
|
224
|
-
export const OPTION_PROGRAM_ERROR__THETA_CLAIM_DISABLED =
|
|
230
|
+
export const OPTION_PROGRAM_ERROR__THETA_CLAIM_DISABLED = 0x17da; // 6106
|
|
225
231
|
/** PoolLoanWriterMismatch: PoolLoan.writer_position does not match the WriterPosition in this instruction */
|
|
226
|
-
export const OPTION_PROGRAM_ERROR__POOL_LOAN_WRITER_MISMATCH =
|
|
232
|
+
export const OPTION_PROGRAM_ERROR__POOL_LOAN_WRITER_MISMATCH = 0x17db; // 6107
|
|
227
233
|
/** MaintenanceLoansIncomplete: Maintenance debt sync remaining_accounts must contain every active PoolLoan for this writer */
|
|
228
|
-
export const OPTION_PROGRAM_ERROR__MAINTENANCE_LOANS_INCOMPLETE =
|
|
234
|
+
export const OPTION_PROGRAM_ERROR__MAINTENANCE_LOANS_INCOMPLETE = 0x17dc; // 6108
|
|
229
235
|
/** RescueUnauthorized: Rescue liquidation is gated to the vault keeper */
|
|
230
|
-
export const OPTION_PROGRAM_ERROR__RESCUE_UNAUTHORIZED =
|
|
236
|
+
export const OPTION_PROGRAM_ERROR__RESCUE_UNAUTHORIZED = 0x17dd; // 6109
|
|
231
237
|
/** InvalidLoanRepayment: Loan repayment amount exceeds synced balances (principal/interest/fees) */
|
|
232
|
-
export const OPTION_PROGRAM_ERROR__INVALID_LOAN_REPAYMENT =
|
|
238
|
+
export const OPTION_PROGRAM_ERROR__INVALID_LOAN_REPAYMENT = 0x17de; // 6110
|
|
233
239
|
/** RescuePreconditionsNotMet: Rescue preconditions not met: collateral_vault must be short of the remaining debt after theta forfeiture */
|
|
234
|
-
export const OPTION_PROGRAM_ERROR__RESCUE_PRECONDITIONS_NOT_MET =
|
|
240
|
+
export const OPTION_PROGRAM_ERROR__RESCUE_PRECONDITIONS_NOT_MET = 0x17df; // 6111
|
|
235
241
|
|
|
236
242
|
export type OptionProgramError =
|
|
237
243
|
| typeof OPTION_PROGRAM_ERROR__ACCOUNT_FROZEN
|
|
@@ -331,6 +337,9 @@ export type OptionProgramError =
|
|
|
331
337
|
| typeof OPTION_PROGRAM_ERROR__PRICE_IMPACT_TOO_HIGH
|
|
332
338
|
| typeof OPTION_PROGRAM_ERROR__RESCUE_PRECONDITIONS_NOT_MET
|
|
333
339
|
| typeof OPTION_PROGRAM_ERROR__RESCUE_UNAUTHORIZED
|
|
340
|
+
| typeof OPTION_PROGRAM_ERROR__SETTLEMENT_CLAIM_ALREADY_CLAIMED
|
|
341
|
+
| typeof OPTION_PROGRAM_ERROR__SETTLEMENT_CLAIM_ALREADY_PREPARED
|
|
342
|
+
| typeof OPTION_PROGRAM_ERROR__SETTLEMENT_CLAIM_NOT_PREPARED
|
|
334
343
|
| typeof OPTION_PROGRAM_ERROR__SLIPPAGE_TOLERANCE_EXCEEDED
|
|
335
344
|
| typeof OPTION_PROGRAM_ERROR__STALE_MARKET_DATA
|
|
336
345
|
| typeof OPTION_PROGRAM_ERROR__STALE_ORACLE_PRICE
|
|
@@ -444,6 +453,9 @@ if (process.env.NODE_ENV !== "production") {
|
|
|
444
453
|
[OPTION_PROGRAM_ERROR__PRICE_IMPACT_TOO_HIGH]: `Price impact too high`,
|
|
445
454
|
[OPTION_PROGRAM_ERROR__RESCUE_PRECONDITIONS_NOT_MET]: `Rescue preconditions not met: collateral_vault must be short of the remaining debt after theta forfeiture`,
|
|
446
455
|
[OPTION_PROGRAM_ERROR__RESCUE_UNAUTHORIZED]: `Rescue liquidation is gated to the vault keeper`,
|
|
456
|
+
[OPTION_PROGRAM_ERROR__SETTLEMENT_CLAIM_ALREADY_CLAIMED]: `Settlement claim has already been claimed`,
|
|
457
|
+
[OPTION_PROGRAM_ERROR__SETTLEMENT_CLAIM_ALREADY_PREPARED]: `Settlement claim has already been prepared`,
|
|
458
|
+
[OPTION_PROGRAM_ERROR__SETTLEMENT_CLAIM_NOT_PREPARED]: `Settlement claim has not been prepared`,
|
|
447
459
|
[OPTION_PROGRAM_ERROR__SLIPPAGE_TOLERANCE_EXCEEDED]: `Slippage tolerance exceeded`,
|
|
448
460
|
[OPTION_PROGRAM_ERROR__STALE_MARKET_DATA]: `Market data is stale and needs to be updated`,
|
|
449
461
|
[OPTION_PROGRAM_ERROR__STALE_ORACLE_PRICE]: `Oracle price is too old`,
|