← Receivers

swap:get

swap family

mcp

Track a swap by its deposit address until it lands or refunds, and read any Hyperliquid account's balance

Effect
ask
Awaits an outcome — the call returns the response below.
Caller
public
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/swap:get \
  -H "Authorization: Bearer $ONE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"data": { "depositAddress": "0xd63c8F578F0a5541c14bFc9AFbC4AdEbE0250Ef2" }}'

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.

  • depositAddress string optional The deposit address swap:quote returned
  • depositMemo string optional Memo, for memo chains only
  • txHash string optional Your deposit tx hash — forwarded to 1Click to speed matching. NOT a verification; status stays the truth
  • hyperliquid string optional A 0x address: also read its Hyperliquid balance (perps + spot, never summed)
  • net string optional For the asked hyperliquid read only: 'testnet' reads api.hyperliquid-testnet.xyz. The swap and the post-SUCCESS read are always mainnet

Response

What comes back from the call.

  • ok boolean true = read; false = named refusal
  • error string nothing_to_read · address_unknown · bad_address · bad_tx_hash · oneclick_timeout · oneclick_unavailable · oneclick_error · hyperliquid_unavailable
  • detail string 1Click's own message on an upstream refusal, verbatim
  • network string 'mainnet' for the swap
  • status string PENDING_DEPOSIT · KNOWN_DEPOSIT_TX · INCOMPLETE_DEPOSIT · PROCESSING · SUCCESS · REFUNDED · FAILED
  • terminal boolean true at SUCCESS · REFUNDED · FAILED — stop polling
  • explain string One human sentence for this status (INCOMPLETE_DEPOSIT: less than quoted arrived; refunded minus refundFee)
  • submitted boolean txHash was forwarded to 1Click — not verified
  • from string Origin alias (or raw assetId if not in the table)
  • to string Destination alias (or raw assetId)
  • recipient string Destination address, from 1Click's stored quote
  • refundTo string Refund address, from 1Click's stored quote
  • amountIn string Decimal deposited
  • amountOut string Decimal delivered
  • amountOutUsd string USD delivered
  • refundedAmount string Decimal refunded
  • refundReason string 1Click's refund reason
  • originTxs object[] Deposit-side txs
  • destinationTxs object[] Delivery-side txs
  • updatedAt string 1Click timestamp
  • refundAfter string ISO, from the stored quote — no send instruction is valid after it
  • addressExpires string ISO, from the stored quote
  • hyperliquid object Balance of the hyperliquid address asked for, or of the recipient after a SUCCESS into Hyperliquid
  • next string One sentence: what happens next or what to do

Traffic

Every call to swap: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 swap: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

UI 2
  • one.ie/web/src/components/swap/SwapPage.tsx:226
  • one.ie/web/src/components/swap/SwapTimeline.tsx:70
API route 3
  • one.ie/web/src/lib/receiver-index.generated.ts:375
  • one.ie/web/src/lib/resolvers/swap.ts:2
  • one.ie/web/src/lib/swap/client.ts:564
CLI 1
  • packages/cli/src/swap.ts:356
Docs 1
  • one.ie/web/src/content/docs/wallets.md:183
→

Answered by

swap:get one.ie/web/src/lib/resolvers/swap.ts:507 Dispatched through POST /api/ask/swap:get, after the envelope validates the payload.

swap family · 1 more

JSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "depositAddress": {
      "description": "The deposit address swap:quote returned",
      "type": "string"
    },
    "depositMemo": {
      "description": "Memo, for memo chains only",
      "type": "string"
    },
    "txHash": {
      "description": "Your deposit tx hash — forwarded to 1Click to speed matching. NOT a verification; status stays the truth",
      "type": "string"
    },
    "hyperliquid": {
      "description": "A 0x address: also read its Hyperliquid balance (perps + spot, never summed)",
      "type": "string"
    },
    "net": {
      "description": "For the asked hyperliquid read only: 'testnet' reads api.hyperliquid-testnet.xyz. The swap and the post-SUCCESS read are always mainnet",
      "type": "string"
    }
  }
}
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean",
      "description": "true = read; false = named refusal"
    },
    "error": {
      "description": "nothing_to_read · address_unknown · bad_address · bad_tx_hash · oneclick_timeout · oneclick_unavailable · oneclick_error · hyperliquid_unavailable",
      "type": "string"
    },
    "detail": {
      "description": "1Click's own message on an upstream refusal, verbatim",
      "type": "string"
    },
    "network": {
      "type": "string",
      "description": "'mainnet' for the swap"
    },
    "status": {
      "description": "PENDING_DEPOSIT · KNOWN_DEPOSIT_TX · INCOMPLETE_DEPOSIT · PROCESSING · SUCCESS · REFUNDED · FAILED",
      "type": "string"
    },
    "terminal": {
      "description": "true at SUCCESS · REFUNDED · FAILED — stop polling",
      "type": "boolean"
    },
    "explain": {
      "description": "One human sentence for this status (INCOMPLETE_DEPOSIT: less than quoted arrived; refunded minus refundFee)",
      "type": "string"
    },
    "submitted": {
      "description": "txHash was forwarded to 1Click — not verified",
      "type": "boolean"
    },
    "from": {
      "description": "Origin alias (or raw assetId if not in the table)",
      "type": "string"
    },
    "to": {
      "description": "Destination alias (or raw assetId)",
      "type": "string"
    },
    "recipient": {
      "description": "Destination address, from 1Click's stored quote",
      "type": "string"
    },
    "refundTo": {
      "description": "Refund address, from 1Click's stored quote",
      "type": "string"
    },
    "amountIn": {
      "description": "Decimal deposited",
      "type": "string"
    },
    "amountOut": {
      "description": "Decimal delivered",
      "type": "string"
    },
    "amountOutUsd": {
      "description": "USD delivered",
      "type": "string"
    },
    "refundedAmount": {
      "description": "Decimal refunded",
      "type": "string"
    },
    "refundReason": {
      "description": "1Click's refund reason",
      "type": "string"
    },
    "originTxs": {
      "description": "Deposit-side txs",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "hash": {
            "type": "string",
            "description": "Tx hash"
          },
          "explorerUrl": {
            "type": "string",
            "description": "Explorer link"
          }
        },
        "required": [
          "hash",
          "explorerUrl"
        ]
      }
    },
    "destinationTxs": {
      "description": "Delivery-side txs",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "hash": {
            "type": "string",
            "description": "Tx hash"
          },
          "explorerUrl": {
            "type": "string",
            "description": "Explorer link"
          }
        },
        "required": [
          "hash",
          "explorerUrl"
        ]
      }
    },
    "updatedAt": {
      "description": "1Click timestamp",
      "type": "string"
    },
    "refundAfter": {
      "description": "ISO, from the stored quote — no send instruction is valid after it",
      "type": "string"
    },
    "addressExpires": {
      "description": "ISO, from the stored quote",
      "type": "string"
    },
    "hyperliquid": {
      "description": "Balance of the hyperliquid address asked for, or of the recipient after a SUCCESS into Hyperliquid",
      "type": "object",
      "properties": {
        "address": {
          "type": "string",
          "description": "Account read"
        },
        "network": {
          "type": "string",
          "description": "mainnet · testnet — always mainnet for the post-SUCCESS read"
        },
        "perps": {
          "type": "object",
          "properties": {
            "accountValue": {
              "type": "string",
              "description": "Decimal USD"
            },
            "withdrawable": {
              "type": "string",
              "description": "Decimal USD"
            }
          },
          "required": [
            "accountValue",
            "withdrawable"
          ],
          "description": "clearinghouseState"
        },
        "spot": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "coin": {
                "type": "string",
                "description": "e.g. USDC, UBTC"
              },
              "total": {
                "type": "string",
                "description": "Decimal"
              },
              "hold": {
                "type": "string",
                "description": "Decimal on hold"
              }
            },
            "required": [
              "coin",
              "total",
              "hold"
            ]
          },
          "description": "spotClearinghouseState balances, every non-zero coin (never paged)"
        },
        "firstDeposit": {
          "type": "boolean",
          "description": "true = empty account; Hyperliquid MAY take a one-time ~1 USDC activation (unverified)"
        },
        "note": {
          "type": "string",
          "description": "Not summed: unified/portfolio-margin accounts show everything in spot"
        }
      },
      "required": [
        "address",
        "network",
        "perps",
        "spot",
        "firstDeposit",
        "note"
      ]
    },
    "next": {
      "type": "string",
      "description": "One sentence: what happens next or what to do"
    }
  },
  "required": [
    "ok",
    "network",
    "next"
  ]
}