PortalSwaps

class PortalSwaps(apiKey: String, portal: Portal)

Deprecated

PortalSwaps has been replaced by 0x trading. Please use 'portal.trading.zeroX' instead.

Replace with

portal.trading.zeroX

Handles swap-related operations such as fetching quotes and sources for token swaps.

Parameters

apiKey

The API key used for authentication.

portal

The Portal instance used to interact with the API.

Constructors

Link copied to clipboard
constructor(apiKey: String, portal: Portal)

Functions

Link copied to clipboard
suspend fun getQuote(chainId: String, args: QuoteArgs): Result<Quote>

Retrieves a swap quote for the specified blockchain network.

Link copied to clipboard
suspend fun getSources(chainId: String): Result<Map<String, String>>

Fetches the available swap sources for the specified blockchain network.