Expand description
Module for handling Internet Computer ledger operations and account management.
This module provides utilities for working with the Internet Computer’s ledger system, including account identifier computation, subaccount management, and conversion between different account formats.
§Example
use candid::Principal;
use ic_ledger_types::AccountIdentifier;
let principal = Principal::from_text("rrkah-fqaaa-aaaaa-aaaaq-cai").unwrap();
let account_id = principal_to_legacy_account_id(principal, None);Functions§
- compute_
neuron_ staking_ subaccount_ bytes - Computes a neuron staking subaccount using SHA-256 hashing.
- icrc_
account_ to_ legacy_ account_ id - Converts an ICRC-1 account to a legacy account identifier.
- principal_
to_ legacy_ account_ id - Creates a legacy account identifier from a principal and optional subaccount.