pub struct JsHydraPublic { /* private fields */ }
Expand description
Public keys of a Hydra account in a vault.
@see HydraPlugin.pub
Implementations§
Source§impl JsHydraPublic
impl JsHydraPublic
Sourcepub fn key(&mut self, idx: i32) -> Result<JsBip44PublicKey, JsValue>
pub fn key(&mut self, idx: i32) -> Result<JsBip44PublicKey, JsValue>
Calculates the receiving address having the given index and takes note that the address was already generated in the account.
@see Bip44Account.key, Bip44Account.chain
Sourcepub fn xpub(&self) -> Result<String, JsValue>
pub fn xpub(&self) -> Result<String, JsValue>
The extended public key for auditing the whole Bip44 account or deriving new public keys outside the vault.
Sourcepub fn receive_keys(&self) -> Result<u32, JsValue>
pub fn receive_keys(&self) -> Result<u32, JsValue>
How many receive addresses have been used in this {@link Bip44Account}
Sourcepub fn change_keys(&self) -> Result<u32, JsValue>
pub fn change_keys(&self) -> Result<u32, JsValue>
How many change addresses have been used in this {@link Bip44Account}
Sourcepub fn key_by_p2pkh_addr(&self, addr: &str) -> Result<JsBip44PublicKey, JsValue>
pub fn key_by_p2pkh_addr(&self, addr: &str) -> Result<JsBip44PublicKey, JsValue>
Finds the {@link Bip44PublicKey} public api that belongs to the given P2PKH address. You can check the index of the key or get the actual {@link SecpPublicKey} from the returned object.
Throws an error if the address is not in this account, which can also happen when the key was derived outside the vault and therefore the vault does not know it was already used. In that case, make sure to “touch” the last key index used by calling {@link key} before calling this method.
Trait Implementations§
Source§impl From<JsHydraPublic> for JsValue
impl From<JsHydraPublic> for JsValue
Source§fn from(value: JsHydraPublic) -> Self
fn from(value: JsHydraPublic) -> Self
Source§impl From<Public> for JsHydraPublic
impl From<Public> for JsHydraPublic
Source§impl FromWasmAbi for JsHydraPublic
impl FromWasmAbi for JsHydraPublic
Source§impl IntoWasmAbi for JsHydraPublic
impl IntoWasmAbi for JsHydraPublic
Source§impl LongRefFromWasmAbi for JsHydraPublic
impl LongRefFromWasmAbi for JsHydraPublic
Source§impl OptionFromWasmAbi for JsHydraPublic
impl OptionFromWasmAbi for JsHydraPublic
Source§impl OptionIntoWasmAbi for JsHydraPublic
impl OptionIntoWasmAbi for JsHydraPublic
Source§impl RefFromWasmAbi for JsHydraPublic
impl RefFromWasmAbi for JsHydraPublic
Source§type Anchor = RcRef<JsHydraPublic>
type Anchor = RcRef<JsHydraPublic>
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 JsHydraPublic
impl RefMutFromWasmAbi for JsHydraPublic
Source§impl TryFromJsValue for JsHydraPublic
impl TryFromJsValue for JsHydraPublic
Source§impl VectorFromWasmAbi for JsHydraPublic
impl VectorFromWasmAbi for JsHydraPublic
type Abi = <Box<[JsValue]> as FromWasmAbi>::Abi
unsafe fn vector_from_abi(js: Self::Abi) -> Box<[JsHydraPublic]>
Source§impl VectorIntoJsValue for JsHydraPublic
impl VectorIntoJsValue for JsHydraPublic
fn vector_into_jsvalue(vector: Box<[JsHydraPublic]>) -> JsValue
Source§impl VectorIntoWasmAbi for JsHydraPublic
impl VectorIntoWasmAbi for JsHydraPublic
type Abi = <Box<[JsValue]> as IntoWasmAbi>::Abi
fn vector_into_abi(vector: Box<[JsHydraPublic]>) -> Self::Abi
Source§impl WasmDescribeVector for JsHydraPublic
impl WasmDescribeVector for JsHydraPublic
Source§impl Wraps<Public> for JsHydraPublic
impl Wraps<Public> for JsHydraPublic
impl SupportsConstructor for JsHydraPublic
impl SupportsInstanceProperty for JsHydraPublic
impl SupportsStaticProperty for JsHydraPublic
Auto Trait Implementations§
impl Freeze for JsHydraPublic
impl !RefUnwindSafe for JsHydraPublic
impl !Send for JsHydraPublic
impl !Sync for JsHydraPublic
impl Unpin for JsHydraPublic
impl !UnwindSafe for JsHydraPublic
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
Source§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
IntoWasmAbi::Abi
Source§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
IntoWasmAbi::into_abi
, except that it may throw and never
return in the case of Err
.