# Table of Contents - [Overview | NEAR Intents](#overview-near-intents) - [Distribution Channels | NEAR Intents](#distribution-channels-near-intents) - [1Click Terms of Service | NEAR Intents](#1click-terms-of-service-near-intents) - [1Click App Fees Calculation | NEAR Intents](#1click-app-fees-calculation-near-intents) - [Aggregate fees from any token into desired asset | NEAR Intents](#aggregate-fees-from-any-token-into-desired-asset-near-intents) - [Market Makers | NEAR Intents](#market-makers-near-intents) - [Message Bus | NEAR Intents](#message-bus-near-intents) - [Security | NEAR Intents](#security-near-intents) - [Risk and Compliance | NEAR Intents](#risk-and-compliance-near-intents) - [Verifier | NEAR Intents](#verifier-near-intents) - [Fees | NEAR Intents](#fees-near-intents) - [Deposits and withdrawals | NEAR Intents](#deposits-and-withdrawals-near-intents) - [Examples | NEAR Intents](#examples-near-intents) - [FAQs | NEAR Intents](#faqs-near-intents) - [NEAR Token treatment | NEAR Intents](#near-token-treatment-near-intents) - [Intents Explorer API | NEAR Intents](#intents-explorer-api-near-intents) - [Introduction | NEAR Intents](#introduction-near-intents) - [Events | NEAR Intents](#events-near-intents) - [Balances, and identifying your token | NEAR Intents](#balances-and-identifying-your-token-near-intents) - [Account Abstraction | NEAR Intents](#account-abstraction-near-intents) - [Example Transactions | NEAR Intents](#example-transactions-near-intents) - [Passive Deposit/Withdrawal Service | NEAR Intents](#passive-deposit-withdrawal-service-near-intents) - [Treasury Addresses | NEAR Intents](#treasury-addresses-near-intents) - [Usage | NEAR Intents](#usage-near-intents) - [Chain Support | NEAR Intents](#chain-support-near-intents) - [Simulating intents | NEAR Intents](#simulating-intents-near-intents) - [Deposits | NEAR Intents](#deposits-near-intents) - [1Click API | NEAR Intents](#1click-api-near-intents) - [Intent types and execution | NEAR Intents](#intent-types-and-execution-near-intents) - [Signing Intents | NEAR Intents](#signing-intents-near-intents) - [Withdrawals | NEAR Intents](#withdrawals-near-intents) - [API | NEAR Intents](#api-near-intents) --- # Overview | NEAR Intents ![NEAR Intents Overview](https://docs.near-intents.org/near-intents/~gitbook/image?url=https%3A%2F%2F2137192178-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FbRFddzGQ8Ims43AJzulz%252Fuploads%252Fgit-blob-32b1177b21cdabf9028f7020b4b37ab07ac8435f%252Fintents-overview.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=aebef6a1&sv=2) 👉 [**Get API Key on the Partners Portal**](https://partners.near-intents.org/) NEAR Intents and its documentation are under active development and have recently been renamed from "Defuse" to "NEAR Intents". While the documentation and examples here focus on multichain token swaps, NEAR Intents extend far beyond these types of requests. Whether you want to swap tokens across chains or buy a pizza with Bitcoin, NEAR Intents serves as a protocol for ANY request where diverse solution marketplaces can naturally emerge through competitive discovery. Read more about it in this [NEAR Intents Deep Dive blogpost](https://www.near.org/blog/unpacking-near-intents-a-deep-dive) . [](https://docs.near-intents.org/near-intents#near-intents-components) NEAR Intents Components --------------------------------------------------------------------------------------------------- ![NEAR Intents Overview](https://docs.near-intents.org/near-intents/~gitbook/image?url=https%3A%2F%2F2137192178-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FbRFddzGQ8Ims43AJzulz%252Fuploads%252Fgit-blob-4d9025fd4e7591349a9c4d5019996ab81f88df63%252Fcore-components.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=9e3a644e&sv=2) There are three core components of NEAR Intents: Name Description [Distribution Channels](https://docs.near-intents.org/near-intents/integration/distribution-channels) Applications used for creating, broadcasting, and executing user Intents. (ex. Apps, Wallets, Exchanges) [Market Makers](https://docs.near-intents.org/near-intents/market-makers) Users or Agents that provide liquidity and compete to fulfill "Intent Requests". [Verifier Smart Contract](https://docs.near-intents.org/near-intents/market-makers/verifier) A smart contract deployed on NEAR Protocol that verifies and settles all transactions. [NextDistribution Channels](https://docs.near-intents.org/near-intents/integration/distribution-channels) Last updated 28 days ago --- # Distribution Channels | NEAR Intents ![Distribution Channel](https://docs.near-intents.org/near-intents/~gitbook/image?url=https%3A%2F%2F2137192178-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FbRFddzGQ8Ims43AJzulz%252Fuploads%252Fgit-blob-a133c3784701e6c3de0af2769a699ce6b5193e5a%252Fdistribution-channels.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=2b633b1f&sv=2) [](https://docs.near-intents.org/near-intents/integration/distribution-channels#what-are-distribution-channels) What are Distribution Channels? ---------------------------------------------------------------------------------------------------------------------------------------------------- Distribution Channels are the user-facing applications, wallets, and exchanges that make NEAR Intents accessible to end users. They handle intent creation, management, and asset delivery, while [Market Makers](https://docs.near-intents.org/near-intents/market-makers) handle the actual fulfillment and pricing. [](https://docs.near-intents.org/near-intents/integration/distribution-channels#create-a-distribution-channel) Create a Distribution Channel ------------------------------------------------------------------------------------------------------------------------------------------------- The fastest way to integrate NEAR Intents into your application is through the [1Click Swap API](https://docs.near-intents.org/near-intents/integration/distribution-channels/1click-api) . This REST API abstracts away the complexity of intent creation, solver coordination, and transaction execution, letting you focus on your user experience. Perfect for: Wallets, dApps, and exchanges wanting to offer intent-based transactions without building infrastructure from scratch. [Get started with 1Click API →](https://docs.near-intents.org/near-intents/integration/distribution-channels/1click-api) [PreviousOverview](https://docs.near-intents.org/near-intents) [Next1Click API](https://docs.near-intents.org/near-intents/integration/distribution-channels/1click-api) Last updated 6 months ago * [What are Distribution Channels?](https://docs.near-intents.org/near-intents/integration/distribution-channels#what-are-distribution-channels) * [Create a Distribution Channel](https://docs.near-intents.org/near-intents/integration/distribution-channels#create-a-distribution-channel) --- # 1Click Terms of Service | NEAR Intents **BY ACCESSING, INTEGRATING WITH, OR USING THE 1CLICK SWAP API (“1CS”) YOU AGREE TO THESE TERMS. 1CS IS A BACKEND ROUTING/SERVICES LAYER DEVELOPED AND MAINTAINED BY DEFUSE LABS LIMITED, A COMPANY INCORPORATED IN GIBRALTAR (“DEFUSE”, “WE” and “US”). IT IS SEPARATE FROM THE PROTOCOL, ANY FRONT-END INTERFACES AND THIRD-PARTY COMPONENTS (EACH AS DEFINED BELOW). 1CS IS PROVIDED “AS IS”. DEFUSE IS NOT LICENSED OR REGULATED BY ANY FINANCIAL REGULATORY AUTHORITY TO PROVIDE REGULATED FINANCIAL SERVICES. 1CS IS NOT OFFERED AS, AND IS NOT INTENDED TO CONSTITUTE, REGULATED FINANCIAL SERVICES. IT IS YOUR RESPONSIBILITY TO DETERMINE WHETHER YOUR USE OF 1CS IS PERMITTED UNDER THE LAWS AND REGULATIONS THAT APPLY TO YOU. BY USING 1CS YOU AGREE THAT ANY DISPUTES WILL BE RESOLVED BY FINAL AND BINDING ARBITRATION ON AN INDIVIDUAL BASIS (SEE SECTION 14), AND YOU WAIVE ANY RIGHT TO PARTICIPATE IN A CLASS ACTION. ALL USE OF 1CS IS ENTIRELY AT YOUR OWN RISK, AND DEFUSE ACCEPTS NO RESPONSIBILITY OR LIABILITY FOR YOUR USE OF 1CS EXCEPT TO THE MINIMUM EXTENT REQUIRED BY LAW.** _**Last updated: October 16th, 2025**_ 1. **PURPOSE AND SCOPE (WHAT 1CS IS / ISN’T)** 1. **Purpose.** The 1Click Swap API simplifies interaction with the Protocol. Instead of requiring users or integrators to manually coordinate multiple blockchain steps (for example, bridging assets to NEAR Protocol, posting intents, and withdrawing assets back to other chains), 1CS automates these routing and settlement steps. The goal is a simplified, “one-click” user experience for complex cross-chain transactions. 2. **How it works.** When called, 1CS takes high-level instructions (intents) and performs the technical steps needed to fulfil them, including interacting with independent third-party components (e.g., bridges, relayers). 1CS orchestrates these processes; it does not provide liquidity, investment advice, or exchange services. Further details of how 1CS works can be found at [https://docs.near-intents.org/near-intents/integration/distribution-channels/1click-api](https://docs.near-intents.org/near-intents/integration/distribution-channels/1click-api) . 3. **What it isn’t.** 1CS is not intended to operate as a wallet, broker, advisor, exchange, payment service provider, money transmitter or fiduciary. It does not operate liquidity pools, order books, yield-generating protocols or trading venues. 1CS does not pool user funds, act as counterparty or provide financial guarantees, insurance or underwritten. All transactions facilitated through 1CS are executed by users through the underlying smart contract, and 1CS bears no responsibility for verifying the legality, suitability or taxation of any user activity. 4. **Separation.** 1CS is separate from the Protocol, any Front-End Interfaces and any Third-Party Components. Those components are developed and maintained by third parties, and have their own terms and documentation. 2. **DEFINITIONS** 1. **“1Click Swap API” or “1CS”:** the backend/API service developed and maintained by Defuse to assist with routing and settlement of intents via the Protocol, as described above. 2. **“Protocol” or “Intents Protocol”:** the smart contracts deployed on the NEAR Protocol (including, without limitation, the intents.near contract) that enable users to post, match, and settle intents. The Protocol is not operated or controlled by Defuse and is distinct from both 1CS and any Front-End Interfaces. 3. **“Front-End Interface”:** any website or application that provides user-facing access to the Protocol or 1CS. 4. **“Third-Party Components”:** independent services, applications or protocols that 1CS may interface with (which may include, for example, OmniBridge, HOT Bridge, or the PoA Bridge), other than services, applications or protocols developed, maintained, or operated by Defuse. 5. **“Integrator”:** any developer or entity that connects or integrates its product, protocol, service, or Front-End Interface to 1CS. 3. **DEVELOPER/MAINTAINER** 1CS is developed and maintained by Defuse. Defuse maintains the infrastructure necessary to operate 1CS. Defuse does not operate the Protocol, any Third-Party Components, or any Front-End Interfaces. 4. **TECHNICAL ACTIONS** 1. To perform routing and settlement, in the ordinary course of operation, 1CS may carry out limited technical actions relating to user assets solely to effect user-authorized transactions. These actions: 1. are incidental and/or necessary to construct and submit transactions (including via Third-Party Components); 2. are limited to executing user-approved instructions; 3. are transient, programmatic, and self-executing, and take no longer than necessary to complete the transaction; 4. do not involve pooling, rehypothecation, or re-use of user assets; 5. do not create any fiduciary, agency, or safekeeping relationship with users; and 6. do not at any time give Defuse or any affiliated entity beneficial ownership of user assets. 2. You remain responsible for your wallet, approvals, and on-chain actions. 5. **THIRD-PARTY COMPONENTS** 1CS interacts with independent Third-Party Components (e.g., bridges, relayers), and is accessible via Front-End Interfaces. These are not developed, maintained, or operated by Defuse and are subject to their own terms, risks, and availability. Defuse is not responsible for the performance, security, governance, downtime, or failures of Third-Party Components or Front-End Interfaces (or their respective operators). 6. **ELIGIBILITY AND PROHIBITED LOCALITIES** 1. 1CS is not intended for use by persons or entities located in, established in, or resident of the following jurisdictions (or any other jurisdiction on applicable sanctions lists). Do not use 1CS if this applies to you: Afghanistan (under Taliban control), Belarus, Central African Republic, Cuba, Democratic Republic of Congo, Guinea-Bissau, Haiti, Iran, Libya, Mali, Myanmar (Burma), Nicaragua, North Korea (DPRK), Russia (including the Crimea, Donetsk, Luhansk, Zaporizhzhia, and Kherson regions of Ukraine), Somalia, South Sudan, Sudan, Syria, Venezuela (including certain SDNs connected with the Maduro regime), Yemen, or Zimbabwe. 2. You must not use 1CS if you are on, or controlled by a party on, any U.S, EU, UK, or UN sanctions list. You must not use any technology (including VPNs) to circumvent these restrictions. 3. If you are a UK resident, you agree and acknowledge that 1CS is provided as a tool for users to interact with the Protocol on their own initiative, with no endorsement or recommendation of cryptocurrency trading activities. In doing so, Defuse is not recommending that users or potential users engage in cryptoasset trading activity, and users or potential users of 1CS should not regard 1CS as involving any form of recommendation, invitation or inducement to deal in cryptoassets. 7. **REGULATORY STATUS AND YOUR COMPLIANCE** 1. Defuse is not licensed or regulated by any financial regulatory authority to provide regulated financial services, and 1CS is not offered as, and is not intended to constitute, regulated financial services. 2. It is your responsibility to determine whether your use of 1CS is permitted under the laws and regulations that apply to you. 3. We make no representations regarding how any authority may characterize 1CS or related activities under applicable laws or regulations. You bear the risk that authorities may take positions inconsistent with our view, and, to the maximum extent permitted by applicable law, you waive, release, and covenant not to sue the Defuse or any of its affiliates for any and all claims, losses or liabilities arising from or related to such positions or actions. 4. You are solely responsible for ensuring that your use of 1CS complies with all laws and regulations applicable to you (including sanctions, AML/CFT, consumer, tax, and securities/derivatives rules or any other applicable law or regulation). 5. If you access 1CS through a Front-End Interface, you may also be subject to that Front-End Interface’s terms of service. Your use of Third-Party Components or Front-End Interfaces are subject to the applicable terms of service, privacy policies, and legal notices of each third-party provider, and you are responsible for reviewing and complying with them. Defuse shall have no liability for any losses, damages, or claims arising from or related to third-party services, integrations, or external dependencies used in connection with 1CS. 8. #### [](https://docs.near-intents.org/near-intents/integration/distribution-channels/1click-terms-of-service#intellectual-property) **INTELLECTUAL PROPERTY** 1. All rights, title, and interest in and to the 1CS, including its software, source code (except to the extent any component is expressly released under an open-source license), infrastructure, documentation, and related materials, are and shall remain the exclusive property of Defuse or (if applicable) its licensors. Except as expressly permitted by these Terms, you may not copy, modify, distribute, sell, lease, sublicense, reverse engineer, decompile, or otherwise exploit any part of 1CS. References to the Protocol or to Third-Party Components are for descriptive purposes only and do not imply any sponsorship, endorsement, or ownership by Defuse. All third-party trademarks, service marks, logos, or brand names are the property of their respective owners. 9. **RISKS, NO WARRANTIES, AND NO SERVICE LEVELS** 1. 1CS is provided “AS IS” and “AS AVAILABLE.” ALL USE OF 1CS IS ENTIRELY AT YOUR OWN RISK. To the maximum extent permitted by law, Defuse disclaims all warranties (express, implied, or statutory), including as to security, availability, correctness, fitness for purpose, non-infringement, or error-free/continuous operation. 2. 1CS is experimental infrastructure and may be interrupted, suspended, or modified at any time. Defuse does not guarantee, and Defuse shall have no liability in respect of, availability, uptime, continuity, or error-free operation of 1CS, nor does it undertake to provide maintenance, support, or any service-level commitments of any kind. 3. On-chain activity carries risks (e.g., smart-contract bugs, bridge exploits, slippage, MEV, reorgs, network congestion, loss of keys). Transactions may be final and irreversible. Only interact if you understand and accept these risks. 10. **FEES AND EXECUTION** You are responsible for all fees associated with your use of 1CS, including network (“gas”) fees, bridge fees, protocol fees, and other execution costs. Fees may apply even if a transaction fails or is reverted. Execution results may differ from estimates due to market conditions and slippage. 1CS does not guarantee pricing or execution. 11. **INTEGRATORS (ADDITIONAL RESPONSIBILITIES)** If you integrate 1CS into a product or interface, you: 1. must present clear, prominent disclosures to your users consistent with these Terms (especially Sections 4, 5, 6, 7, 9, and 12); 2. are responsible for sanctions compliance and user eligibility; 3. must not misrepresent 1CS or imply it is operated by you or by any Front-End Interface; and 4. must implement reasonable safeguards to prevent abusive, illegal, or sanction-circumventing use. 12. **LIMITATION OF LIABILITY** 1. TO THE MAXIMUM EXTENT PERMITTED BY LAW, DEFUSE, DEFUSE’S AFFILIATES AND THEIR RESPECTIVE OFFICERS, DIRECTORS, EMPLOYEES, CONTRACTORS, AND AGENTS WILL NOT BE LIABLE FOR ANY INDIRECT, PUNITIVE, INCIDENTAL, SPECIAL, CONSEQUENTIAL, OR EXEMPLARY DAMAGES, OR FOR ANY LOSS OF PROFITS, REVENUE, DATA, GOODWILL, DIGITAL ASSETS, OR OPPORTUNITY, ARISING FROM OR RELATING TO 1CS OR THESE TERMS, WHETHER BASED IN CONTRACT, TORT, STRICT LIABILITY, OR OTHERWISE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 2. NOTHING IN THESE TERMS EXCLUDES OR LIMITS LIABILITY THAT CANNOT BE EXCLUDED OR LIMITED UNDER APPLICABLE LAW (INCLUDING LIABILITY FOR FRAUD, WILFUL MISCONDUCT, OR DEATH OR PERSONAL INJURY CAUSED BY NEGLIGENCE). SUBJECT TO THE FOREGOING, DEFUSE’S TOTAL AGGREGATE LIABILITY FOR ALL CLAIMS WILL NOT EXCEED USD 100 (ONE HUNDRED UNITED STATES DOLLARS). 13. **INDEMNITY** 1. You agree to indemnify, defend, and hold harmless Defuse, Defuse’s affiliates, and their respective officers, directors, employees, contractors, and agents (together, the “**Indemnified Parties**”) from and against any and all claims, demands, actions, proceedings, damages, losses, liabilities, costs, and expenses (including reasonable legal fees) arising out of or relating to: 1. your access to or use of 1CS; 2. your breach of these Terms; 3. your violation of any law or regulation applicable to you; 4. your violation of any rights of a third party (including intellectual property, privacy, or contractual rights); or 5. if you are an Integrator, any claim, demand, or proceeding brought by an end user of your product, service, or Front-End Interface that integrates with 1CS. 2. The Indemnified Parties may, at their sole discretion, assume the defence and control of any matter subject to indemnification by you. You agree to cooperate with any such defence. 14. **GOVERNING LAW AND DISPUTES** These Terms are governed by the laws of Gibraltar. The courts of Gibraltar will have exclusive jurisdiction over any dispute arising out of or relating to these Terms or 1CS. At our sole discretion, we may require you to submit any dispute to final and binding arbitration under the Rules of Arbitration of the Gibraltar Arbitration Act of 1895 (as amended or replaced). ANY ARBITRATION WILL BE ON AN INDIVIDUAL BASIS; CLASS ARBITRATION AND CLASS ACTIONS ARE WAIVED. 15. **CHANGES, SUSPENSION, TERMINATION** We may suspend or modify 1CS (in whole or part) or terminate your access at any time for operational, security, legal, or sanctions-compliance reasons. We may update these Terms at any time by posting an updated version in the official 1CS repository or documentation. Your continued use after an update means you accept the revised Terms. 16. **DATA** 1CS does not request, store, or have access to, private keys. We may process limited operational metadata (e.g., logs and diagnostics) to run and improve the service and to address abuse, security, or legal compliance. On-chain activity is public by design. 17. **MISCELLANEOUS** If any provision of these Terms is held invalid, the remaining provisions will continue in full force. These Terms constitute the entire agreement regarding your use of 1CS and supersede any prior or contemporaneous understandings on this subject. Nothing in these Terms shall be construed to create any partnership, joint venture, agency, or employment relationship between you and Defuse. Last updated 1 month ago --- # 1Click App Fees Calculation | NEAR Intents A concise guide on how to setup [1Click Swap API](https://docs.near-intents.org/near-intents/integration/distribution-channels/1click-api) app fees distribution during quoting and execution. As a distribution channel while asking for **quote**, you can specify the distribution of fees that come from the swap being executed. ### [](https://docs.near-intents.org/near-intents/integration/distribution-channels/1click-app-fees-calculation#parameters) Parameters * **recipient** — any NEAR‑supported address (named account ID like `alice.near`, implicit based account or EVM-like). * **fee\_bps** — fee in basis points (bps). `100` → `1.00%`. The fee is charged **from the input token**. > Conversion: p = fee\_bps / 10\_000. ### [](https://docs.near-intents.org/near-intents/integration/distribution-channels/1click-app-fees-calculation#constraints) Constraints * `0 ≤ fee_bps ≤ 10_000` (`10_000` = 100%). ### [](https://docs.near-intents.org/near-intents/integration/distribution-channels/1click-app-fees-calculation#how-fees-are-applied) How fees are applied #### [](https://docs.near-intents.org/near-intents/integration/distribution-channels/1click-app-fees-calculation#exact_in) EXACT\_IN * `amount_in` is decreased based on fee during swap * `net_in = amount_in * (1 - p)` * The quote computes `amount_out` **from** `**net_in**`. * `fee_amount = amount_in − net_in` (deducted in input token). #### [](https://docs.near-intents.org/near-intents/integration/distribution-channels/1click-app-fees-calculation#exact_out) EXACT\_OUT * `min_amount_in` is increased based on fee * Apply the fee to the required input: `net_in = min_amount_in × (1 + p)`. * `fee_amount = net_in − min_amount_in` (deducted in input token). * If user deposit more than `min_amount_in` for `EXACT_OUT` fees will be deducted from `amount_in` field. `fee_amount = net_in − amount_in` ### [](https://docs.near-intents.org/near-intents/integration/distribution-channels/1click-app-fees-calculation#examples) Examples **Example 1 — EXACT\_IN** * Inputs: `amount_in = 1,000,000`, `fee_bps = 100` (`p = 0.01`) * Computation: `net_in = 1,000,000 × (1 − 0.01) = 990,000` * User deposits `1,000,000` and the quote calculates `amount_out` from `net_in = 990,000` * Fee: `fee_amount = 10,000` (in input token) **Example 2 — EXACT\_OUT** * Inputs: `min_amount_in = 500,000`, `fee_bps = 100` (`p = 0.01`) * Computation: `net_in = 500,000 × (1 + 0.01) = 505,000` * User have to deposit `505,000` and the quote require at least `505,000` units of the input token. * Fee: `fee_amount = 5,000` (in input token) Last updated 3 months ago --- # Aggregate fees from any token into desired asset | NEAR Intents **1Click Swap — ANY\_INPUT** **Purpose:** Aggregate fees from _any_ supported token into one `destinationAsset`, then auto-withdraw once the pool hits **$1,000 USD**. ### [](https://docs.near-intents.org/near-intents/integration/distribution-channels/1click-app-fees-calculation/aggregate-fees-from-any-token-into-desired-asset#wire-up-fees-flow) Wire-up (fees flow) 1. Create the ANY\_INPUT quote → grab `**depositAddress**`. 2. Put that address into `**appFees**` for user quotes. 3. System auto-swaps incoming tokens to `destinationAsset` and **withdraws at ≥$1,000 USD**. ### [](https://docs.near-intents.org/near-intents/integration/distribution-channels/1click-app-fees-calculation/aggregate-fees-from-any-token-into-desired-asset#how-it-works) How it works * Use `originAsset: "1cs:any"` with `amount: "0"`. * Take the `**depositAddress**` from the quote response and put it into `**appFees**` in user quotes (that’s where fees should land). * Quote **deadline** is checked only at **creation**; after that the quote is **valid indefinitely**. * A background job **continuously polls**, swaps all deposits to `destinationAsset`, and **withdraws** when the **$1k** threshold is reached. * **No refunds.** If a swap attempt fails, it retries **every 5 minutes** (no funds returned). However it’s still suggested to add the address you control to `refundTo` **Auth:** You must call the Quote API with `Authorization: Bearer ` to receive the quote (and `depositAddress`). **Tip:** `quoteWaitingTimeMs` ≈ **5000–10000** (3–4s often OK). * * * ### [](https://docs.near-intents.org/near-intents/integration/distribution-channels/1click-app-fees-calculation/aggregate-fees-from-any-token-into-desired-asset#create-any_input-quote-example-request) Create ANY\_INPUT quote (example request) * * * [](https://docs.near-intents.org/near-intents/integration/distribution-channels/1click-app-fees-calculation/aggregate-fees-from-any-token-into-desired-asset#any_input-withdrawals) ANY\_INPUT Withdrawals --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- #### [](https://docs.near-intents.org/near-intents/integration/distribution-channels/1click-app-fees-calculation/aggregate-fees-from-any-token-into-desired-asset#endpoint) **Endpoint** `GET /any-input/withdrawals` #### [](https://docs.near-intents.org/near-intents/integration/distribution-channels/1click-app-fees-calculation/aggregate-fees-from-any-token-into-desired-asset#description) **Description** Use this endpoint to retrieve withdrawal records. Withdrawals are identified and filtered by the `**depositAddress**` parameter. Each response contains up to **50 records**, ordered by **timestamp** by default. #### [](https://docs.near-intents.org/near-intents/integration/distribution-channels/1click-app-fees-calculation/aggregate-fees-from-any-token-into-desired-asset#features) **Features** * **Filtering:** Records are retrieved by `depositAddress`. * **Pagination:** Supports pagination through standard query parameters. * **Sorting:** Results are sorted by `timestamp` (descending by default). * **Limit:** Maximum of 50 records per request. ### [](https://docs.near-intents.org/near-intents/integration/distribution-channels/1click-app-fees-calculation/aggregate-fees-from-any-token-into-desired-asset#any_input-withdrawals-response) ANY\_INPUT Withdrawals response [Previous1Click App Fees Calculation](https://docs.near-intents.org/near-intents/integration/distribution-channels/1click-app-fees-calculation) [NextIntents Explorer API](https://docs.near-intents.org/near-intents/integration/distribution-channels/intents-explorer-api) Last updated 25 days ago * [Wire-up (fees flow)](https://docs.near-intents.org/near-intents/integration/distribution-channels/1click-app-fees-calculation/aggregate-fees-from-any-token-into-desired-asset#wire-up-fees-flow) * [How it works](https://docs.near-intents.org/near-intents/integration/distribution-channels/1click-app-fees-calculation/aggregate-fees-from-any-token-into-desired-asset#how-it-works) * [Create ANY\_INPUT quote (example request)](https://docs.near-intents.org/near-intents/integration/distribution-channels/1click-app-fees-calculation/aggregate-fees-from-any-token-into-desired-asset#create-any_input-quote-example-request) * [ANY\_INPUT Withdrawals](https://docs.near-intents.org/near-intents/integration/distribution-channels/1click-app-fees-calculation/aggregate-fees-from-any-token-into-desired-asset#any_input-withdrawals) * [ANY\_INPUT Withdrawals response](https://docs.near-intents.org/near-intents/integration/distribution-channels/1click-app-fees-calculation/aggregate-fees-from-any-token-into-desired-asset#any_input-withdrawals-response) Copy { "dry": false, "swapType": "ANY_INPUT", "slippageTolerance": 0, "originAsset": "1cs:any", "depositType": "INTENTS", // Token you want to collect fees in: "destinationAsset": "nep141:eth-0xdac17f958d2ee523a2206206994597c13d831ec7.omft.near", "amount": "0", // Suggested to put the address you control "refundTo": "something.near", "refundType": "INTENTS", // Where converted fees will be withdrawn to: "recipient": "0x1ddA60d784483FBB54304c68830d42A706327C6d", "recipientType": "DESTINATION_CHAIN", // or "INTENTS" // Used only at creation; quote itself is unlimited: "deadline": "2025-09-22T20:00:00Z", "referral": "YOUR_REFERRAL", // Prefer 5–10s "quoteWaitingTimeMs": 10000 } Copy { "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"\ }\ ] } --- # Market Makers | NEAR Intents Market Makers are active market participants that deposit liquidity in order to fill quotes issued by users. To start market making, you are required to perform _bridging_ and _quoting_. ### [](https://docs.near-intents.org/near-intents/market-makers#passive-deposit-withdrawal-service) Passive Deposit/Withdrawal Service In order to deposit and withdraw liquidity, market makers need to send funds themselves or do it via one of the distribution channels (e.g. [https://near-intents.org](https://near-intents.org/) ) . To send the liquidity, please get familiar with [Passive Deposit/Withdrawal Service](https://docs.near-intents.org/near-intents/market-makers/passive-deposit-withdrawal-service) for deposits and with specific bridge (PoA, Omni or HOT) API for withdrawals. More information on that and an SDK will be available soon. ### [](https://docs.near-intents.org/near-intents/market-makers#quoting) Quoting Once the liquidity is available for trading, use the [Message Bus API](https://docs.near-intents.org/near-intents/market-makers/bus/solver-relay) to receive and sign quotes. [PreviousIntents Explorer API](https://docs.near-intents.org/near-intents/integration/distribution-channels/intents-explorer-api) [NextMessage Bus](https://docs.near-intents.org/near-intents/market-makers/bus) Last updated 5 months ago * [Passive Deposit/Withdrawal Service](https://docs.near-intents.org/near-intents/market-makers#passive-deposit-withdrawal-service) * [Quoting](https://docs.near-intents.org/near-intents/market-makers#quoting) --- # Message Bus | NEAR Intents Message Bus is an additional system component that optimizes the price discovery process. Any frontend app may use Message Bus or launch its own instance. ![](https://docs.near-intents.org/near-intents/~gitbook/image?url=https%3A%2F%2Fgithub.com%2Fuser-attachments%2Fassets%2Ffc27dde0-7a3d-428e-9776-8743aa6b43a5&width=768&dpr=4&quality=100&sign=40f6a71e&sv=2) Message Bus Near Intents protocol may operate without a Message Bus component: * frontends may use any other quoting mechanisms to compose and publish signed intents * market makers may index NEAR blockchain to find intents to fill. [PreviousMarket Makers](https://docs.near-intents.org/near-intents/market-makers) [NextAPI](https://docs.near-intents.org/near-intents/market-makers/bus/solver-relay) Last updated 5 months ago --- # Security | NEAR Intents List of audits could be found in [Google Drive](https://drive.google.com/drive/folders/1eNHI_GKsbmMSjeCENRklvtVh8imGSUvy?usp=sharing) . Please report bugs and security vulnerabilities via [Hackenproof](https://hackenproof.com/programs/near-intents) bug bounty program. For any AML/CTF (Anti-Money Laundering and Counter-Terrorism Financing) related requests, please refer to our [AML Portal](https://aml.near-intents.org/) . [PreviousFAQs](https://docs.near-intents.org/near-intents/faqs) [NextRisk and Compliance](https://docs.near-intents.org/near-intents/risk-and-compliance) Last updated 3 months ago --- # Risk and Compliance | NEAR Intents [](https://docs.near-intents.org/near-intents/risk-and-compliance#introduction) Introduction ------------------------------------------------------------------------------------------------- At NEAR Intents, we are deeply committed to implementing best practices in compliance and financial integrity. Transparency, accountability, and adherence to international standards are not just regulatory requirements for us — they are guiding principles. Our goal is to ensure that all transactions routed through NEAR Intents are secure, transparent, and fully aligned with global efforts to combat money laundering, sanctions violations, and other forms of financial crime. [](https://docs.near-intents.org/near-intents/risk-and-compliance#current-implementation) Current Implementation --------------------------------------------------------------------------------------------------------------------- ### [](https://docs.near-intents.org/near-intents/risk-and-compliance#id-1.-real-time-compliance-screening-for-1click-swap-api-quote-requests) 1\. Real-time compliance screening for 1Click Swap API quote requests Every quote request undergoes automated compliance checks against multiple trusted data sources: * **NEAR Intents AML Portal** - ([aml.near-intents.org](https://aml.near-intents.org/) ) * **Binance AML** * **AMLBot & PureFi** These checks are designed to identify any overlap between addresses provided in the request and addresses flagged in external databases. ### [](https://docs.near-intents.org/near-intents/risk-and-compliance#id-2.-enhanced-screening-for-1click-swap-api-non-dry-quote-requests) 2\. Enhanced screening for 1Click Swap API non-dry quote requests In addition to the above, all non-dry quote requests are screened against [TRM Labs](https://www.trmlabs.com/) datasets. At present, we automatically block quote issuance for any address that TRM Labs flags with: * Sanctions (with `riskType: OWNERSHIP`) * Blocking behavior When a match is detected, the quote request is immediately rejected, and the corresponding user or distribution channel receives a clear response that the quote has been blocked. This ensures that potentially tainted flows are contained at the very first interaction point. [PreviousSecurity](https://docs.near-intents.org/near-intents/security) [NextChain Support](https://docs.near-intents.org/near-intents/chain-address-support) Last updated 1 month ago * [Introduction](https://docs.near-intents.org/near-intents/risk-and-compliance#introduction) * [Current Implementation](https://docs.near-intents.org/near-intents/risk-and-compliance#current-implementation) * [1\. Real-time compliance screening for 1Click Swap API quote requests](https://docs.near-intents.org/near-intents/risk-and-compliance#id-1.-real-time-compliance-screening-for-1click-swap-api-quote-requests) * [2\. Enhanced screening for 1Click Swap API non-dry quote requests](https://docs.near-intents.org/near-intents/risk-and-compliance#id-2.-enhanced-screening-for-1click-swap-api-non-dry-quote-requests) --- # Verifier | NEAR Intents [](https://docs.near-intents.org/near-intents/market-makers/verifier#deployment) Deployment ------------------------------------------------------------------------------------------------ The smart contract for NEAR Intents protocol is deployed at [`intents.near`](https://nearblocks.io/address/intents.near) There is no testnet deployment. [](https://docs.near-intents.org/near-intents/market-makers/verifier#source-code) Source code -------------------------------------------------------------------------------------------------- ![](https://images.gitbook.com/__img/width=256,format=auto,signature=485166135/https%3A%2F%2Ffiles.gitbook.com%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fintegrations%252Fgithub-files%252Ficon%252FyLv8rmwlZaZ4xBFdwZLt%252Ficon.png%3Falt%3Dmedia) Not found [PreviousPassive Deposit/Withdrawal Service](https://docs.near-intents.org/near-intents/market-makers/passive-deposit-withdrawal-service) [NextIntroduction](https://docs.near-intents.org/near-intents/market-makers/verifier/introduction) Last updated 8 months ago * [Deployment](https://docs.near-intents.org/near-intents/market-makers/verifier#deployment) * [Source code](https://docs.near-intents.org/near-intents/market-makers/verifier#source-code) --- # Fees | NEAR Intents This page describes all fees that apply to NEAR Intents transactions and integrations. * * * [](https://docs.near-intents.org/near-intents/fees#protocol-fee) Protocol Fee ---------------------------------------------------------------------------------- * **0.0001% (1 pip)** per transaction. * Collected on-chain by the [`intents.near`](https://nearblocks.io/address/intents.near) smart contract. * Applies to every transfer, swap, or transaction. * These fees are sent to the [`fee_collector`](https://near-intents.org/account?user=near:7066024d3f20f94de601c003163367873cca78507eeca4df66d9be645f197f05) . * * * [](https://docs.near-intents.org/near-intents/fees#near-intents.org-fee) Near-Intents.org Fee -------------------------------------------------------------------------------------------------- * **0.2%** fee on swaps executed through [near-intents.org](https://near-intents.org/) . * Collected by the proprietary distribution channel in addition to the protocol fee. * These fees are sent to [`fefundsadmin.sputnik-dao.near`](https://nearblocks.io/address/fefundsadmin.sputnik-dao.near) . * * * [](https://docs.near-intents.org/near-intents/fees#id-1click-swap-api-fees) 1Click Swap API Fees ----------------------------------------------------------------------------------------------------- * **1Click Swap API (with API key):** Only the 0.0001% protocol fee applies. * **1Click Swap API (without API key):** An additional **0.1%** fee is charged. Apply for the API Key [here](https://docs.google.com/forms/d/e/1FAIpQLSdrSrqSkKOMb_a8XhwF0f7N5xZ0Y5CYgyzxiAuoC2g4a2N68g/viewform) . * Developers/Distribution Channels can also add their own fees on top using the [`appFees`](https://docs.near-intents.org/near-intents/integration/distribution-channels/1click-app-fees-calculation) parameter. * * * [PreviousTreasury Addresses](https://docs.near-intents.org/near-intents/treasury-addresses) [NextExamples](https://docs.near-intents.org/near-intents/examples) Last updated 2 months ago * [Protocol Fee](https://docs.near-intents.org/near-intents/fees#protocol-fee) * [Near-Intents.org Fee](https://docs.near-intents.org/near-intents/fees#near-intents.org-fee) * [1Click Swap API Fees](https://docs.near-intents.org/near-intents/fees#id-1click-swap-api-fees) --- # Deposits and withdrawals | NEAR Intents Depositing funds into the `Verifier` smart contract is the first step for using it. The Verifier smart contract is [open-source](https://github.com/near/intents/) , and has transparent logic to how it operates. ### [](https://docs.near-intents.org/near-intents/market-makers/verifier/deposits-and-withdrawals#undefined) [PreviousIntroduction](https://docs.near-intents.org/near-intents/market-makers/verifier/introduction) [NextNEAR Token treatment](https://docs.near-intents.org/near-intents/market-makers/verifier/deposits-and-withdrawals/near-token-treatment) Last updated 7 months ago --- # Examples | NEAR Intents Below are various references for NEAR Intents protocol: Link Description Type [Defuse Frontend](https://github.com/defuse-protocol/defuse-frontend) [near-intents.org](https://near-intents.org/) website GitHub [Cross-Chain Swap Examples](https://github.com/near-examples/near-intents-examples) Tutorial for cross-chain token swaps using 1-Click API GitHub [AMM Solver](https://github.com/defuse-protocol/near-intents-amm-solver) Sample market maker with AMM functionality GitHub [Python Client](https://github.com/referencedev/test-intent) A Python example of interacting with the Message Bus GitHub [Intent JSON Validator](https://app.near-intents.org/dev/multipayload-json-validator) Tool to verify signed intent JSON correctness GitHub [TEE Solver Registry](https://github.com/aurora-is-near/tee-solver) Secure TEE-based solver and liquidity protocol GitHub [Near Intents 101](https://www.youtube.com/watch?v=mOGD2gzZJqE) A New Way to Transact - Build Smarter with AI & Blockchain Video [Near Intents 102](https://www.youtube.com/watch?v=U8ngm2hR4a4) Build Your First One-Click API App for Cross-Chain Swaps Video [Agent Example](https://github.com/near-examples/near-intents-agent-example) Python tool for AI-driven NEAR swaps GitHub [PreviousFees](https://docs.near-intents.org/near-intents/fees) Last updated 1 month ago --- # FAQs | NEAR Intents [](https://docs.near-intents.org/near-intents/faqs#is-there-a-testnet-deployment) Is there a testnet deployment? --------------------------------------------------------------------------------------------------------------------- There is no testnet deployment and no plans for one. We recommend testing on NEAR mainnet using separate dev/test NEAR accounts. [](https://docs.near-intents.org/near-intents/faqs#is-there-support-for-native-near-deposits) Is there support for native NEAR deposits? --------------------------------------------------------------------------------------------------------------------------------------------- Only `ft_transfer_call` can be used to deposit NEP-141 tokens from Near to `intents.near` :\\ Copy ::ft_transfer_call({ "receiver_id": "intents.near", "amount": "1234", "msg": "{\"receiver_id\": \"\"}" }) Here is an example [receipt](https://nearblocks.io/txns/EwmeXzZJStA6e5JB49vgxNYJDemqeYCFGvPH7zapP1Fw#execution#4tyaF4MnMcNQVqrg3kXzsH9277ErDeCXS9g3c2keV38G) for that. Parameter `msg` can also be empty, so that funds will be deposited to `sender_id` (i.e. caller of `ft_transfer_call`). Here is an example of such [tx](https://nearblocks.io/txns/HoWpAR8dF5azsUVaQWrBW5VsRve5X4dwr9GGiHWj3R1P#execution) [](https://docs.near-intents.org/near-intents/faqs#tx_hash-in-the-recent_deposit-response-for-all-sol-deposits-is-empty) `tx_hash` in the `recent_deposit` response for all SOL deposits is empty ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ This information is not available for Solana because the mechanism of deposit tracking works a bit differently there. [](https://docs.near-intents.org/near-intents/faqs#is-there-a-reason-why-my-utxos-arent-being-swept-on-the-btc-i-sent-5-000-sats) Is there a reason why my UTXOs aren't being swept on the BTC ? I sent 5,000 sats ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- This is a very small amount that is considered to be "dust" and there is a special business logic to process such small amount. [](https://docs.near-intents.org/near-intents/faqs#how-does-the-deposit-process-work) How does the deposit process work? ----------------------------------------------------------------------------------------------------------------------------- The deposit process begins once the transfer transaction on the foreign network has been completed. When the balance of the user's unique deposit address has become positive our indexer generates a deposit event and assigns it a PENDING status. The next step is collecting the current tokens in storage. The result of this process will be either a COMPLETED or FAILED status. Deposits with a FAILED status are currently handled manually and eventually updated to the COMPLETED status. On EVM networks, deposits can bypass the PENDING status due to the faster processing and transfer completion times. The data structure for the PENDING and FAILED statuses is identical to that of the COMPLETED status. Regarding BTC deposits: If you want to make a deposit to an account that hasn’t yet been connected to the application - this is possible but requires extreme caution. You can request a deposit address by calling the bridge API (deposit\_address) and specifying the account\_id parameter. The account\_id can be a NEAR account, an EVM address, or a SOL address to which you have access. It is recommended starting with a small amount for experimentation. After the deposit is completed, you can connect wallet and check the tokens. [](https://docs.near-intents.org/near-intents/faqs#eth-connector-migration) ETH-connector migration -------------------------------------------------------------------------------------------------------- Because of the split of ETH-connector, `aurora`contract now [acts](https://github.com/aurora-is-near/aurora-engine/blob/3416d0d170bf3dcaaac3ad3b9ba751d002ea1b3f/engine/src/contract_methods/connector/mod.rs#L209-L210) as a NEP-141 proxy to `eth.bridge.near`. This leads to some changes: * Firstly, **ALL** new deposits will be [treated](https://nearblocks.io/txns/ExLxkbRjKbSDSTVozPpSsTfRL8Aqfs8kvLxFLEx4qDzt#enhanced) as `eth.bridge.near`, even if triggered from `aurora` smart-contract. Even from inside of Aurora Mainnet (example [tx](https://explorer.aurora.dev/tx/0x9c20d9f76443ec3c12f8eb41a65caa0c1391210c539a5924215b9bdf9e0b1fd2?tab=index) )! ALL withdrawals of legacy `aurora` will be received on Near as new `eth.bridge.near`. * Secondly, the migration of already deposited Eth@Near (`aurora`) can be done **permissionlessly** by withdrawing from `intents.near` and depositing it back right away. Luckily, it's possible to do that in a single tx thanks to [this](https://github.com/Near-One/aurora-eth-connector/blob/58d3f39cebcf6266514de3dd04efec5bafb6274e/eth-connector/src/lib.rs#L132-L143) patch on eth-connector side. Users can migrate in two ways: * Via `ft_withdraw()` [tx](https://nearblocks.io/txns/GHrRbGsDuv86u72jHNqofZYTUssfuXyYwcJ8mYyLrq2v#enhanced) with following params: * Via `ft_withdraw` intent with the _same_ params as in above ^ The [front-end](https://app.near-intents.org/) automatically detects legacy tokens on user's balance and prompts him to sign such migration intent. [PreviousSimulating intents](https://docs.near-intents.org/near-intents/market-makers/verifier/simulating-intents) [NextSecurity](https://docs.near-intents.org/near-intents/security) Last updated 5 months ago * [Is there a testnet deployment?](https://docs.near-intents.org/near-intents/faqs#is-there-a-testnet-deployment) * [Is there support for native NEAR deposits?](https://docs.near-intents.org/near-intents/faqs#is-there-support-for-native-near-deposits) * [tx\_hash in the recent\_deposit response for all SOL deposits is empty](https://docs.near-intents.org/near-intents/faqs#tx_hash-in-the-recent_deposit-response-for-all-sol-deposits-is-empty) * [Is there a reason why my UTXOs aren't being swept on the BTC ? I sent 5,000 sats](https://docs.near-intents.org/near-intents/faqs#is-there-a-reason-why-my-utxos-arent-being-swept-on-the-btc-i-sent-5-000-sats) * [How does the deposit process work?](https://docs.near-intents.org/near-intents/faqs#how-does-the-deposit-process-work) * [ETH-connector migration](https://docs.near-intents.org/near-intents/faqs#eth-connector-migration) Copy { "token": "aurora", // legacy token "receiver_id": "intents.near", // deposit back "amount": "1234", "memo": "Migrate ETH: aurora -> eth.bride.near", "msg": "", // recipient inside intents.near for eth.bridge.near tokens } --- # NEAR Token treatment | NEAR Intents Since NEAR is the native token for the near blockchain, implying the requirement to have special treatment for it, and in order to streamline the usage of NEAR with other assets, NEAR is treated as a fungible token ([NEP-141](https://nomicon.io/Standards/Tokens/FungibleToken/Core) ) using its wrapped fungible token, [`wrap.near`](https://nearblocks.io/address/wrap.near) . The source code (and interface) for wrapped NEAR (wNEAR) can be found [here](https://github.com/near/core-contracts/) . As a result, there is no way to deposit NEAR directly. The user should exchange their NEAR token and exchange it for wrapped NEAR token in the `wrap.near` contract before depositing them into the `Verifier` contract. [PreviousDeposits and withdrawals](https://docs.near-intents.org/near-intents/market-makers/verifier/deposits-and-withdrawals) [NextDeposits](https://docs.near-intents.org/near-intents/market-makers/verifier/deposits-and-withdrawals/deposits) Last updated 7 months ago --- # Intents Explorer API | NEAR Intents [](https://docs.near-intents.org/near-intents/integration/distribution-channels/intents-explorer-api#what-is-intents-explorer-api) What is Intents Explorer API? --------------------------------------------------------------------------------------------------------------------------------------------------------------------- The **Intents Explorer API** provides programmatic access to historical 1Click Swap transactions and their statuses, mirroring the data available on the [NEAR Intents Explorer](https://explorer.near-intents.org/) . This API is read-only and features a single HTTP GET endpoint designed specifically for distribution channels and analytical services to fetch and filter 1Click Swap history. ### [](https://docs.near-intents.org/near-intents/integration/distribution-channels/intents-explorer-api#key-features) Key Features * The API is tailored exclusively for 1Click Swap transactions and is not intended for general NEAR Intents activity. * Retrieve and filter swaps by token symbols, transaction hashes, timestamps, and status, enabling precise integration with your analytics or dashboarding tools. * Mirrors the same real-time and historical swap data shown in the [NEAR Intents Explorer](https://explorer.near-intents.org/) interface. ### [](https://docs.near-intents.org/near-intents/integration/distribution-channels/intents-explorer-api#documentation-and-access) Documentation & Access * **Swagger UI**: [https://explorer.near-intents.org/api/docs](https://explorer.near-intents.org/api/docs) * **OpenAPI Spec (YAML)**: [https://explorer.near-intents.org/api/v0/openapi.yaml](https://explorer.near-intents.org/api/v0/openapi.yaml) * **API Key Form**: [https://docs.google.com/forms/d/e/1FAIpQLSdrSrqSkKOMb\_a8XhwF0f7N5xZ0Y5CYgyzxiAuoC2g4a2N68g/viewform](https://docs.google.com/forms/d/e/1FAIpQLSdrSrqSkKOMb_a8XhwF0f7N5xZ0Y5CYgyzxiAuoC2g4a2N68g/viewform) [](https://docs.near-intents.org/near-intents/integration/distribution-channels/intents-explorer-api#api-specification-v0) API Specification (v0) ------------------------------------------------------------------------------------------------------------------------------------------------------ Auto-generate clients using our [OpenAPI spec](https://explorer.near-intents.org/api/v0/openapi.yaml) . Authentication: It is mandatory to [obtain a JWT token](https://docs.google.com/forms/d/e/1FAIpQLSdrSrqSkKOMb_a8XhwF0f7N5xZ0Y5CYgyzxiAuoC2g4a2N68g/viewform) and use it for all requests. ### [](https://docs.near-intents.org/near-intents/integration/distribution-channels/intents-explorer-api#api-endpoints) API Endpoints ### [](https://docs.near-intents.org/near-intents/integration/distribution-channels/intents-explorer-api#get-api-v0-transactions) Get transactions get /api/v0/transactions Authorizations bearerAuth bearerAuth AuthorizationstringRequired JWT token for API authentication. Query parameters numberOfTransactionsnumber · min: 1 · max: 1000Optional The number of transactions to return. Default: 50. Max: 1000. Min: 1. lastDepositAddressAndMemostringOptional Last known depositAddressAndMemo value for pagination. Use the depositAddressAndMemo from the last transaction of the previous page. lastDepositAddressstringOptional DEPRECATED: Use lastDepositAddressAndMemo instead. Last known deposit address for pagination. directionstring · enumOptional Direction of pagination. `next` - get older transactions, `prev` - get newer transactions. Default: `next`. Possible values: `next``prev` searchstringOptional Search by deposit address, recipient, or intent hashes. fromChainIdstring · enumOptional Filter by origin chain ID. Possible values: `near``eth``base``arb``btc``sol``ton``doge``xrp``zec``gnosis``bera``bsc``pol``tron``sui``op``avax``cardano``stellar``aptos``ltc``monad``xlayer``starknet``bch``adi` fromTokenIdstringOptional Filter by origin token ID. Overrides fromChainId. toChainIdstring · enumOptional Filter by destination chain ID. Possible values: `near``eth``base``arb``btc``sol``ton``doge``xrp``zec``gnosis``bera``bsc``pol``tron``sui``op``avax``cardano``stellar``aptos``ltc``monad``xlayer``starknet``bch``adi` toTokenIdstringOptional Filter by destination token ID. Overrides toChainId. Overrides fromTokenId. referralstringOptional Filter by referral. affiliatestringOptional Filter by an affiliate stored in the fees. statusesstringOptional Filter by comma-separated statuses. Allowed values: FAILED, INCOMPLETE\_DEPOSIT, PENDING\_DEPOSIT, PROCESSING, REFUNDED, SUCCESS. Default: FAILED, PROCESSING, REFUNDED, SUCCESS. showTestTxsstringOptional Show transactions from test accounts and with test-related referrals. minUsdPricenumber | nullableOptional Filter by minimum USD price for both input and output amounts. maxUsdPricenumber | nullableOptional Filter by maximum USD price for both input and output amounts. endTimestampstring · date | nullableOptional Filter by end timestamp (non-inclusive). Use ISO 8601 format. endTimestampUnixnumber | nullableOptional Filter by end timestamp (non-inclusive). Use Unix timestamp. startTimestampstring · date | nullableOptional Filter by start timestamp (non-inclusive). Use ISO 8601 format. startTimestampUnixnumber | nullableOptional Filter by start timestamp (non-inclusive). Use Unix timestamp. Responses 200 Transactions application/json 400 Bad Request application/json Responseobject Show properties 401 Unauthorized application/json 429 Too Many Requests - Rate limit exceeded. Maximum 1 request per 5 seconds per partner. application/json get /api/v0/transactions HTTP HTTPcURLJavaScriptPython 200 Transactions ### [](https://docs.near-intents.org/near-intents/integration/distribution-channels/intents-explorer-api#get-api-v0-transactions-pages) Get paginated transactions get /api/v0/transactions-pages Authorizations bearerAuth bearerAuth AuthorizationstringRequired JWT token for API authentication. Query parameters pagenumber · min: 1Optional Page number. Default: 1. Min: 1. perPagenumber · min: 1 · max: 1000Optional Number of transactions per page. Default: 50. Max: 1000. Min: 1. searchstringOptional Search by deposit address, recipient, or intent hashes. fromChainIdstring · enumOptional Filter by origin chain ID. Possible values: `near``eth``base``arb``btc``sol``ton``doge``xrp``zec``gnosis``bera``bsc``pol``tron``sui``op``avax``cardano``stellar``aptos``ltc``monad``xlayer``starknet``bch``adi` fromTokenIdstringOptional Filter by origin token ID. Overrides fromChainId. toChainIdstring · enumOptional Filter by destination chain ID. Possible values: `near``eth``base``arb``btc``sol``ton``doge``xrp``zec``gnosis``bera``bsc``pol``tron``sui``op``avax``cardano``stellar``aptos``ltc``monad``xlayer``starknet``bch``adi` toTokenIdstringOptional Filter by destination token ID. Overrides toChainId. Overrides fromTokenId. referralstringOptional Filter by referral. affiliatestringOptional Filter by an affiliate stored in the fees. statusesstringOptional Filter by comma-separated statuses. Allowed values: FAILED, INCOMPLETE\_DEPOSIT, PENDING\_DEPOSIT, PROCESSING, REFUNDED, SUCCESS. Default: FAILED, PROCESSING, REFUNDED, SUCCESS. showTestTxsstringOptional Show transactions from test accounts and with test-related referrals. minUsdPricenumber | nullableOptional Filter by minimum USD price for both input and output amounts. maxUsdPricenumber | nullableOptional Filter by maximum USD price for both input and output amounts. endTimestampstring · date | nullableOptional Filter by end timestamp (non-inclusive). Use ISO 8601 format. endTimestampUnixnumber | nullableOptional Filter by end timestamp (non-inclusive). Use Unix timestamp. startTimestampstring · date | nullableOptional Filter by start timestamp (non-inclusive). Use ISO 8601 format. startTimestampUnixnumber | nullableOptional Filter by start timestamp (non-inclusive). Use Unix timestamp. Responses 200 Transactions application/json 400 Bad Request application/json Responseobject Show properties 401 Unauthorized application/json 429 Too Many Requests - Rate limit exceeded. Maximum 1 request per 5 seconds per partner. application/json get /api/v0/transactions-pages HTTP HTTPcURLJavaScriptPython 200 Transactions Last updated 5 months ago Copy GET /api/v0/transactions HTTP/1.1 Host: Authorization: Bearer YOUR_SECRET_TOKEN Accept: */* Copy [\ {\ "originAsset": "nep141:eth-0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48.omft.near",\ "destinationAsset": "nep141:17208628f84f5d6ad33f0da3bbbeb27ffcb398eac501a31bd6ad2011e36133a1",\ "depositAddress": "GDJ4JZXZELZD737NVFORH4PSSQDWFDZTKW3AIDKHYQG23ZXBPDGGQBJK",\ "depositAddressAndMemo": "GDJ4JZXZELZD737NVFORH4PSSQDWFDZTKW3AIDKHYQG23ZXBPDGGQBJK_12345",\ "recipient": "somebody.near",\ "status": "SUCCESS",\ "createdAt": "2025-12-31T12:00:00.000Z",\ "createdAtTimestamp": 1767182400,\ "intentHashes": "GnGk38hvi92tTWDYMMS8CWYnVT4fixmfBrnqSErCDMTu",\ "referral": "some-referral",\ "amountInFormatted": "22.130108",\ "amountOutFormatted": "22.113697",\ "appFees": [\ {\ "fee": 50,\ "recipient": "some.near"\ },\ {\ "fee": 5,\ "recipient": "somebody.near"\ }\ ],\ "nearTxHashes": [\ "6XqqDwoaopgg39QsEiFGs9HfwP2Vum9tCCyqHDYXWBBH",\ "EVcgKukwf38XsYcgvkEgiMPWR7qwLfLK5rsVtjgctPBn"\ ],\ "originChainTxHashes": [\ "0x9bcff372aee89b648c922b850573b22387c31d693079f5e37cd255814e2d615a"\ ],\ "destinationChainTxHashes": [\ "0x9bcff372aee89b648c922b850573b22387c31d693079f5e37cd255814e2d615a"\ ],\ "amountIn": "22130108",\ "amountInUsd": "22.1272",\ "amountOut": "22113697",\ "amountOutUsd": "22.1108",\ "refundTo": "somebody.near",\ "refundReason": "AMOUNT_MORE_THAN_BALANCE"\ }\ ] Copy GET /api/v0/transactions-pages HTTP/1.1 Host: Authorization: Bearer YOUR_SECRET_TOKEN Accept: */* Copy { "data": [\ {\ "originAsset": "nep141:eth-0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48.omft.near",\ "destinationAsset": "nep141:17208628f84f5d6ad33f0da3bbbeb27ffcb398eac501a31bd6ad2011e36133a1",\ "depositAddress": "GDJ4JZXZELZD737NVFORH4PSSQDWFDZTKW3AIDKHYQG23ZXBPDGGQBJK",\ "depositAddressAndMemo": "GDJ4JZXZELZD737NVFORH4PSSQDWFDZTKW3AIDKHYQG23ZXBPDGGQBJK_12345",\ "recipient": "somebody.near",\ "status": "SUCCESS",\ "createdAt": "2025-12-31T12:00:00.000Z",\ "createdAtTimestamp": 1767182400,\ "intentHashes": "GnGk38hvi92tTWDYMMS8CWYnVT4fixmfBrnqSErCDMTu",\ "referral": "some-referral",\ "amountInFormatted": "22.130108",\ "amountOutFormatted": "22.113697",\ "appFees": [\ {\ "fee": 50,\ "recipient": "some.near"\ },\ {\ "fee": 5,\ "recipient": "somebody.near"\ }\ ],\ "nearTxHashes": [\ "6XqqDwoaopgg39QsEiFGs9HfwP2Vum9tCCyqHDYXWBBH",\ "EVcgKukwf38XsYcgvkEgiMPWR7qwLfLK5rsVtjgctPBn"\ ],\ "originChainTxHashes": [\ "0x9bcff372aee89b648c922b850573b22387c31d693079f5e37cd255814e2d615a"\ ],\ "destinationChainTxHashes": [\ "0x9bcff372aee89b648c922b850573b22387c31d693079f5e37cd255814e2d615a"\ ],\ "amountIn": "22130108",\ "amountInUsd": "22.1272",\ "amountOut": "22113697",\ "amountOutUsd": "22.1108",\ "refundTo": "somebody.near",\ "refundReason": "AMOUNT_MORE_THAN_BALANCE"\ }\ ], "totalPages": 50, "page": 1, "perPage": 50, "total": 2500, "nextPage": 2, "prevPage": null } --- # Introduction | NEAR Intents The Verifier contract is a smart contract on the Near blockchain that is used as the atomic mediator of transferring assets among users in the intents ecosystem. A brief explanation of the terms mentioned follows. The [Verifier](https://docs.near-intents.org/near-intents/market-makers/verifier) section is written for those who would like to interact with the `Verifier` smart contract directly, or would like to create payloads for the [Message Bus](https://docs.near-intents.org/near-intents/market-makers/bus) . After all, the Message Bus acts as a matching system that brings together quotes from market makers with requests for transactions. Note: The former name of the smart contract is "Defuse". It is still the name used for the smart contract at the time of writing this documentation in a few places. It is planned to change this in the future. ### [](https://docs.near-intents.org/near-intents/market-makers/verifier/introduction#what-payload-are-we-referring-to-or-what-is-the-workflow) What payload are we referring to, or what is the workflow? Let's start with the assumption that any participant in the `Verifier` smart contract has the tokens in question [deposited](https://docs.near-intents.org/near-intents/market-makers/verifier/deposits-and-withdrawals) into the smart contract. In the intents protocol, a single user, be it a market maker, end-user or otherwise, expresses their "intent" to do a transaction. The transaction can be to transfer coins within the smart contract against receive other coins, transfer to another user, etc. These intents can be submitted directly to the smart contract, or can be bundled together by a 3rd party, like the Message Bus, to have them all executed atomically. Let's discuss a few use-cases of the `Verifier` smart contract. #### [](https://docs.near-intents.org/near-intents/market-makers/verifier/introduction#example-1-simple-transfer) Example 1: Simple transfer Alice, the owner of `alice.near`, wants to transfer a fungible token from their own account to the user `bob.near`. In this case, Alice creates an Intent object of type `Transfer`, expressing the desired destination, `bob.near`, [signs it](https://docs.near-intents.org/near-intents/market-makers/verifier/signing-intents) , and calls the function `execute_intents` in the Verifier smart contract. This will transfer ownership of the tokens in question from `alice.near` to `bob.near`. #### [](https://docs.near-intents.org/near-intents/market-makers/verifier/introduction#example-2-token-swap) Example 2: Token swap Alice and Bob, agree to swap their `USDT` and `USDC`, 1000 `USDT` from Alice for 1000 `USDC` from Bob. It can be through chat, or a 3rd party tool, like the Message Bus. However, it is obvious that such a transaction requires trust if done without a impartial mediator. Alice could receive the `USDC` from Bob, and never send him the `USDT` she promised. A solution to this problem goes as follows using the `Verifier` smart contract: 1. Alice and Bob deposit their `USDT` and `USDC` to the `Verifier` smart contract. The `Verifier` maintains full ownership of these assets to their depositors, giving them the freedom to withdraw them in case of any party backing out. 2. Alice creates and signs an intent of type `TokenDiff`, expressing that she is willing to lose 1000 `USDT` if anyone would provide 1000 `USDC` in return. 3. Bob creates and signs an intent of type `TokenDiff`, expressing that he is willing to lose 1000 `USDC` if anyone would provide 1000 `USDT` in return. 4. Both intents from Alice and Bob are bundled in a list. Alice or Bob can then call the function `execute_intents` in the `Verifier` smart contract. The smart contract will fulfill the swap, since both Intents are achievable within that transaction. 5. Alice now has 1000 `USDC` in her account in the `Verifier` contract, and Bob has 1000 `USDT` in his account. 6. Alice and Bob have the right to withdraw their `USDC/USDT` and allocate the funds according to their preferences. Notice that this example is how peer to peer trading is achieved using Near Intents. After all, all that is needed to be able to trade is to have a mediator that bundles swap requests, i.e., `TokenDiff` intents. This is what the Message Bus typically does. In fact, any 3rd party can do this. #### [](https://docs.near-intents.org/near-intents/market-makers/verifier/introduction#example-3-withdrawal) Example 3: Withdrawal From the previous example, if Alice wants to withdraw her USDC tokens, she creates and [signs](https://docs.near-intents.org/near-intents/market-makers/verifier/signing-intents) an Intent of type `FtWithdraw`, where she specifies the receiving address and the amount she wants to withdraw. She, then, calls the function `execute_intents` , and the `Verifier` smart contract will verify her ownership of the USDC tokens, and send them to the address she specified. Withdrawals can also be done by directly calling the `Verifier` smart contract. More information in the [Deposits and withdrawals](https://docs.near-intents.org/near-intents/market-makers/verifier/deposits-and-withdrawals) [PreviousVerifier](https://docs.near-intents.org/near-intents/market-makers/verifier) [NextDeposits and withdrawals](https://docs.near-intents.org/near-intents/market-makers/verifier/deposits-and-withdrawals) Last updated 7 months ago --- # Events | NEAR Intents In the NEAR blockchain, [events](https://docs.near.org/tutorials/nfts/events) are strings that are logged as a result of executing a smart contract function. Smart contracts can emit any events they wish to alert users to important on-chain actions. The `Verifier` smart contract uses events to emit information about what happened in every intent and/or transaction function call. In this section, we will list some of the events used. ### [](https://docs.near-intents.org/near-intents/market-makers/verifier/events#structure-of-event-strings) Structure of event strings In the NEAR blockchain, events, based on [NEP-171](https://docs.near.org/tutorials/nfts/events) , are prefixed with the string `EVENT_JSON`. Smart contracts can then define custom event content freely. The `Verifier` contract uses strictly JSON objects in order to maintain easy programmability with detecting events. #### [](https://docs.near-intents.org/near-intents/market-makers/verifier/events#intents-events) Intents events Below is a [list of the available events](https://near.github.io/intents/defuse_core/events/enum.DefuseEvent.html) and their explanation. These events are directly related to the [intent submitted](https://docs.near-intents.org/near-intents/market-makers/verifier/intent-types-and-execution) : * **PublicKeyAdded**: Emitted when a public key is added to an account with an intent * **PublicKeyRemoved**: Emitted when a public key was removed from an account with an intent * **Transfer**: Emitted when a transfer between two accounts happens with an intent * **TokenDiff**: Emitted when a `TokenDiff` intent executes successfully * **IntentsExecuted**: Emitted after successfully having executed the listed intents * **FtWithdraw**, **NftWithdraw**, **MtWithdraw**, **NativeWithdraw**: Emitted when a withdraw intent is made. Note that many times it is difficult to emit only on success because this depends on cross-contract calls. * **StorageDeposit**: Emitted when a storage deposit intent is submitted. #### [](https://docs.near-intents.org/near-intents/market-makers/verifier/events#multi-token-events) Multi Token events Multi Token events are emitted to indicate a change in the internal balances of the `Verifier` contract. The following are the [available events](https://near.github.io/intents/defuse_nep245/enum.MtEvent.html) . * [MtMintEvent](https://near.github.io/intents/defuse_nep245/struct.MtMintEvent.html) : Is emitted when the balance of a given account in the `Verifier` smart contract increases, due to deposits. * [MtBurnEvent](https://near.github.io/intents/defuse_nep245/struct.MtBurnEvent.html) : Is emitted when the balance of a given account in the `Verifier` smart contract decreases, due to withdrawals. * [MtTransferEvent](https://near.github.io/intents/defuse_nep245/struct.MtTransferEvent.html) : After executing intents like `TokenDiff`, the requests inside of it are converted eventually to transfers between accounts by fulfilling all the requests in it. This event is emitted to indicate that tokens have "changed hands", or moved between accounts. To understand the reasoning behind the naming, one can imagine the `Verifier` as a set of isolated balances that can either increase, decrease or move between accounts. Although balances are conserved and simply moved between accounts, from the Verifier contract’s perspective, increasing token amounts is equivalent to minting, and decreasing them is akin to burning. This picture stems primarily from a discussion in [this section](https://docs.near-intents.org/near-intents/market-makers/verifier/deposits-and-withdrawals/balances-and-identifying-your-token) , where all tokens use the Multi Token standard for storage inside the `Verifier` smart contract. [PreviousSigning Intents](https://docs.near-intents.org/near-intents/market-makers/verifier/signing-intents) [NextExample Transactions](https://docs.near-intents.org/near-intents/market-makers/verifier/example-transactions) Last updated 7 months ago --- # Balances, and identifying your token | NEAR Intents This section explains how to check your token balance and how tokens are organized within the Verifier smart contract. ### [](https://docs.near-intents.org/near-intents/market-makers/verifier/deposits-and-withdrawals/balances-and-identifying-your-token#managing-tokens-via-the-multi-token-standard-nep-245) Managing Tokens via the Multi Token Standard (NEP-245) After a successful deposit, the `Verifier` contract manages tokens using the [Multi Token Standard (NEP-245)](https://nomicon.io/Standards/Tokens/MultiToken/Core) . This enables uniform handling of all supported token types. ### [](https://docs.near-intents.org/near-intents/market-makers/verifier/deposits-and-withdrawals/balances-and-identifying-your-token#token-ids-in-the-verifier-contract) Token IDs in the Verifier contract Each token is identified by a string-based token ID, prefixed with its standard type (e.g., `nep141`, `nep171`, or `nep245`). Examples: * Wrapped NEAR is an NEP-141 fungible token with id `wrap.near`. In the Verifier contract, it's addressed as `nep141:wrap.near`. * An NFT with issuer/collection contract id `coolnfts.near` and token id `rock.near` is addressed in the Verifier contract with `nep171:coolnfts.near:rock.near`. * A generic token that uses the NEP-245 standard, originating from contract `mygame.near` and token id `shield.near` is addressed in the Verifier contract with `nep245:mygame.near:shield.near` ### [](https://docs.near-intents.org/near-intents/market-makers/verifier/deposits-and-withdrawals/balances-and-identifying-your-token#checking-your-balance) Checking your balance After a successful deposit of any token, for example `wrap.near`, your balance can be checked [using the function](https://near.github.io/intents/defuse_nep245/trait.MultiTokenCore.html#tymethod.mt_balance_of) `mt_balance_of`, which adheres to the NEP-245 standard. The following are the parameters of this function: Copy { account_id: "alice.near", token_id: "nep141:wrap.near" } Using `near-cli`, this query can be done using the command: [PreviousDeposits](https://docs.near-intents.org/near-intents/market-makers/verifier/deposits-and-withdrawals/deposits) [NextWithdrawals](https://docs.near-intents.org/near-intents/market-makers/verifier/deposits-and-withdrawals/withdrawals) Last updated 7 months ago * [Managing Tokens via the Multi Token Standard (NEP-245)](https://docs.near-intents.org/near-intents/market-makers/verifier/deposits-and-withdrawals/balances-and-identifying-your-token#managing-tokens-via-the-multi-token-standard-nep-245) * [Token IDs in the Verifier contract](https://docs.near-intents.org/near-intents/market-makers/verifier/deposits-and-withdrawals/balances-and-identifying-your-token#token-ids-in-the-verifier-contract) * [Checking your balance](https://docs.near-intents.org/near-intents/market-makers/verifier/deposits-and-withdrawals/balances-and-identifying-your-token#checking-your-balance) Copy near contract call-function as-read-only intents.near mt_balance_of json-args '{ "account_id": "alice.near", "token_id": "nep141:wrap.near" }' network-config mainnet now --- # Account Abstraction | NEAR Intents The `Verifier` contract currently identifies users via their NEAR `AccountId`, which can be either a Named or Implicit account. ### [](https://docs.near-intents.org/near-intents/market-makers/verifier/account-abstraction#named-account-user.near) Named Account: `user.near` The only way to start using a Named Account is to send a real tx `intents.near::add_public_key(pk)` from user's NEAR wallet. Others can still deposit or transfer funds to you before you "claim" the account. ### [](https://docs.near-intents.org/near-intents/market-makers/verifier/account-abstraction#implicit-account) Implicit Account Such accounts already have a public key encoded in their names, so they can be used without any "claiming" from users. There is 1-to-1 relationship between its format and corresponding signing curve types:\\ * EdDSA: `8c5cba35f5b4db9579c39175ad34a9275758eb29d4866f395ed1a5b5afcb9ffc` (i.e. "Implicit NEAR") * ECDSA: `0x85d456B2DfF1fd8245387C0BfB64Dfb700e98Ef3` (i.e. "Implicit Eth") For example, users logging in with a Cosmos (ECDSA) wallet will have an _Implicit Eth address_ in `intents.near`, whereas Solana or Ton (EdDSA) wallets will yield _Implicit NEAR addresses_. It's not feasible to differentiate these addresses by chain, since we only know the signature and public key. Even when differentiating between them based on the used signing standard (NEP-413, EIP-712), it still results in ambiguity when importing the same seed phrase into multiple wallets. [](https://docs.near-intents.org/near-intents/market-makers/verifier/account-abstraction#account-keys) Account keys ------------------------------------------------------------------------------------------------------------------------ Once an account is created, multiple additional public keys could be added to it to authorize actions on that account. Each of these keys has full control over the account and can add or remove other keys either directly via NEAR transactions or via signed intents. Encoding Requirements for the Verifier Contract Curve Public Key Signature Ed25519 32 bytes 64 bytes Secp256k1 64 bytes (uncompressed) 65 bytes (r || s || v) P256 64 bytes (uncompressed) 64 bytes (r || s) Important: Compressed public keys are not supported for ECDSA curves (Secp256k1, P256). Public keys must be in uncompressed format (raw 64-byte x || y coordinates without prefix bytes). Signatures must be in raw concatenated byte format, not DER-encoded. Here is an example of adding public keys for Explicit NEAR Accounts via [tx](https://nearblocks.io/txns/FBTRk6jRUSW3E1SjBfYbA71DhN5xTX1yE2foy98TafrM#execution) . You can also do it manually with [near-cli](https://github.com/near/near-cli-rs) : In addition to directly calling the `add_public_key`method it's also possible to submit a signed intent: [](https://docs.near-intents.org/near-intents/market-makers/verifier/account-abstraction#authentication-flow-example-via-frontends) Authentication Flow example via Frontends ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Users' wallets store their private keys and allow users to rotate them. In order to verify signatures inside of `Verifier`, `Verifier` should know which keys are associated with which "named" accounts. Therefore, `intents.near` contract should maintain a _copy_ of mapping of `account_ids` to their `public_keys` (again, each `account_id` can have multiple `public_keys` registered). This copy should include a subset of valid public keys that were added as Full Access Keys to each NEAR account that wants to interact with Intents. When a user `user1` opens the Frontend for the first time and clicks "Connect Wallet", the frontend prompts the user's wallet to `signMessage("Authenticate")` . As a result, we get a signature and, more importantly, the `public_key` as a counterpart of a Full Access Key that was used to sign this message and the `account_id` which the public\_key corresponds to. The frontend would store this pair `(account_id, public_key)` in browser's local storage. Now, when a user wants to swap tokens, i.e. sign a `state_change`: 1. First, check if this pair `(account_id, public_key)` is already registered in Intents contract on-chain by calling `get_account_public_keys(account_id) -> Vec` method on `intents.near` contract. 1. If there is no such user or if public\_key was not registered for him, the user should be "registered" in Intents contract. For that we should ask user's wallet to `signMessage("user1 is an owner of public_key ed25519:abcd...")` 2. This signed message is than included in the transaction (by [Message Bus](https://docs.near-intents.org/near-intents/market-makers/bus) ) to `intents.near` calling `add_public_key({"account_id": "user1", "public_key": "ed25519:abcd...", "signature": "xyz123..."})` method. This transaction would add `ed25519:abcd...` to the list of public\_keys that belongs to `user1` 2. The user's wallet should sign `signMessage({"account_id": "user1", "state_changes": [...] })` and this state\_change along with the returned signature and public\_key would be eventually sent by a market maker to the `intents.near`. 3. When `intents.near` receives transaction with such signature, it validates the signature for given `public_key` and atomically checks whether the `public_key` is registered for `user1`. A challenge arises when a user removes his `Full Access Key`, it should also be unregistered on `intents.near` contract by calling `remove_public_key(public_key)` method sent from user's NEAR account. This can be automated by adding a `FunctionalKey` added to user's account on NEAR and call by ourselves whenever we detect that our user has deleted a key from his NEAR account on-chain. [PreviousWithdrawals](https://docs.near-intents.org/near-intents/market-makers/verifier/deposits-and-withdrawals/withdrawals) [NextIntent types and execution](https://docs.near-intents.org/near-intents/market-makers/verifier/intent-types-and-execution) Last updated 2 months ago * [Named Account: user.near](https://docs.near-intents.org/near-intents/market-makers/verifier/account-abstraction#named-account-user.near) * [Implicit Account](https://docs.near-intents.org/near-intents/market-makers/verifier/account-abstraction#implicit-account) * [Account keys](https://docs.near-intents.org/near-intents/market-makers/verifier/account-abstraction#account-keys) * [Authentication Flow example via Frontends](https://docs.near-intents.org/near-intents/market-makers/verifier/account-abstraction#authentication-flow-example-via-frontends) Copy near contract call-function as-transaction \ intents.near add_public_key json-args '{ "public_key": "ed25519:" }' prepaid-gas '100.0 Tgas' attached-deposit '1 yoctoNEAR' \ sign-as network-config mainnet sign-with-keychain send Copy { "signer_id": "", // ... "intents": [\ {\ "intent": "add_public_key",\ "public_key": "" \ },\ ] } --- # Example Transactions | NEAR Intents Examples of supported transactions are listed: * [add\_public\_key](https://nearblocks.io/txns/FBTRk6jRUSW3E1SjBfYbA71DhN5xTX1yE2foy98TafrM#execution) * [remove\_public\_key](https://nearblocks.io/txns/69XiJcRtipZ2i8bkHHgCaSAkswd8Lt6VxiJuM8dKq9qn#execution) * [execute\_intents](https://nearblocks.io/txns/FxpbspXjRQg3gDii18ibp3w7yvbe7MWaDHQfVqVfq7xN#enhanced) (1 withdrawal intent) NEP-141: * [deposit](https://nearblocks.io/txns/DWv4AkrLxnbJV6paqSFR3Tt42SdVAtunBbEi2XATdXTW#enhanced) * [deposit-then-execute-intents](https://nearblocks.io/txns/Bn3iC9B1uUJrX59x7cfxngY1E159HspzTCyyDVwx5DMJ#) (1 withdrawal intent) * [deposit-swap-withdraw](https://nearblocks.io/txns/BMFcWFReAzbH8okweUio2nNTuVXtMr1hXeaaNR4UhEzS#) (~1 NEAR -> ~5 USDT) * [withdrawal by transaction](https://nearblocks.io/txns/3E8TDSLq2Xn8JZEAdbeX8NGS7Ps6f1EwLeoFxhT7YY3G#enhanced) Getting balances via CLI: Copy 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"\ ] -------------- [PreviousEvents](https://docs.near-intents.org/near-intents/market-makers/verifier/events) [NextSimulating intents](https://docs.near-intents.org/near-intents/market-makers/verifier/simulating-intents) Last updated 7 months ago --- # Passive Deposit/Withdrawal Service | NEAR Intents The Passive Deposit/Withdrawal Service enables seamless asset movement between [supported blockchain networks](https://docs.near-intents.org/near-intents/chain-address-support) and NEAR Intents. It provides a lightweight mechanism for moving tokens in and out of the protocol. This service only moves funds to/from the [treasury](https://docs.near-intents.org/near-intents/treasury-addresses) on behalf of the user. There is an SDK for integrating the Passive Deposits/Withdrawals Service: [Bridge SDK on GitHub](https://github.com/defuse-protocol/sdk-monorepo/tree/main/packages/bridge-sdk) . This SDK is under active development and may introduce breaking changes. * * * ### [](https://docs.near-intents.org/near-intents/market-makers/passive-deposit-withdrawal-service#how-to-use) How to use 1. _Get supported assets_. The service only works with a specific list of tokens that are available for transfer to NEAR Intents. The list of supported tokens and networks can be obtained using this request. 2. _Get deposit address._ Once you have verified that your token is supported by the service, you can use the request to obtain a deposit address. After receiving the address, transfer the tokens to it, and they will soon be available in NEAR Intents. 3. _Get recent deposit._ The API service allows you to get the status of the most recent deposits. Simply send a request to retrieve this information. 4. _Get withdrawal status_. The service supports token withdrawals from NEAR Intents to the supported network. To do this, call the 'withdrawal' contract method or use the frontend. The status of the withdrawal can be obtained upon request. * * * ### [](https://docs.near-intents.org/near-intents/market-makers/passive-deposit-withdrawal-service#json-rpc-endpoint) **JSON-RPC Endpoint** **POST:** `**https://bridge.chaindefuser.com/rpc**` * * * ### [](https://docs.near-intents.org/near-intents/market-makers/passive-deposit-withdrawal-service#requests) Requests **1\. Get supported assets** Returns a list of tokens that are supported by the service in each network. Parameters[](https://docs.near-intents.org/near-intents/market-makers/passive-deposit-withdrawal-service#parameters) * `[]chains` - chain filter. Response[](https://docs.near-intents.org/near-intents/market-makers/passive-deposit-withdrawal-service#response) * `[].tokens.defuse_asset_identifier` — unique id of trading asset * `[].tokens.near_token_id` — unique id of the token in the NEAR blockchain * `[].tokens.decimals` — trading asset precision. should be used for amount setup during intent creation * `[].tokens.asset_name` — trading asset name * `[].tokens.min_deposit_amount` — minimum amount of tokens to trigger transfer process * `[].tokens.min_withdrawal_amount` — minimum amount of tokens to initiate a withdrawal * `[].tokens.withdrawal_fee` — the fee charged for withdrawing the specified token Example[](https://docs.near-intents.org/near-intents/market-makers/passive-deposit-withdrawal-service#example) **2\. Get deposit address** Returns the address for depositing supported tokens or native currency. Parameters[](https://docs.near-intents.org/near-intents/market-makers/passive-deposit-withdrawal-service#parameters-1) * `account_id` - user account in NEAR Intents * `chain` - network type and chain id. E.g. `eth:42161` for Arbitrum or `btc:mainnet`for Bitcoin Response[](https://docs.near-intents.org/near-intents/market-makers/passive-deposit-withdrawal-service#response-1) * `address` - deposit address * `chain` - network type and chain id Example[](https://docs.near-intents.org/near-intents/market-makers/passive-deposit-withdrawal-service#example-1) **3\. Get recent deposits** Returns information on recent deposits Parameters[](https://docs.near-intents.org/near-intents/market-makers/passive-deposit-withdrawal-service#parameters-2) * `account_id` - user account in NEAR Intents * `chain` - network type and chain id Response[](https://docs.near-intents.org/near-intents/market-makers/passive-deposit-withdrawal-service#response-2) * `[].tx_hash` - transaction hash \[EVM networks only\] * `[].chain` - network type and chain id * `[].defuse_asset_identifier` - token identifier * `[].decimals` - token decimals * `[].amount` - asset amount * `[].account_id` - user account NEAR Intents * `[].address` - deposit address * `[].status` - deposit status Example[](https://docs.near-intents.org/near-intents/market-makers/passive-deposit-withdrawal-service#example-2) **4\. Get withdrawal status** Returns withdrawal status. Parameters[](https://docs.near-intents.org/near-intents/market-makers/passive-deposit-withdrawal-service#parameters-3) * `withdrawal_hash` - hash of the transaction on NEAR where `ft_burn` event happened on the token contract Response[](https://docs.near-intents.org/near-intents/market-makers/passive-deposit-withdrawal-service#response-3) * `status` - withdrawal status (`COMPLETED`, `PENDING`, `FAILED`, `NOT_FOUND`, `AWAITING`, `REJECTED`, `RETURNING`, `RETURNED`) * `data.tx_hash` - burn transaction hash on NEAR * `data.transfer_tx_hash` - transfer transaction hash on destination chain * `data.chain` - network type and chain id * `data.defuse_asset_identifier` - token identifier * `data.decimals` - token decimals * `data.amount` - asset amount * `data.account_id` - user account * `data.address` - withdrawal address Example[](https://docs.near-intents.org/near-intents/market-makers/passive-deposit-withdrawal-service#example-3) **5\. Notify about deposit transaction hash** Optional method that notifies service about your deposit. Parameters[](https://docs.near-intents.org/near-intents/market-makers/passive-deposit-withdrawal-service#parameters-4) * `deposit_address` - address which you received from service api previously and where you transferred tokens * `tx_hash` - hash of your deposit transaction Response[](https://docs.near-intents.org/near-intents/market-makers/passive-deposit-withdrawal-service#response-4) * `error`\- optional field in case of wrong input Example[](https://docs.near-intents.org/near-intents/market-makers/passive-deposit-withdrawal-service#example-4) **6\. Estimated withdrawal fees** Convenience method that estimates the fees for transactions. Parameters[](https://docs.near-intents.org/near-intents/market-makers/passive-deposit-withdrawal-service#parameters-5) * `chain` - The blockchain network in format {network}:{chainId} * `token` - The token identifier for which to estimate withdrawal fees * `address` - Recipient address Response[](https://docs.near-intents.org/near-intents/market-makers/passive-deposit-withdrawal-service#response-5) * `tokenAddress`\- The address of the token contract * `userAddress` - The user's address * `withdrawalFee` - The estimated fee for withdrawal * `withdrawalFeeDecimals`\- The decimal precision of the withdrawal fee * `token`\- Token information details * `error`\- Error message if estimation fails Example[](https://docs.near-intents.org/near-intents/market-makers/passive-deposit-withdrawal-service#example-5) [PreviousUsage](https://docs.near-intents.org/near-intents/market-makers/bus/usage-examples) [NextVerifier](https://docs.near-intents.org/near-intents/market-makers/verifier) Last updated 4 months ago * [How to use](https://docs.near-intents.org/near-intents/market-makers/passive-deposit-withdrawal-service#how-to-use) * [JSON-RPC Endpoint](https://docs.near-intents.org/near-intents/market-makers/passive-deposit-withdrawal-service#json-rpc-endpoint) * [Requests](https://docs.near-intents.org/near-intents/market-makers/passive-deposit-withdrawal-service#requests) Copy // Request { "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"\ },\ // ...\ ] } } Copy //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" } } Copy //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\ },\ ] } } Copy // Request { "jsonrpc": "2.0", "id": 1, "method": "withdrawal_status", "params": [ \ {\ "withdrawal_hash": "some_hash",\ }\ ] } // Response { "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" } } } Copy // Request { "jsonrpc": "2.0", "id": 1, "method": "notify_deposit", "params": [ \ {\ "deposit_address": "address",\ "tx_hash": "hash"\ }\ ] } // Response { "jsonrpc": "2.0", "id": 1 } Copy // Request { "jsonrpc": "2.0", "id": 1, "method": "withdrawal_estimate", "params": [\ {\ "chain": "eth:1",\ "token": "eth.omft.near",\ "address": "0x456def..."\ }\ ] } // Response { "jsonrpc": "2.0", "id": 1, "result": { "tokenAddress": "0x123abc...", "userAddress": "0x456def...", "withdrawalFee": "12500000000000000", "withdrawalFeeDecimals": 18, "token": { "defuse_asset_identifier": "0x123abc...", "near_token_id": "eth.omft.near", "decimals": 18, "asset_name": "ETH", "min_deposit_amount": 0.001 } } } --- # Treasury Addresses | NEAR Intents [](https://docs.near-intents.org/near-intents/treasury-addresses#treasury-addresses) Treasury Addresses ------------------------------------------------------------------------------------------------------------ For transparency and AML compliance, below are the treasury and refill addresses used by **NEAR Intents** and **HOT Bridge**, listed by network. Network NEAR Intents Treasury Address HOT Bridge Treasury Address **EVM Chains (Ethereum, Arbitrum, Aurora, Base, Bera, BNB, Gnosis, Polygon, Optimism, XLayer, Monad)** [`0x2CfF890f0378a11913B6129B2E97417a2c302680`](https://blockscan.com/address/0x2CfF890f0378a11913B6129B2E97417a2c302680) [`0x233c5370CCfb3cD7409d9A3fb98ab94dE94Cb4Cd`](https://blockscan.com/address/0x233c5370CCfb3cD7409d9A3fb98ab94dE94Cb4Cd) **Bitcoin (BTC)** [`1C6XJtNXiuXvk4oUAVMkKF57CRpaTrN5Ra`](https://www.blockchain.com/btc/address/1C6XJtNXiuXvk4oUAVMkKF57CRpaTrN5Ra) – **Solana (SOL)** [`HWjmoUNYckccg9Qrwi43JTzBcGcM1nbdAtATf9GXmz16`](https://explorer.solana.com/address/HWjmoUNYckccg9Qrwi43JTzBcGcM1nbdAtATf9GXmz16) [`8sXzdKW2jFj7V5heRwPMcygzNH3JZnmie5ZRuNoTuKQC`](https://explorer.solana.com/address/8sXzdKW2jFj7V5heRwPMcygzNH3JZnmie5ZRuNoTuKQC) **Dogecoin (DOGE)** [`DRmCnxzL9U11EJzLmWkm2ikaZikPFbLuQD`](https://blockchair.com/dogecoin/address/DRmCnxzL9U11EJzLmWkm2ikaZikPFbLuQD) – **XRP (XRP Ledger)** [`r9R8jciZBYGq32DxxQrBPi5ysZm67iQitH`](https://xrpscan.com/account/r9R8jciZBYGq32DxxQrBPi5ysZm67iQitH) – **Monad (MON)** [`0x233c5370ccfb3cd7409d9a3fb98ab94de94cb4cd`](https://monad.socialscan.io/address/0x233c5370ccfb3cd7409d9a3fb98ab94de94cb4cd) – **XLayer (LRX)** [`0x233c5370ccfb3cd7409d9a3fb98ab94de94cb4cd`](https://xlayerscan.com/address/0x233c5370ccfb3cd7409d9a3fb98ab94de94cb4cd) – **Litecoin (LTC)** [`LQjEMkuiA2pCwFeUPwsu6ktzUubBVLsahX`](https://litecoinspace.org/address/LQjEMkuiA2pCwFeUPwsu6ktzUubBVLsahX) – **Zcash (ZEC)** [`t1Ku2KLyndDPsR32jwnrTMd3yvi9tfFP8ML`](https://mainnet.zcashexplorer.app/address/t1Ku2KLyndDPsR32jwnrTMd3yvi9tfFP8ML) – **TRON (TRX)** [`TX5XiRXdyz7sdFwF5mnhT1QoGCpbkncpke`](https://tronscan.org/#/address/TX5XiRXdyz7sdFwF5mnhT1QoGCpbkncpke) – **NEAR (NEAR)** [`intents.near`](https://nearblocks.io/zh-cn/address/intents.near) – **TON** [`UQAfoBd_f0pIvNpUPAkOguUrFWpGWV9TWBeZs_5TXE95_trZ`](https://tonscan.org/address/UQAfoBd_f0pIvNpUPAkOguUrFWpGWV9TWBeZs_5TXE95_trZ) [`EQANEViM3AKQzi6Aj3sEeyqFu8pXqhy9Q9xGoId_0qp3CNVJ`](https://tonviewer.com/EQANEViM3AKQzi6Aj3sEeyqFu8pXqhy9Q9xGoId_0qp3CNVJ) **Stellar (XLM)** [`GDJ4JZXZELZD737NVFORH4PSSQDWFDZTKW3AIDKHYQG23ZXBPDGGQBJK`](https://stellar.expert/explorer/public/account/GDJ4JZXZELZD737NVFORH4PSSQDWFDZTKW3AIDKHYQG23ZXBPDGGQBJK) [`CCLWL5NYSV2WJQ3VBU44AMDHEVKEPA45N2QP2LL62O3JVKPGWWAQUVAG`](https://stellar.expert/explorer/public/contract/CCLWL5NYSV2WJQ3VBU44AMDHEVKEPA45N2QP2LL62O3JVKPGWWAQUVAG) **Sui (SUI)** [`0x00ea18889868519abd2f238966cab9875750bb2859ed3a34debec37781520138`](https://suivision.xyz/account/0x00ea18889868519abd2f238966cab9875750bb2859ed3a34debec37781520138) – **Aptos (APT)** [`0xd1a1c1804e91ba85a569c7f018bb7502d2f13d4742d2611953c9c14681af6446`](https://aptoscan.com/account/0xd1a1c1804e91ba85a569c7f018bb7502d2f13d4742d2611953c9c14681af6446) – **Cardano (ADA)** [`addr1v8wfpcg4qfhmnzprzysj6j9c53u5j56j8rvhyjp08s53s6g07rfjm`](https://cardanoscan.io/address/61dc90e115026fb9882311212d48b8a47949535238d972482f3c291869) – [](https://docs.near-intents.org/near-intents/treasury-addresses#refill-addresses) Refill Addresses -------------------------------------------------------------------------------------------------------- Network Refill Address **EVM Chains (Ethereum, Arbitrum, Aurora, Base, Bera, BNB, Gnosis, Polygon, Optimism, XLayer, Monad)** [`0xbb2f33f73ccc2c74e3fb9bb8eb75241ac15337e0`](https://blockscan.com/address/0xbb2f33f73ccc2c74e3fb9bb8eb75241ac15337e0) **Cardano** [`addr1v92k8ex6m7yykq6j0psqlrxxeq23220g9x8yeqd4g65qq3shttpln`](https://cardanoscan.io/address/615563e4dadf884b035278600f8cc6c8151529e8298e4c81b546a80046) **TRON** [`TNzQzT8wDF1GVevMqehVDY51ucxxrNfCap`](https://tronscan.org/#/address/TNzQzT8wDF1GVevMqehVDY51ucxxrNfCap) **Solana** [`9WL2A89YBr6X47ABKYNzPentWiBA3H8tpaiuf5CaYHx6`](https://solscan.io/account/9WL2A89YBr6X47ABKYNzPentWiBA3H8tpaiuf5CaYHx6) **TON** [`EQDgTfO4pJ8LxznVfC0mHsGl94bQBU4KFcJfliAIHebQU2G4`](https://tonviewer.com/EQDgTfO4pJ8LxznVfC0mHsGl94bQBU4KFcJfliAIHebQU2G4) **SUI** [`0x1f6cd55584e6d0c19ae34bfc48b1bd9b1b8a166987e34052cfea7f3c795c6d76`](https://suiscan.xyz/mainnet/account/0x1f6cd55584e6d0c19ae34bfc48b1bd9b1b8a166987e34052cfea7f3c795c6d76) **Aptos** [`0x107b277f8ac97230f1e53cf3661b3f05a40c5a02d1d2b74fe77826b62b4d1c43`](https://aptoscan.com/account/0x107b277f8ac97230f1e53cf3661b3f05a40c5a02d1d2b74fe77826b62b4d1c43) **Litecoin** [`LVUMGpKvAzC4C8KprqyUDWpk6oPd4rKFV9`](ttps://litecoinspace.org/address/LVUMGpKvAzC4C8KprqyUDWpk6oPd4rKFV9) [PreviousChain Support](https://docs.near-intents.org/near-intents/chain-address-support) [NextFees](https://docs.near-intents.org/near-intents/fees) Last updated 1 month ago * [Treasury Addresses](https://docs.near-intents.org/near-intents/treasury-addresses#treasury-addresses) * [Refill Addresses](https://docs.near-intents.org/near-intents/treasury-addresses#refill-addresses) --- # Usage | NEAR Intents There is no SDK for Message Bus API yet. But intents-sdk can be used to create intents Example of how to create response for quote for market makers using TypeScript Here `params` has same type as what you receive from relay in **"quote"** event Copy params: { defuse_asset_identifier_in: string; defuse_asset_identifier_out: string; exact_amount_in: string | undefined; exact_amount_out: string | undefined; min_deadline_ms: number; }, You can read more about versioned nonces [here](https://github.com/near/intents/tree/main/defuse#nonces) Copy import {VersionedNonceBuilder} from "@defuse-protocol/intents-sdk"; const generateNonce = async (deadline: Date): Promise => { const account = await getAccount(); //function that will return Account instance(from "near-api-js") of market makers' Near account const salt_hex = await account.viewFunction({ contractId: "intents.near", methodName: "current_salt", }); let salt_bytes = Uint8Array.from(Buffer.from(salt_hex, "hex")); let versionedNonce = VersionedNonceBuilder.encodeNonce(salt_bytes, deadline); if (await isNonceUsed(versionedNonce)) { // this step can be skipped, but if the nonce is already used the quote won't be taken into account return generateNonce(deadline); } else { return versionedNonce; } } const isNonceUsed = async (nonce: string) => { const account = await getAccount(); return await account.viewFunction({ contractId: defuseContract, methodName: 'is_nonce_used', args: { account_id: account.accountId, nonce, }, }); } [PreviousAPI](https://docs.near-intents.org/near-intents/market-makers/bus/solver-relay) [NextPassive Deposit/Withdrawal Service](https://docs.near-intents.org/near-intents/market-makers/passive-deposit-withdrawal-service) Last updated 1 month ago Copy const getIntentPayload = async ( sdk: IntentsSDK, deadline: Date, params: { defuse_asset_identifier_in: string; defuse_asset_identifier_out: string; exact_amount_in: string | undefined; exact_amount_out: string | undefined; min_deadline_ms: number; }, amount: string ) => { let nonce = await generateNonce(deadline); return await sdk .intentBuilder() .setDeadline(deadline) .setNonce(nonce) .addIntent({ intent: "token_diff", diff: { [params.defuse_asset_identifier_in]: !!params.exact_amount_in ? params.exact_amount_in : amount, [params.defuse_asset_identifier_out]: `-${ !!params.exact_amount_out ? params.exact_amount_out : amount }`, }, }) .build(); }; Copy import bs58 from 'bs58'; const amount = "1000" //calculated amount market maker want to propose const deadline = new Date(Date.now() + 5 * 60 * 1000) const intentSigner = createIntentSignerNearKeyPair({ signer, accountId, }); const sdk = new IntentsSDK({ env: "production", referral: "your_referral", intentSigner: intentSigner, }); const payload = await getIntentPayload( sdk, deadline, params ); let signedPayload = await intentSigner.signIntent(payload); const resp: IQuoteObject = { quote_id, quote_output: {}, signed_data: signedPayload }; if (!params.exact_amount_in) { resp.quote_output.amount_in = amount; } else { resp.quote_output.amount_out = amount; } --- # Chain Support | NEAR Intents List of supported chains and their respective address types can be seen in the table below: Chain Address Types Support Status Example Address **EVM Chains (Arbitrum, Aurora, Base, Bera, BNB, Ethereum, Gnosis, Polygon, XLayer, Monad)** \- EVM address (`0x`\-prefixed, 42-char hex) ✅ Supported `0x85F17Cf997934a597031b2E18a9aB6ebD4B9f6a4` **Cardano** \- Shelley Base - Enterprise ⚠️ Partially supported `addr1v8wfpcg4qfhmnzprzysj6j9c53u5j56j8rvhyjp08s53s6g07rfjm` **Bitcoin** \- Legacy (`1` prefix) - P2SH (`3` prefix) - Bech32 (`bc1`) - Taproot (`bc1p`) ✅ Supported `1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa` (Legacy) `3FZbgi29cpjq2GjdwV8eyHuJJnkLtktZc5` (P2SH) `bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kygt080` (Bech32) `bc1p5cyxnuxmeuwuvkwfem96llyr29s8l68p7z6zgt7zdkv3g7zv3qvqz6z8h7` (Taproot) **Doge** \- P2PKH/Legacy (starts with `D`) - P2SH (starts with `A` or `9`) ✅ Supported `D9nssC5jR1viPZhWwFvDkjYpJZYJVydN8k` **Litecoin** \- Legacy (`L` prefix) - P2SH (`M` prefix) - Bech32 (`ltc1q`) - Taproot (`ltc1p`) ✅ Supported `LZ3v1o8qK4b7sJ9mH2f5xQp8Pd1cR6TuVa` (Legacy) `MDf8y1Kq9Tm5sR3aP7uW4cXn2Lb6vZjQhE` (P2SH) `ltc1q9k3p7u5n0s4y8v2h3w6j5c9r2t0m4k7f5p0d2` (Bech32) `ltc1p4h7q9m3x5u2n8k6t4v9y3r5c2w7z0l3p5u8y6f0k2d` (Taproot) **NEAR** \- Named (`something.near`) - Implicit (64-char hex, SHA-256 of pubkey) ✅ Supported `alice.near`, `ed25519:...` **Sui** \- Sui Address (32-char hex) ✅ Supported `0xcc64b79a3adf4d3c21ad25a97e3ecbe83e659e68964f62e6a1da8a037346a4ce` **Stellar** \- 56-character base32 string ✅ Supported `GBD7QFQVR4QWNEJSHP4VN7RAAUKXTMZ4EJ4EBMCR7CP3HMF7RXEASTD7` **Solana** \- Base58-encoded Ed25519 public key (typically 44 chars) ✅ Supported `BYPsjxa3YuZESQz1dKuBw1QSFCSpecsm8nCQhY5xbU1Z` **TON** \- TON Addresses ✅ Supported `EQAWzEKcdnykvXfUNouqdS62tvrp32bCxuKS6eQrS6ISgcLo` **Tron** \- Base58Check-encoded (starts with `T`) ✅ Supported `TQ1shhBFTN2TwaRXyH1oLyCz3Yvfbzgmbk` **XRP** \- Classic (starts with `r`) - Classic + Tag - X-Address (starts with `X`) ✅ Supported `rDsbeomae4FXwgQTJp9Rs64Qg9vDiTCdBv` **ZCash** \- Transparent (`t1`, `t3`) - Unified (`u1`) ⚠️ Partially supported `t1ZCashExample...`, `t3ZCashExample...`, `u1ZCashExample...` This table provides an overview of supported signature standards and corresponding wallet types. For technical details on how intent signing works, see [Signing Intents](https://docs.near-intents.org/near-intents/market-makers/verifier/signing-intents) . Signing Standard Supported Wallets / Apps Implementation Status **NEP‑413** NEAR wallets: MyNearWallet, Meteor, Sender, Ledger‑NEAR ✅ Implemented **ERC‑191** All EVM wallets: MetaMask, Rabby, Rainbow, WalletConnect‑compatible ✅ Implemented **Raw Ed25519** Solana wallets: Phantom, Solflare, Slope ✅ Implemented **Passkeys (WebAuthn)** Browsers/OS platforms: Chrome, Safari, Edge, Firefox, native apps ✅ Implemented **SEP‑53** Stellar wallets: Freighter, Lumens Wallet, SatoshiPay ✅ Implemented **TIP‑191** TRON wallets: TronLink, Klever, Trust Wallet ✅ Implemented **TON Connect** TON wallets: Tonkeeper, EverWallet, HOT Wallet and other TonConnect 2.0 wallets ✅ Implemented **BIP‑322** Bitcoin wallets: Sparrow, Bitcoin Knots, Bitcoin Core ⚙️ In progress [PreviousRisk and Compliance](https://docs.near-intents.org/near-intents/risk-and-compliance) [NextTreasury Addresses](https://docs.near-intents.org/near-intents/treasury-addresses) Last updated 1 month ago --- # Simulating intents | NEAR Intents In this chapter we have discussed several methods to execute intents in the `Verifier` smart contract. The `execute_intents` function calls a mutable and modifies the `Verifier` contract’s state. However, the `Verifier` smart contract offers the possibility to simulate intents using [the function](https://near.github.io/intents/defuse/intents/trait.Intents.html#tymethod.simulate_intents) `simulate_intents`. Simulation of intents is the process of running the code of the intents provided, without modifying the state of the `Verifier` smart contract. ### [](https://docs.near-intents.org/near-intents/market-makers/verifier/simulating-intents#examples-where-simulations-can-be-useful) Examples where simulations can be useful * Alice constructs an intent, and is not sure whether the format of the digital signature is valid * Bob is constructing an intent to withdraw his `USDC` coins from the `Verifier` contract, and wants to ensure that it will work before executing it * Charlie and Drake want to execute a trade using two intents of `TokenDiff`, but they are not sure about the fees that will be paid to the `Verifier` smart contract ### [](https://docs.near-intents.org/near-intents/market-makers/verifier/simulating-intents#example-outputs-for-simulating-intents) Example outputs for simulating intents The following is a valid, signed intents to trade 100 `USDC` for 100 `USDT`. It has two intents, one from Charlie, expressing his intent to lose 100 `USDC` to get 100 `USDT` in return, while drake expressing the opposite. For more information about this structure, see [this section](https://docs.near-intents.org/near-intents/market-makers/verifier/intent-types-and-execution) . Copy { "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"\ }\ ] } Calling `simulate_intents` with the above mentioned intents list produces the following output: Where * intents\_executed - all intents events, collected during simulation, containing signer, [nonce](https://github.com/near/intents/tree/main/defuse#nonces) and intent hash * logs - all collected defuse events which will be emitted during intent execution * min\_deadline - minimum deadline among all intents * state - current state configurations containing fee and [salt](https://github.com/near/intents/tree/main/defuse#salt) The fees are expressed in pips - 100 pips is 0.01%. Simulation outputs may include additional data in future updates. This is a basic example. Contact NEAR Intents Team if your application requires more detailed output. ### [](https://docs.near-intents.org/near-intents/market-makers/verifier/simulating-intents#accuracy-of-simulations) Accuracy of simulations Simulated results are designed to closely match actual execution outcomes. This is the intended outcome from the programming and heavy testing done for simulated intents. However, due to the asynchronous nature of the NEAR blockchain, ultimate code abstraction to simulate the intents exactly like they would be in real execution is not possible. To date, simulation and execution results have always matched. If you ever discover such a case, please contact the NEAR Intents team and report it as a bug. Note: Simulations reflect only side effects within the `Verifier` contract and exclude those from external asynchronous calls. [PreviousExample Transactions](https://docs.near-intents.org/near-intents/market-makers/verifier/example-transactions) [NextFAQs](https://docs.near-intents.org/near-intents/faqs) Last updated 1 month ago * [Examples where simulations can be useful](https://docs.near-intents.org/near-intents/market-makers/verifier/simulating-intents#examples-where-simulations-can-be-useful) * [Example outputs for simulating intents](https://docs.near-intents.org/near-intents/market-makers/verifier/simulating-intents#example-outputs-for-simulating-intents) * [Accuracy of simulations](https://docs.near-intents.org/near-intents/market-makers/verifier/simulating-intents#accuracy-of-simulations) Copy { "intents_executed": [\ {\ "intent_hash": "5GpL6PsUQVHFYAk5FWEwBUaEQqcZkc2SjTvPYHgHAnx8",\ "account_id": "charlie.near",\ "nonce": "Vij2xgAlKBKzwJcGrQQYQhiLk1HU5AVNH1M3PhtxosE="\ },\ {\ "intent_hash": "4ejradLAAPBhBVAn6tBYExpuj2VCn5f5VEBfVajNXiXk",\ "account_id": "drake.near",\ "nonce": "Vij2xgAlKBKzwJcGrQQYQhjtxxGCsZQhM2DP7btPexE="\ }\ ], "logs": [\ "EVENT_JSON:{\"data\":[{\"account_id\":\"charlie.near\",\"diff\":{\"nep141:usdc.near\":\"-100\",\"nep141:usdt.near\":\"100\"},\"intent_hash\":\"5GpL6PsUQVHFYAk5FWEwBUaEQqcZkc2SjTvPYHgHAnx8\"}],\"event\":\"token_diff\",\"standard\":\"dip4\",\"version\":\"0.3.0\"}",\ "EVENT_JSON:{\"data\":[{\"account_id\":\"drake.near\",\"diff\":{\"nep141:usdc.near\":\"100\",\"nep141:usdt.near\":\"-100\"},\"intent_hash\":\"4ejradLAAPBhBVAn6tBYExpuj2VCn5f5VEBfVajNXiXk\"}],\"event\":\"token_diff\",\"standard\":\"dip4\",\"version\":\"0.3.0\"}",\ "EVENT_JSON:{\"data\":[{\"account_id\":\"charlie.near\",\"intent_hash\":\"5GpL6PsUQVHFYAk5FWEwBUaEQqcZkc2SjTvPYHgHAnx8\",\"nonce\":\"Vij2xgAlKBKzwJcGrQQYQhiLk1HU5AVNH1M3PhtxosE=\"},{\"account_id\":\"drake.near\",\"intent_hash\":\"4ejradLAAPBhBVAn6tBYExpuj2VCn5f5VEBfVajNXiXk\",\"nonce\":\"Vij2xgAlKBKzwJcGrQQYQhjtxxGCsZQhM2DP7btPexE=\"}],\"event\":\"intents_executed\",\"standard\":\"dip4\",\"version\":\"0.3.0\"}"\ ], "min_deadline": "2025-05-23T07:40:13.735337Z", "state": { "fee": 100, "current_salt": "252812b3" } } --- # Deposits | NEAR Intents ### [](https://docs.near-intents.org/near-intents/market-makers/verifier/deposits-and-withdrawals/deposits#depositing-fungible-tokens-nep-141-including-wrapped-near) Depositing fungible tokens (NEP-141), including wrapped NEAR The Verifier contract implements the [FungibleTokenReceiver](https://docs.near.org/primitives/ft) interface, part of the [NEP-141 standard](https://nomicon.io/Standards/Tokens/FungibleToken/Core) . To deposit tokens into the Verifier contract, users must call the function `ft_transfer_call` (see the function signature [here](https://github.com/near/near-sdk-rs/blob/611e01ebf6c226f4e1e820a2f50f4a9acf8f1215/examples/fungible-token/ft/src/lib.rs#L103) ) on the token, with an `msg` parameter specifying information about the user, whose account will be assigned as the owner of the tokens. #### [](https://docs.near-intents.org/near-intents/market-makers/verifier/deposits-and-withdrawals/deposits#format-of-msg-parameter-to-assign-ownership-of-tokens-inside-the-verifier-contract) Format of `msg` parameter to assign ownership of tokens inside the Verifier contract The `msg` parameter must follow a specific format to ensure proper token deposit within the contract. The `msg` parameter supports three formats: 1. It can be empty, with size 0 bytes, which will assign ownership to the sender of the transaction (i.e., the predecessor in NEAR terminology) 2. A simple string that contains an account id, for example `alice.near` 3. A JSON object, referred to as `DepositMessage`, with the following fields: 1. `receiver_id`, a string with an account id taking ownership 2. `execute_intents`, a list of intents to be executed, right after the deposit is complete. 3. `refund_if_fails`, a boolean, when `false` (the default), will execute the intents as a detached promise, decoupling any failure during the execution of the intents from the deposit operation. Examples of `ft_transfer_call` parametrization in JSON: 1. With empty `msg` or non-existing `msg`, granting the tokens to the sender/creator of that transaction Copy { receiver_id: "alice.near", amount: "1000", } 1. With an `msg` that explicitly assigns ownership to another account: 1. With an `msg` that is a `DepositMessage` object or Note: msg is always a string—even when it contains a JSON-encoded object. Proper character escaping is required. ### [](https://docs.near-intents.org/near-intents/market-makers/verifier/deposits-and-withdrawals/deposits#depositing-non-fungible-tokens-nep-171) Depositing non-fungible tokens (NEP-171) The Verifier contract implements the [NonFungibleTokenReceiver](https://docs.near.org/primitives/nft) interface. This is [NEP-171](https://nomicon.io/Standards/Tokens/NonFungibleToken/Core) standard. To transfer NFTs to the `Verifier`, use `nft_transfer_call`, following the same `msg` format rules as for fungible tokens. The `msg` parameter dictates how ownership of the transferred tokens will be assigned. [PreviousNEAR Token treatment](https://docs.near-intents.org/near-intents/market-makers/verifier/deposits-and-withdrawals/near-token-treatment) [NextBalances, and identifying your token](https://docs.near-intents.org/near-intents/market-makers/verifier/deposits-and-withdrawals/balances-and-identifying-your-token) Last updated 7 months ago * [Depositing fungible tokens (NEP-141), including wrapped NEAR](https://docs.near-intents.org/near-intents/market-makers/verifier/deposits-and-withdrawals/deposits#depositing-fungible-tokens-nep-141-including-wrapped-near) * [Depositing non-fungible tokens (NEP-171)](https://docs.near-intents.org/near-intents/market-makers/verifier/deposits-and-withdrawals/deposits#depositing-non-fungible-tokens-nep-171) Copy { receiver_id: "alice.near", amount: "1000", msg: "", } Copy { receiver_id: "alice.near", amount: "1000", msg: "bob.near", } Copy { receiver_id: "alice.near", amount: "1000", msg: "{"\"receiver_id\": \"charlie.near\", \"execute_intents\": [...], \"refund_if_fails\": false}\"", } Copy { receiver_id: "alice.near", amount: "1000", msg: "{"\"receiver_id\": \"charlie.near\", \"execute_intents\": [...]\"", } --- # 1Click API | NEAR Intents [](https://docs.near-intents.org/near-intents/integration/distribution-channels/1click-api#what-is-1click-swap-api) What is 1Click Swap API? ------------------------------------------------------------------------------------------------------------------------------------------------- 1Click simplifies NEAR Intents by temporarily transferring assets to a trusted swapping agent that coordinates with [Market Makers](https://docs.near-intents.org/near-intents/market-makers) to execute your intent. This REST API abstracts away the complexity of intent creation, solver coordination, and transaction execution, letting you focus on your user experience. It features: * Simple REST endpoints for intent creation and management * Automatic solver discovery and competitive pricing * Built-in transaction handling and status tracking * Support for cross-chain intents [](https://docs.near-intents.org/near-intents/integration/distribution-channels/1click-api#how-1click-api-works) How 1Click API Works ------------------------------------------------------------------------------------------------------------------------------------------ ![1Click API Flow](https://docs.near-intents.org/near-intents/~gitbook/image?url=https%3A%2F%2F2137192178-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FbRFddzGQ8Ims43AJzulz%252Fuploads%252Fgit-blob-933ad968d64565b84204cbb67134e6974c6dd479%252F1Click-API-flow.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=242ca46a&sv=2) 1. **Request a quote** - Send the user's intent request to 1Click's [`Request Quote`](https://docs.near-intents.org/near-intents/integration/distribution-channels/1click-api#post-v0-quote) endpoint * Receive the best available quote with a unique deposit address 2. **Transfer tokens** - If provided quote is satisfactory, deposit tokens to the unique address provided * 1Click automatically begins the swapping process upon receipt 3. **Submit deposit transaction** - (optional) * Use the [`Submit Deposit Tx`](https://docs.near-intents.org/near-intents/integration/distribution-channels/1click-api#post-v0-deposit-submit) endpoint with your transaction hash to speed up processing 4. **Monitor progress** - (optional) * You can query the process at any time with the [`Get Execution Status`](https://docs.near-intents.org/near-intents/integration/distribution-channels/1click-api#get-v0-status) endpoint **Result:** The swap either succeeds with tokens delivered to your specified address, or fails with funds automatically refunded to your refund address. Failed swaps can be retried by repeating this flow. Centralized exchanges (CEXes) often use intermediate or per-user deposit addresses. These may not credit deposits sent via NEAR Intents until they are recognized or whitelisted. We recommend sending a small test amount before attempting full-scale transfers. [](https://docs.near-intents.org/near-intents/integration/distribution-channels/1click-api#quickstart-1click-tutorial) Quickstart 1Click Tutorial ------------------------------------------------------------------------------------------------------------------------------------------------------ To quickly get started with 1Click API, see this example breaking down each of the above steps: * [github.com/near-examples/near-intents-examples](https://github.com/near-examples/near-intents-examples) This repo will show you how to quickly get started performing cross-chain swaps using 1Click's TypeScript SDK. [](https://docs.near-intents.org/near-intents/integration/distribution-channels/1click-api#api-specification-v0) API Specification (v0) -------------------------------------------------------------------------------------------------------------------------------------------- Auto-generate clients using our [OpenAPI spec](https://1click.chaindefuser.com/docs/v0/openapi.yaml) . Authentication: Please register on our [Partners Portal to obtain API Key](https://partners.near-intents.org/) to avoid 0.1% (10 basis points) fee while using 1Click Swap API. ### [](https://docs.near-intents.org/near-intents/integration/distribution-channels/1click-api#sdks) SDKs Pre-built SDKs for popular languages: * [TypeScript SDK](https://github.com/defuse-protocol/one-click-sdk-typescript) * [Go SDK](https://github.com/defuse-protocol/one-click-sdk-go) * [Rust SDK](https://github.com/defuse-protocol/one-click-sdk-rs) ### [](https://docs.near-intents.org/near-intents/integration/distribution-channels/1click-api#swap-statuses) Swap Statuses 1Click Swap goes through these states in its lifecycle: * PENDING\_DEPOSIT — Awaiting the deposit to the deposit address. * PROCESSING — Once the deposit on deposit address is detected, information is processed and executed by Market Makers. * SUCCESS — Funds are delivered to the specified destination chain/address. * INCOMPLETE\_DEPOSIT — Deposit is received but below required bridge or quoted amount. * REFUNDED — If the swap is not completed, funds are automatically returned to the refund address. * FAILED - Swap failed due to the error. ![NEAR Intents 1Click Swap Statuses](https://docs.near-intents.org/near-intents/~gitbook/image?url=https%3A%2F%2F2137192178-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FbRFddzGQ8Ims43AJzulz%252Fuploads%252Fgit-blob-671bbd178b1e76ca23edb638fbf3524abf5c914c%252Fnear_intents_1click_swap_transaction_state_diagram.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=21e2565f&sv=2) ### [](https://docs.near-intents.org/near-intents/integration/distribution-channels/1click-api#api-endpoints) API Endpoints **Base URL:** https://1click.chaindefuser.com/ Name Route Description [Get supported tokens](https://docs.near-intents.org/near-intents/integration/distribution-channels/1click-api#get-v0-tokens) /v0/tokens Retrieves list of tokens currently supported by 1Click [Request a swap quote](https://docs.near-intents.org/near-intents/integration/distribution-channels/1click-api#post-v0-quote) /v0/quote Generates a swap quote based on input parameters (Intent) [Submit deposit tx hash](https://docs.near-intents.org/near-intents/integration/distribution-channels/1click-api#post-v0-deposit-submit) /v0/deposit/submit Optional route to speed up process with early deposit notification to 1Click [Check swap status](https://docs.near-intents.org/near-intents/integration/distribution-channels/1click-api#get-v0-status) /v0/status Gets current status of a swap using unique deposit address Use `dry: true` to display the quote price without generating a transaction. Set `dry: false` only at confirmation to reduce system load. The `amountOutUsd` field in quote responses should **NOT** be used in business logic or calculations. It is provided for display purposes only. Always use the actual token amounts for any programmatic operations. ### [](https://docs.near-intents.org/near-intents/integration/distribution-channels/1click-api#get-v0-tokens) Get supported tokens get https://1click.chaindefuser.com/v0/tokens Retrieves a list of tokens currently supported by the 1Click API for asset swaps. Each token entry includes its blockchain, contract address (if available), price in USD, and other metadata such as symbol and decimals. Responses 200Success application/json Responseobject\[\] Show properties get /v0/tokens HTTP HTTPcURLJavaScriptPython Test it 200Success ### [](https://docs.near-intents.org/near-intents/integration/distribution-channels/1click-api#post-v0-quote) Request a swap quote post https://1click.chaindefuser.com/v0/quote Generates a swap quote based on input parameters such as the assets, amount, slippage tolerance, and recipient/refund information. Returns pricing details, estimated time, and a unique **deposit address** to which tokens must be transferred to initiate the swap. You can set the `dry` parameter to `true` to simulate the quote request **without generating a deposit address** or initiating the swap process. This is useful for previewing swap parameters or validating input data without committing to an actual swap. This endpoint is the first required step in the swap process. Authorizations JWT-auth JWT-auth AuthorizationstringRequired Enter JWT token (optional) Body application/json application/json drybooleanRequired Flag indicating whether this is a dry run request. If `true`, the response will **NOT** contain the following fields: * `depositAddress` * `timeWhenInactive` * `deadline` Example: `true` depositModestring · enumOptional What deposit address mode you will get in the response, most chain supports only `SIMPLE` and some(for example `stellar`) only `MEMO`: * `SIMPLE` - usual deposit with only deposit address. * `MEMO` - some chains will **REQUIRE** the `memo` together with `depositAddress` for swap to work. Default: `SIMPLE`Example: `SIMPLE`Possible values: `SIMPLE``MEMO` swapTypestring · enumRequired How to interpret `amount` (and refunds) when performing the swap: * `EXACT_INPUT` — requests the output amount for an exact input. * If deposit is less than `amountIn`, the deposit is refunded by deadline. * If deposit is above than `amountIn`, the swap is processed and the excess is refunded to `refundTo` address after swap is complete. * `EXACT_OUTPUT` — requests the input amount for an exact output. * The quote response would have two fields `minAmountIn` and `maxAmountIn`. * If the input is above than `maxAmountIn` the swap is processed and the excess is refunded to `refundTo` address after swap is complete. * If the input is less than `minAmountIn`, the deposit is refunded by deadline. * `FLEX_INPUT` — a flexible input amount that allows for partial deposits and variable amounts. * `slippage` applies both to `amountOut` and `amountIn` and defines an acceptable range (`minAmountIn` and `minAmountOut`). * Any amount higher than `minAmountIn` is accepted and converted to the output asset as long as `minAmountOut` is met. * The `amountIn` can be less, as long as the 'slippage + 1%' constraint is met. If the total received by the deadline is below the lower bound, the deposit is refunded. * If deposits exceed the upper bound, the swap is still processed Possible values: `EXACT_INPUT``EXACT_OUTPUT``FLEX_INPUT``ANY_INPUT` slippageTolerancenumberRequired Slippage tolerance for the swap. This value is in basis points (1/100th of a percent), e.g. 100 for 1% slippage. Example: `100` originAssetstringRequired ID of the origin asset. Example: `nep141:arb-0xaf88d065e77c8cc2239327c5edb3a432268e5831.omft.near` depositTypestring · enumRequired Type of deposit address: * `ORIGIN_CHAIN` - deposit address on the origin chain. * `INTENTS` - the account ID within NEAR Intents to which you should transfer assets. Possible values: `ORIGIN_CHAIN``INTENTS` destinationAssetstringRequired ID of the destination asset. Example: `nep141:sol-5ce3bf3a31af18be40ba30f721101b4341690186.omft.near` amountstringRequired Amount to swap as the base amount. It is interpreted as the input or output amount based on the `swapType` flag and is specified in the smallest unit of the currency (e.g., wei for ETH). Example: `1000` refundTostringRequired Address used for refunds. Example: `0x2527D02599Ba641c19FEa793cD0F167589a0f10D` refundTypestring · enumRequired Type of refund address: * `ORIGIN_CHAIN` - assets are refunded to the `refundTo` address on the origin chain. * `INTENTS` - assets are refunded to the `refundTo` Intents account. Possible values: `ORIGIN_CHAIN``INTENTS` recipientstringRequired Recipient address. The format must match `recipientType`. Example: `13QkxhNMrTPxoCkRdYdJ65tFuwXPhL5gLS2Z5Nr6gjRK` connectedWalletsstring\[\]Optional Addresses of connected wallets. Example: `["0x123...","0x456..."]` sessionIdstringOptional Unique client session identifier for 1Click. Example: `session_abc123` virtualChainRecipientstringOptional EVM address of a transfer recipient in a virtual chain Example: `0xb4c2fbec9d610F9A3a9b843c47b1A8095ceC887C` virtualChainRefundRecipientstringOptional EVM address of a refund recipient in a virtual chain Example: `0xb4c2fbec9d610F9A3a9b843c47b1A8095ceC887C` customRecipientMsgstringOptional **HIGHLY EXPERIMENTAL** Message to pass to `ft_transfer_call` when withdrawing assets to NEAR. Otherwise, `ft_transfer` will be used. **WARNING**: Funds will be lost if used with non NEP-141 tokens, in case of insufficient `storage_deposit` or if the recipient does not implement `ft_on_transfer` method. Example: `smart-contract-recipient.near` recipientTypestring · enumRequired Type of recipient address: * `DESTINATION_CHAIN` - assets are transferred to the chain of `destinationAsset`. * `INTENTS` - assets are transferred to an account inside Intents Possible values: `DESTINATION_CHAIN``INTENTS` deadlinestring · date-timeRequired Timestamp in ISO format that identifies when the user refund begins if the swap isn't completed by then. It must exceed the time required for the deposit transaction to be mined. For example, Bitcoin may require around one hour depending on the fees paid. Example: `2019-08-24T14:15:22Z` referralstringOptional Referral identifier (lowercase only). It will be reflected in the on-chain data and displayed on public analytics platforms. Example: `referral` quoteWaitingTimeMsnumberOptional Time in milliseconds the user is willing to wait for a quote from the relay. **If you want to receive the fastest quote - use `0` as a value** Default: `3000`Example: `3000` appFeesobject\[\]Optional List of recipients and their fees Show properties Responses 200Success application/json Responseobject Show properties 400 Bad Request - Invalid input data application/json 401 Unauthorized - JWT token is invalid post /v0/quote HTTP HTTPcURLJavaScriptPython Test it 200Success ### [](https://docs.near-intents.org/near-intents/integration/distribution-channels/1click-api#post-v0-deposit-submit) Submit deposit transaction hash post https://1click.chaindefuser.com/v0/deposit/submit Optionally notifies the 1Click service that a deposit has been sent to the specified address, using the blockchain transaction hash. This step can speed up swap processing by allowing the system to preemptively verify the deposit. Authorizations JWT-auth JWT-auth AuthorizationstringRequired Enter JWT token (optional) Body application/json application/json txHashstringRequired Transaction hash of your deposit Example: `0x123abc456def789` depositAddressstringRequired Deposit address for the quote Example: `0x2527D02599Ba641c19FEa793cD0F167589a0f10D` nearSenderAccountstringOptional Sender account (used only for NEAR blockchain) Example: `relay.tg` memostringOptional Memo (use if deposit was submitted with one) Example: `123456` Responses 200Success application/json Responseobject Show properties 400 Bad Request - Invalid input data application/json 401 Unauthorized - JWT token is invalid post /v0/deposit/submit HTTP HTTPcURLJavaScriptPython Test it 200Success ### [](https://docs.near-intents.org/near-intents/integration/distribution-channels/1click-api#get-v0-status) Check swap execution status get https://1click.chaindefuser.com/v0/status Retrieves the current status of a swap using the unique deposit address from the quote, if quote response included deposit memo, it is required as well. The response includes the state of the swap (e.g., pending, processing, success, refunded) and any associated swap and transaction details. Authorizations JWT-auth JWT-auth AuthorizationstringRequired Enter JWT token (optional) Query parameters depositAddressstringRequired depositMemostringOptional Responses 200Success application/json Responseobject Show properties 401 Unauthorized - JWT token is invalid 404 Deposit address not found application/json get /v0/status HTTP HTTPcURLJavaScriptPython Test it 200Success ### [](https://docs.near-intents.org/near-intents/integration/distribution-channels/1click-api#get-v0-any-input-withdrawals) Get ANY\_INPUT withdrawals get https://1click.chaindefuser.com/v0/any-input/withdrawals Retrieves all withdrawals by ANY\_INPUT quote with filtering, pagination and sorting Authorizations JWT-auth JWT-auth AuthorizationstringRequired Enter JWT token (optional) Query parameters depositAddressstringRequired depositMemostringOptional timestampFromstringOptional Filter withdrawals from this timestamp (ISO string) pagenumberOptional Page number for pagination (default: 1) limitnumberOptional Number of withdrawals per page (max: 50, default: 50) sortOrderstring · enumOptional Sort order Possible values: `asc``desc` Responses 200Success application/json Responseobject Show properties 401 Unauthorized - JWT token is invalid 404 Deposit address not found application/json get /v0/any-input/withdrawals HTTP HTTPcURLJavaScriptPython Test it 200Success Last updated 29 days ago Copy GET /v0/tokens HTTP/1.1 Host: 1click.chaindefuser.com Accept: */* Copy [\ {\ "assetId": "nep141:wrap.near",\ "decimals": 24,\ "blockchain": "near",\ "symbol": "wNEAR",\ "price": "2.79",\ "priceUpdatedAt": "2025-03-28T12:23:00.070Z",\ "contractAddress": "wrap.near"\ }\ ] Copy POST /v0/quote HTTP/1.1 Host: 1click.chaindefuser.com Authorization: Bearer YOUR_SECRET_TOKEN Content-Type: application/json Accept: */* Content-Length: 875 { "dry": true, "depositMode": "SIMPLE", "swapType": "EXACT_INPUT", "slippageTolerance": 100, "originAsset": "nep141:arb-0xaf88d065e77c8cc2239327c5edb3a432268e5831.omft.near", "depositType": "ORIGIN_CHAIN", "destinationAsset": "nep141:sol-5ce3bf3a31af18be40ba30f721101b4341690186.omft.near", "amount": "1000", "refundTo": "0x2527D02599Ba641c19FEa793cD0F167589a0f10D", "refundType": "ORIGIN_CHAIN", "recipient": "13QkxhNMrTPxoCkRdYdJ65tFuwXPhL5gLS2Z5Nr6gjRK", "connectedWallets": [\ "0x123...",\ "0x456..."\ ], "sessionId": "session_abc123", "virtualChainRecipient": "0xb4c2fbec9d610F9A3a9b843c47b1A8095ceC887C", "virtualChainRefundRecipient": "0xb4c2fbec9d610F9A3a9b843c47b1A8095ceC887C", "customRecipientMsg": "smart-contract-recipient.near", "recipientType": "DESTINATION_CHAIN", "deadline": "2019-08-24T14:15:22Z", "referral": "referral", "quoteWaitingTimeMs": 3000, "appFees": [\ {\ "recipient": "recipient.near",\ "fee": 100\ }\ ] } Copy { "correlationId": "550e8400-e29b-41d4-a716-446655440000", "timestamp": "2019-08-24T14:15:22Z", "signature": "text", "quoteRequest": { "dry": true, "depositMode": "SIMPLE", "swapType": "EXACT_INPUT", "slippageTolerance": 100, "originAsset": "nep141:arb-0xaf88d065e77c8cc2239327c5edb3a432268e5831.omft.near", "depositType": "ORIGIN_CHAIN", "destinationAsset": "nep141:sol-5ce3bf3a31af18be40ba30f721101b4341690186.omft.near", "amount": "1000", "refundTo": "0x2527D02599Ba641c19FEa793cD0F167589a0f10D", "refundType": "ORIGIN_CHAIN", "recipient": "13QkxhNMrTPxoCkRdYdJ65tFuwXPhL5gLS2Z5Nr6gjRK", "connectedWallets": [\ "0x123...",\ "0x456..."\ ], "sessionId": "session_abc123", "virtualChainRecipient": "0xb4c2fbec9d610F9A3a9b843c47b1A8095ceC887C", "virtualChainRefundRecipient": "0xb4c2fbec9d610F9A3a9b843c47b1A8095ceC887C", "customRecipientMsg": "smart-contract-recipient.near", "recipientType": "DESTINATION_CHAIN", "deadline": "2019-08-24T14:15:22Z", "referral": "referral", "quoteWaitingTimeMs": 3000, "appFees": [\ {\ "recipient": "recipient.near",\ "fee": 100\ }\ ] }, "quote": { "depositAddress": "0x76b4c56085ED136a8744D52bE956396624a730E8", "depositMemo": "1111111", "amountIn": "1000000", "amountInFormatted": "1", "amountInUsd": "1", "minAmountIn": "995000", "amountOut": "9950000", "amountOutFormatted": "9.95", "amountOutUsd": "9.95", "minAmountOut": "9900000", "deadline": "2025-03-04T15:00:00Z", "timeWhenInactive": "2025-03-04T15:00:00Z", "timeEstimate": 120, "virtualChainRecipient": "0xb4c2fbec9d610F9A3a9b843c47b1A8095ceC887C", "virtualChainRefundRecipient": "0xb4c2fbec9d610F9A3a9b843c47b1A8095ceC887C", "customRecipientMsg": "smart-contract-recipient.near" } } Copy POST /v0/deposit/submit HTTP/1.1 Host: 1click.chaindefuser.com Authorization: Bearer YOUR_SECRET_TOKEN Content-Type: application/json Accept: */* Content-Length: 139 { "txHash": "0x123abc456def789", "depositAddress": "0x2527D02599Ba641c19FEa793cD0F167589a0f10D", "nearSenderAccount": "relay.tg", "memo": "123456" } Copy { "correlationId": "550e8400-e29b-41d4-a716-446655440000", "quoteResponse": { "correlationId": "550e8400-e29b-41d4-a716-446655440000", "timestamp": "2019-08-24T14:15:22Z", "signature": "text", "quoteRequest": { "dry": true, "depositMode": "SIMPLE", "swapType": "EXACT_INPUT", "slippageTolerance": 100, "originAsset": "nep141:arb-0xaf88d065e77c8cc2239327c5edb3a432268e5831.omft.near", "depositType": "ORIGIN_CHAIN", "destinationAsset": "nep141:sol-5ce3bf3a31af18be40ba30f721101b4341690186.omft.near", "amount": "1000", "refundTo": "0x2527D02599Ba641c19FEa793cD0F167589a0f10D", "refundType": "ORIGIN_CHAIN", "recipient": "13QkxhNMrTPxoCkRdYdJ65tFuwXPhL5gLS2Z5Nr6gjRK", "connectedWallets": [\ "0x123...",\ "0x456..."\ ], "sessionId": "session_abc123", "virtualChainRecipient": "0xb4c2fbec9d610F9A3a9b843c47b1A8095ceC887C", "virtualChainRefundRecipient": "0xb4c2fbec9d610F9A3a9b843c47b1A8095ceC887C", "customRecipientMsg": "smart-contract-recipient.near", "recipientType": "DESTINATION_CHAIN", "deadline": "2019-08-24T14:15:22Z", "referral": "referral", "quoteWaitingTimeMs": 3000, "appFees": [\ {\ "recipient": "recipient.near",\ "fee": 100\ }\ ] }, "quote": { "depositAddress": "0x76b4c56085ED136a8744D52bE956396624a730E8", "depositMemo": "1111111", "amountIn": "1000000", "amountInFormatted": "1", "amountInUsd": "1", "minAmountIn": "995000", "amountOut": "9950000", "amountOutFormatted": "9.95", "amountOutUsd": "9.95", "minAmountOut": "9900000", "deadline": "2025-03-04T15:00:00Z", "timeWhenInactive": "2025-03-04T15:00:00Z", "timeEstimate": 120, "virtualChainRecipient": "0xb4c2fbec9d610F9A3a9b843c47b1A8095ceC887C", "virtualChainRefundRecipient": "0xb4c2fbec9d610F9A3a9b843c47b1A8095ceC887C", "customRecipientMsg": "smart-contract-recipient.near" } }, "status": "KNOWN_DEPOSIT_TX", "updatedAt": "2026-01-03T23:21:59.903Z", "swapDetails": { "intentHashes": [\ "text"\ ], "nearTxHashes": [\ "text"\ ], "amountIn": "1000", "amountInFormatted": "0.1", "amountInUsd": "0.1", "amountOut": "9950000", "amountOutFormatted": "9.95", "amountOutUsd": "9.95", "slippage": 50, "originChainTxHashes": [\ {\ "hash": "0x123abc456def789",\ "explorerUrl": "text"\ }\ ], "destinationChainTxHashes": [\ {\ "hash": "0x123abc456def789",\ "explorerUrl": "text"\ }\ ], "refundedAmount": "1000", "refundedAmountFormatted": "0.1", "refundedAmountUsd": "0.1", "refundReason": "PARTIAL_DEPOSIT", "depositedAmount": "text", "depositedAmountFormatted": "text", "depositedAmountUsd": "text", "referral": "referral" } } Copy GET /v0/status?depositAddress=text HTTP/1.1 Host: 1click.chaindefuser.com Authorization: Bearer YOUR_SECRET_TOKEN Accept: */* Copy { "correlationId": "550e8400-e29b-41d4-a716-446655440000", "quoteResponse": { "correlationId": "550e8400-e29b-41d4-a716-446655440000", "timestamp": "2019-08-24T14:15:22Z", "signature": "text", "quoteRequest": { "dry": true, "depositMode": "SIMPLE", "swapType": "EXACT_INPUT", "slippageTolerance": 100, "originAsset": "nep141:arb-0xaf88d065e77c8cc2239327c5edb3a432268e5831.omft.near", "depositType": "ORIGIN_CHAIN", "destinationAsset": "nep141:sol-5ce3bf3a31af18be40ba30f721101b4341690186.omft.near", "amount": "1000", "refundTo": "0x2527D02599Ba641c19FEa793cD0F167589a0f10D", "refundType": "ORIGIN_CHAIN", "recipient": "13QkxhNMrTPxoCkRdYdJ65tFuwXPhL5gLS2Z5Nr6gjRK", "connectedWallets": [\ "0x123...",\ "0x456..."\ ], "sessionId": "session_abc123", "virtualChainRecipient": "0xb4c2fbec9d610F9A3a9b843c47b1A8095ceC887C", "virtualChainRefundRecipient": "0xb4c2fbec9d610F9A3a9b843c47b1A8095ceC887C", "customRecipientMsg": "smart-contract-recipient.near", "recipientType": "DESTINATION_CHAIN", "deadline": "2019-08-24T14:15:22Z", "referral": "referral", "quoteWaitingTimeMs": 3000, "appFees": [\ {\ "recipient": "recipient.near",\ "fee": 100\ }\ ] }, "quote": { "depositAddress": "0x76b4c56085ED136a8744D52bE956396624a730E8", "depositMemo": "1111111", "amountIn": "1000000", "amountInFormatted": "1", "amountInUsd": "1", "minAmountIn": "995000", "amountOut": "9950000", "amountOutFormatted": "9.95", "amountOutUsd": "9.95", "minAmountOut": "9900000", "deadline": "2025-03-04T15:00:00Z", "timeWhenInactive": "2025-03-04T15:00:00Z", "timeEstimate": 120, "virtualChainRecipient": "0xb4c2fbec9d610F9A3a9b843c47b1A8095ceC887C", "virtualChainRefundRecipient": "0xb4c2fbec9d610F9A3a9b843c47b1A8095ceC887C", "customRecipientMsg": "smart-contract-recipient.near" } }, "status": "KNOWN_DEPOSIT_TX", "updatedAt": "2026-01-03T23:21:59.903Z", "swapDetails": { "intentHashes": [\ "text"\ ], "nearTxHashes": [\ "text"\ ], "amountIn": "1000", "amountInFormatted": "0.1", "amountInUsd": "0.1", "amountOut": "9950000", "amountOutFormatted": "9.95", "amountOutUsd": "9.95", "slippage": 50, "originChainTxHashes": [\ {\ "hash": "0x123abc456def789",\ "explorerUrl": "text"\ }\ ], "destinationChainTxHashes": [\ {\ "hash": "0x123abc456def789",\ "explorerUrl": "text"\ }\ ], "refundedAmount": "1000", "refundedAmountFormatted": "0.1", "refundedAmountUsd": "0.1", "refundReason": "PARTIAL_DEPOSIT", "depositedAmount": "text", "depositedAmountFormatted": "text", "depositedAmountUsd": "text", "referral": "referral" } } Copy GET /v0/any-input/withdrawals?depositAddress=text HTTP/1.1 Host: 1click.chaindefuser.com Authorization: Bearer YOUR_SECRET_TOKEN Accept: */* Copy { "asset": "nep141:sol-5ce3bf3a31af18be40ba30f721101b4341690186.omft.near", "recipient": "0x2527d02599ba641c19fea793cd0f167589a0f10d", "affiliateRecipient": "0x2527d02599ba641c19fea793cd0f167589a0f10d", "withdrawals": { "status": "SUCCESS", "amountOutFormatted": "9.95", "amountOutUsd": "9.95", "amountOut": "9950000", "withdrawFeeFormatted": "0.01", "withdrawFee": "10000", "withdrawFeeUsd": "0.01", "timestamp": "2019-08-24T14:15:22Z", "hash": "0x123abc456def789" } } --- # Intent types and execution | NEAR Intents ### [](https://docs.near-intents.org/near-intents/market-makers/verifier/intent-types-and-execution#introduction) Introduction An intent is a desired action done on your account in the `Verifier` smart contract, performed by submitting a transaction to the NEAR blockchain. There are multiple possible actions that can be done, and the `Verifier` allows submitting a list of these actions to be done using [the function](https://near.github.io/intents/defuse/intents/trait.Intents.html#tymethod.execute_intents) `execute_intents`. ### [](https://docs.near-intents.org/near-intents/market-makers/verifier/intent-types-and-execution#note-on-ordering-of-intent-execution-and-atomicity) Note on ordering of intent execution and atomicity Multiple intents can be submitted to `execute_intents` in a list, as will be seen later in the examples, where all of them will be executed in the order they are provided. Because NEAR is an asynchronous and sharded blockchain, intents submitted in a sequence does not mean that they will complete in that sequence. This is because while individual intents will be executed in order, there is no guarantee that [calls/promises (asynchronous calls)](https://docs.near.org/smart-contracts/anatomy/crosscontract) originating from the `Verifier` will end up finishing in order. For example: The user submits a list of intents that will do two things: 1. Intent 1: Perform a [storage deposit](https://nomicon.io/Standards/StorageManagement) on usdc.near to create an account on it 2. Intent 2: Withdraw native NEAR from the user's account in the `Verifier` to `usdc.near` account In this example, there is no guarantee that the whole process will be successful, given that we quantify the success of these intent by having them all pass. The `usdc.near` contract requires a storage deposit before tokens can be deposited. While the intent for storage deposit will be executed first, there is no guarantee that the calls emitted from it into the `usdc.near` smart contract will finish by the time the withdrawal function call is made. ### [](https://docs.near-intents.org/near-intents/market-makers/verifier/intent-types-and-execution#structure-of-intents-call-and-their-encoding) Structure of intents call and their encoding Intents are submitted as JSON objects written as strings in a payload object. The following is an example of a [Transfer](https://near.github.io/intents/defuse_core/intents/tokens/struct.Transfer.html) intent `USDC` tokens from Alice to Bob. Copy { "intent": "transfer", "receiver_id": "bob.near", "tokens": { "nep141:wrap.near": "10" } } The intent does not mention Alice, as _the signer_ of the intent defines the account that performs transfer. This intent is part of the payload, which should have the following members: * signer\_id - signer acount id * verifying\_contract - contract address to which intents are sent * deadline - timestamp in ISO 8601 format * nonce - 256 bit value. It is very important to include it with the correct structure.which has clear [requirements](https://github.com/near/intents/tree/main/defuse#nonces) for structure * intents - array of intents The "intents" in there contains the same intent from above, but in an array, because users can submit multiple intents to be executed as a batch in order. Keep in mind the [caveats explained here](https://docs.near-intents.org/near-intents/market-makers/verifier/intent-types-and-execution#note-on-ordering-of-intent-execution-and-atomicity) about the order of execution. Finally, to create a valid, signed intent to submit to the `Verifier` contract with the `execute_intents` function, we put the payload above in a message string. Note that the message is the same JSON as above, but serialized as a one-liner with escaped quotes. This is very important. The field "recipient" prevents replay attacks on other copies of the `Verifier` on the NEAR blockchain. The exact cryptographic mechanisms for signing will be discussed in the [following sections](https://docs.near-intents.org/near-intents/market-makers/verifier/signing-intents) . ### [](https://docs.near-intents.org/near-intents/market-makers/verifier/intent-types-and-execution#types-of-intents) Types of intents There are multiple [possible intents](https://near.github.io/intents/defuse_core/intents/enum.Intent.html) that can be submitted for execution in the `Verifier` contract. Note that every intent has its own parametrization. The parameters needed to execute the intent can be seen in the linked docs. Rust [PascalCase](https://en.wikipedia.org/wiki/Camel_case) object names are usually converted to [snake\_case](https://en.wikipedia.org/wiki/Snake_case) in JSON. Hence, an intent like `TokenDiff` becomes `token_diff`. Let's discuss the available intents: * [add\_public\_key](https://near.github.io/intents/defuse/accounts/trait.AccountManager.html#tymethod.add_public_key) : Given an account id in the `Verifier` contract, the user can add public keys to this account. The added public key's private key can sign intents on behalf of this account, even to add new ones. Warning: Implicit account ids, by default, have their corresponding public keys added. This means if a private key is leaked for an implicit account used in intents, the user must manually rotate the public key in the Verifier. Note that public keys can be added through transactions too. See [this section](https://docs.near-intents.org/near-intents/market-makers/verifier/account-abstraction) for more information. Example of an intent to add a public key: * [remove\_public\_key](https://near.github.io/intents/defuse/accounts/trait.AccountManager.html#tymethod.remove_public_key) : Removes a public key associated with a given account. Note that public keys can be removed through transactions too. See [this section](https://docs.near-intents.org/near-intents/market-makers/verifier/account-abstraction) for more information. Example of an intent to remove a public key: * [Transfer](https://near.github.io/intents/defuse_core/intents/tokens/struct.Transfer.html) : Transfer a set of tokens from the signer to a specified account id, within the intents contract. Note that transfers can be done using [through transactions too directly to the blockchain](https://near.github.io/intents/defuse_nep245/trait.MultiTokenCore.html#tymethod.mt_transfer) . Example of an intent to transfer coins within the `Verifier` contract from Alice's account to Bob's account: Note that token ids are specified in Multi Token format that was discussed in [this section](https://docs.near-intents.org/near-intents/market-makers/verifier/deposits-and-withdrawals/balances-and-identifying-your-token) . * [FtWithdraw](https://near.github.io/intents/defuse_core/intents/tokens/struct.FtWithdraw.html) , [NftWithdraw](https://near.github.io/intents/defuse_core/intents/tokens/struct.NftWithdraw.html) , [MtWithdraw](https://near.github.io/intents/defuse_core/intents/tokens/struct.MtWithdraw.html) , [NativeWithdraw](https://near.github.io/intents/defuse_core/intents/tokens/struct.NativeWithdraw.html) are withdraw intents to move their tokens from the `Verifier` contract to an arbitrary address. More information [here](https://docs.near-intents.org/near-intents/market-makers/verifier/deposits-and-withdrawals/withdrawals) . Example of an intent to withdraw from Alice's account to Bob's account. Notice that on success, the tokens will be in `usdc.near` contract under Bob's account there. The tokens have exited the `Verifier` contract: * [StorageDeposit](https://near.github.io/intents/defuse_core/intents/tokens/struct.StorageDeposit.html) : Make an [NEP-145](https://nomicon.io/Standards/StorageManagement#nep-145) `storage_deposit` call for an `account_id` on `contract_id`. The `amount` will be subtracted from user’s NEP-141 `wNEAR` balance. The `wNEAR` will not be refunded in any case. Example of an intent to perform storage deposit that will pay for storage deposit in the usdc.near smart contract. The Near token required (and specified) will be taken from `alice.near` account, and paid to `bob.near` in the `usdc.near` contract: [TokenDiff](https://near.github.io/intents/defuse_core/intents/token_diff/struct.TokenDiff.html) : The user declares the will to have a set of changes done to set of tokens. For example, a simple trade of 100 of token A for 200 of token B, can be represented by `TokenDiff` of {“A”: -100, “B”: 200} (this format is just for demonstration purposes). In general, the user can submit multiple changes with many tokens, not just token A for token B. Example of two intents submitted from two users to be used with the `Verifier's` smart contract's `execute_intents` function. In the first intent, Alice declares that she is willing to lose 10 `USDC` to get 10 `USDT` in return. In the second intent, Bob declares their will to lose 10 `USDT` and get 10 `USDC` in return. As mentioned in the [introduction](https://docs.near-intents.org/near-intents/market-makers/verifier/introduction) , there are many different ways to put these intents together for submission to the blockchain, such as in the [Message Bus](https://docs.near-intents.org/near-intents/market-makers/bus) or with third parties or any off-chain communication channel. Once a transaction is submitted calling the function `execute_intents` in the `Verifier's` smart contract, the `Verifier` solves the `TokenDiff` orders and converts them into transfers from Alice to Bob and Bob to Alice. \\ \\ \\ [PreviousAccount Abstraction](https://docs.near-intents.org/near-intents/market-makers/verifier/account-abstraction) [NextSigning Intents](https://docs.near-intents.org/near-intents/market-makers/verifier/signing-intents) Last updated 1 month ago * [Introduction](https://docs.near-intents.org/near-intents/market-makers/verifier/intent-types-and-execution#introduction) * [Note on ordering of intent execution and atomicity](https://docs.near-intents.org/near-intents/market-makers/verifier/intent-types-and-execution#note-on-ordering-of-intent-execution-and-atomicity) * [Structure of intents call and their encoding](https://docs.near-intents.org/near-intents/market-makers/verifier/intent-types-and-execution#structure-of-intents-call-and-their-encoding) * [Types of intents](https://docs.near-intents.org/near-intents/market-makers/verifier/intent-types-and-execution#types-of-intents) Copy { "signer_id": "alice.near", "verifying_contract": "intents.near", "deadline": "2025-05-21T12:23:04.252814Z", "nonce": "Vij2xgAlKBKzAMcLzEqKQRhRHXp3ThAEFTYtBmfhzvE=", "intents": [\ {\ "intent": "transfer",\ "receiver_id": "bob.near",\ "tokens": {\ "nep141:wrap.near": "10"\ }\ }\ ] } Copy { "standard": "nep413", "payload": { "recipient": "intents.near", "nonce": "Vij2xgAlKBKzgNPJFViEQRiSQad02gXP6pv9IQRCFeg=", "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:2o7Cg7N8bEAKtEDbC9Nja8Ks1bJ9Nunh5Ems51G8oV6n96ckUVFeT81vr3TouE47R24HJSrLyxdeBEbvWeuizVBZ" } Copy [\ {\ "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"\ }\ ] Copy [\ {\ "standard": "nep413",\ "payload": {\ "recipient": "intents.near",\ "nonce": "Vij2xgAlKBKzAAxeFUp9QRi4FmMX9Jj6kmrjkUTtltk=",\ "message": "{\"deadline\":\"2025-05-21T08:24:47.536976Z\",\"intents\":\ [{\"intent\":\"remove_public_key\",\"public_key\":\"ed25519:5TagutioHgKLh7KZ1VEFBYfgRkPtqnKm9LoMnJMJugxm\"}],\ \"signer_id\":\"alice.near\"}"\ },\ "public_key": "ed25519:C3jXhkGhEx88Gj7XKtUziJKXEBMRaJ67bWFkxJikVxZ2",\ "signature": "ed25519:3E11skwith3ub3w22FnUdcqYzDFy698qBnP8FEPjZyZKbFtqUZK17AXGSLiwnHXppGrV8wbbGafX8fqXUvefoE8p"\ }\ ] Copy [\ {\ "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"\ }\ ] Copy [\ {\ "standard": "nep413",\ "payload": {\ "recipient": "intents.near",\ "nonce": "Vij2xgAlKBKzgNPJFViEQRiRYtwetaXk8zFqV//Lq3c=",\ "message": "{\"deadline\":\"2025-05-21T10:45:30.098925Z\",\"intents\":\ [{\"intent\":\"ft_withdraw\",\"token\":\"usdc.near\",\"receiver_id\":\"bob.near\",\"amount\":\"1000\"}],\ \"signer_id\":\"alice.near\"}"\ },\ "public_key": "ed25519:C3jXhkGhEx88Gj7XKtUziJKXEBMRaJ67bWFkxJikVxZ2",\ "signature": "ed25519:XYNGWVRyGFGRVZAAn62k9r8qthzbj4a5Ct9eCjrSUW9hXpPRaBvqpLKXpaeBgsekfLFiTLdXMEitrbsZAmMmdmU"\ }\ ] Copy [\ {\ "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"\ }\ ] Copy [\ {\ "standard": "nep413",\ "payload": {\ "recipient": "intents.near",\ "nonce": "Vij2xgAlKBKzgMh0PGuHQRiOD4cMhPLCgZfb8bCmR7s=",\ "message": "{\"deadline\":\"2025-05-21T11:30:25.042157Z\",\"intents\":\ [{\"intent\":\"token_diff\",\"diff\":{\"nep141:usdc.near\":\"-10\",\"nep141:usdt.near\":\"10\"}}],\ \"signer_id\":\"alice.near\"}"\ },\ "public_key": "ed25519:C3jXhkGhEx88Gj7XKtUziJKXEBMRaJ67bWFkxJikVxZ2",\ "signature": "ed25519:2tKuCpxqtx6YUY6LRkQGeqmAizA8CKhkFtYdsHsAGRjwm4tFcPHHhBRGtuQAAbAkUkwJ6n2UptTP4Mpot1cTvf2u"\ },\ {\ "standard": "nep413",\ "payload": {\ "recipient": "intents.near",\ "nonce": "Vij2xgAlKBKzgMh0PGuHQRhE5M+mHoAocV57AzeIPuQ=",\ "message": "{\"deadline\":\"2025-05-21T11:30:25.054132Z\",\"intents\":\ [{\"intent\":\"token_diff\",\"diff\":{\"nep141:usdc.near\":\"10\",\"nep141:usdt.near\":\"-10\"}}],\ \"signer_id\":\"bob.near\"}"\ },\ "public_key": "ed25519:C3jXhkGhEx88Gj7XKtUziJKXEBMRaJ67bWFkxJikVxZ2",\ "signature": "ed25519:gTrJn3CaESvDJ765SDZ7JdkXupeGApjU6t66XpwrCXKM5K7b4VEeZXxL6NSL7i5zJ2Dn1aracg9xubktcPLwHEq"\ }\ ] --- # Signing Intents | NEAR Intents After creating intents, they must be signed before submission to the `Verifier` contract via the `execute_intents` function. This section explains the signing process. Encoding Requirements for the Verifier Contract Curve Public Key Signature Ed25519 32 bytes 64 bytes Secp256k1 64 bytes (uncompressed) 65 bytes (r || s || v) P256 64 bytes (uncompressed) 64 bytes (r || s) Important: Compressed public keys are not supported for ECDSA curves (Secp256k1, P256). Public keys must be in uncompressed format (raw 64-byte x || y coordinates without prefix bytes). Signatures must be in raw concatenated byte format, not DER-encoded. ### [](https://docs.near-intents.org/near-intents/market-makers/verifier/signing-intents#account-abstraction) Account abstraction As discussed in the [account abstraction section](https://docs.near-intents.org/near-intents/market-makers/verifier/account-abstraction) , accounts in the `Verifier` contract are identified by their NEAR account (whether implicit, being derived from a public key, or named, like `alice.near`). Every account can add an arbitrary number of public keys. Every public key in a user's account can be used to produce signatures that authorize intents for that user. Proper key management is essential. ### [](https://docs.near-intents.org/near-intents/market-makers/verifier/signing-intents#signing-philosophy-and-where-our-choice-of-algorithms-come-from) Signing philosophy and where our choice of algorithms come from Digital signature algorithms vary significantly in design and application. Key differences include: * **Key Generation:** The type of the public/private key generation mechanisms, like RSA vs elliptic curves * **Curve types:** The type of curve within the elliptic curve, being a NIST curve, like secp256k1 from Bitcoin and Ethereum, or some Montgomery curve, like Ed25519 * **Message (payload) construction for verification:** Given a payload and a specific algorithm, how do we construct the message so that anyone can verify it with the public key? Given that the goal with NEAR Intents, with any choice from the above, is to make it as easy as possible to integrate other wallets and services, we have allowed [multiple choices](https://near.github.io/intents/defuse_core/payload/multi/enum.MultiPayload.html) on how to verify payloads. Each signature type corresponds to a wallet or service capable of verifying it. For example, from the [available options](https://near.github.io/intents/defuse_core/payload/multi/enum.MultiPayload.html) , you see ERC-191. This exists because Ethereum wallets, like Metamask, support the [ERC-191 standard](https://eips.ethereum.org/EIPS/eip-191) for off-chain data signing. In the following subsections, we will discuss more available signature types. [](https://docs.near-intents.org/near-intents/market-makers/verifier/signing-intents#signature-types) Signature types -------------------------------------------------------------------------------------------------------------------------- A signed [Transfer](https://near.github.io/intents/defuse_core/intents/tokens/struct.Transfer.html) intent that is ready to be submitted to the blockchain looks something like this: This object conforms to the [MultiPayload](https://near.github.io/intents/defuse_core/payload/multi/enum.MultiPayload.html) enum. A signed intent can be one of the possibilities provided by this enum. ### [](https://docs.near-intents.org/near-intents/market-makers/verifier/signing-intents#nep-413) NEP-413 The object above follows the NEP-413 [compliant standard](https://github.com/near/NEPs/blob/master/neps/nep-0413.md) . This is an off-chain message signing standard that is recognized by NEAR wallets. #### [](https://docs.near-intents.org/near-intents/market-makers/verifier/signing-intents#encoding-information) Encoding information Nonce: base64 public\_key: prefixed with the key type, then base58 signature: prefixed with the key type, then base58 ### [](https://docs.near-intents.org/near-intents/market-makers/verifier/signing-intents#erc-191) ERC-191 The object of this type is compliant with the [ERC-191 standard](https://eips.ethereum.org/EIPS/eip-191) for off-chain message signing. #### [](https://docs.near-intents.org/near-intents/market-makers/verifier/signing-intents#encoding-information-1) Encoding information signature: prefixed with the key type, then base58 Note that there is no public key, as the public key can be recovered from the signature and the data. ### [](https://docs.near-intents.org/near-intents/market-makers/verifier/signing-intents#raw-ed25519) Raw Ed25519 This is a standard used by [Phantom wallet for Solana off-chain message signing](https://docs.phantom.com/solana/signing-a-message) . #### [](https://docs.near-intents.org/near-intents/market-makers/verifier/signing-intents#encoding-information-2) Encoding information public\_key: prefixed with the key type, then base58 signature: prefixed with the key type, then base58 ### [](https://docs.near-intents.org/near-intents/market-makers/verifier/signing-intents#passkey-webauthn) Passkey, "WebAuthn" This object type is meant to be used with [passkeys](https://en.wikipedia.org/wiki/WebAuthn) with [Web Authentication standard](https://w3c.github.io/webauthn/) . An object of this type looks as follows: The [signature](https://near.github.io/intents/defuse_webauthn/enum.Signature.html) can use either [Ed25519 or P256, aka, secp256r1](https://www.iana.org/assignments/cose/cose.xhtml#algorithms) . #### [](https://docs.near-intents.org/near-intents/market-makers/verifier/signing-intents#encoding-information-3) Encoding information The object uses the following encoding authenticator\_data: base64, url-safe challenge: base64, url-safe signature: prefixed with key type, being `p256` or `ed25519`, following by the signature in base58 encoding public\_key: prefixed with the key type, then base58 ### [](https://docs.near-intents.org/near-intents/market-makers/verifier/signing-intents#tonconnect) TonConnect TonConnect follows the [standard for data signing](https://docs.tonconsole.com/academy/sign-data) on TON. #### [](https://docs.near-intents.org/near-intents/market-makers/verifier/signing-intents#encoding-information-4) Encoding information public\_key: prefixed with the key type, then base58 signature: prefixed with the key type, then base58 [](https://docs.near-intents.org/near-intents/market-makers/verifier/signing-intents#adding-more-key-and-signature-types) Adding more key and signature types ------------------------------------------------------------------------------------------------------------------------------------------------------------------ To support additional key or signature types, please contact the Near Intents team. [PreviousIntent types and execution](https://docs.near-intents.org/near-intents/market-makers/verifier/intent-types-and-execution) [NextEvents](https://docs.near-intents.org/near-intents/market-makers/verifier/events) Last updated 1 month ago * [Account abstraction](https://docs.near-intents.org/near-intents/market-makers/verifier/signing-intents#account-abstraction) * [Signing philosophy and where our choice of algorithms come from](https://docs.near-intents.org/near-intents/market-makers/verifier/signing-intents#signing-philosophy-and-where-our-choice-of-algorithms-come-from) * [Signature types](https://docs.near-intents.org/near-intents/market-makers/verifier/signing-intents#signature-types) * [NEP-413](https://docs.near-intents.org/near-intents/market-makers/verifier/signing-intents#nep-413) * [ERC-191](https://docs.near-intents.org/near-intents/market-makers/verifier/signing-intents#erc-191) * [Raw Ed25519](https://docs.near-intents.org/near-intents/market-makers/verifier/signing-intents#raw-ed25519) * [Passkey, "WebAuthn"](https://docs.near-intents.org/near-intents/market-makers/verifier/signing-intents#passkey-webauthn) * [TonConnect](https://docs.near-intents.org/near-intents/market-makers/verifier/signing-intents#tonconnect) * [Adding more key and signature types](https://docs.near-intents.org/near-intents/market-makers/verifier/signing-intents#adding-more-key-and-signature-types) Copy { "standard": "nep413", "payload": { "recipient": "intents.near", "nonce": "Vij2xgAlKBKzgNPJFViEQRgYyS7p2NEiYTTY4XmT8go=", "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:2ns3eCikZFxFA6e9ApunuDG4XwJUPrB8q82fYViBKjheqiDYcCmLN9RnB9NhoEvCdNoS3L3qYD9FAnKd7UkTnuij" } Copy { "standard": "erc191", "payload": "{\"signer_id\":\"0xca67C1Bb3FD69857E5edaF6aA1c65371bF46A464\",\"verifying_contract\":\"intents.near\",\"deadline\":\"2025-05-26T13:24:16.983Z\",\"nonce\":\"Vij2xgAlKBKzwGNqwogWQxiy87p9jW5Omfg+L9bXBDw=\",\"intents\":[{\"intent\":\"token_diff\",\"diff\":{\"nep141:usdc.near\":\"-1000\",\"nep141:usdt.near\":\"1000\"}},{\"intent\":\"ft_withdraw\",\"token\":\"usdt.near\",\"receiver_id\":\"bob.near\",\"amount\":\"1000\"}]}", "signature": "secp256k1:BoR53NKKJ2GfP8bETk427Xav8VMpUcZovLzXeq2EsUD7NnPH2sSmxWFEkDUrguJHHkiu3GwEQxxMo2Rm2ZTDHFygU" } Copy { "standard": "raw_ed25519", "payload": "{\"signer_id\":\"alice.near\",\"verifying_contract\":\"intents.near\",\"deadline\":{\"timestamp\":1732035219},\"nonce\":\"Vij2xgAlKBKzwGNqwogWQxi9ZuGDNBXlmdy9g3MQSMk=\",\"intents\":[{\"intent\":\"token_diff\",\"diff\":{\"nep141:usdc.near\":\"-1000\",\"nep141:usdt.near\":\"998\"}}]}", "public_key": "ed25519:9aqyNsCRrDkq9SceVRCdW1Zs9BmEP8ieJQRJim8iRLF", "signature": "ed25519:9RHRenkbYN6cfWXkou47sjAf1PuTc6nYM8amHADApfqio8dcMQu28cgfz6wkktBFoE8J7FsZ3rxifFdMdzTTJi6" } Copy { "standard": "webauthn", "payload": "{\"signer_id\":\"0x3602b546589a8fcafdce7fad64a46f91db0e4d50\",\"verifying_contract\":\"intents.near\",\"deadline\":\"2025-03-30T00:00:00Z\",\"nonce\":\"A3nsY1GMVjzyXL3mUzOOP3KT+5a0Ruy+QDNWPhchnxM=\",\"intents\":[{\"intent\":\"transfer\",\"receiver_id\":\"bob.near\",\"tokens\":{\"nep141:usdc.near\":\"1000\"}}]}", "public_key": "p256:2V8Np9vGqLiwVZ8qmMmpkxU7CTRqje4WtwFeLimSwuuyF1rddQK5fELiMgxUnYbVjbZHCNnGc6fAe4JeDcVxgj3Q", "signature": "p256:3KBMZ72BHUiVfE1ey5dpi3KgbXvSEf9kuxgBEax7qLBQtidZExxxjjQk1hTTGFRrPvUoEStfrjoFNVVW4Abar94W", "client_data_json": "{\"type\":\"webauthn.get\",\"challenge\":\"4cveZsIe6p-WaEcL-Lhtzt3SZuXbYsjDdlFhLNrSjjk\",\"origin\":\"https://defuse-widget-git-feat-passkeys-defuse-94bbc1b2.vercel.app\"}", "authenticator_data": "933cQogpBzE3RSAYSAkfWoNEcBd3X84PxE8iRrRVxMgdAAAAAA==" } Copy { "address": "EXvSRnDlYHziOJRm1MqGLgQB3EN7319eZLYWVinpoPv7LkBd", "domain": "example.com", "timestamp": "2025-01-01T00:00:00Z", "payload": { "type": "text", "text": "{\"signer_id\":\"alice.near\",\"verifying_contract\":\"intent.near\",\"deadline\":\"2025-05-26T15:19:43.617898Z\",\"nonce\":\"ZnbiFf4tP4cn65XLuZ6T1H6/Vr3o6ucNftdx3pInLnc=\",\"intents\":[{\"intent\":\"ft_withdraw\",\"token\":\"usdc.near\",\"receiver_id\":\"bob.near\",\"amount\":\"1000\"}]}" }, "public_key": "ed25519:G4HVCaJg9vZb2srcLoWxR9grQ3tGLNFMVrZBhTtBi4Q1", "signature": "ed25519:5cwYdTNeGy1mApo9RNor9hSXvcG6GbvVm6di6kuf4frnARtVWRpJoPtvFKHMbt7uDGDtgFfn6bPDFGPK5jamqBwC" } --- # Withdrawals | NEAR Intents After a successful [deposit](https://docs.near-intents.org/near-intents/market-makers/verifier/deposits-and-withdrawals/deposits) , tokens are assigned to a user's account in the `Verifier` contract. Users retain full ownership and control of their tokens. Besides executing trades through intents, the user has the liberty to withdraw their tokens whenever they want. Given how tokens are stored in the `Verifier` smart contract (see [balances section](https://docs.near-intents.org/near-intents/market-makers/verifier/deposits-and-withdrawals/balances-and-identifying-your-token) ), there are two ways to withdraw a fungible token from the contract. The same applies to non-fungible tokens, but the difference shall become clear. 1. Using the `Verifier` smart contract [function call](https://near.github.io/intents/defuse/tokens/nep141/trait.FungibleTokenWithdrawer.html#tymethod.ft_withdraw) `ft_withdraw`, where the token id is used without a prefix (see the [balances section](https://docs.near-intents.org/near-intents/market-makers/verifier/deposits-and-withdrawals/balances-and-identifying-your-token) ). 2. Using a signed intent, where the token id is also prefixed with `nep141`. ### [](https://docs.near-intents.org/near-intents/market-makers/verifier/deposits-and-withdrawals/withdrawals#examples) Examples 1. If Alice has sufficient balance, she can initiate the following withdrawal using `near-cli`: Copy near contract call-function as-transaction intents.near ft_withdraw json-args '{ "token": "wrap.near", "receiver_id": "alice.near", "amount": "1000" }' prepaid-gas '100.0 Tgas' attached-deposit '1 yoctoNEAR' sign-as alice.near network-config mainnet sign-with-keychain send 1. To withdraw using a signed intent, here’s an example for an NEP-141 token: Copy { "standard": "nep413", "payload": { "recipient": "intents.near", "nonce": "Vij2xgAlKBKzgNPJFViEQRhPvveC+P9xRwOXFW/IK5w=", "message": "{\"deadline\":\"2025-05-20T13:29:34.360380Z\",\"intents\": [{\"intent\":\"ft_withdraw\",\"token\":\"wrap.near\",\"receiver_id\":\"alice.near\",\"amount\":\"1000\"}], \"signer_id\":\"user1.test.near\"}" }, "public_key": "ed25519:C3jXhkGhEx88Gj7XKtUziJKXEBMRaJ67bWFkxJikVxZ2", "signature": "ed25519:5op5APf9YaRznvMVwZBw6GGk9ychU3QtNRKJSxuVajHFMQths4ZZMRoAENU1zWhjinqz8KuLNyM9589c86opopyT" } ### [](https://docs.near-intents.org/near-intents/market-makers/verifier/deposits-and-withdrawals/withdrawals#withdrawal-of-other-types-of-tokens) Withdrawal of other types of tokens As with NEP-141 tokens, the same withdrawal methods apply to other token types. Any token type can be withdrawn via a signed intent or a direct function call on NEAR. The following is a table with this information summarized Token type/standard Withdraw function Withdraw Intent NEP-141 - Fungible Token [ft\_withdraw](https://near.github.io/intents/defuse/tokens/nep141/trait.FungibleTokenWithdrawer.html#tymethod.ft_withdraw) [FtWithdraw](https://near.github.io/intents/defuse_core/intents/tokens/struct.FtWithdraw.html) NEP-171 - Non-fungible Token [nft\_withdraw](https://near.github.io/intents/defuse/tokens/nep171/trait.NonFungibleTokenWithdrawer.html#tymethod.nft_withdraw) [NftWithdraw](https://near.github.io/intents/defuse_core/intents/tokens/struct.NftWithdraw.html) NEP-245 - Multi Token [mt\_withdraw](https://near.github.io/intents/defuse/tokens/nep245/trait.MultiTokenWithdrawer.html#tymethod.mt_withdraw) [MtWithdraw](https://near.github.io/intents/defuse_core/intents/tokens/struct.MtWithdraw.html) Native NEAR Token ❌ [NativeWithdraw](https://near.github.io/intents/defuse_core/intents/tokens/struct.NativeWithdraw.html) [](https://docs.near-intents.org/near-intents/market-makers/verifier/deposits-and-withdrawals/withdrawals#refunds-on-failed-withdrawals-warning) Refunds on failed withdrawals - Warning --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- This discussion applies to all withdraw types in the previous section, except for NativeWithdraw, since NEAR transfers cannot fail. A refund restores the user’s balance when a withdrawal fails on the target smart contract. For example. Say Alice makes a request to withdraw 100 USDC from her `Verifier` smart contract account. There are two modes of operation for this request, whether it is done through a function call or an intent. Notice the [withdraw function and its signature](https://near.github.io/intents/defuse/tokens/nep141/trait.FungibleTokenWithdrawer.html#tymethod.ft_withdraw) . The key parameter in the function for this discussion is `msg`, stemming from the [NEP-141 standard](https://nomicon.io/Standards/Tokens/FungibleToken/Core) . There are two possible cases: 1. If `msg` is specified, the contract will use `ft_transfer` to process the withdrawal 2. If `msg` is not specified, or `"msg": null` in json, the withdrawal will be done using an `ft_transfer_call` function call Note: The same applies for Multi Token and NFT transfers mentioned in the table above, with their corresponding `nft_transfer`, `nft_transfer_call`, `mt_transfer`, and `mt_transfer_call`, and the intents, which eventually call these functrions. Ideally speaking, if Alice does not receive her tokens to the smart contract in question, i.e., if her balance in the USDC smart contract does not increase by the 100 USDC after withdrawing 100 USDC from the `Verifier` smart contract due to an error in the USDC smart contract, the `Verifier` should return the 100 USDC to her balance in the `Verifier` contract. However, this is not always the case. Due to complexities related to the asynchronous and sharded nature of the NEAR blockchain, refunds will only be processed when `msg` is unspecified or has a value `null`, i.e., when `ft_transfer` is used for processing the withdrawal. It is important to emphasize that this refund discussion is exclusively relevant for failures occurring in the target smart contract, not in the `Verifier` contract itself. If an error happens within the `Verifier` contract, the balance will not change. But the refund issue happens if an asynchronous call to another smart contract, the USDC smart contract in the above example, leads to an error. Note that `msg` being empty, i.e., being `""` or an empty string, or being `Some("")` in Rust instead of `None`, still means that `msg` is specified. In the json parameters of your request, make sure you do not specify `msg` at all or specify the value `null` if you are seeking the behavior of `ft_transfer` and guarantee a refund on failure. See the summary table below: Withdrawal request \`msg\` parameter specified Is a refund possible? `FtWithdraw` intent or `ft_withdraw` call No (or msg = null) Yes `FtWithdraw` intent or `ft_withdraw` call Yes, as string No `MtWithdraw` intent or `mt_withdraw` call No (or msg = null) Yes `MtWithdraw` intent or `mt_withdraw` call Yes, as string No `NftWithdraw` intent or `nft_withdraw` call No (or msg = null) Yes `NftWithdraw` intent or `nft_withdraw` call Yes, as string No To ensure a successful withdrawal and refund, avoid specifying `msg` or set it explicitly to `null`. For programmable actions on the receiving contract, perform them from your own account using `ft_transfer_call`. [PreviousBalances, and identifying your token](https://docs.near-intents.org/near-intents/market-makers/verifier/deposits-and-withdrawals/balances-and-identifying-your-token) [NextAccount Abstraction](https://docs.near-intents.org/near-intents/market-makers/verifier/account-abstraction) Last updated 1 month ago * [Examples](https://docs.near-intents.org/near-intents/market-makers/verifier/deposits-and-withdrawals/withdrawals#examples) * [Withdrawal of other types of tokens](https://docs.near-intents.org/near-intents/market-makers/verifier/deposits-and-withdrawals/withdrawals#withdrawal-of-other-types-of-tokens) * [Refunds on failed withdrawals - Warning](https://docs.near-intents.org/near-intents/market-makers/verifier/deposits-and-withdrawals/withdrawals#refunds-on-failed-withdrawals-warning) --- # API | NEAR Intents Not recommended for distribution channels, consider using [1Click](https://docs.near-intents.org/near-intents/integration/distribution-channels/1click-api) instead. * * * ### [](https://docs.near-intents.org/near-intents/market-makers/bus/solver-relay#frontend-json-rpc-endpoint) Frontend **JSON-RPC Endpoint** **POST:** `https://solver-relay-v2.chaindefuser.com/rpc` * * * **1\. Quote asset prices from solvers** Allow the front end to estimate potential output for a given exact input or the required input for a given exact output based on user intent. The solver bus will forward a quote request to all connected solvers, wait for up to 3000 ms, and return all available quote options to the user. Only one of `exact_amount_in` or `exact_amount_out` should be provided in the request, not both. Parameters[](https://docs.near-intents.org/near-intents/market-makers/bus/solver-relay#parameters) * `defuse_asset_identifier_in` - asset to trade from * `defuse_asset_identifier_out`\- asset to trade to * `exact_amount_in` - amount of _token\_in_ for exchange * `exact_amount_out` - amount of _token\_out_ for exchange * `min_deadline_ms`_(optional)_ - minimum validity time for an offer from solvers (in milliseconds). The shorter the time, the better the price solvers can offer. Default is 60000 (1 minute). Response[](https://docs.near-intents.org/near-intents/market-makers/bus/solver-relay#response) * array of quote responses from solvers * `quote_hash` - quote response hash * `defuse_asset_identifier_in` - asset to trade from * `defuse_asset_identifier_out` - asset to trade to * `amount_in`: * If `exact_amount_in` is defined: Specifies _token\_in_ amount for the exchange. * If `exact_amount_in` is **not** defined: Represents a proposed amount of _token\_in_. * `amount_out`: * If `exact_amount_out` is defined: Specifies _token\_out_ amount for the exchange. * If `exact_amount_out` is **not** defined: Represents a proposed amount of _token\_out_. * `expiration_time` - expiration date of the offer from the solver Example[](https://docs.near-intents.org/near-intents/market-makers/bus/solver-relay#example) Copy // Request { "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\ }\ ] } // Response { "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"\ }, \ // ...\ ] } **2\. Publish intent** If the user is satisfied with the offer provided by the solver, they can sign an intent and send it to the Solver Bus for execution along with the solver's quote hash(es). Solver Bus supports these types of signatures for publishing intents: `nep413`, `erc191`, `raw_ed25519` Parameters(NEP413)[](https://docs.near-intents.org/near-intents/market-makers/bus/solver-relay#parameters-nep413) * `quote_hashes` - quote response hashes from solvers * `signed_data` - data containing user intents with a signature * `standard` - content signature standard (`nep413`) * `payload` - payload that was signed * `message` * `signer_id` - signer's account ID in Near Intents * `intents[]` - array of user intents * `intent` - intent type * other data depending on intent type * `deadline` - deadline until which this intent is valid, ISO-8601 string * `nonce` - unique nonce for operation * `recipient` - Near Intents contract address (`intents.near`) * `callbackUrl`_(optional)_ - needed for some wallets * `signature` - signature of the payload * `public_key` - signer's public key Parameters(ERC191)[](https://docs.near-intents.org/near-intents/market-makers/bus/solver-relay#parameters-erc191) * `quote_hashes` - quote response hashes from solverss * `signed_data` - data containing user intents with a signature * `standard` - content signature standard (`erc191`) * `payload` - **STRINGIFIED** payload that was signed * `signer_id` - signer's account ID in Near Intents * `intents[]` - array of user intents * `intent` - intent type * other data depending on intent type * `deadline` - deadline until which this intent is valid, ISO-8601 string * `nonce` - unique nonce for operation * `verifying_contract` - Near Intents contract address (`intents.near`) * `signature` - signature of the payload Parameters(RAW\_ED25519)[](https://docs.near-intents.org/near-intents/market-makers/bus/solver-relay#parameters-raw_ed25519) * `quote_hashes` - quote response hashes from solvers * `signed_data` - data containing user intents with a signature * `standard` - content signature standard (`raw_ed25519`) * `payload` - **STRINGIFIED** payload that was signed * `signer_id` - signer's account ID in Near Intents * `intents[]` - array of user intents * `intent` - intent type * other data depending on intent type * `deadline` - deadline until which this intent is valid, ISO-8601 string * `nonce` - unique nonce for operation * `verifying_contract` - Near Intents contract address (`intents.near`) * `signature` - signature of the payload * `public_key` - signer's public key TokenDiff Intent[](https://docs.near-intents.org/near-intents/market-makers/bus/solver-relay#tokendiff-intent) * `intent` - intent type (equals `token_diff`) * `diff` - map where: * **Keys**: Represent `defuse_asset_identifiers` of tokens. * **Values**: Represent amounts for the tokens as strings. * Positive values indicate tokens to be received by the account. * Negative values (prefixed with "-") indicate tokens to be transferred from the account. Response[](https://docs.near-intents.org/near-intents/market-makers/bus/solver-relay#response-1) * `status` - intent receiving status (`OK` or `FAILED`) * `reason` - error reason (if the status is `FAILED`) * `intent_hash` - intent identifier Example[](https://docs.near-intents.org/near-intents/market-makers/bus/solver-relay#example-1) **3\. Get intent status** Check the status of intent execution. Parameters[](https://docs.near-intents.org/near-intents/market-makers/bus/solver-relay#parameters-1) * `intent_hash` - intent identifier Response[](https://docs.near-intents.org/near-intents/market-makers/bus/solver-relay#response-2) * `intent_hash` - intent identifier * `status` - intent execution status * `data` - additional data * `hash` - Near transaction hash (if available) Statuses[](https://docs.near-intents.org/near-intents/market-makers/bus/solver-relay#statuses) * `PENDING` - the intent was successfully received by the Solver Bus and is pending the execution * `TX_BROADCASTED` - transaction for the intent has been successfully sent to the Near Intents contract * `SETTLED` - the intent has been successfully settled on chain * `NOT_FOUND_OR_NOT_VALID` - the intent wasn't received successfully, has expired, or there was an error when executing it on chain Example[](https://docs.near-intents.org/near-intents/market-makers/bus/solver-relay#example-2) * * * ### [](https://docs.near-intents.org/near-intents/market-makers/bus/solver-relay#solver-ws-endpoint) Solver WS Endpoint `wss://solver-relay-v2.chaindefuser.com/ws` **1\. Subscribe to quote/quote\_status requests** Parameters[](https://docs.near-intents.org/near-intents/market-makers/bus/solver-relay#parameters-2) * `method` - subscribe * `params[0]` - subscription name ("**quote"** or **"quote\_status"**) Response[](https://docs.near-intents.org/near-intents/market-makers/bus/solver-relay#response-3) * `result` - subscription identifier which can be used to track following events Example[](https://docs.near-intents.org/near-intents/market-makers/bus/solver-relay#example-3) * `defuse_asset_identifier_out` - asset to trade to **2\. Receive quote requests** Event data[](https://docs.near-intents.org/near-intents/market-makers/bus/solver-relay#event-data) * `subscription` - subscription identifier * `quote_id` - quote request identifier * `defuse_asset_identifier_in` - asset to trade from * `defuse_asset_identifier_out` - asset to trade to * `exact_amount_in` - amount of _token\_in_ for exchange * `exact_amount_out` - amount of _token\_out_ for exchange * **Condition**: Only one of `exact_amount_in` or`exact_amount_out` can will be specified in a request. * `min_deadline_ms` - minimum validity time for an offer from solvers (in milliseconds). The shorter the time, the better the price solvers can offer. Example[](https://docs.near-intents.org/near-intents/market-makers/bus/solver-relay#example-4) **3\. Respond to quote requests** Please note that unique `id` is required in the JSON-RPC message when using this method. Parameters[](https://docs.near-intents.org/near-intents/market-makers/bus/solver-relay#parameters-3) * `quote_id` - quote request identifier * `quote_output` - quote result * `amount_out` - proposed `amount`for `exact_amount_in` requests * `amount_in` - proposed `amount`for `exact_amount_out` requests * `signed_data` - data containing solver intents with a signature * `standard` - content signature standard (`nep413`) * `payload` - payload that was signed * `message` * `signer_id` - solver's account ID in Near Intents * `intents[]` - array of intents * `intent` - intent type * other data depending on intent type * `deadline` - deadline until which this intent is valid, ISO-8601 string * `nonce` - unique nonce for operation * `recipient` - Near Intents contract address (`intents.near`) * `signature` - signature of the payload * `public_key` - signer's (solver's) public key * `other_quote_hashes` - hashes of other quote results to fulfill the current intent (optional) Response[](https://docs.near-intents.org/near-intents/market-makers/bus/solver-relay#response-4) * `result` - "OK" if the solver's proposal was successfully accepted Example[](https://docs.near-intents.org/near-intents/market-makers/bus/solver-relay#example-5) **4.Receive quote\_status event** Event data[](https://docs.near-intents.org/near-intents/market-makers/bus/solver-relay#event-data-1) * `quote_hash` - solver's intent hash used to identify the quote response * `intent_hash` - user's intent hash (identifier) * `tx_hash` - hash of the mined intent transaction on Near Example[](https://docs.near-intents.org/near-intents/market-makers/bus/solver-relay#example-6) **5\. Unsubscribe** Parameters[](https://docs.near-intents.org/near-intents/market-makers/bus/solver-relay#parameters-4) * `method` - "unsubscribe" * `params[0]` - subscription identifier Example[](https://docs.near-intents.org/near-intents/market-makers/bus/solver-relay#example-7) [PreviousMessage Bus](https://docs.near-intents.org/near-intents/market-makers/bus) [NextUsage](https://docs.near-intents.org/near-intents/market-makers/bus/usage-examples) Last updated 1 month ago * [Frontend JSON-RPC Endpoint](https://docs.near-intents.org/near-intents/market-makers/bus/solver-relay#frontend-json-rpc-endpoint) * [Solver WS Endpoint](https://docs.near-intents.org/near-intents/market-makers/bus/solver-relay#solver-ws-endpoint) Copy // Request { "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" } } Copy // Request { "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" } } } Copy // Request { "jsonrpc": "2.0", "id": 1, "method": "subscribe", "params": ["quote"] } // Response { "jsonrpc": "2.0", "id": 1, "result": "00000000-0000-0000-0000-000000000000", // subscriptionId } Copy // Event { "jsonrpc": "2.0" "method": "subscribe", "params": { "subscription": "00000000-0000-0000-0000-000000000000", "quote_id":"00000000-0000-0000-0000-000000000000", "defuse_asset_identifier_in": "nep141:ft1.near", "defuse_asset_identifier_out": "nep141:ft2.near", "exact_amount_in": "1000", "min_deadline_ms": 60000 } } Copy // Request { "jsonrpc": "2.0", "id": 1, "method": "quote_response", "params": [\ {\ "quote_id":"00000000-0000-0000-0000-000000000000",\ "quote_output": {\ "amount_out": "300",\ },\ "signed_data": {\ "standard": "nep413",\ "payload": {\ "recipient": "intents.near",\ "nonce": "Vij2xgAlKBKzAEiS6N1S/hcQLaHzX2s1fNKhBDblXT4=",\ "message": "{\"deadline\":\"2024-10-14T12:53:40.000Z\",\"intents\":[{\"intent\":\"token_diff\",\"diff\":{\"nep141:ft2.near\":\"-300\",\"nep141:ft1.near\":\"500\"}}],\"signer_id\":\"solver.near\"}"\ },\ "public_key": "ed25519:C3jXhkGhEx88Gj7XKtUziJKXEBMRaJ67bWFkxJikVxZ2",\ "signature": "ed25519:WQXG37prMyT4f1vp6JSvamsjqDR5fSnDiinSPaCoq9sPcDgFGPRiMWX7csqqudDbzc8i6wrfpemgpVX2wQDmwww"\ }\ },\ "other_quote_hashes": ["00000000000000000000000000000000", ...] //optional\ ] } // Response { "jsonrpc": "2.0", "id": 1, "result": "OK", } Copy // Event { "jsonrpc": "2.0" "method": "subscribe", "params": { "quote_hash": "00000000000000000000000000000000", "intent_hash":"00000000000000000000000000000000", "tx_hash": "00000..." } } Copy // Request { "jsonrpc": "2.0", "id": 1, "method": "unsubscribe", "params": ["00000000-0000-0000-0000-000000000000"] //subscriptionId } // Response { "jsonrpc": "2.0", "id": 1, "result": "OK" } ---