Struct OrdTransactionBuilder

Source
pub struct OrdTransactionBuilder { /* private fields */ }
Expand description

Ordinal-aware transaction builder for arbitrary (Nft) and Brc20 inscriptions.

Implementations§

Source§

impl OrdTransactionBuilder

Source

pub fn new( public_key: PublicKey, script_type: ScriptType, signer: Wallet, ) -> Self

Source

pub fn new_with_taproot_payload( public_key: PublicKey, script_type: ScriptType, signer: Wallet, taproot_payload: Option<TaprootPayload>, ) -> Self

A constructor that allows to set the taproot payload, in case the user wants to resume a previous session

Source

pub fn taproot_payload(&self) -> Option<&TaprootPayload>

Source

pub async fn build_commit_transaction<T>( &mut self, network: Network, recipient_address: Address, args: CreateCommitTransactionArgs<T>, ) -> OrdResult<CreateCommitTransaction>
where T: Inscription,

Creates the commit transaction.

Source

pub async fn sign_commit_transaction( &mut self, unsigned_tx: Transaction, args: SignCommitTransactionArgs, ) -> OrdResult<Transaction>

Sign the commit transaction

Source

pub async fn sign_transaction( &self, unsigned_tx: &Transaction, inputs: &[TxInputInfo], ) -> OrdResult<Transaction>

Sign a generic transaction, returning a new signed transaction.

Source

pub async fn build_reveal_transaction( &mut self, args: RevealTransactionArgs, ) -> OrdResult<Transaction>

Create the reveal transaction

Source

pub fn p2tr(private_key: PrivateKey) -> Self

Initialize a new OrdTransactionBuilder with the given private key and use P2TR as script type (preferred).

Source

pub fn p2wsh(private_key: PrivateKey) -> Self

Initialize a new OrdTransactionBuilder with the given private key and use P2WSH as script type. P2WSH may not be supported by all the indexers, so P2TR should be preferred.

Source

pub async fn build_commit_transaction_with_fixed_fees<T>( &mut self, network: Network, args: CreateCommitTransactionArgsV2<T>, ) -> OrdResult<CreateCommitTransaction>
where T: Inscription,

Creates the commit transaction with predetermined commit and reveal fees.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.