junobuild_shared::ledger::icp

Function principal_to_account_identifier

Source
pub fn principal_to_account_identifier(
    principal: &Principal,
    sub_account: &Subaccount,
) -> AccountIdentifier
Expand description

Converts a principal and subaccount into an account identifier.

§Arguments

  • principal - A reference to the principal to be converted.
  • sub_account - A reference to the subaccount.

§Returns

An AccountIdentifier derived from the given principal and subaccount.