Events & Errors
Events
Defined in hinkal_events.rs.
Indexers should subscribe to these to reconstruct shielded state.
NewCommitment
pub struct NewCommitment {
pub commitment: Bytes32,
pub index: Bytes32,
pub encrypted_output: Vec<u8>,
pub on_chain_data: [Bytes32; 8],
}Emitted on every commitment inserted into the Merkle tree.
For proof-derived commitments:
encrypted_outputis the ciphertext;on_chain_datais all zeros.For on-chain-created commitments (proofless deposits, swap outputs):
encrypted_outputis empty;on_chain_data = [amount, mint_part1, mint_part2, extra_randomization, stealth_address, h0, h1, timestamp].swapemits its output commitment viaemit_cpi!(event-CPI, requires#[event_cpi]accounts) so it survives log truncation from the router CPI — indexers must also read inner instructions, not just program logs.
Nullified
pub struct Nullified { pub nullifier: Bytes32 }Emitted whenever a non-zero nullifier transitions to is_used = true.
NewAccessKeyAdded
Emitted by add_access_token after the key lands in the access-token Merkle tree.
BlockedUtxosCreated
Emitted by proofless_deposit when the caller passes create_blocked_utxos = true. Allows downstream services to surface "blocked" deposits (e.g. cooldown windows).
Lifecycle events
RelayerStatusUpdated { relayer, status }TokenLimitUpdated { mint: Option<Pubkey>, amount_limit }AccessTokenOwnerChanged { old_owner, new_owner }OwnershipTransferred { previous_owner, new_pending_owner }OwnershipAccepted { previous_owner, new_owner }
Errors
Defined in error.rs (HinkalError). Selected categories:
Configuration / supply issues
InvalidMintConfiguration,MissingMintFrom,MissingMintTo,IdenticalTokenMintsMissingStorageSourceAta,MissingStorageDestinationAta,MissingSwapperSourceAta,MissingSwapperDestinationAtaATAValidationFailed
Amount / dimension invariants
ReceivedAmountLowerThanExpectedExpectedNegativeInputAmount,ExpectedPositiveOutputAmountUnexpectedDimensions,UnsupportedDimensions,UnsupportedDimensionsErrorInvalidPublicSignalsSizeInvalidAmountChangeOnChainCreationLengthMismatch,EncryptedOutputsLengthMismatchBalanceDiffMismatch
Proof / cryptography
ProofVerificationFailedCalldataHashMismatchRootHashDoesNotExistValueLargerThanCircomPPoseidonHashFailedZeroRandomizationForbiddenExpectedMintAddressZero,ExpectedMintAddressNotZero
Nullifier integrity
NullifierUsedNullifierNotZeroButAccountNotSpecifiedNullifierAccountsListLengthMustBeEvenInNullifiersLengthMismatch,InNullifierMismatchInvalidNullifierPDA
Authorization
UnauthorizedRelayerNotWhitelistedExpectedAccessTokenOwner,AccessTokenRequired,AccessTokenAlreadyAddedAccessTokenOwnerDepositForbiddenDepositForbidden
External call safety
RemainingAccountSignerForbiddenSelfCPIForbidden
Swap-specific
SwapperAccountAdditionalSeedMismatchFeeCalculationOverflow
Generic
UnsafeArithmeticUnexpectedValueUnexpectedOnchainCreationInvalidVersion
merkle.rs defines a separate MerkleError enum:
TreeIsFullIncompleteHash
Last updated

