Skip to content

NEAR 1Click API Reference

Technical documentation for integrating NEAR Intents 1Click API with SIP Protocol.

NEAR Intents is a multichain transaction protocol where users specify desired outcomes and third parties (solvers/market makers) compete to provide optimal solutions. The 1Click API abstracts backend complexity for easy integration.

  • Intent-Based: Users declare what they want, not how to execute
  • Competitive: Market makers compete for best prices
  • Cross-Chain: Supports multiple chains via unified interface
  • Non-Custodial: Funds flow directly, never held by intermediaries
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ User/Agent │────▶│ 1Click API │────▶│ Solver Network │
│ │ │ (REST + WS) │ │ (Market Makers) │
└─────────────────┘ └──────────────────┘ └─────────────────┘
│ │ │
│ ▼ │
│ ┌──────────────────┐ │
│ │ Solver Bus │◀─────────────┘
│ │ (Quote Routing) │
│ └──────────────────┘
│ │
│ ▼
│ ┌──────────────────┐
└──────────────▶│ Verifier Smart │
│ Contract │
│ (NEAR Chain) │
└──────────────────┘
ComponentFunction
1Click APIREST gateway for distribution channels (apps, wallets)
Solver BusOff-chain message bus routing quotes between users and solvers
Solver/Market MakerCompetes to fulfill intents optimally
Verifier ContractOn-chain settlement and verification (NEAR Protocol)
https://1click.chaindefuser.com/

JWT token optional but recommended. Without JWT, 0.1% fee applies (effective August 5, 2025).

Request API key: https://forms.gle/near-intents-api-key

GET /v0/tokens

Returns available tokens with metadata.

Response:

[
{
"defuse_asset_id": "near:mainnet:wrap.near",
"blockchain": "near",
"address": "wrap.near",
"symbol": "wNEAR",
"decimals": 24,
"priceUsd": "3.45"
}
]
POST /v0/quote

Request Body:

{
"dry": false,
"swapType": "EXACT_INPUT",
"slippageTolerance": 100,
"originAsset": "near:mainnet:wrap.near",
"destinationAsset": "eth:1:0x0000000000000000000000000000000000000000",
"amount": "1000000000000000000000000",
"refundTo": "user.near",
"recipient": "0x742d35Cc6634C0532925a3b844Bc9e7595f...",
"depositType": "near",
"refundType": "near",
"recipientType": "eth",
"deadline": "2024-12-01T00:00:00.000Z",
"depositMode": "SIMPLE"
}

Parameters:

FieldTypeRequiredDescription
drybooleanNoPreview only, no deposit address generated
swapTypeenumYesEXACT_INPUT, EXACT_OUTPUT, FLEX_INPUT, ANY_INPUT
slippageTolerancenumberNoBasis points (100 = 1%)
originAssetstringYesSource asset identifier
destinationAssetstringYesTarget asset identifier
amountstringYesAmount in smallest units
refundTostringYesAddress for failed transaction refunds
recipientstringYesDestination address for output
depositTypestringYesSource chain identifier
refundTypestringYesRefund chain identifier
recipientTypestringYesDestination chain identifier
deadlinestringNoISO timestamp for refund trigger
depositModeenumNoSIMPLE or MEMO
appFeesarrayNoAdditional fee recipients

Swap Types:

TypeDescription
EXACT_INPUTFixed input amount, variable output
EXACT_OUTPUTFixed output amount, variable input
FLEX_INPUTPartial deposits allowed, variable amounts
ANY_INPUTStreaming deposits, ongoing swaps

Response:

{
"quoteId": "quote_abc123",
"depositAddress": "0x1234...deposit",
"amountIn": "1000000000000000000000000",
"amountInFormatted": "1.0",
"amountOut": "300000000000000000",
"amountOutFormatted": "0.3",
"amountOutUsd": "1050.00",
"deadline": "2024-12-01T00:00:00.000Z",
"timeEstimate": 120,
"signature": "0x..."
}
POST /v0/deposit/submit

Request Body:

{
"txHash": "0xabc123...",
"depositAddress": "0x1234...deposit",
"nearSenderAccount": "user.near",
"memo": "optional_memo"
}
GET /v0/status?depositAddress=0x1234...

Response:

{
"status": "SUCCESS",
"depositTxHash": "0xabc...",
"settlementTxHash": "0xdef...",
"amountIn": "1000000000000000000000000",
"amountOut": "300000000000000000"
}

Status Values:

StatusDescription
PENDING_DEPOSITAwaiting user deposit
PROCESSINGDeposit detected, execution in progress
SUCCESSDelivered to destination
INCOMPLETE_DEPOSITBelow minimum threshold
REFUNDEDReturned automatically
FAILEDExecution error

Direct solver integration for advanced use cases.

POST https://solver-relay-v2.chaindefuser.com/rpc
WSS wss://solver-relay-v2.chaindefuser.com/ws
{
"jsonrpc": "2.0",
"method": "quote",
"params": {
"defuse_asset_identifier_in": "near:mainnet:wrap.near",
"defuse_asset_identifier_out": "eth:1:native",
"exact_amount_in": "1000000000000000000000000",
"min_deadline_ms": 60000
},
"id": 1
}

Response:

{
"jsonrpc": "2.0",
"result": {
"quote_hash": "0x...",
"defuse_asset_identifier_in": "near:mainnet:wrap.near",
"defuse_asset_identifier_out": "eth:1:native",
"amount_in": "1000000000000000000000000",
"amount_out": "300000000000000000",
"expiration_time": "2024-11-26T12:00:00Z"
},
"id": 1
}
{
"jsonrpc": "2.0",
"method": "publish_intent",
"params": {
"quote_hashes": ["0x..."],
"signed_data": {
"message": "...",
"nonce": "123456",
"recipient": "solver.near"
},
"signature_type": "nep413"
},
"id": 2
}

Supported Signature Types:

  • nep413 - NEAR Protocol standard
  • erc191 - Ethereum-compatible
  • raw_ed25519 - Raw Ed25519 signatures
{
"jsonrpc": "2.0",
"method": "get_status",
"params": {
"quote_hash": "0x..."
},
"id": 3
}

Status Values:

  • PENDING - Awaiting execution
  • TX_BROADCASTED - Transaction submitted
  • SETTLED - Complete with tx hash
  • NOT_FOUND_OR_NOT_VALID - Invalid or expired

Subscribe to Quotes (for solvers):

{
"method": "subscribe",
"params": ["quote"]
}

Quote Event:

{
"event": "quote",
"data": {
"quote_id": "...",
"defuse_asset_identifier_in": "...",
"defuse_asset_identifier_out": "...",
"exact_amount_in": "...",
"min_deadline_ms": 60000
}
}
User 1Click API Solvers NEAR Chain
│ │ │ │
│── POST /v0/quote ──────▶│ │ │
│ │── Broadcast ────────▶│ │
│ │◀── Compete & Quote ──│ │
│◀── Quote Response ──────│ │ │
│ │ │ │
│── Deposit to address ──────────────────────────────────────────────▶│
│ │ │ │
│ │◀─ Detect Deposit ────│◀────────────────────│
│ │ │ │
│ │── Execute Intent ───▶│── Call Verifier ───▶│
│ │ │◀── Verify & Settle ─│
│ │ │ │
│◀── Status: SUCCESS ─────│◀─ Settlement Confirmed ─────────────────│

Core intent type on verifier contract:

{
"token_diff": {
"near:mainnet:wrap.near": "-1000000000000000000000000",
"eth:1:native": "300000000000000000"
}
}
  • Positive values: Tokens to receive
  • Negative values: Tokens to transfer out

Format: {chain}:{network}:{address}

AssetIdentifier
NEAR (native)near:mainnet:native
wNEARnear:mainnet:wrap.near
ETH (native)eth:1:native
USDC (Ethereum)eth:1:0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48
SOL (native)sol:mainnet:native
ZEC (native)zcash:mainnet:native
TierRequests/minNotes
Anonymous600.1% fee applies
Authenticated600JWT required
CodeMeaning
400Invalid request parameters
401Authentication required/invalid
429Rate limit exceeded
500Internal server error
ErrorDescription
INSUFFICIENT_LIQUIDITYNo solvers can fill this amount
UNSUPPORTED_PAIRAsset pair not supported
AMOUNT_TOO_LOWBelow minimum threshold (~0.1 NEAR equivalent)
DEADLINE_TOO_SHORTDeadline must be at least min_deadline_ms
  1. Recipient Shielding

    • Use stealth addresses as recipient parameter
    • One-time addresses prevent linkability
  2. Amount Hiding

    • Input amounts visible on source chain
    • Output amounts hidden via Zcash shielded pools (when supported)
  3. Viewing Key Disclosure

    • Generate viewing keys for compliant mode
    • Solvers can verify amounts without full disclosure
┌─────────────────────────────────────────────────────────────────┐
│ SIP Client │
│ ┌─────────────────┐ ┌──────────────────┐ ┌──────────────┐ │
│ │ Stealth Address │──▶│ Intent Builder │──▶│ 1Click API │ │
│ │ Generator │ │ (with privacy) │ │ Adapter │ │
│ └─────────────────┘ └──────────────────┘ └──────────────┘ │
└─────────────────────────────────────────────────────────────────┘
┌──────────────────────┐
│ NEAR 1Click API │
│ (swap execution) │
└──────────────────────┘
┌──────────────────────┐
│ Destination Chain │
│ (stealth address) │
└──────────────────────┘