pub type CanisterId = candid::Principal; pub type CanisterIdText = String;
pub type UserId = candid::Principal; pub type UserIdText = String;
pub type CallerId = candid::Principal; pub type CallerIdText = String;
pub type Subaccount = icrc_ledger_types::icrc1::account::Subaccount; pub type SubaccountHex = String;
pub type AccountIdentifier = ic_ledger_types::AccountIdentifier; pub type AccountIdentifierHex = String;
pub fn u64_to_subaccount(value: u64) -> Subaccount {
let mut subaccount: [u8; 32] = [0; 32];
subaccount[24..].copy_from_slice(&value.to_be_bytes());
subaccount
}
#[inline]
pub fn caller() -> CallerId {
ic_cdk::api::msg_caller()
}
#[inline]
pub fn self_canister_id() -> CanisterId {
ic_cdk::api::canister_self()
}