agentPass.precheck
Will this Agent Pass accept the action? Each rule checked before anything is signed.
Details
- Endpoint
- POST /v1/agent-pass/precheck
- Credits
- 2
- Rate class
- Light. Counts against your light requests per second.
Reads the pass now and checks one action against it: pass active and not expired, the signer is its agent, a rule for the coin or pair, per-action and daily limits with today's usage, listed pools and the price floor, named recipients, listed validators, and the budget left. Returns accept and every check in one sentence; `refusal` names the rule that would stop it. The chain is the final word: a dry run of the built bytes (tx.receipt) confirms it.
Parameters
| Name | Type | Description |
|---|---|---|
| passrequired | string | Pass object id. |
| sender | string | The signer (should be the pass's agent). |
| steprequired | object | The action. |
| step.action | string | swap, transfer, stake or supply. |
| step.coin_in | string | swap: coin sold. |
| step.coin_out | string | swap: coin bought. |
| step.coin | string | transfer or supply: the coin. |
| step.amount | string or number | Whole coins. |
| step.min_out | string or number | swap: least to receive. |
| step.recipient | string | transfer: a recipient NAME the owner listed. |
| step.validator | string | stake: validator address. |
Request
Send your key in the x-api-key header, or leave it out to use the keyless tier.
curl
curl -X POST "https://api.tide.ad/v1/agent-pass/precheck" \
-H "x-api-key: YOUR_API_KEY" \
-H "content-type: application/json" \
-d '{
"pass": "0x03c7bd6a3d4910f56fea05dedb632efd9824c82f22ef274180b7b8756ce47bac",
"step": {
"action": "swap",
"coin_in": "USDC",
"coin_out": "SUI",
"amount": "0.2"
}
}'TypeScript
const res = await fetch("https://api.tide.ad/v1/agent-pass/precheck", {
method: "POST",
headers: {
"x-api-key": process.env.TIDE_API_KEY!,
"content-type": "application/json",
},
body: JSON.stringify({
"pass": "0x03c7bd6a3d4910f56fea05dedb632efd9824c82f22ef274180b7b8756ce47bac",
"step": {
"action": "swap",
"coin_in": "USDC",
"coin_out": "SUI",
"amount": "0.2"
}
}),
});
const data = await res.json();Response
JSON
{
"accept": true,
"refusal": null,
"checks": [
{
"rule": "pass",
"ok": true,
"text": "Active. The agent can act until 2026-11-06."
},
{
"rule": "config",
"ok": true,
"text": "Agent Pass is not paused."
},
{
"rule": "rule",
"ok": true,
"text": "Swap USDC for SUI on DeepBook SUI/USDC or Cetus USDC/SUI, up to 0.5 USDC a trade and 0.5 USDC a day, at no worse than 1 SUI per USDC."
}
],
"pass": {
"id": "0x03c7bd6a3d4910f56fea05dedb632efd9824c82f22ef274180b7b8756ce47bac",
"name": "Buy SUI daily",
"owner": "0x1eb7c57e3f2bd0fc6cb9dcffd143ea957e4d98f805c358733f76dee0667fe0b1",
"agent": "0xb569f5371380e339038c0cdce2729621d36bfc89e740c28e3976bf04357edab6",
"status": "active"
}
}Long lists are cut to a few items here.