Skip to main content
POST
TypeScript

Autorisationer

Authorization
string
header
påkrævet

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

Overskrifter

Idempotency-Key
string

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

Maximum string length: 255
Eksempel:

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

Krop

application/json
amount
string
påkrævet

Source token amount.

Eksempel:

"100"

from_token
string
påkrævet

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

Eksempel:

"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

to_token
string
påkrævet

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

Eksempel:

"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.

Eksempel:

"0x6f1c0a3d5b2e4f8a9c7d1e0b3a5f7c9d2e4b6a80"

from_chain

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

Eksempel:

"plasma"

metadata
object

Metadata to include with the quote response.

Eksempel:
slippage_bps
integer | null

Maximum slippage tolerance in basis points.

Eksempel:

50

to_address
string | null

Destination wallet address used for the quote.

Eksempel:

"0x9d2e4b6a806f1c0a3d5b2e4f8a9c7d1e0b3a5f7c"

to_chain

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

Eksempel:

"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.

Svar

swap quote created

amount_in
string
påkrævet

Source token amount used for the quote.

Eksempel:

"100"

amount_out
string
påkrævet

Estimated destination token amount.

Eksempel:

"0.15"

fee_bps
integer
påkrævet

Whop fee in basis points.

Eksempel:

100

from_token
object
påkrævet

Resolved source token details.

Eksempel:
metadata
object
påkrævet

Metadata from the request.

Eksempel:
object
enum<string>
påkrævet
Tilgængelige muligheder:
swap_quote
Eksempel:

"swap_quote"

rate
string
påkrævet

Quoted exchange rate.

Eksempel:

"1.5"

to_token
object
påkrævet

Resolved destination token details.

Eksempel:
amount_out_min
string

Minimum destination amount after slippage.

Eksempel:

"0.148"

bridge_fee
string | null

Estimated bridge fee for cross-chain swaps.

Eksempel:

"0.25"

estimated_duration_seconds
integer | null

Estimated time for the swap to complete.

Eksempel:

30

from_address
string | null

Source wallet address used for the quote.

Eksempel:

"0x6f1c0a3d5b2e4f8a9c7d1e0b3a5f7c9d2e4b6a80"

requires_token_approval
boolean | null

Whether the source token needs approval before swapping.

Eksempel:

true

to_address
string | null

Destination wallet address used for the quote.

Eksempel:

"0x9d2e4b6a806f1c0a3d5b2e4f8a9c7d1e0b3a5f7c"