use candid::{CandidType, Nat, Principal};
use num_bigint::BigUint;
use serde::{Deserialize, Serialize};
use serde_bytes::ByteBuf;

pub mod chain;
pub mod error;
pub mod pager;
pub mod range;
pub mod report;
pub mod result;
pub mod setting;
pub mod wallet_identifier;
pub mod withdrawal;

pub type PublicKey = ByteBuf;
pub type BlockHash = [u8; 32];
pub type TransactionHash = [u8; 32];
pub type MerkleRoot = [u8; 32];

pub type AssetId = Nat;
pub type SerdeAssetId = BigUint;

pub type AssetAmount = Nat;
pub type SerdeAssetAmount = BigUint;

pub type BlockHeight = Nat;
pub type SerdeBlockHeight = BigUint;

pub type WalletRegisterId = Nat;
pub type SerdeWalletRegisterId = BigUint;

pub type Nonce = Nat;
pub type SerdeNonce = BigUint;

pub type CanisterId = Principal;
pub type NodeProvider = Principal;

#[derive(CandidType, Debug, Clone, Deserialize, Serialize, PartialEq, Eq)]
pub enum SnapshotVaultStatus {
    Uninitialized,
    /// The snapshot vault is initialized
    Initialized,
    /// The snapshot vault is registered
    Registered,
    /// The snapshot vault is activated
    Activated,
}

impl Default for SnapshotVaultStatus {
    fn default() -> Self {
        Self::Uninitialized
    }
}
