WalletImpl class

Build transactional wallet by combining features of HdWallet, TransactionBuilder and ReadOnlyWallet.

Inheritance
Implemented types

Constructors

WalletImpl({required BlockchainAdapter blockchainAdapter, required ShelleyAddress stakeAddress, required Bip32KeyPair addressKeyPair, required String walletName, required HdWallet hdWallet, int accountIndex = defaultAddressIndex, CoinSelectionAlgorithm coinSelectionFunction = largestFirst})
Normaly WalletFactory is used to build a wallet and call this method.

Properties

accountIndex int
Account index of wallet, defaults to 0.
final
addresses List<ShelleyAddress>
no setterinherited
addressKeyPair Bip32KeyPair
Base address key pair used for signing transactions
final
assets Map<String, CurrencyAsset>
assets present in this wallet indexed by assetId
no setterinherited
balance Coin
balance of wallet in lovelace
no setterinherited
blockchainAdapter BlockchainAdapter
access to the bockchain
finalinherited
calculatedBalance Coin
calculate balance from transactions and rewards
no setterinherited
coinSelectionFunction CoinSelectionAlgorithm
final
currencies Map<String, Coin>
balances of native tokens indexed by assetId
no setterinherited
firstUnusedChangeAddress ShelleyAddress
Returns first unused change address, used to return unspent change to this wallet.
no setteroverride
firstUnusedReceiveAddress ShelleyAddress
Returns first unused receive address, used by others to send money to this account.
no setteroverride
hashCode int
The hash code for this object.
no setterinherited
hdWallet HdWallet
Hierarchical deterministic wallet
final
loadingTime Duration
Duration since update was called. Set to zero when update completes.
no setterinherited
networkId NetworkId
networkId is either mainnet or nestnet
finalinherited
readOnly bool
return true if this is read-only wallet that can't sign transactions and send funds.
no setteroverride
rootKeyPair Bip32KeyPair
Root private and public key
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stakeAccounts List<StakeAccount>
optional stake pool details
no setterinherited
stakeAddress ShelleyAddress
staking address
finalinherited
transactions List<WalletTransaction>
no setterinherited
unspentTransactions List<WalletTransaction>
no setterinherited
updateTimeout Duration
Timeout on update call. Hard-coded to 2 minutes
no setterinherited
walletId WalletId
Return walletId. ID is public staking address for Shelley wallets.
no setterinherited
walletName String
name of wallet
finalinherited

Methods

buildSpendTransaction({required ShelleyAddress toAddress, required int lovelace, int ttl = 0, int fee = 0}) Future<Result<ShelleyTransaction, String>>
Build a simple spend transaction.
override
filterTransactions({required String assetId}) List<WalletTransaction>
inherited
findAssetByTicker(String ticker) CurrencyAsset?
inherited
findAssetWhere(bool matcher(CurrencyAsset asset)) CurrencyAsset?
inherited
findKeyPairForChangeAddress({required ShelleyAddress address, int account = defaultAccountIndex, int index = defaultAddressIndex}) Bip32KeyPair?
Find signing key for spend or change address.
override
isUnusedAddress(ShelleyAddress address) bool
return true if the address has not been used before
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
refresh({required Coin balance, required List<ShelleyAddress> usedAddresses, required List<RawTransaction> transactions, required Map<String, CurrencyAsset> assets, required List<StakeAccount> stakeAccounts}) bool
inherited
sendAda({required ShelleyAddress toAddress, required int lovelace, int ttl = 0, int fee = 0, bool logTxHex = false, bool logTx = false}) Future<Result<ShelleyTransaction, String>>
Send ADA to another address.
override
submitTransaction({required ShelleyTransaction tx}) Future<Result<ShelleyTransaction, String>>
Send a transaction.
override
toString() String
A string representation of this object.
inherited
update() Future<Result<bool, String>>
Update or sync wallet transactions with blockchain. Return true if data changed. Is ignored if loadingTime is not zero.
inherited

Operators

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