Module utils

Source

Functions§

cancel_withdrawal
Cancels a withdrawal request, returning the withheld amount to the available balance.
confirm_withdrawal
Confirms a successful withdrawal by updating the necessary balances.
get_available_balance
Retrieves the total available balance for a user.
get_canister_balance
Retrieves the total balance available to a specific canister.
get_remitted_balance
Retrieves the remitted balance for a given account and amount.
hash_remittance_parameters
Hashes the parameters needed for a remittance transaction.
only_whitelisted_dc_canister
Ensures the caller is a whitelisted DC canister, otherwise panics. This function checks if the caller’s principal ID is in the list of allowed DC canisters.
update_balance
Updates the balance for a specific account in a DC canister within the remittance mapping.
update_canister_balance
Updates the canister’s balance for a specific token.
validate_dc_remittance_data
Validates remittance data for processing by a DC canister.
validate_pdc_remittance_data
Validates remittance data for processing by a PDC.
validate_remittance_data
Validates remittance data based on whether the caller is a PDC or not.