Address class

A Bitcoin address.

Properties

hashCode int
The hash code for this object.
no setterinherited
ptr → Address
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

asString() String
inherited
isValidForNetwork({required Network network}) bool
Parsed addresses do not always have one network. The problem is that legacy testnet, regtest and signet addresses use the same prefix instead of multiple different ones. When parsing, such addresses are always assumed to be testnet addresses (the same is true for bech32 signet addresses). So if one wants to check if an address belongs to a certain network a simple comparison is not enough anymore. Instead this function can be used.
network() Network
The network on which this address is usable.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
payload() Payload
The type of the address.
scriptPubkey() ScriptBuf
Generates a script pubkey spending to this address
toQrUri() String
If the address is bech32, both the schema and the address become uppercase. If the address is base58, the schema is lowercase and the address is left mixed case. Quoting BIP 173 "inside QR codes uppercase SHOULD be used, as those permit the use of alphanumeric mode, which is 45% more compact than the normal byte mode." Note however that despite BIP21 explicitly stating that the bitcoin: prefix should be parsed as case-insensitive many wallets got this wrong and don't parse correctly. See compatibility table. If you want to avoid allocation you can use alternate display instead:
toString() String
A string representation of this object.
override

Operators

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

Static Methods

fromScript({required ScriptBuf script, required Network network}) Future<Address>
Address constructor
fromString({required String s, required Network network}) Future<Address>
Address constructor