### Get Account Balance via NEAR CLI Source: https://docs.near-intents.org/near-intents/market-makers/verifier/example-transactions Demonstrates how to retrieve balances for specified NEP-141 tokens for a given account using the NEAR CLI. This is a read-only contract call. It requires the account ID and a list of token IDs. ```bash near contract call-function as-read-only \ defuse-alpha.near mt_batch_balance_of \ json-args '{ "account_id": "defuse-ops.near", "token_ids": [ "nep141:wrap.near", "nep141:usdt.tether-token.near" ] }' network-config mainnet now -------------- [ "3000004000004000006", "10" ] -------------- ``` -------------------------------- ### Publish Intent Request and Response Example (JavaScript) Source: https://docs.near-intents.org/near-intents/market-makers/bus/solver-relay Demonstrates the structure of a JSON-RPC request to publish an intent and the corresponding response from the Near Intents service. Includes examples of 'token_diff' and 'transfer' intents. ```javascript { "id": 1, "jsonrpc": "2.0", "method": "publish_intent", "params": [ { "quote_hashes": ["00000000000000000000000000000000", ...], "signed_data": { "standard": "nep413", "payload": { "recipient": "intents.near", "nonce": "Vij2xgAlKBKzAEiS6N1S/hfrNi8/We0ieTmcMBti1YE=", "message": "{\"deadline\":\"2024-10-14T12:53:40.000Z\",\"intents\":[{\"intent\":\"token_diff\",\"diff\":{\"nep141:ft1.near\":\"300\",\"nep141:ft2.near\":\"-500\"}},{\"intent\":\"transfer\",\"receiver_id\":\"referral.near\",\"tokens\":{\"nep141:ft1.near\":\"1\"}},{\"intent\":\"ft_withdraw\",\"token\":\"ft1.near\",\"receiver_id\":\"ft1.near\",\"amount\":\"299\",\"memo\":\"WITHDRAW_TO:address_on_target_chain\"}],\"signer_id\":\"user.near\"}", "public_key": "ed25519:C3jXhkGhEx88Gj7XKtUziJKXEBMRaJ67bWFkxJikVxZ2", "signature": "ed25519:5tk3UyFcAgnd6D4ZAuzEdZqMrneRSiTqe48ptjbjYHwiCy2vTw38uDB3KusW2cEsF3TGcqZXoQmRaeNs2erhPpqu" } } } ] } // Response { "jsonrpc": "2.0", "id": 1, "result": { "status": "FAILED", "reason": "expired", "intent_hash": "00000000000000000000000000000000" } } ``` -------------------------------- ### Get Intent Status Request and Response Example (JavaScript) Source: https://docs.near-intents.org/near-intents/market-makers/bus/solver-relay Illustrates the JSON-RPC request to query the status of a specific intent using its hash, and the format of the response which includes the intent's status and associated transaction data if available. ```javascript { "id": 1, "jsonrpc": "2.0", "method": "get_status", "params": [ { "intent_hash": "00000000000000000000000000000000" } ] } // Response { "jsonrpc": "2.0", "id": 1, "result": { "intent_hash": "00000000000000000000000000000000" "status": "SETTLED", "data": { "hash": "8yFNEk7GmRcM3NMJihwCKXt8ZANLpL2koVFWWH1MEEj" } } } ``` -------------------------------- ### Transfer Intent Example (JSON) Source: https://docs.near-intents.org/near-intents/market-makers/verifier/intent-types-and-execution This JSON example illustrates an intent to transfer tokens within the Verifier contract. It follows the NEP413 standard and includes the sender's ID, receiver's ID, token details (using Multi Token format), deadline, and signature. ```json [ { "standard": "nep413", "payload": { "recipient": "intents.near", "nonce": "Vij2xgAlKBKzgNPJFViEQRhm1GXQz/Vt+TS0PazCsJQ=", "message": "{\"deadline\":\"2025-05-21T10:34:04.254392Z\",\"intents\":[{\"intent\":\"transfer\",\"receiver_id\":\"bob.near\",\"tokens\":{\"nep141:usdc.near\":\"10\"}}],\"signer_id\":\"alice.near\"}" }, "public_key": "ed25519:C3jXhkGhEx88Gj7XKtUziJKXEBMRaJ67bWFkxJikVxZ2", "signature": "ed25519:4nY7kjYV11djwsZ9UmezX1eoVMnzTg2wN6jT67o5vyWnibQ7g34zti8wc9imafbAzH5v4rqmksiextQCas14uxm5" } ] ``` -------------------------------- ### Get Supported Assets Source: https://docs.near-intents.org/near-intents/market-makers/passive-deposit-withdrawal-service Retrieves a list of all tokens supported by the NEAR Intents service across various networks. This is useful for understanding which assets can be deposited or withdrawn. ```APIDOC ## POST /websites/near-intents_near-intents ### Description Returns a list of tokens that are supported by the service in each network. ### Method POST ### Endpoint /websites/near-intents_near-intents ### Parameters #### Query Parameters - **chains** (string array) - Optional - Chain filter to narrow down the results. ### Request Example ```json { "id": 1, "jsonrpc": "2.0", "method": "supported_tokens", "params": [ { "chains": ["CHAIN_TYPE:CHAIN_ID", "..."] // optional } ] } ``` ### Response #### Success Response (200) - **tokens** (array) - A list of supported tokens. - **defuse_asset_identifier** (string) - Unique ID of the trading asset. - **near_token_id** (string) - Unique ID of the token in the NEAR blockchain. - **decimals** (integer) - Trading asset precision, used for amount setup during intent creation. - **asset_name** (string) - Trading asset name. - **min_deposit_amount** (string) - Minimum amount of tokens to trigger the transfer process. - **min_withdrawal_amount** (string) - Minimum amount of tokens to initiate a withdrawal. - **withdrawal_fee** (string) - The fee charged for withdrawing the specified token. #### Response Example ```json { "jsonrpc": "2.0", "id": 1, "result": { "tokens": [ { "defuse_asset_identifier" : "eth:8453:0x123", // CHAIN_TYPE:CHAIN_ID:ADDRESS "near_token_id": "...", "decimals" : 18, "asset_name" : "PEPE", "min_deposit_amount": "100000", "min_withdrawal_amount": "10000", "withdrawal_fee": "1000" } // ... ] } } ``` ``` -------------------------------- ### Get Supported Tokens Source: https://docs.near-intents.org/near-intents/integration/distribution-channels/1click-api Retrieves a list of all tokens currently supported by the 1Click platform. This endpoint is useful for understanding which assets can be traded. ```APIDOC ## GET /v0/tokens ### Description Retrieves a list of tokens currently supported by 1Click. ### Method GET ### Endpoint /v0/tokens ### Parameters #### Path Parameters None #### Query Parameters None ### Request Example None ### Response #### Success Response (200) - **tokens** (array) - A list of supported token objects. - **address** (string) - The contract address of the token. - **symbol** (string) - The trading symbol of the token. - **decimals** (integer) - The number of decimal places for the token. - **logoURI** (string) - The URI for the token's logo. #### Response Example ```json { "tokens": [ { "address": "0x...', "symbol": "WETH", "decimals": 18, "logoURI": "https://..." } ] } ``` ``` -------------------------------- ### ANY_INPUT Withdrawals Response Example Source: https://docs.near-intents.org/near-intents/integration/distribution-channels/1click-app-fees-calculation/aggregate-fees-from-any-token-into-desired-asset This JSON structure represents a successful response from the ANY_INPUT withdrawals endpoint. It includes details about the recipient, asset, and a list of withdrawal records, each containing status, amounts, fees, and timestamps. ```json { "recipient": "0x88b9da55b59a59751424b357cf8aea239770944c", "affiliateRecipient": "2fd5aba4dc4729dcaec040242fc3b0b1faf8c81f74831c7c7843c6a96ad28add", "asset": "nep141:base-0x833589fcd6edb6e08f4c7c32d4f71b54bda02913.omft.near", "withdrawals": [ { "status": "SUCCESS", "amountOut": "140735", "amountOutFormatted": "0.140735", "amountOutUsd": "0.140693483175", "withdrawFee": "2400", "withdrawFeeFormatted": "0.0024", "withdrawFeeUsd": "0.0023992919999999995", "timestamp": "2025-10-07T10:16:19.702Z", "hash": "0xcc005d3e3340c61b1240905c4e383d8b8ecb114a827bef3e0394293997406621" } ] } ``` -------------------------------- ### Get Supported Assets Request (JavaScript) Source: https://docs.near-intents.org/near-intents/market-makers/passive-deposit-withdrawal-service Retrieves a list of tokens supported by the NEAR Intents service across different networks. It can optionally filter by specific chains. The response includes detailed information about each token, such as its unique identifiers, decimals, name, and minimum deposit/withdrawal amounts. ```javascript { "id": 1, "jsonrpc": "2.0", "method": "supported_tokens", "params": [ { "chains": ["CHAIN_TYPE:CHAIN_ID", "..."], // optional } ] } // Response { "jsonrpc": "2.0", "id": 1, "result": { "tokens": [ { "defuse_asset_identifier" : "eth:8453:0x123", // CHAIN_TYPE:CHAIN_ID:ADDRESS "near_token_id": "...", "decimals" : 18, "asset_name" : "PEPE", "min_deposit_amount": "100000" "min_withdrawal_amount": "10000" "withdrawal_fee": "1000" }, // ... ] } } ``` -------------------------------- ### Get Recent Deposits Request (JavaScript) Source: https://docs.near-intents.org/near-intents/market-makers/passive-deposit-withdrawal-service Fetches a history of recent deposits made to a NEAR Intents account on a specified network. This endpoint is useful for tracking incoming funds and verifying deposit statuses. The response details each deposit, including transaction hash (for EVM networks), asset information, amount, and status. ```javascript //Request { "jsonrpc": "2.0", "id": 1, "method": "recent_deposits", "params": [ { "account_id": "user.near", "chain": "CHAIN_TYPE:CHAIN_ID" } ] } //Response { "jsonrpc": "2.0", "id": 1, "result": { "deposits": [ { "tx_hash": "", "chain": "CHAIN_TYPE:CHAIN_ID", "defuse_asset_identifier": "eth:8543:0x123", "decimals": 18, "amount": 10000000000, "account_id": "user.near", "address": "0x123", "status": "COMPLETED" // PENDING, FAILED }, ] } } ``` -------------------------------- ### Storage Deposit Intent (JSON) Source: https://docs.near-intents.org/near-intents/market-makers/verifier/intent-types-and-execution An example of an intent to perform a storage deposit using the NEP-145 standard via NEP-413. It shows how to pay for storage in a specific contract using a specified amount of NEAR tokens. ```json [ { "standard": "nep413", "payload": { "recipient": "intents.near", "nonce": "Vij2xgAlKBKzgNPJFViEQRhA/qs878LtXEL9iIjJC14=", "message": "{\"deadline\":\"2025-05-21T11:06:28.803408Z\",\"intents\":[{\"intent\":\"storage_deposit\",\"contract_id\":\"usdc.near\",\"account_id\":\"bob.near\",\"amount\":\"1250000000000000000000\"}],\"signer_id\":\"alice.near\"}" }, "public_key": "ed25519:C3jXhkGhEx88Gj7XKtUziJKXEBMRaJ67bWFkxJikVxZ2", "signature": "ed25519:4rAYXBa9UY6Zw32dKcGrXgydParzzdygEwdAaaKRg9TxXSP9541rikLWhVCtJqFHJh4Rcvpp2YrbRQ4LBaay7Xa6" } ] ``` -------------------------------- ### Get Deposit Address Request (JavaScript) Source: https://docs.near-intents.org/near-intents/market-makers/passive-deposit-withdrawal-service Generates a deposit address for a specific NEAR Intents account and network. This is essential for users to initiate token transfers into the NEAR Intents system. The response provides the unique deposit address and the associated chain identifier. ```javascript //Request { "jsonrpc": "2.0", "id": 1, "method": "deposit_address", "params": [ { "account_id": "user.near", "chain": "CHAIN_TYPE:CHAIN_ID" } ] } //Response { "jsonrpc": "2.0", "id": 1, "result": { "address": "0x....", "chain": "CHAIN_TYPE:CHAIN_ID" } } ``` -------------------------------- ### Add Public Key Intent Example (JSON) Source: https://docs.near-intents.org/near-intents/market-makers/verifier/intent-types-and-execution This JSON structure represents an intent to add a new public key to an account within the Verifier contract. It follows the NEP413 standard and includes details like recipient, nonce, message payload with intent type and public key, and the signature. ```json [ { "standard": "nep413", "payload": { "recipient": "intents.near", "nonce": "Vij2xgAlKBKzwKyKBC58QRjK3paApkNO6LU77m306Vw=", "message": "{\"deadline\":\"2025-05-21T08:04:27.483198Z\",\"intents\":[{\"intent\":\"add_public_key\",\"public_key\":\"ed25519:5TagutioHgKLh7KZ1VEFBYfgRkPtqnKm9LoMnJMJugxm\"}],\"signer_id\":\"alice.near\"}" }, "public_key": "ed25519:C3jXhkGhEx88Gj7XKtUziJKXEBMRaJ67bWFkxJikVxZ2", "signature": "ed25519:M6gK8WMNBL9vnkuScshNuKF5Yro5gQNRLpTTbruadR54AQvi53xWw8NizyCRbdM3j6y9XZ7MJy4DtQ1JLDz4xGQ" } ] ``` -------------------------------- ### Simulate Intents: Signed Intent Data (JSON) Source: https://docs.near-intents.org/near-intents/market-makers/verifier/simulating-intents This JSON structure represents a signed intent for trading USDC for USDT, as used in the simulation example. It includes details like standard, payload (recipient, nonce, message with deadline and intent diff), public key, and signature for each party involved. ```json { "signed": [ { "standard": "nep413", "payload": { "recipient": "intents.near", "nonce": "Vij2xgAlKBKzwJcGrQQYQhiLk1HU5AVNH1M3PhtxosE=", "message": "{\"deadline\":\"2025-05-23T07:40:13.735337Z\",\"intents\":[{\"intent\":\"token_diff\",\"diff\":{\"nep141:usdc.near\":\"-100\",\"nep141:usdt.near\":\"100\"}}],\"signer_id\":\"charlie.near\"}" }, "public_key": "ed25519:C3jXhkGhEx88Gj7XKtUziJKXEBMRaJ67bWFkxJikVxZ2", "signature": "ed25519:617X6QMiwFohRHqEuFwZ8aGU6Gn8PsH1DM3grArCYSKSvLz4wBPPGLzLPX3SLstLB331ESGPUToaPkUE7DvgefUu" }, { "standard": "nep413", "payload": { "recipient": "intents.near", "nonce": "Vij2xgAlKBKzwJcGrQQYQhjtxxGCsZQhM2DP7btPexE=", "message": "{\"deadline\":\"2025-05-23T07:40:13.753085Z\",\"intents\":[{\"intent\":\"token_diff\",\"diff\":{\"nep141:usdc.near\":\"100\",\"nep141:usdt.near\":\"-100\"}}],\"signer_id\":\"drake.near\"}" }, "public_key": "ed25519:C3jXhkGhEx88Gj7XKtUziJKXEBMRaJ67bWFkxJikVxZ2", "signature": "ed25519:3mLCEKyhofYLVakC9qgyb2FWh4L3jQxnUNyBHxYMTC13bo9y4AeqRh29dDYC4ZAQk4Z4mA2QZL8y7KGGKp5Pc3S1" } ] } ``` -------------------------------- ### GET /api/v0/transactions Source: https://docs.near-intents.org/near-intents/integration/distribution-channels/intents-explorer-api Retrieves a list of 1Click Swap transactions based on specified filters. ```APIDOC ## GET /api/v0/transactions ### Description Retrieves a list of 1Click Swap transactions. You can filter these transactions by token symbols, transaction hashes, timestamps, and status. ### Method GET ### Endpoint /api/v0/transactions ### Parameters #### Query Parameters - **token_symbol** (string) - Optional - Filter by the symbol of the token involved in the swap. - **transaction_hash** (string) - Optional - Filter by the unique hash of the transaction. - **start_timestamp** (integer) - Optional - Filter transactions from this Unix timestamp onwards. - **end_timestamp** (integer) - Optional - Filter transactions up to this Unix timestamp. - **status** (string) - Optional - Filter by the status of the swap (e.g., "Success", "Failed"). ### Request Example ```json { "example": "/api/v0/transactions?token_symbol=USDC&status=Success" } ``` ### Response #### Success Response (200) - **transactions** (array) - An array of transaction objects. - **transaction_hash** (string) - The hash of the transaction. - **timestamp** (integer) - The Unix timestamp of the transaction. - **token_in** (string) - The symbol of the input token. - **token_out** (string) - The symbol of the output token. - **amount_in** (string) - The amount of the input token. - **amount_out** (string) - The amount of the output token. - **status** (string) - The status of the swap. #### Response Example ```json { "example": { "transactions": [ { "transaction_hash": "Ff7k5nQdM6yHk3z2j1p8x7t4v9s0f2d3c1b0a9e8d7", "timestamp": 1678886400, "token_in": "NEAR", "token_out": "USDC", "amount_in": "1000000000000000000000000", "amount_out": "1500000000000000000000000", "status": "Success" } ] } } ``` ``` -------------------------------- ### Create ANY_INPUT Quote Source: https://docs.near-intents.org/near-intents/integration/distribution-channels/1click-app-fees-calculation/aggregate-fees-from-any-token-into-desired-asset This endpoint allows you to create a quote for the ANY_INPUT swap type. This is used to aggregate fees from any supported token into a specified destination asset. After creation, the quote is valid indefinitely, and a background job handles the swapping and withdrawal process once a $1,000 USD threshold is met. ```APIDOC ## POST /quotes ### Description Creates a quote for the ANY_INPUT swap type, facilitating the aggregation of fees from any supported token into a specified destination asset. The system will automatically swap incoming tokens to the destination asset and withdraw when the pool reaches or exceeds $1,000 USD. The quote, once created, is valid indefinitely. ### Method POST ### Endpoint /quotes ### Parameters #### Query Parameters - **Authorization** (string) - Required - Bearer token for authentication. #### Request Body - **dry** (boolean) - Optional - If true, performs a dry run without executing the swap. - **swapType** (string) - Required - Must be "ANY_INPUT". - **slippageTolerance** (integer) - Required - The maximum acceptable price slippage. - **originAsset** (string) - Required - The asset to swap from. Use "1cs:any" for ANY_INPUT. - **depositType** (string) - Required - The type of deposit, e.g., "INTENTS". - **destinationAsset** (string) - Required - The asset to aggregate fees into. - **amount** (string) - Required - Amount, typically "0" for ANY_INPUT. - **refundTo** (string) - Optional - An address to refund to if necessary. - **refundType** (string) - Optional - The type of the refund address. - **recipient** (string) - Required - The address where converted fees will be withdrawn. - **recipientType** (string) - Required - The type of the recipient address (e.g., "DESTINATION_CHAIN", "INTENTS"). - **deadline** (string) - Required - The quote creation deadline in ISO 8601 format. - **referral** (string) - Optional - Referral code. - **quoteWaitingTimeMs** (integer) - Optional - Preferred waiting time for the quote in milliseconds. ### Request Example ```json { "dry": false, "swapType": "ANY_INPUT", "slippageTolerance": 0, "originAsset": "1cs:any", "depositType": "INTENTS", "destinationAsset": "nep141:eth-0xdac17f958d2ee523a2206206994597c13d831ec7.omft.near", "amount": "0", "refundTo": "something.near", "refundType": "INTENTS", "recipient": "0x1ddA60d784483FBB54304c68830d42A706327C6d", "recipientType": "DESTINATION_CHAIN", "deadline": "2025-09-22T20:00:00Z", "referral": "YOUR_REFERRAL", "quoteWaitingTimeMs": 10000 } ``` ### Response #### Success Response (200) - **depositAddress** (string) - The address where fees should be deposited. #### Response Example (Response structure not explicitly provided in the input for creation, but the `depositAddress` is crucial.) ``` -------------------------------- ### GET /api/v0/transactions-pages Source: https://docs.near-intents.org/near-intents/integration/distribution-channels/intents-explorer-api Retrieves paginated lists of 1Click Swap transactions, allowing for efficient fetching of large datasets. ```APIDOC ## GET /api/v0/transactions-pages ### Description Retrieves paginated lists of 1Click Swap transactions. This endpoint is useful for fetching large datasets in manageable chunks. ### Method GET ### Endpoint /api/v0/transactions-pages ### Parameters #### Query Parameters - **page** (integer) - Optional - The page number to retrieve (defaults to 1). - **limit** (integer) - Optional - The number of transactions per page (defaults to 50, max 100). - **token_symbol** (string) - Optional - Filter by the symbol of the token involved in the swap. - **transaction_hash** (string) - Optional - Filter by the unique hash of the transaction. - **start_timestamp** (integer) - Optional - Filter transactions from this Unix timestamp onwards. - **end_timestamp** (integer) - Optional - Filter transactions up to this Unix timestamp. - **status** (string) - Optional - Filter by the status of the swap (e.g., "Success", "Failed"). ### Request Example ```json { "example": "/api/v0/transactions-pages?page=2&limit=25&token_symbol=ETH" } ``` ### Response #### Success Response (200) - **transactions** (array) - An array of transaction objects for the current page. - **transaction_hash** (string) - The hash of the transaction. - **timestamp** (integer) - The Unix timestamp of the transaction. - **token_in** (string) - The symbol of the input token. - **token_out** (string) - The symbol of the output token. - **amount_in** (string) - The amount of the input token. - **amount_out** (string) - The amount of the output token. - **status** (string) - The status of the swap. - **total_transactions** (integer) - The total number of transactions matching the query. - **page** (integer) - The current page number. - **limit** (integer) - The number of transactions per page. #### Response Example ```json { "example": { "transactions": [ { "transaction_hash": "A1b2c3d4e5f678901234567890abcdef1234567890abcdef1234567890abcdef", "timestamp": 1678890000, "token_in": "ETH", "token_out": "USDC", "amount_in": "50000000000000000000", "amount_out": "75000000000000000000", "status": "Success" } ], "total_transactions": 150, "page": 2, "limit": 50 } } ``` ``` -------------------------------- ### Create ANY_INPUT Quote Request Source: https://docs.near-intents.org/near-intents/integration/distribution-channels/1click-app-fees-calculation/aggregate-fees-from-any-token-into-desired-asset This JSON object demonstrates the structure for creating an ANY_INPUT quote. It specifies parameters like the destination asset for fee collection, refund address, recipient for withdrawals, and deadline. The `originAsset` is set to "1cs:any" and `amount` to "0" to indicate fee aggregation. ```json { "dry": false, "swapType": "ANY_INPUT", "slippageTolerance": 0, "originAsset": "1cs:any", "depositType": "INTENTS", "destinationAsset": "nep141:eth-0xdac17f958d2ee523a2206206994597c13d831ec7.omft.near", "amount": "0", "refundTo": "something.near", "refundType": "INTENTS", "recipient": "0x1ddA60d784483FBB54304c68830d42A706327C6d", "recipientType": "DESTINATION_CHAIN", "deadline": "2025-09-22T20:00:00Z", "referral": "YOUR_REFERRAL", "quoteWaitingTimeMs": 10000 } ``` -------------------------------- ### Check Swap Status Source: https://docs.near-intents.org/near-intents/integration/distribution-channels/1click-api Gets the current status of a swap using the unique deposit address. This allows users to track the progress of their ongoing swaps. ```APIDOC ## GET /v0/status ### Description Gets current status of a swap using unique deposit address. ### Method GET ### Endpoint /v0/status ### Parameters #### Path Parameters None #### Query Parameters - **depositAddress** (string) - Required - The unique deposit address provided by 1Click for the swap. ### Request Example ``` GET /v0/status?depositAddress=0x... ``` ### Response #### Success Response (200) - **status** (string) - The current status of the swap (e.g., "PENDING", "COMPLETED", "FAILED"). - **message** (string) - A detailed message about the swap status. - **swapId** (string) - The unique identifier for the swap. #### Response Example ```json { "status": "COMPLETED", "message": "Swap has been successfully completed.", "swapId": "s_..." } ``` ``` -------------------------------- ### Get Recent Deposits Source: https://docs.near-intents.org/near-intents/market-makers/passive-deposit-withdrawal-service Fetches a list of recent deposit transactions for a user account on a specified network. Provides details about each deposit, including status and amount. ```APIDOC ## POST /websites/near-intents_near-intents ### Description Returns information on recent deposits. ### Method POST ### Endpoint /websites/near-intents_near-intents ### Parameters #### Query Parameters - **account_id** (string) - Required - User account ID in NEAR Intents. - **chain** (string) - Required - Network type and chain ID (e.g., `eth:42161`). ### Request Example ```json { "jsonrpc": "2.0", "id": 1, "method": "recent_deposits", "params": [ { "account_id": "user.near", "chain": "CHAIN_TYPE:CHAIN_ID" } ] } ``` ### Response #### Success Response (200) - **deposits** (array) - A list of recent deposit objects. - **tx_hash** (string) - Transaction hash (EVM networks only). - **chain** (string) - Network type and chain ID. - **defuse_asset_identifier** (string) - Token identifier. - **decimals** (integer) - Token decimals. - **amount** (integer) - Asset amount. - **account_id** (string) - User account ID in NEAR Intents. - **address** (string) - Deposit address. - **status** (string) - Deposit status (e.g., `COMPLETED`, `PENDING`, `FAILED`). #### Response Example ```json { "jsonrpc": "2.0", "id": 1, "result": { "deposits": [ { "tx_hash": "", "chain": "CHAIN_TYPE:CHAIN_ID", "defuse_asset_identifier": "eth:8543:0x123", "decimals": 18, "amount": 10000000000, "account_id": "user.near", "address": "0x123", "status": "COMPLETED" } ] } } ``` ``` -------------------------------- ### Get Deposit Address Source: https://docs.near-intents.org/near-intents/market-makers/passive-deposit-withdrawal-service Obtains a specific deposit address for a given user account and network. This address is used to send funds into the NEAR Intents service. ```APIDOC ## POST /websites/near-intents_near-intents ### Description Returns the address for depositing supported tokens or native currency. ### Method POST ### Endpoint /websites/near-intents_near-intents ### Parameters #### Query Parameters - **account_id** (string) - Required - User account ID in NEAR Intents. - **chain** (string) - Required - Network type and chain ID (e.g., `eth:42161` for Arbitrum or `btc:mainnet` for Bitcoin). ### Request Example ```json { "jsonrpc": "2.0", "id": 1, "method": "deposit_address", "params": [ { "account_id": "user.near", "chain": "CHAIN_TYPE:CHAIN_ID" } ] } ``` ### Response #### Success Response (200) - **address** (string) - The generated deposit address. - **chain** (string) - The network type and chain ID for which the address was generated. #### Response Example ```json { "jsonrpc": "2.0", "id": 1, "result": { "address": "0x....", "chain": "CHAIN_TYPE:CHAIN_ID" } } ``` ``` -------------------------------- ### GET /v0/any-input/withdrawals Source: https://docs.near-intents.org/near-intents/integration/distribution-channels/1click-api Retrieves all withdrawals associated with an ANY_INPUT quote. This endpoint supports filtering by deposit address and memo, time range, pagination, and sorting of withdrawal records. ```APIDOC ## GET /v0/any-input/withdrawals ### Description Retrieves all withdrawals by ANY_INPUT quote with filtering, pagination and sorting. ### Method GET ### Endpoint /v0/any-input/withdrawals ### Parameters #### Query Parameters - **depositAddress** (string) - Required - The deposit address for which to retrieve withdrawals. - **depositMemo** (string) - Optional - The deposit memo associated with the withdrawals. - **timestampFrom** (string) - Optional - Filter withdrawals from this timestamp (ISO string). - **page** (number) - Optional - Page number for pagination (default: 1). - **limit** (number) - Optional - Number of withdrawals per page (max: 50, default: 50). - **sortOrder** (string) - Optional - Sort order for withdrawals ('asc' or 'desc'). ### Request Example ```json { "example": "No request body for GET request" } ``` ### Response #### Success Response (200) - **asset** (string) - ID of the destination asset. - **recipient** (string) - Recipient address. - **affiliateRecipient** (string) - Affiliate recipient address. - **withdrawals** (object) - Details of withdrawals, including status, amounts, fees, timestamp, and hash. #### Response Example ```json { "asset": "USDT", "recipient": "0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B", "affiliateRecipient": "0x0000000000000000000000000000000000000000", "withdrawals": [ { "status": "SUCCESS", "amountOutFormatted": "100.00 USDT", "amountOutUsd": "100.00", "amountOut": "100000000", "withdrawFeeFormatted": "0.10 USDT", "withdrawFee": "100000", "withdrawFeeUsd": "0.10", "timestamp": "2023-10-27T10:00:00Z", "hash": "0x123abc..." } ] } ``` #### Error Response (401) - **message** (string) - Unauthorized - JWT token is invalid. #### Error Response (404) - **message** (string) - Deposit address not found. ``` -------------------------------- ### Add Public Key Intent Structure Source: https://docs.near-intents.org/near-intents/market-makers/verifier/account-abstraction This snippet shows the JSON structure for submitting a signed intent to add a public key to an account. It includes the signer's ID and a list of intents, specifically detailing the 'add_public_key' intent with the user's public key. ```json { "signer_id": "", // ... "intents": [ { "intent": "add_public_key", "public_key": "" }, ] } ``` -------------------------------- ### Get Execution Status API Source: https://docs.near-intents.org/near-intents/integration/distribution-channels/1click-api Queries the status of a swap execution using its unique quote ID. This allows users to track the progress of their NEAR Intent swap. ```APIDOC ## GET /v0/status ### Description Queries the status of a swap execution using its unique quote ID. ### Method GET ### Endpoint /v0/status ### Parameters #### Query Parameters - **apiKey** (string) - Required - Your API key for authentication. - **quote_id** (string) - Required - The unique identifier for the quote. ### Response #### Success Response (200) - **quote_id** (string) - The unique identifier for the quote. - **status** (string) - The current status of the swap (e.g., PENDING_DEPOSIT, PROCESSING, SUCCESS, FAILED). - **output_amount** (string) - The amount of output tokens received (if applicable). - **destination_address** (string) - The address where the output tokens were sent. - **refund_address** (string) - The address where funds were refunded (if applicable). - **error_message** (string) - Details about the error if the swap failed (if applicable). #### Response Example ```json { "quote_id": "quote_abc123", "status": "SUCCESS", "output_amount": "990000", "destination_address": "alice.near", "refund_address": null, "error_message": null } ``` ``` -------------------------------- ### Submit Deposit Transaction Hash Source: https://docs.near-intents.org/near-intents/integration/distribution-channels/1click-api An optional route to expedite the swap process by providing an early notification of a deposit transaction to 1Click. This can be used to potentially speed up the confirmation and processing of your swap. ```APIDOC ## POST /v0/deposit/submit ### Description Optional route to speed up process with early deposit notification to 1Click. ### Method POST ### Endpoint /v0/deposit/submit ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **depositTxHash** (string) - Required - The transaction hash of the deposit. - **depositAddress** (string) - Required - The unique deposit address provided by 1Click for the swap. ### Request Example ```json { "depositTxHash": "0x...", "depositAddress": "0x..." } ``` ### Response #### Success Response (200) - **status** (string) - Confirmation message indicating the deposit information was received. #### Response Example ```json { "status": "Deposit information received successfully." } ``` ``` -------------------------------- ### Quote Asset Prices from Solvers using JSON-RPC Source: https://docs.near-intents.org/near-intents/market-makers/bus/solver-relay This method allows frontend applications to estimate potential output amounts for a given input, or the required input for a desired output, based on user intent. It forwards quote requests to connected solvers and returns available options within a specified timeout. Provide either `exact_amount_in` or `exact_amount_out`, but not both. ```javascript { "id": 1, "jsonrpc": "2.0", "method": "quote", "params": [ { "defuse_asset_identifier_in": "nep141:ft1.near", "defuse_asset_identifier_out": "nep141:ft2.near", "exact_amount_in": "1000", "min_deadline_ms": 60000 // OPTIONAL. default 60_000ms / 1min } ] } ``` ```javascript { "jsonrpc": "2.0", "id": 1, "result": [ { "quote_hash": "00000000000000000000000000000000", "defuse_asset_identifier_in": "nep141:ft1.near", "defuse_asset_identifier_out": "nep141:ft2.near", "amount_in": "1000", "amount_out": "2000" "expiration_time": "2024-10-01T12:10:27Z" }, // ... ] } ``` -------------------------------- ### Get Withdrawal Status Source: https://docs.near-intents.org/near-intents/market-makers/passive-deposit-withdrawal-service Checks the status of a withdrawal request based on its transaction hash on the NEAR network. Provides detailed information about the withdrawal's progress and destination. ```APIDOC ## POST /websites/near-intents_near-intents ### Description Returns withdrawal status. ### Method POST ### Endpoint /websites/near-intents_near-intents ### Parameters #### Query Parameters - **withdrawal_hash** (string) - Required - The hash of the transaction on NEAR where the `ft_burn` event occurred on the token contract. ### Request Example ```json { "jsonrpc": "2.0", "id": 1, "method": "withdrawal_status", "params": [ { "withdrawal_hash": "some_hash" } ] } ``` ### Response #### Success Response (200) - **status** (string) - The overall withdrawal status (e.g., `COMPLETED`, `PENDING`, `FAILED`, `NOT_FOUND`, `AWAITING`, `REJECTED`, `RETURNING`, `RETURNED`). - **data** (object) - Contains detailed information about the withdrawal. - **tx_hash** (string) - Burn transaction hash on NEAR. - **transfer_tx_hash** (string) - Transfer transaction hash on the destination chain (if exists). - **chain** (string) - Network type and chain ID. - **defuse_asset_identifier** (string) - Token identifier. - **decimals** (integer) - Token decimals. - **amount** (integer) - Asset amount. - **account_id** (string) - User account. - **address** (string) - Withdrawal address. #### Response Example ```json { "jsonrpc": "2.0", "id": 1, "result": { "status": "COMPLETED", "data": { "tx_hash": "some_hash", "transfer_tx_hash": "", // if exists "chain": "CHAIN_TYPE:CHAIN_ID", "defuse_asset_identifier": "eth:8543:0x123", "decimals": 18, "amount": 10000000000, "account_id": "user.near", "address": "0x123" } } } ``` ``` -------------------------------- ### Get Intent Status API Source: https://docs.near-intents.org/near-intents/market-makers/bus/solver-relay Retrieves the current status of an intent execution. This endpoint allows you to track the progress of your submitted intents. ```APIDOC ## POST /get_status ### Description Retrieves the current status of an intent execution. This endpoint allows you to track the progress of your submitted intents. ### Method POST ### Endpoint /get_status ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **id** (number) - Unique request identifier. - **jsonrpc** (string) - JSON-RPC version, always "2.0". - **method** (string) - The RPC method name, should be "get_status". - **params** (array) - Array containing the parameters for the method. - **intent_hash** (string) - The unique identifier of the intent to check. ### Request Example ```json { "id": 1, "jsonrpc": "2.0", "method": "get_status", "params": [ { "intent_hash": "00000000000000000000000000000000" } ] } ``` ### Response #### Success Response (200) - **jsonrpc** (string) - JSON-RPC version, always "2.0". - **id** (number) - The request identifier. - **result** (object) - The result of the status query. - **intent_hash** (string) - The identifier of the intent. - **status** (string) - The execution status of the intent. Possible values include: - `PENDING`: Intent received and waiting for execution. - `TX_BROADCASTED`: Transaction for the intent has been sent to the Near Intents contract. - `SETTLED`: Intent has been successfully settled on-chain. - `NOT_FOUND_OR_NOT_VALID`: Intent not received, expired, or execution error. - **data** (object) - Additional data related to the intent status. - **hash** (string) - Near transaction hash, if available. #### Response Example ```json { "jsonrpc": "2.0", "id": 1, "result": { "intent_hash": "00000000000000000000000000000000" "status": "SETTLED", "data": { "hash": "8yFNEk7GmRcM3NMJihwCKXt8ZANLpL2koVFWWH1MEEj" } } } ``` ```