Zum Inhalt
HALOWERK

X402werk

reconcile

Reads all incoming ERC-20 transfers of one token to one address within a block or time window and matches them against the receipts you supply. Matching runs first over the transaction hash, which is the strongest link, and otherwise over amount plus payer plus a stated time tolerance; the method used is named for every single match, so a weak match is never mistaken for a strong one.

POST https://x402.halowerk.com/reconcile

Eingaben

Felder des veröffentlichten Eingabeschemas
FeldTypPflichtBeschreibung
chainstringJaChain as CAIP-2, short name or chain id.
addressstringJaYour receiving address whose incoming transfers should be read.
assetstringNeinToken contract address to reconcile. Defaults to the canonical USDC of that chain.
receiptsarrayJaYour receipts. Each needs at least amount_units; tx_hash makes the match strong, payer and ts make the fallback match possible.
windowobjectNein
time_tolerance_secondsintegerNeinHow far a receipt timestamp may sit from the block time of a payment and still match. Receipt and chain rarely carry the same second.
Vollständiges Eingabeschema anzeigen
{
  "type": "object",
  "required": [
    "chain",
    "address",
    "receipts"
  ],
  "additionalProperties": false,
  "properties": {
    "chain": {
      "type": "string",
      "enum": [
        "arb",
        "arbitrum",
        "arbitrum-one",
        "avalanche",
        "avax",
        "base",
        "base-mainnet",
        "base-sepolia",
        "basesepolia",
        "eip155:1",
        "eip155:10",
        "eip155:137",
        "eip155:42161",
        "eip155:43114",
        "eip155:8453",
        "eip155:84532",
        "eth",
        "ethereum",
        "ethereum-mainnet",
        "mainnet",
        "matic",
        "op",
        "op-mainnet",
        "optimism",
        "polygon"
      ],
      "description": "Chain as CAIP-2, short name or chain id."
    },
    "address": {
      "type": "string",
      "pattern": "^0x[0-9a-fA-F]{40}$",
      "description": "Your receiving address whose incoming transfers should be read."
    },
    "asset": {
      "type": "string",
      "description": "Token contract address to reconcile. Defaults to the canonical USDC of that chain."
    },
    "receipts": {
      "type": "array",
      "minItems": 1,
      "maxItems": 500,
      "description": "Your receipts. Each needs at least amount_units; tx_hash makes the match strong, payer and ts make the fallback match possible.",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "amount_units"
        ],
        "properties": {
          "receipt_id": {
            "type": "string",
            "maxLength": 200,
            "description": "Your own identifier for this receipt. Echoed back in every result."
          },
          "payment_id": {
            "type": "string",
            "maxLength": 200,
            "description": "Payment identifier, used to detect duplicate receipts."
          },
          "tx_hash": {
            "type": "string",
            "pattern": "^0x[0-9a-fA-F]{64}$",
            "description": "Settlement transaction hash, if you recorded one."
          },
          "amount_units": {
            "type": "string",
            "pattern": "^[0-9]{1,78}$",
            "description": "Amount as an integer in the smallest unit of the token."
          },
          "payer": {
            "type": "string",
            "pattern": "^0x[0-9a-fA-F]{40}$",
            "description": "Address you believe paid."
          },
          "ts": {
            "type": "integer",
            "description": "Unix seconds when the receipt was issued. Needed for the amount-and-time fallback match."
          }
        }
      }
    },
    "window": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "from": {
          "type": "integer",
          "description": "Start of the window as unix seconds. Resolved to a block by reading real blocks."
        },
        "to": {
          "type": "integer",
          "description": "End of the window as unix seconds."
        },
        "from_block": {
          "type": "integer",
          "minimum": 0,
          "description": "Start block. Takes precedence over from."
        },
        "to_block": {
          "type": "integer",
          "minimum": 0,
          "description": "End block. Takes precedence over to."
        }
      }
    },
    "time_tolerance_seconds": {
      "type": "integer",
      "minimum": 0,
      "maximum": 86400,
      "default": 300,
      "description": "How far a receipt timestamp may sit from the block time of a payment and still match. Receipt and chain rarely carry the same second."
    }
  }
}

Originalschema öffnen

Veröffentlichtes Eingabebeispiel

{
  "chain": "arb",
  "address": "0x0000000000000000000000000000000000000000",
  "receipts": [
    {
      "amount_units": "0"
    }
  ],
  "time_tolerance_seconds": 300
}

Ergebnis & Dokumentation

Maschinenlesbare Dokumentation dieses Hubs

Quelle dieser Seite: der veröffentlichte HALOWERK-Katalog. Stand: 2026-11-01, 15:19 UTC.

Weitere Endpunkte dieses Hubs

Alle Endpunkte dieses Hubs →