Expand description
§Apex SDK Types
Common types and data structures used across the Apex SDK.
This crate provides fundamental types for representing blockchain entities across different chain types (Substrate, EVM, Hybrid).
§Core Types
- Chain: Enumeration of supported blockchain networks
- ChainType: Classification of chains (Substrate, EVM, Hybrid)
- Address: Generic address type supporting multiple formats
- TransactionStatus: Unified transaction status representation
- CrossChainTransaction: Cross-chain transaction information
§Example
use apex_sdk_types::{Chain, ChainType, Address};
// Create addresses for different chains
let eth_addr = Address::evm("0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb7");
let dot_addr = Address::substrate("15oF4uVJwmo4TdGW7VfQxNLavjCXviqxT9S1MgbjMNHr6Sp5");
// Check chain types
assert_eq!(Chain::Ethereum.chain_type(), ChainType::Evm);
assert_eq!(Chain::Polkadot.chain_type(), ChainType::Substrate);
assert_eq!(Chain::Moonbeam.chain_type(), ChainType::Hybrid);Re-exports§
pub use TransactionStatus as OldTransactionStatus;
Structs§
- Cross
Chain Transaction - Cross-chain transaction info
- Event
- Represents a blockchain event emitted by a smart contract or runtime.
- Event
Filter - Filter criteria for subscribing to blockchain events.
- Transaction
Status - Comprehensive transaction status information
Enums§
- Address
- Generic address type for different chains
- Chain
- Supported blockchain networks
- Chain
Type - Blockchain types
- TxStatus
- Transaction status
- Validation
Error - Errors that can occur when working with addresses and chains
Functions§
- extract_
ss58_ prefix - Extract SS58 network prefix from an address string Returns None if the address cannot be decoded