Struct bsv_wasm::transaction::Transaction[][src]

pub struct Transaction { /* fields omitted */ }

Implementations

(hashPrevouts) https://github.com/bitcoincashorg/bitcoincash.org/blob/master/spec/replay-protected-sighash.md Checks the hash cache to see if there already are hashed inputs, otherwise calculates the hash and adds it to the cache.

Logic:

  • If SigHash does not contain ANYONECANPAY, SHA256d all input outpoints
  • Else 32 bytes of zeroes

Platform Agnostic Functions ie. Don’t need Result<T, E>

Creates a new empty transaction where you need to add inputs and outputs Transaction.add_input(TxIn) and Transaction.add_output(TxOut)

Returns the first output index that matches the given parameters, returns None or null if not found.

Returns a list of outputs indexes that match the given parameters

Returns the first input index that matches the given parameters, returns None or null if not found.

Returns a list of input indexes that match the given parameters

XT Method: Returns the combined sum of all input satoshis. If any of the inputs dont have satoshis defined, this returns None or null

Returns the combined sum of all output satoshis.

Native Specific Functions

Gets the ID of the current transaction as a hex string.

Gets the ID of the current transaction as a Vec.

Get size of current serialised Transaction object

Serialises this entire transaction to CBOR, preserving all fields from the standard Transaction format + TX+

Deserialises the provided CBOR buffer to the TX+ format

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Deserialize this value from the given Serde deserializer. Read more

Performs the conversion.

The wasm ABI type that this converts from when coming back out from the ABI boundary. Read more

Recover a Self from Self::Abi. Read more

The wasm ABI type that this converts into when crossing the ABI boundary. Read more

Convert self into Self::Abi so that it can be sent across the wasm ABI boundary. Read more

Tests whether the argument is a “none” instance. If so it will be deserialized as None, and otherwise it will be passed to FromWasmAbi. Read more

Returns an ABI instance indicating “none”, which JS will interpret as the None branch of this option. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

The wasm ABI type references to Self are recovered from.

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. Read more

Recover a Self::Anchor from Self::Abi. Read more

Same as RefFromWasmAbi::Abi

Same as RefFromWasmAbi::Anchor

Same as RefFromWasmAbi::ref_from_abi

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Same as IntoWasmAbi::Abi

Same as IntoWasmAbi::into_abi, except that it may throw and never return in the case of Err. Read more

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.