pub struct NativeScript(/* private fields */);
Implementations§
Source§impl NativeScript
impl NativeScript
Sourcepub fn get_required_signers(&self) -> Ed25519KeyHashList
pub fn get_required_signers(&self) -> Ed25519KeyHashList
Returns an array of unique Ed25519KeyHashes contained within this script recursively on any depth level. The order of the keys in the result is not determined in any way.
pub fn hash(&self) -> ScriptHash
pub fn verify( &self, lower_bound: Option<Slot>, upper_bound: Option<Slot>, key_hashes: &Ed25519KeyHashList, ) -> bool
Source§impl NativeScript
impl NativeScript
Sourcepub fn to_cbor_bytes(&self) -> Vec<u8> ⓘ
pub fn to_cbor_bytes(&self) -> Vec<u8> ⓘ
- Serialize this type to CBOR bytes
- This type type supports encoding preservation so this will preserve round-trip CBOR formats.
- If created from scratch the CBOR will be canonical.
Sourcepub fn to_canonical_cbor_bytes(&self) -> Vec<u8> ⓘ
pub fn to_canonical_cbor_bytes(&self) -> Vec<u8> ⓘ
- Serialize this type to CBOR bytes using canonical CBOR encodings
Sourcepub fn from_cbor_bytes(cbor_bytes: &[u8]) -> Result<NativeScript, JsError>
pub fn from_cbor_bytes(cbor_bytes: &[u8]) -> Result<NativeScript, JsError>
- Create this type from CBOR bytes
Sourcepub fn to_cbor_hex(&self) -> String
pub fn to_cbor_hex(&self) -> String
- Serialize this type to CBOR bytes encoded as a hex string (useful for working with CIP30).
- This type type supports encoding preservation so this will preserve round-trip CBOR formats.
- If created from scratch the CBOR will be canonical.
Sourcepub fn to_canonical_cbor_hex(&self) -> String
pub fn to_canonical_cbor_hex(&self) -> String
- Serialize this type to CBOR bytes using canonical CBOR encodings as hex bytes
Sourcepub fn from_cbor_hex(cbor_bytes: &str) -> Result<NativeScript, JsError>
pub fn from_cbor_hex(cbor_bytes: &str) -> Result<NativeScript, JsError>
- Create this type from the CBOR bytes encoded as a hex string.
- This is useful for interfacing with CIP30
Source§impl NativeScript
impl NativeScript
Source§impl NativeScript
impl NativeScript
pub fn new_script_pubkey(ed25519_key_hash: &Ed25519KeyHash) -> Self
pub fn new_script_all(native_scripts: &NativeScriptList) -> Self
pub fn new_script_any(native_scripts: &NativeScriptList) -> Self
pub fn new_script_n_of_k(n: u64, native_scripts: &NativeScriptList) -> Self
Sourcepub fn new_script_invalid_before(before: Slot) -> Self
pub fn new_script_invalid_before(before: Slot) -> Self
Timelock validity intervals are half-open intervals [a, b). This field specifies the left (included) endpoint a.
Sourcepub fn new_script_invalid_hereafter(after: Slot) -> Self
pub fn new_script_invalid_hereafter(after: Slot) -> Self
Timelock validity intervals are half-open intervals [a, b). This field specifies the right (excluded) endpoint b.
pub fn kind(&self) -> NativeScriptKind
pub fn as_script_pubkey(&self) -> Option<ScriptPubkey>
pub fn as_script_all(&self) -> Option<ScriptAll>
pub fn as_script_any(&self) -> Option<ScriptAny>
pub fn as_script_n_of_k(&self) -> Option<ScriptNOfK>
pub fn as_script_invalid_before(&self) -> Option<ScriptInvalidBefore>
pub fn as_script_invalid_hereafter(&self) -> Option<ScriptInvalidHereafter>
Trait Implementations§
Source§impl AsRef<NativeScript> for NativeScript
impl AsRef<NativeScript> for NativeScript
Source§fn as_ref(&self) -> &NativeScript
fn as_ref(&self) -> &NativeScript
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl Clone for NativeScript
impl Clone for NativeScript
Source§fn clone(&self) -> NativeScript
fn clone(&self) -> NativeScript
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for NativeScript
impl Debug for NativeScript
Source§impl From<NativeScript> for JsValue
impl From<NativeScript> for JsValue
Source§fn from(value: NativeScript) -> Self
fn from(value: NativeScript) -> Self
Converts to this type from the input type.
Source§impl From<NativeScript> for NativeScript
impl From<NativeScript> for NativeScript
Source§fn from(native: NativeScript) -> Self
fn from(native: NativeScript) -> Self
Converts to this type from the input type.
Source§impl FromWasmAbi for NativeScript
impl FromWasmAbi for NativeScript
Source§impl Into<NativeScript> for NativeScript
impl Into<NativeScript> for NativeScript
Source§fn into(self) -> NativeScript
fn into(self) -> NativeScript
Converts this type into the (usually inferred) input type.
Source§impl IntoWasmAbi for NativeScript
impl IntoWasmAbi for NativeScript
Source§impl LongRefFromWasmAbi for NativeScript
impl LongRefFromWasmAbi for NativeScript
Source§impl OptionFromWasmAbi for NativeScript
impl OptionFromWasmAbi for NativeScript
Source§impl OptionIntoWasmAbi for NativeScript
impl OptionIntoWasmAbi for NativeScript
Source§impl RefFromWasmAbi for NativeScript
impl RefFromWasmAbi for NativeScript
Source§type Anchor = RcRef<NativeScript>
type Anchor = RcRef<NativeScript>
The type that holds the reference to
Self
for the duration of the
invocation of the function that has an &Self
parameter. This is
required to ensure that the lifetimes don’t persist beyond one function
call, and so that they remain anonymous.Source§impl RefMutFromWasmAbi for NativeScript
impl RefMutFromWasmAbi for NativeScript
Source§impl TryFromJsValue for NativeScript
impl TryFromJsValue for NativeScript
Source§impl VectorFromWasmAbi for NativeScript
impl VectorFromWasmAbi for NativeScript
type Abi = <Box<[JsValue]> as FromWasmAbi>::Abi
unsafe fn vector_from_abi(js: Self::Abi) -> Box<[NativeScript]>
Source§impl VectorIntoJsValue for NativeScript
impl VectorIntoJsValue for NativeScript
fn vector_into_jsvalue(vector: Box<[NativeScript]>) -> JsValue
Source§impl VectorIntoWasmAbi for NativeScript
impl VectorIntoWasmAbi for NativeScript
type Abi = <Box<[JsValue]> as IntoWasmAbi>::Abi
fn vector_into_abi(vector: Box<[NativeScript]>) -> Self::Abi
Source§impl WasmDescribeVector for NativeScript
impl WasmDescribeVector for NativeScript
impl SupportsConstructor for NativeScript
impl SupportsInstanceProperty for NativeScript
impl SupportsStaticProperty for NativeScript
Auto Trait Implementations§
impl Freeze for NativeScript
impl RefUnwindSafe for NativeScript
impl Send for NativeScript
impl Sync for NativeScript
impl Unpin for NativeScript
impl UnwindSafe for NativeScript
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 moreSource§impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
Source§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
Same as
IntoWasmAbi::Abi
Source§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
Same as
IntoWasmAbi::into_abi
, except that it may throw and never
return in the case of Err
.