Lock API and events
Locks are public. Every endpoint here is unauthenticated and CORS-open, because a lock is only worth making if a stranger can verify it.
Endpoints
| Endpoint | Returns |
|---|---|
GET /api/locks | A page of locks, newest first. |
GET /api/locks?stats=1 | Active locks, distinct tokens, claimable now, unlocking within 7 days. |
GET /api/locks/:id | One lock by its on-chain id. |
Filters
token— locks holding one ERC-20.walletwithrole=depositor|beneficiary|any.status=locked|claimable|claimed|all.limit(max 200) andoffset.
Status is computed, not stored
locked, claimable and claimed are derived at read time from the unlock timestamp and the clock. Nothing flips a stored column when a lock matures, so there is no window in which a matured lock still reports as locked. Treat unlockTime as the authority and compute your own status if you cache.
Amounts
amount is a decimal string in the token's base units, and decimals is supplied when known. Both are strings because a 256-bit integer does not survive JSON numbers. symbol, name and decimals are null for tokens Arcanium did not launch — the locker accepts any ERC-20 and we only know the metadata of our own.
503 means we could not read the data, not that there are no locks. The two are different claims and this API will never substitute one for the other. Retry, or read the contract.Reading the contract directly
Nothing here requires our API. The locker at 0x0aB1fbD6c01f4908f509746393DE25849aE2a9E7 exposes lockCount(), getLock(id), isClaimable(id), timeRemaining(id) and totalLocked(token). Ids start at 1. Our own pages fall back to these when the indexer is behind, and so should yours.
Events
Both carry indexed fields for the three questions worth asking.
| Event | Indexed |
|---|---|
LockCreated | lockId, token, beneficiary |
LockClaimed | lockId, token, beneficiary |
LockCreated also carries the depositor, the amount actually received, the unlock time and the creation time, unindexed.
lockCount() and getLock(id) instead, which are direct calls and never expire.