Module deepbook::custodian
- Struct
Account
- Struct
AccountCap
- Struct
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 std::address;
use std::ascii;
use std::bcs;
use std::option;
use std::string;
use std::type_name;
use std::vector;
use sui::address;
use sui::bag;
use sui::balance;
use sui::coin;
use sui::config;
use sui::deny_list;
use sui::dynamic_field;
use sui::dynamic_object_field;
use sui::event;
use sui::hex;
use sui::object;
use sui::table;
use sui::transfer;
use sui::tx_context;
use sui::types;
use sui::url;
use sui::vec_set;
Struct Account
public struct AccountT has store
Click to open
Fields
- available_balance: sui::balance::Balance<T>
- locked_balance: sui::balance::Balance<T>
Struct AccountCap
public struct AccountCap has key, store
Click to open
Fields
- id: sui::object::UID
Struct Custodian
public struct CustodianT has key, store
Click to open
Fields
- id: sui::object::UID
- account_balances: sui::table::Table<sui::object::ID, deepbook::custodian::Account<T>>
- Map from an AccountCap object ID to an Account object
Function mint_account_cap
Create an AccountCap that can be used across all DeepBook pool
public fun mint_account_cap(ctx: &mut sui::tx_context::TxContext): deepbook::custodian::AccountCap
Click to open
Implementation
public fun mint_account_cap(ctx: &mut TxContext): AccountCap {
AccountCap { id: object::new(ctx) }
}