pub struct Builder { /* private fields */ }Expand description
Builder used to create Address instances
By default, when no VTXO delivery mechanism is provided by the user, the builder will add the built-in VtxoDelivery::ServerBuiltin. To prevent this, use Builder::no_delivery.
Implementations§
Source§impl Builder
impl Builder
Sourcepub fn testnet(self, testnet: bool) -> Self
pub fn testnet(self, testnet: bool) -> Self
Set the address to be used for test networks
Default is false.
Sourcepub fn server_pubkey(self, server_pubkey: PublicKey) -> Self
pub fn server_pubkey(self, server_pubkey: PublicKey) -> Self
Set the Ark server pubkey
Sourcepub fn policy(self, policy: VtxoPolicy) -> Self
pub fn policy(self, policy: VtxoPolicy) -> Self
Set the VTXO policy
Sourcepub fn pubkey_policy(self, user_pubkey: PublicKey) -> Self
pub fn pubkey_policy(self, user_pubkey: PublicKey) -> Self
Set the VTXO policy to the given PublicKey.
Sourcepub fn delivery(self, delivery: VtxoDelivery) -> Self
pub fn delivery(self, delivery: VtxoDelivery) -> Self
Add the given delivery method
Sourcepub fn no_delivery(self) -> Self
pub fn no_delivery(self) -> Self
Prevent the builder from adding the built-in delivery when no delivery is set.
Sourcepub fn mailbox(
self,
mailbox: MailboxIdentifier,
vtxo_key: &Keypair,
) -> Result<Self, AddressBuilderError>
pub fn mailbox( self, mailbox: MailboxIdentifier, vtxo_key: &Keypair, ) -> Result<Self, AddressBuilderError>
Set the mailbox identifier of the server mailbox to use
This will also disable adding the built-in delivery mechanism.
Errors if no server pubkey was provided yet or if the vtxo key is incorrect.
Sourcepub fn into_address(self) -> Result<Address, AddressBuilderError>
pub fn into_address(self) -> Result<Address, AddressBuilderError>
Finish by building an Address
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Builder
impl RefUnwindSafe for Builder
impl Send for Builder
impl Sync for Builder
impl Unpin for Builder
impl UnwindSafe for Builder
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
Mutably borrows from an owned value. Read more