WalletBuilder class

This builder creates both read-only and transactional wallets from provided properties. Generated from a staking addresses, read-only wallets can show a balance and recieve funds, but can't sign or send payment transactions. Transactional wallets require a cryptographic private/signing key and can sign and send payment transactions. Alternatively, private keys can be generated from a 24-word mnemonic phrase. A BlockchainAdapter is used to communicate with the blockchain, it defaults to BlockfrostBlockchainAdapter for which an authorization adapter key must be provided for the target network. Each wallet type has a sync-varient build method that will load it's transactions and calculate the current balance before returning. Finally, all wallets must choose to run on either the mainnet or testnet.

Constructors

WalletBuilder()

Properties

accountIndex int
getter/setter pair
blockchainAdapter BlockchainAdapter
Set a pre-configured adapter used for accessing the blockchain.
no getter
coinSelectionAlgorithm CoinSelectionAlgorithm
Set the prefered CoinSelectionAlgorithm, defaults to largestFirst.
no getter
hashCode int
The hash code for this object.
no setterinherited
hdWallet HdWallet
Set a preconfigured HdWallet wallet instance.
no getter
mainnetAdapterKey String?
Set the mainnet authorization key required to access a given blockchain adapter like blockfrost.
no getter
mnemonic List<String>
Set the 24-word mnemonic used to create or restore a wallet.
no getter
networkId NetworkId?
Set the NetworkId of the blockchain, either testnet or mainnet.
no getter
rootSigningKey ← Bip32SigningKey?
Set the root private or signing key for this wallet.
no getter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stakeAddress ShelleyAddress
Set the staking address needed for creating read-only wallets.
no getter
testnetAdapterKey String?
Set the testnet authorization key required to access a given blockchain adapter like blockfrost.
no getter
walletName String?
Set optional wallet name, like the owner or purpose of the wallet.
no getter

Methods

build() → Result<Wallet, String>
Create a transactional wallet matching the supplied properties. Resets the builder.
buildAndSync() Future<Result<Wallet, String>>
Create a transactinoal wallet and syncronize it's transactions with the blockchain. Resets the builder.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
readOnlyBuild() → Result<ReadOnlyWallet, String>
Create a read-only wallet matching the supplied properties. Resets the builder.
readOnlyBuildAndSync() Future<Result<ReadOnlyWallet, String>>
Create a read-only wallet and syncronize it's transactions with the blockchain. Resets the builder.
reset() → void
Reset wallet-specific properties. Preserves that NetworkId and BlockchainAdapter.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

generateNewMnemonic() List<String>
Generate a unique 24-word mnumonic phrase which can be used to create a new wallet.