githubEdit

computer-mouseAggregate fees from any token into desired asset

1Click Swap — ANY_INPUT

Purpose: Aggregate fees from any supported token into one destinationAsset, then auto-withdraw once the pool hits $1,000 USD.

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.

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 <JWT> to receive the quote (and depositAddress).

Tip: quoteWaitingTimeMs5000–10000 (3–4s often OK).


Create ANY_INPUT quote (example request)


ANY_INPUT Withdrawals

Endpoint

GET /any-input/withdrawals

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.

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.

ANY_INPUT Withdrawals response

Last updated