DeepBookMarginPool class

Helper class wrapping DeepBook's MarginPool contract interactions.

Handles parameter retrieval, simulate-based pool parameter previews, and supplier-cap based parameter calls.

Constructors

DeepBookMarginPool({String? network, String address = '', SuiGrpcClient? suiClient, DeepBookConfig? dbConfig})
@param network - Optional network ('testnet' | 'mainnet'). @param address - Optional sender address (used for simulation). @param suiClient - Optional grpc.SuiGrpcClient; defaults to a fullnode client. @param dbConfig - Optional DeepBookConfig; derives network when omitted.

Properties

dbConfig DeepBookConfig
Resolved DeepBook configuration.
latefinal
hashCode int
The hash code for this object.
no setterinherited
marginPoolContract MarginPoolContract
Margin pool contract wrapper.
latefinal
network String
The network this instance targets.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
suiClient ↔ SuiGrpcClient
Underlying Sui gRPC client.
latefinal

Methods

buildMintSupplierCap(Transaction tx) → TransactionResult
Build a mint-supplier-cap call. Returns the new cap object argument — transfer it to the owner in the same tx when minting a fresh cap.
buildMintSupplyReferral(Transaction tx, String coinKey) → TransactionResult
Build a mint-supply-referral call. Returns the new referral object argument.
buildSupply(Transaction tx, String coinKey, dynamic supplierCap, num amount, {String? owner, String? referralId}) Future<void>
Build a supply call from a human amount, resolving the supply coin (SUI from gas, otherwise from the owner's coins). No signing.
buildWithdraw(Transaction tx, String coinKey, dynamic supplierCap, {num? amount}) → TransactionResult
Build a withdraw call. Returns the withdrawn coin argument for the caller to transfer/merge into the wallet. Omit amount to withdraw all. No signing.
buildWithdrawReferralFees(Transaction tx, String coinKey, String referralId) → TransactionResult
Build a withdraw-referral-fees call. No signing.
dispose() Future<void>
Release the underlying gRPC channel.
getPoolParameters(String coinKey, {String? supplierCapId}) Future<MarginPoolParams>
Build, simulate, and decode the parameters of a single margin pool.
getPoolsParameters(List<String> coinKeys, {String? supplierCapId}) Future<List<MarginPoolParams>>
Batch version of getPoolParameters for reduced RPC calls.
getSupplierCapIds([String? owner]) Future<List<String>>
List the SupplierCap object ids owned by owner (defaults to dbConfig.address). A wallet integrator can let the user pick among these.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited