X3 Guard

X3 Lang on NEAR Intents

Write a swap's rules as a program. Before anyone deposits, a real 1Click quote has to satisfy every line of it.

Your rules

near_intents_sol_to_near.x3
A dry quote: nothing is signed, deposited or sent.

What 1Click quoted

Change any rule, then get a live quote. Each line of the program gets its verdict in the margin.

What happens when you press the button

  1. Your program becomes a quote request

    The page compiles the X3 intent in your browser. require slippage becomes 1Click's tolerance in whole basis points, rounded toward the stricter side. timeout becomes the deadline after which 1Click refunds. A rule NEAR Intents cannot enforce is refused, not dropped.

  2. 1Click quotes it, and signs the quote

    The request goes straight from your browser to the 1Click API. 1Click signs every quote with its Ed25519 manager key.

  3. This page checks the signature before reading a number

    It rebuilds the exact bytes 1Click signed, using the same steps as NEAR's official SDK, and verifies them with your browser's own cryptography. A forged or altered quote stops here.

  4. Every rule is checked against the signed numbers

    The amount, the floor, slippage, the cost of the swap and of a refund, and whether the quote is fresh. Each verdict lands on the line of the program it came from.

For a real swap, the x3-guard contract does step 3 and step 4 again on NEAR, with env::ed25519_verify, and lets each nonce open only one deposit address. This page stays on dry quotes, so it never holds keys or moves funds.