WotsAddress class

WotsAddress implementation for Mochimo addresses

Constructors

WotsAddress.new()

Properties

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

Methods

bytes() ByteArray
Returns the combined address and amount as a byte array. The address occupies the first TXADDRLEN bytes, followed by the amount in TXAMOUNT bytes.
getAddress() ByteArray
Returns the full address portion (excluding amount).
getAddrHash() ByteArray
Extracts and returns the address hash portion of the address. The address hash starts after the tag and extends to TXADDRLEN.
getAmount() BigInt
Returns the amount as a BigInt.
getAmountBytes() ByteArray
Converts the current amount (BigInt) to an 8-byte little-endian array.
getTag() ByteArray
Extracts and returns the tag portion of the address. The tag is the first ADDR_TAG_LEN bytes of the address.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setAddrHash(ByteArray addrHash) → void
Sets the address hash portion of the address. Copies the first ADDR_TAG_LEN bytes from the provided addrHash into the address hash section. @param addrHash The byte array containing the new address hash.
setAmountBytes(ByteArray amountBytes) → void
Sets the amount from a byte array. Reads an 8-byte little-endian unsigned integer from the provided array. @param amountBytes The byte array representing the amount.
setTag(ByteArray tag) → void
Sets the tag portion of the address. Copies the first ADDR_TAG_LEN bytes from the provided tag array. @param tag The byte array containing the new tag.
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

addrFromImplicit(Uint8List tag) Uint8List
Generates an address from an implicit tag. This function seems to construct a 40-byte address by repeating parts of the tag. @param tag The input tag byte array. @returns A new 40-byte address byte array.
addrFromWots(Uint8List wots) Uint8List?
Derives an address from a WOTS public key. @param wots The WOTS public key as a byte array. @returns The derived address as a byte array, or null if the WOTS public key length is invalid.
addrHashGenerate(Uint8List input) Uint8List
Generates an address hash from an input byte array. Performs a SHA3-512 hash followed by a RIPEMD160 hash. @param input The input byte array for hashing. @returns The calculated address hash as a byte array.
wotsAddressFromBytes(ByteArray bytes) WotsAddress
Creates a WotsAddress instance from a byte array. Handles different byte array lengths representing WOTS public key, address only, or address with amount. @param bytes The input byte array. @returns A new WotsAddress instance.
wotsAddressFromHex(String wotsHex) WotsAddress
Creates a WotsAddress instance from a hexadecimal string. @param wotsHex The hexadecimal string representation of the address. @returns A new WotsAddress instance. Returns a default instance if length is invalid.

Constants

ADDR_TAG_LEN → const int
SHA3LEN512 → const int
TXADDRLEN → const int
TXAMOUNT → const int
WOTS_PK_LEN → const int