SettleMint
Developer guidesOperations

Reconciliate balances

Compare token balances and transaction history between your system and on-chain state.

Reconciliation compares your internal records against on-chain state to detect discrepancies. Regular reconciliation catches integration bugs, missed events, and unauthorized transfers before they become audit findings.

Common use cases:

  • Daily reconciliation - Compare end-of-day balances with your ledger
  • Transaction matching - Verify all transfers in your system exist on-chain
  • Audit preparation - Generate proof of on-chain state for compliance
  • Incident investigation - Trace balance discrepancies to specific transactions
  • Migration validation - Confirm balances after system upgrades

Indexer latency

All endpoints return indexed on-chain data. Typical latency is under 2 seconds after block confirmation. For real-time status of pending transactions, use transaction tracking.

Prerequisites

  • Platform URL (e.g., https://your-platform.example.com)
  • API key (see Getting Started)
  • Token contract address for the asset to reconcile
  • Your internal balance records for comparison

Asset analytics for balance reconciliation

Steps

Query current holder balances

Get all holder balances for a token:

curl -X GET "https://your-platform.example.com/api/token/0xTOKEN_ADDRESS/holders" \
  -H "X-Api-Key: sm_dalp_xxxxxxxxxxxxxxxx"

Response:

{
  "token": {
    "balances": [
      {
        "account": { "id": "0xHOLDER_1" },
        "value": "1000.00",
        "available": "800.00",
        "frozen": "200.00",
        "isFrozen": false,
        "lastUpdatedAt": "2025-01-15T10:30:00.000Z"
      },
      {
        "account": { "id": "0xHOLDER_2" },
        "value": "500.00",
        "available": "500.00",
        "frozen": "0.00",
        "isFrozen": false,
        "lastUpdatedAt": "2025-01-14T15:20:00.000Z"
      }
    ]
  },
  "totalCount": 2
}

For a single holder:

curl -X GET "https://your-platform.example.com/api/token/0xTOKEN_ADDRESS/holder?holderAddress=0xHOLDER_ADDRESS" \
  -H "X-Api-Key: sm_dalp_xxxxxxxxxxxxxxxx"

Query transaction history

Get balance-affecting events for the token:

curl -X GET "https://your-platform.example.com/api/token/0xTOKEN_ADDRESS/events?eventNames=TransferCompleted&eventNames=MintCompleted&eventNames=BurnCompleted" \
  -H "X-Api-Key: sm_dalp_xxxxxxxxxxxxxxxx"

Response:

{
  "events": [
    {
      "id": "0xEVENT_ID",
      "eventName": "TransferCompleted",
      "blockNumber": "12345678",
      "blockTimestamp": "2025-01-15T10:30:00.000Z",
      "transactionHash": "0xTX_HASH",
      "emitter": { "id": "0xTOKEN_ADDRESS" },
      "sender": { "id": "0xSENDER_ADDRESS" },
      "values": [
        { "id": "0x...", "name": "from", "value": "0xFROM_ADDRESS" },
        { "id": "0x...", "name": "to", "value": "0xTO_ADDRESS" },
        { "id": "0x...", "name": "amount", "value": "1000000000000000000" }
      ]
    }
  ]
}

Compare with your records

Match on-chain data against your internal ledger:

  1. Balance check - For each holder, compare value field with your records
  2. Transaction check - For each event, verify a matching entry exists in your system
  3. Missing transactions - Events on-chain without internal records indicate missed processing
  4. Extra transactions - Internal records without on-chain events indicate failed submissions

Investigate discrepancies

For mismatches, query specific transactions:

curl -X GET "https://your-platform.example.com/api/token/0xTOKEN_ADDRESS/events?transactionHashes=0xTX_HASH_1&transactionHashes=0xTX_HASH_2" \
  -H "X-Api-Key: sm_dalp_xxxxxxxxxxxxxxxx"

Or filter by sender to find transactions initiated by a specific wallet:

curl -X GET "https://your-platform.example.com/api/token/0xTOKEN_ADDRESS/events?eventNames=TransferCompleted&senderAddress=0xYOUR_WALLET" \
  -H "X-Api-Key: sm_dalp_xxxxxxxxxxxxxxxx"

Reconciliation flow

Rendering diagram...

API endpoints

All holders for a token

Endpoint: GET /api/token/{tokenAddress}/holders

Returns all holder balances for the specified token.

Single holder balance

Endpoint: GET /api/token/{tokenAddress}/holder

Query parameters:

ParameterTypeDescription
holderAddressstringWallet address to query

All balances for a user

Endpoint: GET /api/user/assets

Query parameters:

ParameterTypeDescription
walletstringWallet address to query

Returns all token balances held by a specific wallet.

Token events

Endpoint: GET /api/token/{tokenAddress}/events

Query parameters:

ParameterTypeDescription
eventNamesstring[]Filter by event types
senderAddressstringFilter by transaction initiator
transactionHashesstring[]Filter by specific transactions

User events

Endpoint: GET /api/user/events

Query parameters:

ParameterTypeDefaultDescription
limitnumber20Max events (1-500)
offsetnumber0Pagination offset
orderBystringblockTimestampSort field
orderDirectionstringdescSort direction
eventNamesstring[]Filter by event types
senderAddressstringFilter by initiator
transactionHashesstring[]Filter by transactions

Event types for reconciliation

EventDescriptionBalance Impact
TransferCompletedStandard transfer between holdersSender ↓, Receiver ↑
MintCompletedNew tokens createdRecipient ↑
BurnCompletedTokens destroyedHolder ↓
ForcedTransferCustodian-initiated transferSender ↓, Receiver ↑

Response fields

Balance fields

FieldTypeDescription
valuestringTotal balance (available + frozen)
availablestringBalance available for transfer
frozenstringBalance locked by compliance or custodian
isFrozenbooleanWhether the entire account is frozen
lastUpdatedAtstringISO timestamp of last balance change

Event fields

FieldTypeDescription
idstringUnique event identifier
eventNamestringType of event
transactionHashstringOn-chain transaction identifier
blockTimestampstringISO timestamp when event occurred
blockNumberstringBlock containing the transaction
emitterobjectContract that emitted the event
senderobjectAccount that initiated the transaction
involvedarrayAll accounts participating in the event
valuesarrayEvent parameters (from, to, amount, etc.)

Sender vs involved

  • sender - The wallet that signed and submitted the transaction
  • involved - All addresses participating in the event (sender, recipient, grantee, etc.)

Use senderAddress filter when you want only transactions you initiated, excluding those where you were merely a recipient.

Troubleshooting

IssueSolution
Balance mismatchCheck for pending transactions not yet indexed
Missing eventsVerify event name filter matches exactly
Events show wrong amountsAmounts are in wei; apply token decimals
Stale dataIndexer latency ~2 seconds; wait and retry
Too many resultsUse pagination with limit and offset

On this page