Errors
Contract and token error codes as defined in the SDK.
Source: packages/mvp1-sdk/src/sdk/errors.ts.
Clearing contract
| Code | Name | Meaning |
|---|---|---|
| 1 | SessionNotFound | There is no session with this id. |
| 2 | SessionExists | A session with this id already exists; ids are never reused. |
| 3 | WrongState | The action is not allowed in the session's current state. |
| 4 | NotParticipant | The account is not an admitted participant. |
| 5 | NoProposal | There is no settlement proposal yet. |
| 6 | MissingApproval | Not every admitted participant has approved the current proposal. |
| 10 | TooManyParticipants | The participant capacity is reached. |
| 11 | ParticipantExists | The account is already admitted. |
| 12 | BadAddressKind | Only account (G...) and contract (C...) addresses are accepted; the token must be a contract. |
| 13 | BadCapacity | Capacities must be 2 to 4 participants and 1 to 16 obligations. |
| 20 | TooManyObligations | The obligation capacity is reached. |
| 21 | DuplicateObligation | An obligation with this id already exists. |
| 22 | BadAmount | An amount must be greater than zero. |
| 23 | SameParty | Debtor and creditor must differ. |
| 24 | UnknownParty | An account named is not an admitted participant. |
| 25 | ObligationNotFound | There is no obligation with this id. |
| 30 | TooFewParticipants | At least two participants are needed to finalize. |
| 31 | NoObligations | There is no obligation to finalize. |
| 33 | TooManyInstructions | The plan has more instructions than the ceiling. |
| 34 | InstructionOrder | Instructions must be strictly ascending by payer, then payee. |
| 35 | InstructionSelfPay | An instruction cannot pay an account to itself. |
| 36 | FlowMismatch | The instructions do not realise every net position exactly. |
| 37 | OffsettingFlows | A participant would both pay and receive. |
| 38 | Overflow | An amount or sum is outside the i128 range. |
| 40 | DigestMismatch | The digest is not the current proposal digest. |
| 50 | AlreadySettled | The session is already settled. |
| 90 | CorruptState | An integrity check failed; the contract failed closed. |
Token contract
| Code | Name | Meaning |
|---|---|---|
| 101 | BadAmount | An amount must be greater than zero. |
| 102 | InsufficientBalance | A balance is too low; a whole settlement is reverted. |
| 103 | CapExceeded | Minting would exceed the supply cap. |
| 104 | Overflow | Arithmetic overflow. |
| 105 | BadCap | Invalid cap. |
SDK error kinds
TobinError.kind is one of contract, token, auth, host, transport or policy. A policy error is a refusal
by the SDK itself before any call (for example, sending one settlement authorisation round twice).