Module 0xdee9::custodian
- Struct
Account
- Resource
AccountCap
- Resource
Custodian
- Function
mint_account_cap
- Function
account_balance
- Function
new
- Function
withdraw_asset
- Function
increase_user_available_balance
- Function
decrease_user_available_balance
- Function
increase_user_locked_balance
- Function
decrease_user_locked_balance
- Function
lock_balance
- Function
unlock_balance
- Function
account_available_balance
- Function
account_locked_balance
- Function
borrow_mut_account_balance
use 0x2::balance;
use 0x2::coin;
use 0x2::object;
use 0x2::table;
use 0x2::tx_context;
Struct Account
struct Account<T> has store
Click to open
Fields
Resource AccountCap
struct AccountCap has store, key
Click to open
Fields
Resource Custodian
struct Custodian<T> has store, key
Click to open
Fields
Function mint_account_cap
Create an AccountCap that can be used across all DeepBook pool
public fun mint_account_cap(ctx: &mut tx_context::TxContext): custodian::AccountCap
Click to open
Implementation
Function account_balance
public(friend) fun account_balance<Asset>(custodian: &custodian::Custodian<Asset>, user: object::ID): (u64, u64)
Click to open
Implementation
Function new
public(friend) fun new<T>(ctx: &mut tx_context::TxContext): custodian::Custodian<T>
Click to open
Implementation
Function withdraw_asset
public(friend) fun withdraw_asset<Asset>(custodian: &mut custodian::Custodian<Asset>, quantity: u64, account_cap: &custodian::AccountCap, ctx: &mut tx_context::TxContext): coin::Coin<Asset>
Click to open
Implementation
Function increase_user_available_balance
public(friend) fun increase_user_available_balance<T>(custodian: &mut custodian::Custodian<T>, user: object::ID, quantity: balance::Balance<T>)
Click to open
Implementation
Function decrease_user_available_balance
public(friend) fun decrease_user_available_balance<T>(custodian: &mut custodian::Custodian<T>, account_cap: &custodian::AccountCap, quantity: u64): balance::Balance<T>
Click to open
Implementation
Function increase_user_locked_balance
public(friend) fun increase_user_locked_balance<T>(custodian: &mut custodian::Custodian<T>, account_cap: &custodian::AccountCap, quantity: balance::Balance<T>)
Click to open
Implementation
Function decrease_user_locked_balance
public(friend) fun decrease_user_locked_balance<T>(custodian: &mut custodian::Custodian<T>, user: object::ID, quantity: u64): balance::Balance<T>
Click to open
Implementation
Function lock_balance
Move quantity from the unlocked balance of user to the locked balance of user
public(friend) fun lock_balance<T>(custodian: &mut custodian::Custodian<T>, account_cap: &custodian::AccountCap, quantity: u64)
Click to open
Implementation
Function unlock_balance
Move quantity from the locked balance of user to the unlocked balacne of user
public(friend) fun unlock_balance<T>(custodian: &mut custodian::Custodian<T>, user: object::ID, quantity: u64)
Click to open
Implementation
Function account_available_balance
public(friend) fun account_available_balance<T>(custodian: &custodian::Custodian<T>, user: object::ID): u64
Click to open
Implementation
Function account_locked_balance
public(friend) fun account_locked_balance<T>(custodian: &custodian::Custodian<T>, user: object::ID): u64
Click to open
Implementation
Function borrow_mut_account_balance
fun borrow_mut_account_balance<T>(custodian: &mut custodian::Custodian<T>, user: object::ID): &mut custodian::Account<T>
Click to open