Skip to main content

Crate qorechain

Crate qorechain 

Source
Expand description

QoreChain SDK for Rust.

This crate mirrors the QoreChain TypeScript, Python, and Go SDKs and provides the building blocks dApp developers need to talk to a QoreChain network:

  • [networks] — built-in network presets (testnet and mainnet, both live).
  • denom — exact integer conversion between display and base amounts.
  • address — bech32 / hex address conversion and validation.
  • accounts — BIP-39 mnemonics and HD derivation of native (QoreChain Native secp256k1), EVM (secp256k1), and SVM (ed25519) accounts.
  • pqc — post-quantum ML-DSA-87 (FIPS 204) keygen / sign / verify and the on-chain hybrid-signature extension builder.
  • query — async REST (LCD) and JSON-RPC read clients, including the typed qor_* namespace.
  • client — the top-level create_client factory.
  • tx — native bank-send building/signing, REST broadcast, and end-to-end hybrid (classical + ML-DSA-87) transaction signing.
  • ai — EVM AI pre-flight precompiles (aiRiskScore / aiAnomalyCheck) over eth_call, plus an advisory simulate_with_risk_score.
  • cross_vm — high-level unified cross-VM call helper (build / sign / broadcast MsgCrossVMCall, including atomic multi-call txs).
  • pqc_dx — high-level quantum-safe DX helper (idempotent PQC-key registration, status reads, key rotation, and a bound hybrid send path).
  • unified — the unified eth-native wallet: one secp256k1 key rendered as all three address encodings (native/EVM/SVM) plus a deterministic ML-DSA-87 keypair, so a single identity shares one balance across all lanes.
  • sign_etheth_secp256k1 native-lane signing (classical + hybrid) for the unified account: secp256k1 over keccak256(SignDoc) with the eth_secp256k1 pubkey type.

Re-exports§

pub use error::Error;
pub use error::Result;
pub use networks::get_network;
pub use networks::list_networks;
pub use networks::networks;
pub use networks::Bech32Prefixes;
pub use networks::CoinInfo;
pub use networks::Endpoints;
pub use networks::NetworkConfig;
pub use denom::from_base;
pub use denom::to_base;
pub use denom::DEFAULT_EXPONENT;
pub use address::bech32_to_hex;
pub use address::bytes_to_bech32;
pub use address::hex_to_bech32;
pub use address::is_valid_bech32;
pub use address::DEFAULT_PREFIX;
pub use accounts::derive_evm_account;
pub use accounts::derive_native_account;
pub use accounts::derive_svm_account;
pub use accounts::generate_mnemonic;
pub use accounts::validate_mnemonic;
pub use accounts::Ed25519Account;
pub use accounts::Secp256k1Account;
pub use pqc::build_hybrid_signature_extension;
pub use pqc::generate_pqc_keypair;
pub use pqc::pqc_keypair_from_seed;
pub use pqc::pqc_sign;
pub use pqc::pqc_sign_hedged;
pub use pqc::pqc_verify;
pub use pqc::HybridSignatureExtension;
pub use pqc::PqcKeypair;
pub use pqc::ALGORITHM_DILITHIUM5;
pub use pqc::ALGORITHM_MLKEM1024;
pub use pqc::HYBRID_SIG_TYPE_URL;
pub use pqc::MLDSA87_PUBLIC_KEY_LEN;
pub use pqc::MLDSA87_SECRET_KEY_LEN;
pub use pqc::MLDSA87_SIGNATURE_LEN;
pub use authenticator::cosmos_auth_sign_bytes;
pub use authenticator::derive_pqc_canonical;
pub use authenticator::derive_pqc_legacy;
pub use authenticator::evm_auth_sign_bytes;
pub use authenticator::rotate_pqc_key_msg_from_mnemonic;
pub use authenticator::rotation_sign_bytes;
pub use authenticator::RotateFromMnemonic;
pub use authenticator::RotateFromMnemonicOptions;
pub use authenticator::DERIVATION_CANONICAL;
pub use authenticator::DERIVATION_LEGACY;
pub use unified::addresses_from_20;
pub use unified::derive_unified_account;
pub use unified::qore_addresses;
pub use unified::unified_account_from_seed;
pub use unified::UnifiedAccount;
pub use unified::UnifiedAddresses;
pub use sign_eth::parse_ethsecp256k1_pubkey;
pub use sign_eth::sign_classical_eth;
pub use sign_eth::sign_hybrid_eth;
pub use sign_eth::unified_account_from_phantom_signature;
pub use sign_eth::EthBuiltTx;
pub use sign_eth::EthSignParams;
pub use sign_eth::ETHSECP256K1_PUBKEY_TYPE;
pub use query::JsonRpcClient;
pub use query::QorClient;
pub use query::RestClient;
pub use query::TypedQueryClient;
pub use query::QOR_METHODS;
pub use client::create_client;
pub use client::Client;
pub use client::ClientBuilder;
pub use client::Fees;
pub use tx::bank_send;
pub use tx::broadcast;
pub use tx::broadcast_and_wait;
pub use tx::build_hybrid_tx;
pub use tx::calculate_fee;
pub use tx::decode_tx_error;
pub use tx::estimate_fee;
pub use tx::estimate_gas;
pub use tx::fee_from_estimate;
pub use tx::get_block;
pub use tx::get_latest_block;
pub use tx::get_tx;
pub use tx::search_txs;
pub use tx::send_messages;
pub use tx::wait_for_tx;
pub use tx::with_retry;
pub use tx::BankSendParams;
pub use tx::BroadcastMode;
pub use tx::BuildHybridTxParams;
pub use tx::BuiltTx;
pub use tx::Coin;
pub use tx::Fee;
pub use tx::GasPrice;
pub use tx::Message;
pub use tx::QoreTxError;
pub use tx::SendMessagesParams;
pub use tx::TxResult;
pub use tx::TxSearchResult;
pub use tx::WaitOptions;
pub use tx::MSG_SEND_TYPE_URL;
pub use subscribe::Event;
pub use subscribe::SubscribeClient;
pub use subscribe::Subscription;
pub use ai::AiClient;
pub use ai::Anomaly;
pub use ai::Preflight;
pub use ai::PreflightTx;
pub use ai::RiskScore;
pub use ai::Score;
pub use ai::AI_ANOMALY_CHECK_PRECOMPILE;
pub use ai::AI_RISK_SCORE_PRECOMPILE;
pub use cross_vm::CallOptions;
pub use cross_vm::CrossVm;
pub use cross_vm::Payload;
pub use cross_vm::VM_TYPES;
pub use cross_vm::VM_TYPE_COSMWASM;
pub use cross_vm::VM_TYPE_EVM;
pub use cross_vm::VM_TYPE_SVM;
pub use pqc_dx::EnsureResult;
pub use pqc_dx::HybridSendPath;
pub use pqc_dx::MigrateKeyOptions;
pub use pqc_dx::PqcDx;
pub use pqc_dx::PqcStatus;
pub use pqc_dx::DEFAULT_KEY_TYPE;
pub use pqc_dx::PQC_KEY_STATUS_PRECOMPILE;
pub use utils::format_units;
pub use utils::hash160;
pub use utils::is_valid_evm_address;
pub use utils::is_valid_svm_address;
pub use utils::keccak256;
pub use utils::parse_units;
pub use utils::ripemd160;
pub use utils::sha256;
pub use utils::to_checksum_address;

Modules§

accounts
BIP-39 mnemonics and hierarchical-deterministic (HD) derivation of QoreChain accounts in all three supported schemes:
address
Conversion and validation for QoreChain bech32 addresses (e.g. qor1...) and their underlying byte payloads expressed as 0x-prefixed hex.
ai
AI pre-flight checks over the EVM JSON-RPC eth_call interface.
authenticator
v3.1.85 authenticator sign-bytes and key-rotation helpers.
client
The top-level create_client factory and ClientBuilder for the QoreChain Rust SDK.
cross_vm
High-level unified cross-VM call helper for QoreChain’s x/crossvm module.
denom
Convert between human display amounts and integer base amounts.
error
Crate-wide error type.
msg
Typed message constructors (composers) for every QoreChain custom-module message and the standard Native message types, plus the to_any helper that packs any prost message into a cosmrs::Any with the correct type_url.
networks
Built-in network presets for the QoreChain Rust SDK.
pqc
Post-quantum (PQC) signing for QoreChain, using ML-DSA-87 (Dilithium-5, NIST FIPS 204) for digital signatures.
pqc_dx
High-level quantum-safe developer-experience helper for QoreChain’s x/pqc module.
proto
Generated prost types for the QoreChain custom modules.
query
Async REST (LCD) and JSON-RPC read clients for QoreChain.
sign_eth
Eth-native (eth_secp256k1) native-lane signing (classical + hybrid).
subscribe
WebSocket subscriptions to the chain RPC /websocket endpoint, exposing typed helpers for new-block and transaction event subscriptions over JSON-RPC, mirroring the TS / Go SDKs.
tx
Native + hybrid (classical + post-quantum) transaction building, signing, and broadcast for QoreChain.
unified
Unified eth-native QoreChain wallet.
utils
Hashing, unit-conversion, and address-validation helpers shared across the QoreChain SDK, mirroring the TypeScript / Python / Go utils surface.