Find something... ⌘K

Start / First swap

First order

Run one order from nothing to completed, with a throwaway wallet that holds nothing. It takes three commands and about a minute, needs no sign-up and no SDK, and nothing real moves.

Get a test key

One call gives you a test key, with no sign-up. It runs the same API with nothing real behind it, and no wallet needs funds. The button at the foot of any page here gives one too, and fills it into these samples. It looks like mxk_test_ and 32 letters and digits.

curlTypeScriptPython
Copy
export BASE=https://whhxyutitykcsdpvdgcd.supabase.co/functions/v1/maxy-api export MAXY_API_KEY=$(curl -s -X POST "$BASE/sandbox/keys" -H 'content-type: application/json' -d '{}' | jq -r .secretKey) curl -s -H "x-maxy-key: $MAXY_API_KEY" "$BASE/key"

The answer shows "kind": "secret", your orderCapUsd and "sandbox": true. A cut-off key answers invalid_api_key; a call with no key answers auth_required.

Get a price

What 0.01 ETH on Base buys in BTC now. No wallet is needed, and nothing is reserved.

curl Copy
curl -sG -H "x-maxy-key: $MAXY_API_KEY" "$BASE/price" --data-urlencode "from=ETH on base" -d to=BTC -d amount=0.01

Or ask it here, from this page:

GET /price Live · sandbox
Send Amount Coin you send
Get Coin you get Send
cURLJavaScriptPythonCopy
curl -H "x-maxy-key: mxk_test_…" "https://whhxyutitykcsdpvdgcd.supabase.co/functions/v1/maxy-api/price?from=ETH%20on%20Base&to=BTC&amount=0.01"
···

Press Send. The first press gets you a free test key, then asks.

Run the order

Each sample needs one thing first, and nothing from the kit:

  • curl: jq and Foundry's cast.
  • TypeScript: npm install viem. Node 22.18 or newer runs the .ts file as it is. On older Node, name it sandbox-fetch.mjs.
  • Python: pip install requests eth-account.
curlTypeScriptPython
Copy
#!/usr/bin/env bash # One whole escrow order in the sandbox with curl, jq and Foundry's cast. Run it with a test key: nothing real happens, # and the wallet is a throwaway made here. It never broadcasts: `transaction.simulatedHash` stands in for the hash. # export MAXY_API_KEY=mxk_test_… set -euo pipefail BASE=${MAXY_API_BASE:-https://whhxyutitykcsdpvdgcd.supabase.co/functions/v1/maxy-api} BTC=bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4 KEY=$(cast wallet new --json | jq -r '.[0].private_key') WALLET=$(cast wallet address --private-key "$KEY") QUOTE=$(curl -sG -H "x-maxy-key: $MAXY_API_KEY" "$BASE/quote" --data-urlencode "from=ETH on base" -d to=BTC -d amount=0.001 -d fromAddress="$WALLET" -d toAddress="$BTC" ${SCENARIO:+-d scenario="$SCENARIO"}) echo "$QUOTE" | jq '{sandbox, route, toAmount, steps: [.steps[]?.id]}' TYPED=$(echo "$QUOTE" | jq -c '.steps[] | select(.id=="intent") | .typedData | .types.EIP712Domain = [{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"}]') SIG=$(cast wallet sign --private-key "$KEY" --data "$TYPED") PLACED=$(curl -s -X POST -H "x-maxy-key: $MAXY_API_KEY" -H 'content-type: application/json' "$BASE/orders" -d "$(echo "$QUOTE" | jq -c --arg s "$SIG" '{order, signatures: {intent: $s}}')") echo "$PLACED" | jq '{orderId, transaction, simulation}' ID=$(echo "$PLACED" | jq -r .orderId) HASH=$(echo "$PLACED" | jq -r .transaction.simulatedHash) curl -s -X POST -H "x-maxy-key: $MAXY_API_KEY" -H 'content-type: application/json' "$BASE/orders/submit" -d "$(echo "$QUOTE" | jq -c --arg h "$HASH" --arg s "$SIG" '{order, signatures: {intent: $s}, txHash: $h}')" | jq . for _ in 1 2 3 4 5 6 7 8; do STATUS=$(curl -s -H "x-maxy-key: $MAXY_API_KEY" "$BASE/orders/$ID") echo "$STATUS" | jq -c '{state, btcTxId, sandbox}' [ "$(echo "$STATUS" | jq -r .isComplete)" = true ] && break sleep 4 done

It quotes, signs, places the order and waits. The order reads pending, in_progress at 8 seconds, and completed at 20. Between the quote and the order you have 60 seconds; after that the answer is quote_expired, and you quote again.

The same order with the SDK is in your kit's examples folder as first-order.ts and first-order.py. To go step by step, carry on to Buy BTC.