vialabs-stellar-common 0.1.10

Common interfaces, types, and utilities for Stellar contracts in the VIA cross-chain messaging system
Documentation
/// # Events Module
///
/// This module provides event types for contract operations.
use soroban_sdk::{contractevent, Address, Bytes, Vec};

/* send events */
#[contractevent]
#[derive(Clone, Debug, PartialEq)]
pub struct SendRequested {
  pub tx_id: u128,
  // Commented out, cannot guarantee sending contracts address on chain,
  // this is now derived off-chain in the StellarV4.ts driver
  // pub sender: Bytes,
  pub recipient: Bytes,
  pub destination_chain: u64,
  pub chain_data: Bytes,
  pub confirmations: u32,
}

/* system setup & config events */
#[contractevent]
#[derive(Clone, Debug, PartialEq)]
pub struct SetSystemEnabled {
  #[topic]
  pub system_enabled: bool,
}

#[contractevent]
#[derive(Clone, Debug, PartialEq)]
pub struct SetViaSigners {
  pub via_signers: Vec<Address>,
  pub required: u32,
}

#[contractevent]
#[derive(Clone, Debug, PartialEq)]
pub struct SetChainSigners {
  pub chain_signers: Vec<Address>,
  pub required: u32,
}

#[contractevent]
#[derive(Clone, Debug, PartialEq)]
pub struct SetRelayers {
  pub relayers: Vec<Address>,
  pub required: bool,
}

#[contractevent]
#[derive(Clone, Debug, PartialEq)]
pub struct SetContractRelayers {
  pub contract: Address,
  pub relayers: Vec<Address>,
}

#[contractevent]
#[derive(Clone, Debug, PartialEq)]
pub struct SetProjectSigners {
  pub contract: Address,
  pub signers: Vec<Address>,
  pub required: u32,
}

/* process events */
#[contractevent]
#[derive(Clone, Debug, PartialEq)]
pub struct SendProcessed {}

/* gas events */
#[contractevent]
#[derive(Clone, Debug, PartialEq)]
pub struct SetMaxGasAmount {
  pub max_gas_amount: u64,
  pub client_contract: Address,
}

#[contractevent]
#[derive(Clone, Debug, PartialEq)]
pub struct SetGasHandler {
  pub gas_handler: Address,
}

#[contractevent]
#[derive(Clone, Debug, PartialEq)]
pub struct SetFeeHandler {
  pub fee_handler: Address,
}

/* fees events */
#[contractevent]
#[derive(Clone, Debug, PartialEq)]
pub struct SetFeesOffline {
  pub status: bool,
}

#[contractevent]
#[derive(Clone, Debug, PartialEq)]
pub struct SetCustomSourceFee {
  pub client_contract: Address,
  pub amount: u64,
}

#[contractevent]
#[derive(Clone, Debug, PartialEq)]
pub struct SetMaxFeeAmount {
  pub client_contract: Address,
  pub amount: u64,
}

#[contractevent]
#[derive(Clone, Debug, PartialEq)]
pub struct SetFeeTokenContract {
  pub client_contract: Address,
  pub contract: Address,
}

#[contractevent]
#[derive(Clone, Debug, PartialEq)]
pub struct SetTokenContract {
  pub client_contract: Address,
  pub token_contract: Address,
}

/* pos events */
#[contractevent]
#[derive(Clone, Debug, PartialEq)]
pub struct SetPosHandler {
  pub pos_handler: Address,
}