pub enum Asset {
Native(Pubkey),
TokenProgram(TokenAsset),
}Expand description
One side of a trade: what moves, and the account it moves through.
The wire spells a side as a (mint, account) pair; this is the same pair
with the one combination that isn’t a token account named for what it is.
Variants§
Native(Pubkey)
Native SOL, moving as lamports on this plain account rather than through a token account.
TokenProgram(TokenAsset)
Tokens moved by a token program.
Implementations§
Trait Implementations§
impl Eq for Asset
impl StructuralPartialEq for Asset
Source§impl TryFrom<TokenAsset> for Asset
impl TryFrom<TokenAsset> for Asset
Source§fn try_from(token: TokenAsset) -> Result<Self, Self::Error>
fn try_from(token: TokenAsset) -> Result<Self, Self::Error>
Rejects a token naming ENCODED_NATIVE_SOL_TRANSFER: that’s native SOL, and
wrapping it as a token side would encode an asset that decodes back as
Asset::Native.
Source§type Error = NativeSolHasNoMint
type Error = NativeSolHasNoMint
The type returned in the event of a conversion error.
Auto Trait Implementations§
impl Freeze for Asset
impl RefUnwindSafe for Asset
impl Send for Asset
impl Sync for Asset
impl Unpin for Asset
impl UnsafeUnpin for Asset
impl UnwindSafe for Asset
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