pub struct JsHydraTxBuilder { /* private fields */ }
Expand description
Builder for core Hydra transactions on a given network.
Implementations§
Source§impl JsHydraTxBuilder
impl JsHydraTxBuilder
Sourcepub fn new(network_name: &str) -> Result<JsHydraTxBuilder, JsValue>
pub fn new(network_name: &str) -> Result<JsHydraTxBuilder, JsValue>
Creates a transaction builder on the given network.
@see allNetworkNames, validateNetworkName
Sourcepub fn transfer(
&self,
recipient_id: &JsSecpKeyId,
sender_pubkey: &JsSecpPublicKey,
amount_flake: u64,
nonce: u64,
vendor_field: Option<String>,
manual_fee: Option<u64>,
) -> Result<JsValue, JsValue>
pub fn transfer( &self, recipient_id: &JsSecpKeyId, sender_pubkey: &JsSecpPublicKey, amount_flake: u64, nonce: u64, vendor_field: Option<String>, manual_fee: Option<u64>, ) -> Result<JsValue, JsValue>
Creates a token transfer transaction that moves amount of flakes (smallest denomination on the chain) from the balance that belongs to the sender {@SecpPublicKey} to the one that has the recipient address {@SecpKeyId}.
The nonce of the sender needs to be known in advance and the next transaction must be 1 above the one of the last transaction made by the sender on-chain.
Vendor field is a public memo attached to the transaction. The fee can be manually overriden, or the defaults will be calculated based on the size of the serialized transaction size and some offset based on the transaction type.
@see SecpKeyId.fromAddress
Sourcepub fn vote(
&self,
delegate: &JsSecpPublicKey,
sender_pubkey: &JsSecpPublicKey,
nonce: u64,
vendor_field: Option<String>,
manual_fee: Option<u64>,
) -> Result<JsValue, JsValue>
pub fn vote( &self, delegate: &JsSecpPublicKey, sender_pubkey: &JsSecpPublicKey, nonce: u64, vendor_field: Option<String>, manual_fee: Option<u64>, ) -> Result<JsValue, JsValue>
Creates a vote transaction that empowers a delegate {@SecpPublicKey} to validate blocks and earn rewards for doing so.
The nonce of the sender needs to be known in advance and the next transaction must be 1 above the one of the last transaction made by the sender on-chain.
Vendor field is a public memo attached to the transaction. The fee can be manually overriden, or the defaults will be calculated based on the size of the serialized transaction size and some offset based on the transaction type.
Sourcepub fn unvote(
&self,
delegate: &JsSecpPublicKey,
sender_pubkey: &JsSecpPublicKey,
nonce: u64,
vendor_field: Option<String>,
manual_fee: Option<u64>,
) -> Result<JsValue, JsValue>
pub fn unvote( &self, delegate: &JsSecpPublicKey, sender_pubkey: &JsSecpPublicKey, nonce: u64, vendor_field: Option<String>, manual_fee: Option<u64>, ) -> Result<JsValue, JsValue>
Creates an unvote transaction that revokes empowerment from a delegate {@SecpPublicKey} to validate blocks.
The nonce of the sender needs to be known in advance and the next transaction must be 1 above the one of the last transaction made by the sender on-chain.
Vendor field is a public memo attached to the transaction. The fee can be manually overriden, or the defaults will be calculated based on the size of the serialized transaction size and some offset based on the transaction type.
Sourcepub fn register_delegate(
&self,
sender_pubkey: &JsSecpPublicKey,
delegate_name: &str,
nonce: u64,
vendor_field: Option<String>,
manual_fee: Option<u64>,
) -> Result<JsValue, JsValue>
pub fn register_delegate( &self, sender_pubkey: &JsSecpPublicKey, delegate_name: &str, nonce: u64, vendor_field: Option<String>, manual_fee: Option<u64>, ) -> Result<JsValue, JsValue>
Creates a transaction that registers a delegate so it can validate blocks and earn rewards for doing so. If there is not enough balance on the delegate’s address, other addresses can vote for the delegate with their own balance and if the sum of these are in the top 53 (or the limit on the actual network), they can validate blocks in the coming rounds.
The nonce of the sender needs to be known in advance and the next transaction must be 1 above the one of the last transaction made by the sender on-chain.
Vendor field is a public memo attached to the transaction. The fee can be manually overriden, or the defaults will be calculated based on the size of the serialized transaction size and some offset based on the transaction type.
Trait Implementations§
Source§impl From<JsHydraTxBuilder> for JsValue
impl From<JsHydraTxBuilder> for JsValue
Source§fn from(value: JsHydraTxBuilder) -> Self
fn from(value: JsHydraTxBuilder) -> Self
Source§impl FromWasmAbi for JsHydraTxBuilder
impl FromWasmAbi for JsHydraTxBuilder
Source§impl IntoWasmAbi for JsHydraTxBuilder
impl IntoWasmAbi for JsHydraTxBuilder
Source§impl OptionFromWasmAbi for JsHydraTxBuilder
impl OptionFromWasmAbi for JsHydraTxBuilder
Source§impl OptionIntoWasmAbi for JsHydraTxBuilder
impl OptionIntoWasmAbi for JsHydraTxBuilder
Source§impl RefFromWasmAbi for JsHydraTxBuilder
impl RefFromWasmAbi for JsHydraTxBuilder
Source§type Anchor = RcRef<JsHydraTxBuilder>
type Anchor = RcRef<JsHydraTxBuilder>
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 JsHydraTxBuilder
impl RefMutFromWasmAbi for JsHydraTxBuilder
Source§impl TryFromJsValue for JsHydraTxBuilder
impl TryFromJsValue for JsHydraTxBuilder
Source§impl VectorFromWasmAbi for JsHydraTxBuilder
impl VectorFromWasmAbi for JsHydraTxBuilder
type Abi = <Box<[JsValue]> as FromWasmAbi>::Abi
unsafe fn vector_from_abi(js: Self::Abi) -> Box<[JsHydraTxBuilder]>
Source§impl VectorIntoJsValue for JsHydraTxBuilder
impl VectorIntoJsValue for JsHydraTxBuilder
fn vector_into_jsvalue(vector: Box<[JsHydraTxBuilder]>) -> JsValue
Source§impl VectorIntoWasmAbi for JsHydraTxBuilder
impl VectorIntoWasmAbi for JsHydraTxBuilder
type Abi = <Box<[JsValue]> as IntoWasmAbi>::Abi
fn vector_into_abi(vector: Box<[JsHydraTxBuilder]>) -> Self::Abi
Source§impl WasmDescribeVector for JsHydraTxBuilder
impl WasmDescribeVector for JsHydraTxBuilder
impl SupportsConstructor for JsHydraTxBuilder
impl SupportsInstanceProperty for JsHydraTxBuilder
impl SupportsStaticProperty for JsHydraTxBuilder
Auto Trait Implementations§
impl Freeze for JsHydraTxBuilder
impl !RefUnwindSafe for JsHydraTxBuilder
impl !Send for JsHydraTxBuilder
impl !Sync for JsHydraTxBuilder
impl Unpin for JsHydraTxBuilder
impl !UnwindSafe for JsHydraTxBuilder
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
.