pub trait AccountManager<Account, Balance, Hash, BlockNumber, AssetId> {
Show 16 methods // Required methods fn get_charge_or_fail( charge_id: Hash ) -> Result<RequestCharge<Account, Balance, AssetId>, DispatchError>; fn no_charge_or_fail(charge_id: Hash) -> Result<(), DispatchError>; fn get_settlement( charge_id: Hash ) -> Option<Settlement<Account, Balance, AssetId>>; fn get_settlements_by_role( role: CircuitRole ) -> Vec<(Account, Settlement<Account, Balance, AssetId>), Global>; fn bump_contracts_registry_nonce() -> Result<Hash, DispatchError>; fn validate_deposit( charge_id: Hash, request_charge: RequestCharge<Account, Balance, AssetId> ) -> Result<Balance, DispatchError>; fn deposit_batch( batch: &[(Hash, RequestCharge<Account, Balance, AssetId>)] ) -> Result<(), DispatchError>; fn deposit( charge_id: Hash, request_charge: RequestCharge<Account, Balance, AssetId> ) -> Result<(), DispatchError>; fn finalize( charge_id: Hash, outcome: Outcome, maybe_recipient: Option<Account>, maybe_actual_fees: Option<Balance> ) -> Result<(), DispatchError>; fn finalize_infallible(charge_id: Hash, outcome: Outcome) -> bool; fn cancel_deposit(charge_id: Hash) -> bool; fn assign_deposit(charge_id: Hash, recipient: &Account) -> bool; fn transfer_deposit( charge_id: Hash, new_charge_id: Hash, new_reward: Option<Balance>, new_payee: Option<&Account>, new_recipient: Option<&Account> ) -> Result<(), DispatchError>; fn can_withdraw( beneficiary: &Account, amount: Balance, asset_id: Option<AssetId> ) -> bool; fn deposit_immediately( beneficiary: &Account, amount: Balance, asset_id: Option<AssetId> ); fn withdraw_immediately( beneficiary: &Account, amount: Balance, asset_id: Option<AssetId> ) -> Result<(), DispatchError>;
}

Required Methods§

fn get_charge_or_fail( charge_id: Hash ) -> Result<RequestCharge<Account, Balance, AssetId>, DispatchError>

Lookup charge by Id and fail if not found

fn no_charge_or_fail(charge_id: Hash) -> Result<(), DispatchError>

Lookup charge by Id and fail if not found

fn get_settlement( charge_id: Hash ) -> Option<Settlement<Account, Balance, AssetId>>

Lookup charge by Id and fail if not found

fn get_settlements_by_role( role: CircuitRole ) -> Vec<(Account, Settlement<Account, Balance, AssetId>), Global>

Get all settlements by role in the current round

fn bump_contracts_registry_nonce() -> Result<Hash, DispatchError>

Bump contracts registry nonce in Account Manager nonce state and return charge request Id

fn validate_deposit( charge_id: Hash, request_charge: RequestCharge<Account, Balance, AssetId> ) -> Result<Balance, DispatchError>

Validate deposit goes through

fn deposit_batch( batch: &[(Hash, RequestCharge<Account, Balance, AssetId>)] ) -> Result<(), DispatchError>

Send batch deposits to a recipient via the escrow

fn deposit( charge_id: Hash, request_charge: RequestCharge<Account, Balance, AssetId> ) -> Result<(), DispatchError>

Send funds to a recipient via the escrow

fn finalize( charge_id: Hash, outcome: Outcome, maybe_recipient: Option<Account>, maybe_actual_fees: Option<Balance> ) -> Result<(), DispatchError>

Finalize a transaction, with an optional reason for failures

fn finalize_infallible(charge_id: Hash, outcome: Outcome) -> bool

Assert infallible finalize of a transaction if exists

fn cancel_deposit(charge_id: Hash) -> bool

fn assign_deposit(charge_id: Hash, recipient: &Account) -> bool

fn transfer_deposit( charge_id: Hash, new_charge_id: Hash, new_reward: Option<Balance>, new_payee: Option<&Account>, new_recipient: Option<&Account> ) -> Result<(), DispatchError>

fn can_withdraw( beneficiary: &Account, amount: Balance, asset_id: Option<AssetId> ) -> bool

fn deposit_immediately( beneficiary: &Account, amount: Balance, asset_id: Option<AssetId> )

fn withdraw_immediately( beneficiary: &Account, amount: Balance, asset_id: Option<AssetId> ) -> Result<(), DispatchError>

Implementors§