Skip to main content
Due to rare on-chain edge cases, such as blockchain re-organizations, dynamic fee deductions, or execution adjustments, calculating local balances incrementally using transfer/deposit amounts can lead to ledger drift over time. Instead of calculating state changes incrementally, set your local ledger records directly using the verified snapshot provided in params.wallet.token.balance:
  • value: The human-readable string representation of the verified balance, pre-formatted to match token decimals.
  • rawValue: The raw integer string representation in minimal base units (atomic units/wei/lamport/satoshi/sun).

Samples

wallets are always synchronized with onchain state. Balance values returned in webhook events reflect the latest blockchain state for the wallet and token.

Why Use params.wallet.token.balance?

  1. State Overwriting: Replacing local database values with the payload state guarantees absolute alignment with the on-chain ledger at transaction execution time.
  2. Re-org Protection: In the event of a chain re-organization, subsequent state updates automatically correct local records without requiring manual database reconciliation.
  3. Multi-Source Consistency: Overwriting state avoids race conditions when multiple transactions occur in close succession across automated wallet workflows.