balance2 (31)
Planned Upgrade
The balance2 message is the response to a getBalance2 request. It provides the requested balance along with the specific block context (height and hash) in which that balance is valid. Including the block context is crucial, as it allows the requester to know exactly "as of when" the balance was calculated.
Core Data Types
IxiVarUInt: See IxiVarInt Encoding.IxiBytes: See IxiBytes Encoding.
Payload Structure
| Field | Data Type | Min | Max | Description |
|---|---|---|---|---|
walletAddress | IxiBytes | The wallet address (without checksum) this balance is for. Echoes the value from the request. | ||
balance | IxiNumber | The raw IxiNumber amount of the balance. | ||
blockNum | IxiVarUInt | The block number at which this balance was calculated. | ||
blockChecksum | IxiBytes | The checksum (hash) of the block at blockNum. |
Behavioral Notes
- A node receiving this message can update its local state or display the balance information to a user.
- The
balancefield is the raw internal integer of anIxiNumber. To convert it to a human-readable value, it must be divided by 10^8. - The
blockNumandblockChecksumfields provide essential context. If the recipient has a different block at thatblockNum, it knows its state has diverged from the sender's.