ONE anchor:get
← Receivers

anchor:get

anchor family

For the audit anchor's own tenant only (the owner of the platform workspace, or staff; everyone else gets `not_found`): read one day of ONE's security record as the anchor holds it on Sui (its root, row count and when it was written), and, given a row, its table and its proof, whether that row is in it, from your input and the chain alone. Each proof carries the row's salt. With `proofOf` it hands out a proof instead: the row as anchored and its proof. Public release and npm proofs are on /api/security/releases, not here. `verified: false` means the row is not in that day's record as given; `ok: false` means no answer (a refused input, no anchor on that network: mainnet answers `not_deployed_on_mainnet` until it is published, the day not anchored, or the chain unreachable). Read-only.

Effect
ask
Awaits an outcome — the call returns the response below.
Caller
owner
The class of authority the caller must already hold, decided from the attested context with no round trip.
Cost
free
What one call costs, so you can budget before acting.
Reversible
yes
The effect can be undone by a later call.
Idempotent
yes
Safe to retry as-is.

Send it with your agent

One click hands your coding agent a prompt that registers the substrate, reads this contract, and makes the call. Launch opens the app; the others copy the prompt.

Claude Code
Codex
Cursor
Gemini CLI
Claude Desktop
ChatGPT
curl -X POST https://one.ie/api/ask/anchor:get \
  -H "Authorization: Bearer $ONE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"data": { "net": <testnet | mainnet>, "day": <number> }}'

The key is never in a link. npx -y @oneie/cli login writes it to ~/.config/oneie/key on your machine.

Request

Validated before dispatch — an invalid payload is refused with the fix, never half-applied.

  • net testnet | mainnet required The Sui network whose anchor to read. Required: there is no default
  • day number required The UTC day, as days since 1970-01-01: floor(win / 288) for a security_events row, floor(received_at / 86400) for an owner_audit row
  • source security_events | owner_audit optional The table the row comes from. Required with a row
  • row object optional The row exactly as anchored, its table's columns and nothing else. security_events: win, kind, receiver, door, caller, slug, net, as_other, n, first_seen, last_seen, detail. owner_audit: id, ts, slug, group_id, action, outcome, caller_sig, payload, received_at. Send it with its proof, or neither
  • proof object optional The row's Merkle proof under the day's root: leaf = SHA-256(0x00 || table byte || salt || row)
  • proofOf object optional Ask for a row's proof instead of checking one. Who may ask is decided by the signed-in caller, never by this body

Response

What comes back from the call.

  • ok boolean
  • net string
  • day number
  • root string The root Sui holds for that day, hex
  • rows number How many leaves the anchored day holds
  • writtenMs number When the chain took the root, ms
  • anchor string The AuditAnchor object read
  • verified boolean Present only when a row and proof were sent
  • source string With proofOf: the row's table
  • row object With proofOf: the row exactly as anchored
  • proof object With proofOf: the row's proof, salt included
  • error string Why there is no answer: bad_net, bad_day, bad_source, bad_row, bad_proof, row_and_proof_go_together, missing_day, not_deployed_on_mainnet, chain_unreachable; with proofOf also not_found, bad_key, wrong_network, no_salt_secret, day_too_large, root_differs, record_unreadable

Traffic

Every call to anchor:get, counted where it is dispatched — over HTTP or in-process alike. Aggregate only — no actor, no payload, no workspace.

Counting…

Wiring

Every place in the open source that names anchor:get, and the file that answers it. Read from the tree at build time — a receiver is reached by NAME through one door, so there is no import edge to follow and a grep is the honest shape of the question. Structure, not volume — the count is in Traffic above.

Called from

API route 3
  • one.ie/web/src/lib/receiver-index.generated.ts:47
  • one.ie/web/src/lib/resolvers/sui.ts:309
  • one.ie/web/src/lib/security/anchor-verify.ts:3
→

Answered by

anchor:get one.ie/web/src/lib/resolvers/sui.ts:305 Dispatched through POST /api/ask/anchor:get, after the envelope validates the payload.
JSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "net": {
      "type": "string",
      "enum": [
        "testnet",
        "mainnet"
      ],
      "description": "The Sui network whose anchor to read. Required: there is no default"
    },
    "day": {
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991,
      "description": "The UTC day, as days since 1970-01-01: floor(win / 288) for a security_events row, floor(received_at / 86400) for an owner_audit row"
    },
    "source": {
      "description": "The table the row comes from. Required with a row",
      "type": "string",
      "enum": [
        "security_events",
        "owner_audit"
      ]
    },
    "row": {
      "description": "The row exactly as anchored, its table's columns and nothing else. security_events: win, kind, receiver, door, caller, slug, net, as_other, n, first_seen, last_seen, detail. owner_audit: id, ts, slug, group_id, action, outcome, caller_sig, payload, received_at. Send it with its proof, or neither",
      "type": "object",
      "propertyNames": {
        "type": "string"
      },
      "additionalProperties": {
        "anyOf": [
          {
            "type": "string",
            "maxLength": 16384
          },
          {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          {
            "type": "boolean"
          },
          {
            "type": "null"
          }
        ]
      }
    },
    "proof": {
      "description": "The row's Merkle proof under the day's root: leaf = SHA-256(0x00 || table byte || salt || row)",
      "type": "object",
      "properties": {
        "index": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991,
          "description": "The row's position in the day's leaves"
        },
        "count": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "maximum": 9007199254740991,
          "description": "How many leaves the day holds"
        },
        "salt": {
          "type": "string",
          "pattern": "^[0-9a-f]{64}$",
          "description": "The row's salt, 32 bytes of lowercase hex, as issued with the proof"
        },
        "path": {
          "maxItems": 32,
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "side": {
                "type": "string",
                "enum": [
                  "left",
                  "right"
                ],
                "description": "Which side the sibling sits on"
              },
              "hash": {
                "type": "string",
                "pattern": "^[0-9a-f]{64}$",
                "description": "The sibling's SHA-256, lowercase hex"
              }
            },
            "required": [
              "side",
              "hash"
            ]
          },
          "description": "Sibling hashes from the leaf up to the root (RFC 6962)"
        }
      },
      "required": [
        "index",
        "count",
        "salt",
        "path"
      ]
    },
    "proofOf": {
      "description": "Ask for a row's proof instead of checking one. Who may ask is decided by the signed-in caller, never by this body",
      "type": "object",
      "properties": {
        "source": {
          "type": "string",
          "enum": [
            "security_events",
            "owner_audit"
          ],
          "description": "The table the row is in"
        },
        "key": {
          "type": "object",
          "propertyNames": {
            "type": "string"
          },
          "additionalProperties": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 256
              },
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              }
            ]
          },
          "description": "The row's key. owner_audit: { id }. security_events: { win, kind, receiver, door, caller, slug, net, as_other }"
        }
      },
      "required": [
        "source",
        "key"
      ]
    }
  },
  "required": [
    "net",
    "day"
  ]
}
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean"
    },
    "net": {
      "type": "string"
    },
    "day": {
      "type": "number"
    },
    "root": {
      "description": "The root Sui holds for that day, hex",
      "type": "string"
    },
    "rows": {
      "description": "How many leaves the anchored day holds",
      "type": "number"
    },
    "writtenMs": {
      "description": "When the chain took the root, ms",
      "type": "number"
    },
    "anchor": {
      "description": "The AuditAnchor object read",
      "type": "string"
    },
    "verified": {
      "description": "Present only when a row and proof were sent",
      "type": "boolean"
    },
    "source": {
      "description": "With proofOf: the row's table",
      "type": "string"
    },
    "row": {
      "description": "With proofOf: the row exactly as anchored",
      "type": "object",
      "propertyNames": {
        "type": "string"
      },
      "additionalProperties": {}
    },
    "proof": {
      "description": "With proofOf: the row's proof, salt included",
      "type": "object",
      "properties": {
        "index": {
          "type": "number"
        },
        "count": {
          "type": "number"
        },
        "salt": {
          "type": "string"
        },
        "path": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "side": {
                "type": "string"
              },
              "hash": {
                "type": "string"
              }
            },
            "required": [
              "side",
              "hash"
            ]
          }
        }
      },
      "required": [
        "index",
        "count",
        "salt",
        "path"
      ]
    },
    "error": {
      "description": "Why there is no answer: bad_net, bad_day, bad_source, bad_row, bad_proof, row_and_proof_go_together, missing_day, not_deployed_on_mainnet, chain_unreachable; with proofOf also not_found, bad_key, wrong_network, no_salt_secret, day_too_large, root_differs, record_unreadable",
      "type": "string"
    }
  },
  "required": [
    "ok"
  ]
}