pub trait AMMFields: LedgerObjectCommonFields {
// Provided methods
fn account(&self) -> Result<AccountID> { ... }
fn trading_fee(&self) -> Result<Option<u16>> { ... }
fn lp_token_balance(&self) -> Result<Amount> { ... }
fn asset(&self) -> Result<Issue> { ... }
fn asset2(&self) -> Result<Issue> { ... }
fn owner_node(&self) -> Result<u64> { ... }
fn previous_txn_id(&self) -> Result<Option<Hash256>> { ... }
fn previous_txn_lgr_seq(&self) -> Result<Option<u32>> { ... }
}Expand description
Trait providing access to fields specific to AMM objects in any ledger.
Provided Methods§
Sourcefn account(&self) -> Result<AccountID>
fn account(&self) -> Result<AccountID>
The address of the special account that holds this AMM’s assets.
Sourcefn trading_fee(&self) -> Result<Option<u16>>
fn trading_fee(&self) -> Result<Option<u16>>
The percentage fee to be charged for trades against this AMM instance, in units of 1/100,000. The maximum value is 1000, for a 1% fee.
Sourcefn lp_token_balance(&self) -> Result<Amount>
fn lp_token_balance(&self) -> Result<Amount>
The total outstanding balance of liquidity provider tokens from this AMM instance. The holders of these tokens can vote on the AMM’s trading fee in proportion to their holdings, or redeem the tokens for a share of the AMM’s assets which grows with the trading fees collected.
Sourcefn asset(&self) -> Result<Issue>
fn asset(&self) -> Result<Issue>
The definition for one of the two assets this AMM holds. In JSON, this is an object with
currency and issuer fields.
Sourcefn asset2(&self) -> Result<Issue>
fn asset2(&self) -> Result<Issue>
The definition for the other asset this AMM holds. In JSON, this is an object with
currency and issuer fields.
Sourcefn owner_node(&self) -> Result<u64>
fn owner_node(&self) -> Result<u64>
The OwnerNode field (Required).
Sourcefn previous_txn_id(&self) -> Result<Option<Hash256>>
fn previous_txn_id(&self) -> Result<Option<Hash256>>
The identifying hash of the transaction that most recently modified this entry.
Sourcefn previous_txn_lgr_seq(&self) -> Result<Option<u32>>
fn previous_txn_lgr_seq(&self) -> Result<Option<u32>>
The index of the ledger that contains the transaction that most recently modified this entry.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".