Smart contracts
Contract errors
Every KwError code the wallet can return, and what it means.
Contract errors surface in RPC responses as Error(Contract, #N). The SDK maps the common ones to SDK error codes.
| Code | Name | Meaning |
|---|---|---|
| 100 | NotInitialized | Wallet config is missing |
| 101 | AlreadyInitialized | Constructor ran twice |
| 102 | InvalidAmount | Amount is zero or negative |
| 103 | InvalidPolicy | Policy out of range: limit above budget, no sellers, past expiry, or timeout outside 10 s–24 h |
| 104 | TooManyAllowedSellers | More than 32 sellers |
| 105 | AgentAlreadyExists | Key already registered |
| 106 | AgentNotFound | Key isn't registered on this wallet |
| 107 | AgentNotActive | Agent is paused or revoked |
| 108 | AgentExpired | Agent's expires_at has passed |
| 109 | WalletPaused | Kill switch is on |
| 110 | UnsupportedAuthContext | Authorisation isn't a contract call to transfer |
| 111 | TokenNotAllowed | Transfer of a token other than the wallet's USDC |
| 112 | SubInvocationsNotAllowed | More than one auth context in the transaction |
| 113 | InvalidTransferArgs | Not a well-formed transfer(from=wallet, to, amount) |
| 114 | SellerNotAllowed | Recipient isn't on the allow-list |
| 115 | BudgetExceeded | Spent today + open holds + amount > daily budget |
| 116 | HoldRequired | Amount is above the auto-approve limit and no hold was given |
| 117 | HoldNotFound | No hold with that ID |
| 118 | HoldNotApproved | Hold exists but isn't approved (pending or denied) |
| 119 | HoldAlreadyUsed | Hold was already consumed |
| 120 | HoldExpired | Past the hold's deadline |
| 121 | HoldMismatch | Transfer's agent, seller or amount differs from the hold |
| 122 | HoldNotPending | Hold can't move to the requested state |
| 123 | TooManyActiveHolds | Agent already has 8 open holds |
| 124 | RequestAlreadyUsed | request_id seen within the last 7 days |
| 125 | IntentExpired | Current ledger is past the intent's max_ledger |
| 126 | InsufficientUnreservedBalance | Withdrawal is larger than balance minus open holds |
| 127 | ArithmeticOverflow | Checked arithmetic overflowed |
| 128 | RenounceDisabled | renounce_ownership is turned off |
| 1000 | OpenZeppelin EnforcedPause | Paused, from the OpenZeppelin Pausable module |