pub struct JsSecpPrivateKey { /* private fields */ }
Expand description
Secp256k1 private key
Implementations§
Source§impl JsSecpPrivateKey
impl JsSecpPrivateKey
Sourcepub fn from_ark_passphrase(phrase: &str) -> Result<JsSecpPrivateKey, JsValue>
pub fn from_ark_passphrase(phrase: &str) -> Result<JsSecpPrivateKey, JsValue>
Creates a {@link SecpPrivateKey} from a passphrase compatible with ark.io wallets.
An Ark passphrase is a secret that must not be kept unencrypted in transit or in rest!
Sourcepub fn from_wif(wif: &str, network: &str) -> Result<JsSecpPrivateKey, JsValue>
pub fn from_wif(wif: &str, network: &str) -> Result<JsSecpPrivateKey, JsValue>
Creates a {@link SecpPrivateKey} from a WIF string compatible with BTC-related wallets. The second argument is a network name, that {@link validateNetworkName} accepts.
A WIF is a secret that must not be kept unencrypted in transit or in rest!
Sourcepub fn to_wif(&self, network: &str) -> Result<String, JsValue>
pub fn to_wif(&self, network: &str) -> Result<String, JsValue>
Creates a WIF string compatible with BTC-related wallets. The second argument is a network name, that {@link validateNetworkName} accepts.
This is a secret that must not be kept unencrypted in transit or in rest!
Sourcepub fn public_key(&self) -> JsSecpPublicKey
pub fn public_key(&self) -> JsSecpPublicKey
Calculates the public key the belongs to this private key.
Sourcepub fn sign_ecdsa(&self, data: &[u8]) -> JsSecpSignature
pub fn sign_ecdsa(&self, data: &[u8]) -> JsSecpSignature
Calculates the signature of a message that can be then verified using {@link SecpPublicKey.validate_ecdsa}
Trait Implementations§
Source§impl Clone for JsSecpPrivateKey
impl Clone for JsSecpPrivateKey
Source§fn clone(&self) -> JsSecpPrivateKey
fn clone(&self) -> JsSecpPrivateKey
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl From<JsSecpPrivateKey> for JsValue
impl From<JsSecpPrivateKey> for JsValue
Source§fn from(value: JsSecpPrivateKey) -> JsValue
fn from(value: JsSecpPrivateKey) -> JsValue
Source§impl From<SecpPrivateKey> for JsSecpPrivateKey
impl From<SecpPrivateKey> for JsSecpPrivateKey
Source§fn from(inner: SecpPrivateKey) -> JsSecpPrivateKey
fn from(inner: SecpPrivateKey) -> JsSecpPrivateKey
Source§impl FromWasmAbi for JsSecpPrivateKey
impl FromWasmAbi for JsSecpPrivateKey
Source§impl IntoWasmAbi for JsSecpPrivateKey
impl IntoWasmAbi for JsSecpPrivateKey
Source§impl LongRefFromWasmAbi for JsSecpPrivateKey
impl LongRefFromWasmAbi for JsSecpPrivateKey
Source§type Anchor = RcRef<JsSecpPrivateKey>
type Anchor = RcRef<JsSecpPrivateKey>
RefFromWasmAbi::Anchor
Source§unsafe fn long_ref_from_abi(
js: <JsSecpPrivateKey as LongRefFromWasmAbi>::Abi,
) -> <JsSecpPrivateKey as LongRefFromWasmAbi>::Anchor
unsafe fn long_ref_from_abi( js: <JsSecpPrivateKey as LongRefFromWasmAbi>::Abi, ) -> <JsSecpPrivateKey as LongRefFromWasmAbi>::Anchor
RefFromWasmAbi::ref_from_abi
Source§impl OptionFromWasmAbi for JsSecpPrivateKey
impl OptionFromWasmAbi for JsSecpPrivateKey
Source§fn is_none(abi: &<JsSecpPrivateKey as FromWasmAbi>::Abi) -> bool
fn is_none(abi: &<JsSecpPrivateKey as FromWasmAbi>::Abi) -> bool
None
, and otherwise it will be passed to
FromWasmAbi
.Source§impl OptionIntoWasmAbi for JsSecpPrivateKey
impl OptionIntoWasmAbi for JsSecpPrivateKey
Source§fn none() -> <JsSecpPrivateKey as IntoWasmAbi>::Abi
fn none() -> <JsSecpPrivateKey as IntoWasmAbi>::Abi
None
branch of this option. Read moreSource§impl RefFromWasmAbi for JsSecpPrivateKey
impl RefFromWasmAbi for JsSecpPrivateKey
Source§type Anchor = RcRef<JsSecpPrivateKey>
type Anchor = RcRef<JsSecpPrivateKey>
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§unsafe fn ref_from_abi(
js: <JsSecpPrivateKey as RefFromWasmAbi>::Abi,
) -> <JsSecpPrivateKey as RefFromWasmAbi>::Anchor
unsafe fn ref_from_abi( js: <JsSecpPrivateKey as RefFromWasmAbi>::Abi, ) -> <JsSecpPrivateKey as RefFromWasmAbi>::Anchor
Source§impl RefMutFromWasmAbi for JsSecpPrivateKey
impl RefMutFromWasmAbi for JsSecpPrivateKey
Source§type Anchor = RcRefMut<JsSecpPrivateKey>
type Anchor = RcRefMut<JsSecpPrivateKey>
RefFromWasmAbi::Anchor
Source§unsafe fn ref_mut_from_abi(
js: <JsSecpPrivateKey as RefMutFromWasmAbi>::Abi,
) -> <JsSecpPrivateKey as RefMutFromWasmAbi>::Anchor
unsafe fn ref_mut_from_abi( js: <JsSecpPrivateKey as RefMutFromWasmAbi>::Abi, ) -> <JsSecpPrivateKey as RefMutFromWasmAbi>::Anchor
RefFromWasmAbi::ref_from_abi
Source§impl TryFromJsValue for JsSecpPrivateKey
impl TryFromJsValue for JsSecpPrivateKey
Source§fn try_from_js_value(
value: JsValue,
) -> Result<JsSecpPrivateKey, <JsSecpPrivateKey as TryFromJsValue>::Error>
fn try_from_js_value( value: JsValue, ) -> Result<JsSecpPrivateKey, <JsSecpPrivateKey as TryFromJsValue>::Error>
Source§impl VectorFromWasmAbi for JsSecpPrivateKey
impl VectorFromWasmAbi for JsSecpPrivateKey
type Abi = <Box<[JsValue]> as FromWasmAbi>::Abi
unsafe fn vector_from_abi( js: <JsSecpPrivateKey as VectorFromWasmAbi>::Abi, ) -> Box<[JsSecpPrivateKey]>
Source§impl VectorIntoWasmAbi for JsSecpPrivateKey
impl VectorIntoWasmAbi for JsSecpPrivateKey
type Abi = <Box<[JsValue]> as IntoWasmAbi>::Abi
fn vector_into_abi( vector: Box<[JsSecpPrivateKey]>, ) -> <JsSecpPrivateKey as VectorIntoWasmAbi>::Abi
Source§impl Wraps<SecpPrivateKey> for JsSecpPrivateKey
impl Wraps<SecpPrivateKey> for JsSecpPrivateKey
Source§fn inner(&self) -> &SecpPrivateKey
fn inner(&self) -> &SecpPrivateKey
Auto Trait Implementations§
impl Freeze for JsSecpPrivateKey
impl RefUnwindSafe for JsSecpPrivateKey
impl Send for JsSecpPrivateKey
impl Sync for JsSecpPrivateKey
impl Unpin for JsSecpPrivateKey
impl UnwindSafe for JsSecpPrivateKey
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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
.