← Receivers

plugins:buy-with-one-token

plugins family

Buys a plugin by verifying a Sui ONE token transfer and granting entitlement with no credit mint

Effect
ask
Awaits an outcome — the call returns the response below.
Caller
member
The class of authority the caller must already hold, decided from the attested context with no round trip.
Reversible
no
This cannot be undone. Dry-run it first where the contract allows.

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/plugins:buy-with-one-token \
  -H "Authorization: Bearer $ONE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"data": { "name": <any>, "tx": <any>, "txDigest": <any>, "contract": <any> }}'

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.

  • name any optional
  • tx any optional
  • txDigest any optional
  • contract any optional WORK-AST s-expression (JSON arrays) — `["contract", ["workflow", name, ["signal", ["to", "<this receiver>"]], …]]`. Required from an agent key on a value-moving receiver, and it must name THIS receiver in a `signal` node; validated against the schema-generated grammar before the resolver runs (@oneie/sdk/work-contract).
  • contractScope object optional The scope the contract is validated against. Must travel with `contract` (half a declaration is refused).

Response

What comes back from the call.

No declared fields.

Traffic

Every call to plugins:buy-with-one-token, 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 plugins:buy-with-one-token, 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:304
  • one.ie/web/src/lib/resolvers/_shared.ts:190
  • one.ie/web/src/lib/resolvers/market.ts:1061
→

Answered by

plugins:buy-with-one-token one.ie/web/src/lib/resolvers/plugins.ts:190 Dispatched through POST /api/ask/plugins:buy-with-one-token, after the envelope validates the payload.
JSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "name": {},
    "tx": {},
    "txDigest": {},
    "contract": {
      "description": "WORK-AST s-expression (JSON arrays) — `[\"contract\", [\"workflow\", name, [\"signal\", [\"to\", \"<this receiver>\"]], …]]`. Required from an agent key on a value-moving receiver, and it must name THIS receiver in a `signal` node; validated against the schema-generated grammar before the resolver runs (@oneie/sdk/work-contract)."
    },
    "contractScope": {
      "description": "The scope the contract is validated against. Must travel with `contract` (half a declaration is refused).",
      "type": "object",
      "properties": {
        "agent": {
          "type": "string",
          "description": "Overridden server-side by the attested actor (ctx.actorId) for a bare key."
        },
        "workspace": {
          "type": "string",
          "description": "Overridden server-side for a bare key: at a value-moving receiver, the workspace the call moves value in (its declared movesIn field, else the caller's attested ownerSlug — exactly what the resolver debits); elsewhere the key's attested home."
        },
        "granted": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Capabilities the contract may use (workflow:define · step:<kind> · track:mark · signal:<receiver> …). For a bare key this is a REQUEST: it is intersected with the bare-key ceiling plus the key's attested grant rows. A value-moving capability (signal:<receiver> for a `moves: \"value\"` receiver) is held only through an `agents:approve` row the workspace owner wrote — it cannot be self-granted here. step:sell is a step kind in the ceiling: a sell step only mints a checkout."
        }
      },
      "required": [
        "agent",
        "workspace",
        "granted"
      ]
    }
  },
  "additionalProperties": {}
}
{
  "$schema": "https://json-schema.org/draft/2020-12/schema"
}