Skip to main content
POST
TypeScript

Yetkilendirmeler

Authorization
string
header
gerekli

An Account API key, an App API key, an account access token, an account-scoped user token, or a user OAuth token. Prepend the key or token with Bearer, for example Bearer ***************************. See Auth & API keys for how to get each one.

Scopes

payout:transfer_funds

Başlıklar

Idempotency-Key
string

A unique key that makes this request safe to retry. See Idempotent requests.

Maximum string length: 255
Örnek:

"d9105228-4a08-46b1-8b91-42fed586d383"

Gövde

application/json
amount
string
gerekli

Source token amount.

Örnek:

"100"

from_token
string
gerekli

Source token contract address or ticker symbol, such as "USDT".

Örnek:

"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

to_token
string
gerekli

Destination token contract address or ticker symbol, such as "XAUT".

Örnek:

"0x1b64b9025eebb9a6239575df9ea4b9ac46d4d193"

account_id
string

Fiat pairs only: business account to quote the swap for, prefixed biz_. Requires a credential with payout:transfer_funds on that account. Provide this, user_id, or neither for a public quote.

from_address
string | null

Source wallet address used for the quote.

Örnek:

"0x6f1c0a3d5b2e4f8a9c7d1e0b3a5f7c9d2e4b6a80"

from_chain

Source chain name or chain ID. Defaults to the source token's chain when omitted.

Örnek:

"plasma"

metadata
object

Metadata to include with the quote response.

Örnek:
slippage_bps
integer | null

Maximum slippage tolerance in basis points.

Örnek:

50

to_address
string | null

Destination wallet address used for the quote.

Örnek:

"0x9d2e4b6a806f1c0a3d5b2e4f8a9c7d1e0b3a5f7c"

to_chain

Destination chain name or chain ID. Defaults to the destination token's chain when omitted.

Örnek:

"plasma"

user_id
string

Fiat pairs only: the caller's own user ID, prefixed user_, to quote the swap for their personal account. Provide this or account_id.

Yanıt

swap quote created

amount_in
string
gerekli

Source token amount used for the quote.

Örnek:

"100"

amount_out
string
gerekli

Estimated destination token amount.

Örnek:

"0.15"

fee_bps
integer
gerekli

Whop fee in basis points.

Örnek:

100

from_token
object
gerekli

Resolved source token details.

Örnek:
metadata
object
gerekli

Metadata from the request.

Örnek:
object
enum<string>
gerekli
Mevcut seçenekler:
swap_quote
Örnek:

"swap_quote"

rate
string
gerekli

Quoted exchange rate.

Örnek:

"1.5"

to_token
object
gerekli

Resolved destination token details.

Örnek:
amount_out_min
string

Minimum destination amount after slippage.

Örnek:

"0.148"

bridge_fee
string | null

Estimated bridge fee for cross-chain swaps.

Örnek:

"0.25"

estimated_duration_seconds
integer | null

Estimated time for the swap to complete.

Örnek:

30

from_address
string | null

Source wallet address used for the quote.

Örnek:

"0x6f1c0a3d5b2e4f8a9c7d1e0b3a5f7c9d2e4b6a80"

requires_token_approval
boolean | null

Whether the source token needs approval before swapping.

Örnek:

true

to_address
string | null

Destination wallet address used for the quote.

Örnek:

"0x9d2e4b6a806f1c0a3d5b2e4f8a9c7d1e0b3a5f7c"