pub struct CreateSupplyRequest {
pub offered: UniqueAssetId,
pub desired: UniqueAssetId,
pub receiver_address: Option<Principal>,
pub exchange_rate: u256,
pub max_amount: u256,
pub ext_ref: u32,
pub take_all: bool,
pub controller: Option<ContractId>,
pub valid_until: u64,
}
Fields§
§offered: UniqueAssetId
The asset offered in exchange for the desired asset - unique ID containing the ledger ID.
desired: UniqueAssetId
Desired in exchange for the offered asset - unique ID containing the ledger ID.
receiver_address: Option<Principal>
If different to sender.
exchange_rate: u256
The exchangerate yields the amount of output (offered) asset by multiplying it with the amount of desired asset and dividing by decimalPointer.
max_amount: u256
Maximum, that can be traded.
ext_ref: u32
Hex reference, so that the supply can be retrieved again. Does not have to be 32 bytes. It just must be unique.
take_all: bool
If the offer must be consumed all at once.
controller: Option<ContractId>
Optional address to a whitelist/blacklist.
valid_until: u64
Can be 0. That’s the maximum lifetime of the supply in nanoseconds.
Trait Implementations§
§impl CandidType for CreateSupplyRequest
impl CandidType for CreateSupplyRequest
§impl<'de> Deserialize<'de> for CreateSupplyRequest
impl<'de> Deserialize<'de> for CreateSupplyRequest
§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl Serialize for CreateSupplyRequest
impl Serialize for CreateSupplyRequest
Auto Trait Implementations§
impl Freeze for CreateSupplyRequest
impl RefUnwindSafe for CreateSupplyRequest
impl Send for CreateSupplyRequest
impl Sync for CreateSupplyRequest
impl Unpin for CreateSupplyRequest
impl UnwindSafe for CreateSupplyRequest
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more