epic: swaps via NEAR Intents #7

Open
opened 2026-09-15 12:35:43 +00:00 by grenade · 1 comment
Owner

Goal

A swap module built on NEAR Intents' 1Click API: quote, one-time deposit address, deposit, status, persisted as an order the user can come back to. Built and verified end to end against chains Intents already lists, with Quantus as a registry entry that activates when the bridge does.

Facts the design rests on

  • 1Click: GET /v0/tokens, POST /v0/quote (returns depositAddress), POST /v0/deposit/submit with the tx hash, GET /v0/status with a terminal enum. OpenAPI at https://1click.chaindefuser.com/docs/v0/openapi.yaml. A partner JWT drops the fee from 25 bps; it lives in the relay, not the binary.
  • QTC is not in the token list. Quantus's near-mpc fork (threshold ML-DSA-87, derived keys needing a DKG each, signing with an empty FIPS 204 context, no inbound attestation, unmerged since July) cannot yet sign a mainnet extrinsic. Do not plan a Quantus leg for v1 of this epic.
  • When it lands, the Quantus deposit address will be an ordinary qz… account under an MPC key, and a fresh address per quote is unlikely (one DKG per derived key). Expect a shared address and reliance on deposit/submit, possibly a utility.batch with a system.remark memo. Raise with Quantus and NEAR before building.
  • The wallet is PQ-only: the origin leg of an on-ramp swap is paid by the ramp provider or the user's external wallet, and the destination of an off-ramp swap is the provider's address. The wallet never holds a classical key.

Operator-owned decisions

  • Partner registration with NEAR Intents for the JWT and referral. Needed before the relay child.
  • Whether v1 exposes swaps between two non-Quantus chains at all (pure orchestration, no wallet leg) or hides the module until Quantus is listed. Default: expose behind a setting, labelled preview.

Definition of done

From the wallet, quote USDC on Base to NEAR, receive a deposit address, pay it from an external wallet, watch the order through to SUCCESS, and see the order survive an app restart. A Quantus asset added to the registry in a test environment flows through the same state machine unchanged.

## Goal A swap module built on NEAR Intents' 1Click API: quote, one-time deposit address, deposit, status, persisted as an order the user can come back to. Built and verified end to end against chains Intents already lists, with Quantus as a registry entry that activates when the bridge does. ## Facts the design rests on - 1Click: `GET /v0/tokens`, `POST /v0/quote` (returns `depositAddress`), `POST /v0/deposit/submit` with the tx hash, `GET /v0/status` with a terminal enum. OpenAPI at `https://1click.chaindefuser.com/docs/v0/openapi.yaml`. A partner JWT drops the fee from 25 bps; it lives in the relay, not the binary. - QTC is not in the token list. Quantus's `near-mpc` fork (threshold ML-DSA-87, derived keys needing a DKG each, signing with an empty FIPS 204 context, no inbound attestation, unmerged since July) cannot yet sign a mainnet extrinsic. Do not plan a Quantus leg for v1 of this epic. - When it lands, the Quantus deposit address will be an ordinary `qz…` account under an MPC key, and a fresh address per quote is unlikely (one DKG per derived key). Expect a shared address and reliance on `deposit/submit`, possibly a `utility.batch` with a `system.remark` memo. Raise with Quantus and NEAR before building. - The wallet is PQ-only: the origin leg of an on-ramp swap is paid by the ramp provider or the user's external wallet, and the destination of an off-ramp swap is the provider's address. The wallet never holds a classical key. ## Operator-owned decisions - Partner registration with NEAR Intents for the JWT and referral. **Needed before the relay child.** - Whether v1 exposes swaps between two non-Quantus chains at all (pure orchestration, no wallet leg) or hides the module until Quantus is listed. **Default: expose behind a setting, labelled preview.** ## Definition of done From the wallet, quote USDC on Base to NEAR, receive a deposit address, pay it from an external wallet, watch the order through to `SUCCESS`, and see the order survive an app restart. A Quantus asset added to the registry in a test environment flows through the same state machine unchanged.
grenade added the epic label 2026-09-15 12:38:47 +00:00
Author
Owner

Children, in dependency order: #38 (1Click client) → #39 (orders state machine) and #40 (wallet-api relay) → #41 (swap UI, preview) → #42 (the Quantus leg: spike and the memo question). #40 needs the NEAR Intents partner registration first.

Children, in dependency order: #38 (1Click client) → #39 (orders state machine) and #40 (wallet-api relay) → #41 (swap UI, preview) → #42 (the Quantus leg: spike and the memo question). #40 needs the NEAR Intents partner registration first.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: blackbeard/wallet#7