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>)>; 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>)] ) -> DispatchResult; fn deposit( charge_id: Hash, request_charge: RequestCharge<Account, Balance, AssetId> ) -> DispatchResult; fn finalize( charge_id: Hash, outcome: Outcome, maybe_recipient: Option<Account>, maybe_actual_fees: Option<Balance> ) -> DispatchResult; 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> ) -> DispatchResult; 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> ) -> DispatchResult;
}

Required Methods§

source

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

Lookup charge by Id and fail if not found

source

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

Lookup charge by Id and fail if not found

source

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

Lookup charge by Id and fail if not found

source

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

Get all settlements by role in the current round

source

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

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

source

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

Validate deposit goes through

source

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

Send batch deposits to a recipient via the escrow

source

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

Send funds to a recipient via the escrow

source

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

Finalize a transaction, with an optional reason for failures

source

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

Assert infallible finalize of a transaction if exists

source

fn cancel_deposit(charge_id: Hash) -> bool

source

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

source

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

source

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

source

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

source

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

Implementors§