vialabs-stellar-common 0.1.10

Common interfaces, types, and utilities for Stellar contracts in the VIA cross-chain messaging system
Documentation
/// # Errors Module
///
/// This module provides error types for contract operations.
use soroban_sdk::contracterror;

#[contracterror]
#[derive(Copy, Clone, Debug, PartialEq)]
pub enum Error {
  /// Invalid number of signatures provided
  InvalidSignatureCount = 1,
  /// The system is not enabled
  SystemNotEnabled = 2,
  /// Recipient address is zero
  RecipientZeroAddress = 3,
  /// Fee was not paid
  FeeNotPaid = 4,
  /// Transaction has already been processed
  TransactionAlreadyProcessed = 5,
  /// Relayer is not authorized
  RelayerNotAuthorized = 6,
  /// Caller is not a relayer
  CallerNotRelayer = 7,
  /// Gas refund failed
  GasRefundFailed = 8,
  /// Invalid key provided
  InvalidKey = 9,
  /// Duplicate signer detected
  DuplicateSignerDetected = 10,
  /// Insufficient project signatures
  InsufficientProjectSignatures = 11,
  /// Insufficient chain signatures
  InsufficientChainSignatures = 12,
  /// Insufficient VIA signatures
  InsufficientVIASignatures = 13,
  /// POS (Proof of Stake) validation failed
  POSValidationFailed = 14,
  /// Chains and endpoints arrays have mismatched lengths
  ChainsEndpointsMislength = 15,
  /// Message gateway is not set
  MissingMessageGateway = 16,
  /// Chain endpoint is not configured
  MissingChainEndpoint = 17,
  /// Caller is not the gateway
  CallerNotGateway = 18,
  /// Gas amount exceeds maximum allowed
  GasAmountExceedsMaxGasAmount = 19,
  /// Gas amount is not authorized
  GasAmountNotAuthorized = 20,
  /// Insufficient balance
  InsufficientBalance = 21,
  /// Gas token contract is not set
  GasTokenContractNotSet = 22,
  /// Maximum fee exceeds maximum fee amount
  MaxFeeExceededMaxFeeAmount = 23,
  /// Fee token contract is not set
  FeeTokenContractNotSet = 24,
  /// Fee amount is not authorized
  FeeAmountNotAuthorized = 25,
  /// Invalid recipient address
  InvalidRecipient = 26,
  /// Invalid amount (e.g., zero or negative)
  InvalidAmount = 27,
  /// Amount overflow occurred
  AmountOverflow = 28,
  /// Sender length doesn't match expected length
  SenderLengthMismatch = 29,
  /// Invalid chain sender
  InvalidChainSender = 30,
  /// Address XDR representation is too short
  AddressXDRRepresentationTooShort = 31,
  /// Owner is not set
  OwnerNotSet = 32,
  /// Chain details not found
  ChainDetailsNotFound = 33,
  /// Invalid public key
  InvalidPublicKey = 34,
  /// Owner has already been set
  OwnerAlreadySet = 35,
  /// Unauthorized contract caller
  UnauthorizedContractCaller = 36,
  /// Unauthorized bridge caller
  UnauthorizedBridgeCaller = 37,
  /// Text message is too long
  TextTooLong = 38,
  /// Invalid XDR address format
  InvalidXDRAddress = 39,
}