#[repr(u32)]pub enum SettlementError {
Show 34 variants
FinalizeBeforeInitialize = 0,
BeginFinalizePairOverlap = 1,
MissingCounterpartInstruction = 2,
CounterpartIsExternal = 3,
InvalidCounterpartDiscriminator = 4,
InvalidCounterpartCounterpart = 5,
MismatchedCounterpartDiscriminator = 6,
OwnerMismatch = 7,
AccountNotDerivable = 8,
OrdersNotStrictlyIncreasing = 9,
SellTokenAccountMismatch = 10,
SellTokenAccountInvalid = 11,
SellTokenOwnerMismatch = 12,
AccountCountNotMatchingOrderCount = 13,
CalledViaCpi = 14,
OrderCancelled = 15,
OrderExpired = 16,
TransferCountMismatch = 17,
StateAccountMismatch = 18,
AccountCountNotMatchingPushCount = 19,
SettledOrderPushCountMismatch = 20,
PushDestinationMismatch = 21,
PushSourceNotBuffer = 22,
InvalidBuyTokenAccount = 23,
LimitPriceViolated = 24,
PullAmountOverflow = 25,
FillExceedsOrderAmount = 26,
OrderNotExactlyFilled = 27,
AmountWithdrawnOverflow = 28,
AmountReceivedOverflow = 29,
OrderNotExpired = 30,
ReclaimRecipientMismatch = 31,
ReclaimAuthorityMismatch = 32,
ReclaimBufferNotCanonical = 33,
}Expand description
Program-side errors surfaced by the settlement program.
The discriminant value is the on-chain ProgramError::Custom code.
Variants§
FinalizeBeforeInitialize = 0
The FinalizeSettle included as input to BeginSettle isn’t before
the actual BeginSettle index.
BeginFinalizePairOverlap = 1
Another BeginSettle/FinalizeSettle of this program appears strictly
between this pair’s bounds, nesting or overlapping two settlements.
MissingCounterpartInstruction = 2
The counterpart index points past the end of the transaction’s instruction list, so no instruction sits there.
CounterpartIsExternal = 3
The instruction at the counterpart index belongs to a different program.
InvalidCounterpartDiscriminator = 4
The counterpart instruction’s discriminator byte couldn’t be recovered from its data.
InvalidCounterpartCounterpart = 5
The counterpart instruction’s own counterpart index couldn’t be recovered from its data.
MismatchedCounterpartDiscriminator = 6
The counterpart’s discriminator isn’t the expected
BeginSettle/FinalizeSettle kind, or its counterpart index doesn’t
point back at this instruction.
OwnerMismatch = 7
CreateOrder instruction wasn’t signed by the created OrderIntent
owner.
AccountNotDerivable = 8
An account was provided that cannot be derived from the seeds recognized by the program
OrdersNotStrictlyIncreasing = 9
BeginSettle’s order accounts aren’t passed strictly increasing by
address.
SellTokenAccountMismatch = 10
A BeginSettle sell token account doesn’t match the
sell_token_account recorded in the order’s intent.
SellTokenAccountInvalid = 11
A BeginSettle sell token account isn’t a valid SPL token account
(wrong data length or not owned by the token program).
SellTokenOwnerMismatch = 12
A BeginSettle sell token account’s SPL owner isn’t the order’s intent
owner.
AccountCountNotMatchingOrderCount = 13
BeginSettle’s order-account count doesn’t match the structure its
instruction data expects: n orders each contribute an order PDA and a
sell token account, plus one destination account per transfer.
CalledViaCpi = 14
BeginSettle or FinalizeSettle was invoked via CPI rather than as a
top-level transaction instruction.
OrderCancelled = 15
A BeginSettle order has been cancelled by its owner and can no longer
be settled.
OrderExpired = 16
A BeginSettle order’s valid_to lies in the past: the order has
expired and can no longer be settled.
TransferCountMismatch = 17
The transfer counts in BeginSettle don’t sum to the number of transfer
amounts, so destinations and amounts can’t be paired up exactly.
StateAccountMismatch = 18
BeginSettle’s state account isn’t the canonical settlement state PDA,
which must sign the pulls as the user’s token delegate.
AccountCountNotMatchingPushCount = 19
FinalizeSettle’s push-account count doesn’t match its instruction
data: each push contributes a source buffer and a destination account,
so the count must be twice the number of push amounts.
SettledOrderPushCountMismatch = 20
BeginSettle: the number of pushes carried by the paired FinalizeSettle
doesn’t equal the number of settled orders. Each order must be paid by
exactly one push.
PushDestinationMismatch = 21
BeginSettle: a paired FinalizeSettle push doesn’t send its proceeds
to the order’s buy token account; its destination differs from the
buy_token_account in the order’s intent.
PushSourceNotBuffer = 22
FinalizeSettle: a push doesn’t draw funds from the canonical buffer
for its destination’s mint.
InvalidBuyTokenAccount = 23
FinalizeSettle: a push’s destination isn’t a valid SPL token account
(wrong data length or not owned by the token program), so its mint can’t
be read to derive the buffer.
LimitPriceViolated = 24
BeginSettle: a settled order’s executed price (amount_out/amount_in)
is worse than the order’s limit price (buy_amount/sell_amount).
PullAmountOverflow = 25
BeginSettle: an order’s pull amounts sum to more than u64::MAX.
FillExceedsOrderAmount = 26
BeginSettle: filling this order would consume more tokens than the
maximum the user is willing to trade on this intent.
Sell: amount_in > sell_amount; buy: amount_out > buy_amount.
OrderNotExactlyFilled = 27
BeginSettle: a non-partially_fillable order isn’t filled exactly to
its amount (either under- or over-filled).
Sell: amount_in != sell_amount; buy: total amount_out != buy_amount.
AmountWithdrawnOverflow = 28
BeginSettle: the order’s cumulative amount_withdrawn would exceed
u64::MAX once this settlement’s pulls are added.
AmountReceivedOverflow = 29
BeginSettle: the order’s cumulative amount_received would exceed
u64::MAX once this settlement’s push is added.
OrderNotExpired = 30
ReclaimOrder was called before the order’s valid_to has elapsed.
ReclaimRecipientMismatch = 31
ReclaimOrder’s reclaim_recipient account doesn’t match the
created_by address recorded in the order.
ReclaimAuthorityMismatch = 32
ReclaimBuffer’s reclaim_authority account isn’t a signer, or doesn’t
match the reclaim_authority address recorded in the settlement state
PDA.
ReclaimBufferNotCanonical = 33
A ReclaimBuffer buffer_pda doesn’t sit at the canonical buffer PDA
derived from its paired mint.
Trait Implementations§
Source§impl Clone for SettlementError
impl Clone for SettlementError
Source§fn clone(&self) -> SettlementError
fn clone(&self) -> SettlementError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more