pub struct Token { /* private fields */ }Expand description
FFI-compatible Token
Implementations§
Source§impl Token
impl Token
Sourcepub fn from_string(encoded_token: String) -> Result<Token, FfiError>
pub fn from_string(encoded_token: String) -> Result<Token, FfiError>
Create a new Token from string
Sourcepub fn unit(&self) -> Option<CurrencyUnit>
pub fn unit(&self) -> Option<CurrencyUnit>
Get the currency unit
Sourcepub fn proofs_simple(&self) -> Result<Proofs, FfiError>
pub fn proofs_simple(&self) -> Result<Proofs, FfiError>
Get proofs from the token (simplified - no keyset filtering for now)
Sourcepub fn proofs(&self, mint_keysets: Vec<KeySetInfo>) -> Result<Proofs, FfiError>
pub fn proofs(&self, mint_keysets: Vec<KeySetInfo>) -> Result<Proofs, FfiError>
Get proofs from the token
Sourcepub fn decode(encoded_token: String) -> Result<Token, FfiError>
pub fn decode(encoded_token: String) -> Result<Token, FfiError>
Decode token from string representation
Sourcepub fn spending_conditions(&self) -> Vec<SpendingConditions>
pub fn spending_conditions(&self) -> Vec<SpendingConditions>
Return unique spending conditions across all proofs in this token
Sourcepub fn p2pk_pubkeys(&self) -> Vec<String>
pub fn p2pk_pubkeys(&self) -> Vec<String>
Return all P2PK pubkeys referenced by this token’s spending conditions
Sourcepub fn p2pk_refund_pubkeys(&self) -> Vec<String>
pub fn p2pk_refund_pubkeys(&self) -> Vec<String>
Return all refund pubkeys from P2PK spending conditions
Sourcepub fn htlc_hashes(&self) -> Vec<String>
pub fn htlc_hashes(&self) -> Vec<String>
Return all HTLC hashes from spending conditions
Trait Implementations§
Source§impl<UT> LowerError<UT> for Token
impl<UT> LowerError<UT> for Token
Source§fn lower_error(obj: Self) -> RustBuffer
fn lower_error(obj: Self) -> RustBuffer
Lower this value for scaffolding function return Read more
Source§impl<UT> LowerReturn<UT> for Token
impl<UT> LowerReturn<UT> for Token
Source§type ReturnType = <Arc<Token> as LowerReturn<UniFfiTag>>::ReturnType
type ReturnType = <Arc<Token> as LowerReturn<UniFfiTag>>::ReturnType
The type that should be returned by scaffolding functions for this type. Read more
Source§fn lower_return(obj: Self) -> Result<Self::ReturnType, RustCallError>
fn lower_return(obj: Self) -> Result<Self::ReturnType, RustCallError>
Lower the return value from an scaffolding call Read more
Source§fn handle_failed_lift(
error: LiftArgsError,
) -> Result<Self::ReturnType, RustCallError>
fn handle_failed_lift( error: LiftArgsError, ) -> Result<Self::ReturnType, RustCallError>
Lower the return value for failed argument lifts Read more
Auto Trait Implementations§
impl Freeze for Token
impl RefUnwindSafe for Token
impl Send for Token
impl Sync for Token
impl Unpin for Token
impl UnsafeUnpin for Token
impl UnwindSafe for Token
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more