openapi: 3.0.0 info: contact: {} description: API for One-Click Swaps title: 1Click Swap API version: 0.1.10 servers: - url: https://1click.chaindefuser.com paths: /v0/tokens: get: description: |- 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. operationId: getTokens parameters: [] responses: "200": content: application/json: schema: items: $ref: '#/components/schemas/TokenResponse' type: array description: "" summary: Get supported tokens tags: - OneClick /v0/quote: post: description: |- 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. operationId: getQuote parameters: [] requestBody: content: application/json: schema: $ref: '#/components/schemas/QuoteRequest' required: true responses: "200": content: application/json: schema: $ref: '#/components/schemas/QuoteResponse' description: "" "400": content: application/json: schema: $ref: '#/components/schemas/BadRequestResponse' description: Bad Request - Invalid input data "401": description: Unauthorized - JWT token is invalid security: - JWT-auth: [] summary: Request a swap quote tags: - OneClick /v0/status: get: description: |- 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. operationId: getExecutionStatus parameters: - explode: true in: query name: depositAddress required: true schema: type: string style: form - explode: true in: query name: depositMemo required: false schema: type: string style: form responses: "200": content: application/json: schema: $ref: '#/components/schemas/GetExecutionStatusResponse' description: "" "401": description: Unauthorized - JWT token is invalid "404": content: application/json: schema: $ref: '#/components/schemas/BadRequestResponse' description: Deposit address not found security: - JWT-auth: [] summary: Check swap execution status tags: - OneClick /v0/any-input/withdrawals: get: description: "Retrieves all withdrawals by ANY_INPUT quote with filtering, pagination\ \ and sorting" operationId: getAnyInputQuoteWithdrawals parameters: - explode: true in: query name: depositAddress required: true schema: type: string style: form - explode: true in: query name: depositMemo required: false schema: type: string style: form - description: Filter withdrawals from this timestamp (ISO string) explode: true in: query name: timestampFrom required: false schema: type: string style: form - description: "Page number for pagination (default: 1)" explode: true in: query name: page required: false schema: type: number style: form - description: "Number of withdrawals per page (max: 50, default: 50)" explode: true in: query name: limit required: false schema: type: number style: form - description: Sort order explode: true in: query name: sortOrder required: false schema: enum: - asc - desc type: string style: form responses: "200": content: application/json: schema: $ref: '#/components/schemas/GetAnyInputQuoteWithdrawals' description: "" "401": description: Unauthorized - JWT token is invalid "404": content: application/json: schema: $ref: '#/components/schemas/BadRequestResponse' description: Deposit address not found security: - JWT-auth: [] summary: Get ANY_INPUT withdrawals tags: - OneClick /v0/deposit/submit: post: description: |- 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. operationId: submitDepositTx parameters: [] requestBody: content: application/json: schema: $ref: '#/components/schemas/SubmitDepositTxRequest' required: true responses: "200": content: application/json: schema: $ref: '#/components/schemas/SubmitDepositTxResponse' description: "" "400": content: application/json: schema: $ref: '#/components/schemas/BadRequestResponse' description: Bad Request - Invalid input data "401": description: Unauthorized - JWT token is invalid security: - JWT-auth: [] summary: Submit deposit transaction hash tags: - OneClick components: schemas: TokenResponse: example: symbol: wNEAR blockchain: near assetId: nep141:wrap.near price: 2.79 decimals: 24 priceUpdatedAt: 2025-03-28T12:23:00.07Z contractAddress: wrap.near properties: assetId: description: Unique asset identifier example: nep141:wrap.near type: string decimals: description: Number of decimals for the token example: 24 type: number blockchain: description: Blockchain associated with the token enum: - near - eth - base - arb - btc - sol - ton - dash - doge - xrp - zec - gnosis - bera - bsc - pol - tron - sui - op - avax - cardano - ltc - xlayer - monad - bch - adi - plasma - scroll - starknet - aleo example: near type: string symbol: description: "Token symbol (e.g. BTC, ETH)" example: wNEAR type: string price: description: Current price of the token in USD example: 2.79 type: number priceUpdatedAt: description: Date when the token price was last updated example: 2025-03-28T12:23:00.07Z format: date-time type: string contractAddress: description: Contract address of the token example: wrap.near type: string required: - assetId - blockchain - decimals - price - priceUpdatedAt - symbol type: object AppFee: example: fee: 100 recipient: recipient.near properties: recipient: description: Account ID within Intents to which this fee will be transferred example: recipient.near type: string fee: description: "Fee for this recipient as part of amountIn in basis points\ \ (1/100th of a percent), e.g. 100 for 1% fee" example: 100 type: number required: - fee - recipient type: object QuoteRequest: example: quoteWaitingTimeMs: 3000 depositMode: SIMPLE amount: "1000" connectedWallets: - 0x123... - 0x456... customRecipientMsg: smart-contract-recipient.near swapType: EXACT_INPUT appFees: - fee: 100 recipient: recipient.near - fee: 100 recipient: recipient.near dry: true sessionId: session_abc123 destinationAsset: nep141:sol-5ce3bf3a31af18be40ba30f721101b4341690186.omft.near refundType: ORIGIN_CHAIN recipientType: DESTINATION_CHAIN referral: referral virtualChainRefundRecipient: 0xb4c2fbec9d610F9A3a9b843c47b1A8095ceC887C recipient: 13QkxhNMrTPxoCkRdYdJ65tFuwXPhL5gLS2Z5Nr6gjRK virtualChainRecipient: 0xb4c2fbec9d610F9A3a9b843c47b1A8095ceC887C slippageTolerance: 100 deadline: 2019-08-24T14:15:22Z depositType: ORIGIN_CHAIN refundTo: 0x2527D02599Ba641c19FEa793cD0F167589a0f10D originAsset: nep141:arb-0xaf88d065e77c8cc2239327c5edb3a432268e5831.omft.near properties: dry: description: |- Flag indicating whether this is a dry run request. If `true`, the response will **NOT** contain the following fields: - `depositAddress` - `timeWhenInactive` - `deadline` example: true type: boolean depositMode: default: SIMPLE description: |- 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. enum: - SIMPLE - MEMO example: SIMPLE type: string swapType: description: |- 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 enum: - EXACT_INPUT - EXACT_OUTPUT - FLEX_INPUT - ANY_INPUT type: string slippageTolerance: description: "Slippage tolerance for the swap. This value is in basis points\ \ (1/100th of a percent), e.g. 100 for 1% slippage." example: 100 type: number originAsset: description: ID of the origin asset. example: nep141:arb-0xaf88d065e77c8cc2239327c5edb3a432268e5831.omft.near type: string depositType: description: |- 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. enum: - ORIGIN_CHAIN - INTENTS type: string destinationAsset: description: ID of the destination asset. example: nep141:sol-5ce3bf3a31af18be40ba30f721101b4341690186.omft.near type: string amount: description: "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" type: string refundTo: description: Address used for refunds. example: 0x2527D02599Ba641c19FEa793cD0F167589a0f10D type: string refundType: description: |- 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. enum: - ORIGIN_CHAIN - INTENTS type: string recipient: description: Recipient address. The format must match `recipientType`. example: 13QkxhNMrTPxoCkRdYdJ65tFuwXPhL5gLS2Z5Nr6gjRK type: string connectedWallets: description: Addresses of connected wallets. example: - 0x123... - 0x456... items: type: string type: array sessionId: description: Unique client session identifier for 1Click. example: session_abc123 type: string virtualChainRecipient: description: EVM address of a transfer recipient in a virtual chain example: 0xb4c2fbec9d610F9A3a9b843c47b1A8095ceC887C type: string virtualChainRefundRecipient: description: EVM address of a refund recipient in a virtual chain example: 0xb4c2fbec9d610F9A3a9b843c47b1A8095ceC887C type: string customRecipientMsg: description: |- **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 type: string recipientType: description: |- Type of recipient address: - `DESTINATION_CHAIN` - assets are transferred to the chain of `destinationAsset`. - `INTENTS` - assets are transferred to an account inside Intents enum: - DESTINATION_CHAIN - INTENTS type: string deadline: description: "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 format: date-time type: string referral: description: Referral identifier (lowercase only). It will be reflected in the on-chain data and displayed on public analytics platforms. example: referral type: string quoteWaitingTimeMs: default: 3000 description: "Time in milliseconds the user is willing to wait for a quote\ \ from the relay.\n**If you want to receive the fastest quote - use `0`\ \ as a value** " example: 3000 type: number appFees: description: List of recipients and their fees items: $ref: '#/components/schemas/AppFee' type: array required: - amount - deadline - depositType - destinationAsset - dry - originAsset - recipient - recipientType - refundTo - refundType - slippageTolerance - swapType type: object Quote: properties: depositAddress: description: |- The deposit address on the chain of `originAsset` when `depositType` is `ORIGIN_CHAIN`. The deposit address inside NEAR Intents (the verifier smart contract) when `depositType` is `INTENTS`. example: 0x76b4c56085ED136a8744D52bE956396624a730E8 type: string depositMemo: description: Some of the deposit addresses **REQUIRE** to also include the `memo` for the deposit to be processed example: "1111111" type: string amountIn: description: Amount of the origin asset example: "1000000" type: string amountInFormatted: description: Amount of the origin asset in readable format example: "1" type: string amountInUsd: description: Amount of the origin assets equivalent in USD example: "1" type: string minAmountIn: description: Minimum amount of the origin asset that will be used for the swap example: "995000" type: string amountOut: description: Amount of the destination asset example: "9950000" type: string amountOutFormatted: description: Amount of the destination asset in readable format example: "9.95" type: string amountOutUsd: description: Amount of the destination asset equivalent in USD example: "9.95" type: string minAmountOut: description: Minimum output amount after slippage is applied example: "9900000" type: string deadline: description: Time when the deposit address becomes inactive and funds may be lost example: 2025-03-04T15:00:00Z format: date-time type: string timeWhenInactive: description: "Time when the deposit address becomes cold, causing swap processing\ \ to take longer" example: 2025-03-04T15:00:00Z format: date-time type: string timeEstimate: description: Estimated time in seconds for the swap to be executed after the deposit transaction is confirmed example: 120 type: number virtualChainRecipient: description: EVM address of a transfer recipient in a virtual chain example: 0xb4c2fbec9d610F9A3a9b843c47b1A8095ceC887C type: string virtualChainRefundRecipient: description: EVM address of a refund recipient in a virtual chain example: 0xb4c2fbec9d610F9A3a9b843c47b1A8095ceC887C type: string customRecipientMsg: description: |- **HIGHLY EXPERIMENTAL** Message passed 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 type: string refundFee: description: Fee charged for refunding assets to the refund address in the smallest unit of the origin asset example: "10000" type: string required: - amountIn - amountInFormatted - amountInUsd - amountOut - amountOutFormatted - amountOutUsd - minAmountIn - minAmountOut - timeEstimate type: object QuoteResponse: example: quote: "" signature: signature correlationId: 550e8400-e29b-41d4-a716-446655440000 quoteRequest: "" timestamp: 2019-08-24T14:15:22Z properties: correlationId: description: Unique identifier for request tracing and debugging example: 550e8400-e29b-41d4-a716-446655440000 type: string timestamp: description: Timestamp in ISO format that was used to derive the deposit address example: 2019-08-24T14:15:22Z format: date-time type: string signature: description: Signature of the 1Click service confirming the quote for the specific deposit address. Must be saved on the client side (along with the whole quote) in order to resolve any disputes or mistakes. type: string quoteRequest: allOf: - $ref: '#/components/schemas/QuoteRequest' description: User request quote: allOf: - $ref: '#/components/schemas/Quote' description: Response containing the deposit address for sending the `amount` of `originAsset` and the expected output amount. required: - correlationId - quote - quoteRequest - signature - timestamp type: object BadRequestResponse: example: message: error message properties: message: example: error message type: string required: - message type: object TransactionDetails: properties: hash: description: Transaction hash example: 0x123abc456def789 type: string explorerUrl: description: Explorer URL for the transaction type: string required: - explorerUrl - hash type: object SwapDetails: properties: intentHashes: description: All intent hashes that took part in this swap items: type: string type: array nearTxHashes: description: All NEAR transactions executed for this swap items: type: string type: array amountIn: description: Exact amount of `originToken` after the trade was settled example: "1000" type: string amountInFormatted: description: Exact amount of `originToken` in readable format after the trade was settled example: "0.1" type: string amountInUsd: description: Exact amount of `originToken` equivalent in USD example: "0.1" type: string amountOut: description: Exact amount of `destinationToken` after the trade was settled example: "9950000" type: string amountOutFormatted: description: Exact amount of `destinationToken` in readable format after the trade was settled example: "9.95" type: string amountOutUsd: description: Exact amount of `destinationToken` equivalent in USD example: "9.95" type: string slippage: description: Actual slippage example: 50 type: number originChainTxHashes: description: Hashes and explorer URLs for all transactions on the origin chain items: $ref: '#/components/schemas/TransactionDetails' type: array destinationChainTxHashes: description: Hashes and explorer URLs for all transactions on the destination chain items: $ref: '#/components/schemas/TransactionDetails' type: array refundedAmount: description: Amount of `originAsset` transferred to `refundTo` example: "1000" type: string refundedAmountFormatted: description: Refunded amount in readable format example: "0.1" type: string refundedAmountUsd: description: Refunded amount equivalent in USD example: "0.1" type: string refundReason: description: Reason for refund example: PARTIAL_DEPOSIT type: string depositedAmount: description: Amount deposited to `depositAddress` onchain type: string depositedAmountFormatted: description: Amount deposited in readable format type: string depositedAmountUsd: description: Amount deposited equivalent in USD type: string referral: description: Referral identifier example: referral type: string required: - destinationChainTxHashes - intentHashes - nearTxHashes - originChainTxHashes type: object GetExecutionStatusResponse: example: quoteResponse: "" correlationId: 550e8400-e29b-41d4-a716-446655440000 swapDetails: "" status: KNOWN_DEPOSIT_TX updatedAt: 2000-01-23T04:56:07.000+00:00 properties: correlationId: description: Unique identifier for request tracing and debugging example: 550e8400-e29b-41d4-a716-446655440000 type: string quoteResponse: allOf: - $ref: '#/components/schemas/QuoteResponse' description: Quote response from the original request status: enum: - KNOWN_DEPOSIT_TX - PENDING_DEPOSIT - INCOMPLETE_DEPOSIT - PROCESSING - SUCCESS - REFUNDED - FAILED type: string updatedAt: description: Last time the state was updated format: date-time type: string swapDetails: allOf: - $ref: '#/components/schemas/SwapDetails' description: Details of actual swaps and withdrawals required: - correlationId - quoteResponse - status - swapDetails - updatedAt type: object AnyInputQuoteWithdrawal: properties: status: description: Withdrawal status enum: - SUCCESS - FAILED type: string amountOutFormatted: description: Amount out in readable format example: "9.95" type: string amountOutUsd: description: Amount out in USD example: "9.95" type: string amountOut: description: Amount out in smallest unit example: "9950000" type: string withdrawFeeFormatted: description: Withdrawal fee in readable format example: "0.01" type: string withdrawFee: description: Withdrawal fee in smallest unit example: "10000" type: string withdrawFeeUsd: description: Withdrawal fee in USD example: "0.01" type: string timestamp: description: Timestamp of withdrawal example: 2019-08-24T14:15:22Z type: string hash: description: Transaction hash example: 0x123abc456def789 type: string required: - amountOut - amountOutFormatted - amountOutUsd - hash - status - timestamp - withdrawFee - withdrawFeeFormatted - withdrawFeeUsd type: object GetAnyInputQuoteWithdrawals: example: affiliateRecipient: 0x2527d02599ba641c19fea793cd0f167589a0f10d recipient: 0x2527d02599ba641c19fea793cd0f167589a0f10d asset: nep141:sol-5ce3bf3a31af18be40ba30f721101b4341690186.omft.near withdrawals: "" properties: asset: description: ID of the destination asset. example: nep141:sol-5ce3bf3a31af18be40ba30f721101b4341690186.omft.near type: string recipient: description: Recipient address example: 0x2527d02599ba641c19fea793cd0f167589a0f10d type: string affiliateRecipient: description: Affiliate recipient address example: 0x2527d02599ba641c19fea793cd0f167589a0f10d type: string withdrawals: allOf: - $ref: '#/components/schemas/AnyInputQuoteWithdrawal' description: Details of withdrawals required: - affiliateRecipient - asset - recipient type: object SubmitDepositTxRequest: example: depositAddress: 0x2527D02599Ba641c19FEa793cD0F167589a0f10D nearSenderAccount: relay.tg memo: "123456" txHash: 0x123abc456def789 properties: txHash: description: Transaction hash of your deposit example: 0x123abc456def789 type: string depositAddress: description: Deposit address for the quote example: 0x2527D02599Ba641c19FEa793cD0F167589a0f10D type: string nearSenderAccount: description: Sender account (used only for NEAR blockchain) example: relay.tg type: string memo: description: Memo (use if deposit was submitted with one) example: "123456" type: string required: - depositAddress - txHash type: object SubmitDepositTxResponse: example: quoteResponse: "" correlationId: 550e8400-e29b-41d4-a716-446655440000 swapDetails: "" status: KNOWN_DEPOSIT_TX updatedAt: 2000-01-23T04:56:07.000+00:00 properties: correlationId: description: Unique identifier for request tracing and debugging example: 550e8400-e29b-41d4-a716-446655440000 type: string quoteResponse: allOf: - $ref: '#/components/schemas/QuoteResponse' description: Quote response from the original request status: enum: - KNOWN_DEPOSIT_TX - PENDING_DEPOSIT - INCOMPLETE_DEPOSIT - PROCESSING - SUCCESS - REFUNDED - FAILED type: string updatedAt: description: Last time the state was updated format: date-time type: string swapDetails: allOf: - $ref: '#/components/schemas/SwapDetails' description: Details of actual swaps and withdrawals required: - correlationId - quoteResponse - status - swapDetails - updatedAt type: object securitySchemes: JWT-auth: bearerFormat: JWT description: Enter JWT token (optional) scheme: bearer type: http