Protocols
Discovery
getProtocols
Peers may call getProtocols to determine protocols supported by a peer. Protocols are identified by interfaceId and configuration params include the chainId, swapContractAddress, and walletAddress that the peer intends to use.
getProtocols(
): [SupportedProtocolInfo](#supportedprotocolinfo)[]Returns
[SupportedProtocolInfo](#supportedprotocolinfo)[] — Array of supported protocol configurations
setProtocols
When connected via WebSocket, the server may send a setProtocols notification to the client to indicate the protocols it supports.
setProtocols(
protocols: [SupportedProtocolInfo](#supportedprotocolinfo)[], // Array of supported protocol configurations
): booleanParameters
Returns
boolean
getTokens
Peers may call getTokens to determine tokens supported by another peer, whether connected via HTTPS or WebSocket. The return value is an array of tokens identified by the token contract address.
Returns
[Address](#address)[] — Array of token contract addresses
setTokens
When connected via WebSocket, the server may send a setTokens notification to indicate the tokens it supports.
Parameters
Returns
boolean
RequestForQuoteERC20
getSignerSideOrderERC20
Given a senderAmount the server returns a signed OrderERC20 including the signerAmount. The client is selling to the server. Client may optionally request a minimum expiry in seconds.
Parameters
Returns
[OrderERC20](#ordererc20) — Signed ERC20 order
getSenderSideOrderERC20
Given a signerAmount the server returns a signed OrderERC20 with a senderAmount. The client is buying from the server. Client may optionally request a minimum expiry in seconds.
Parameters
Returns
[OrderERC20](#ordererc20) — Signed ERC20 order
getPricingERC20
Client may request soft pricing for a list of token pairs. Client may optionally request a minimum expiry in seconds to be factored into pricing. Returns current formula or levels for each pair.
Parameters
Returns
[Pricing](#pricing)[] — Pricing information for each pair
getAllPricingERC20
Client may request pricing for all available pairs.
Returns
[Pricing](#pricing)[] — Pricing information for all available pairs
LastLookERC20
subscribePricingERC20
Client subscribes to pricing updates for a list of token pairs. Returns current formula or levels for each pair.
Parameters
Returns
[Pricing](#pricing)[] — Current pricing for subscribed pairs
subscribeAllPricingERC20
Client subscribes to pricing updates for all available pairs. Returns current formula or levels for each pair.
Returns
[Pricing](#pricing)[] — Current pricing for all available pairs
unsubscribePricingERC20
Client unsubscribes from pricing updates for a list of token pairs.
Parameters
Returns
boolean
unsubscribeAllPricingERC20
Client unsubscribes from all pricing subscriptions.
Returns
boolean
setPricingERC20
Server updates pricing for one or more token pairs.
Parameters
Returns
boolean
considerOrderERC20
Client provides a priced OrderERC20 to the server. Returns boolean true if accepted by the server. In last-look, the client is the signer and the server is the sender.
Parameters
Returns
boolean — Whether the order was accepted
Indexing
addOrder
Peers may call addOrder to add an order to another peer.
Parameters
tags
string[]
No
Tags to associate with the order
Returns
boolean
getOrders
Peers may call getOrders to query for orders indexed by another peer.
Parameters
offset
integer
No
Pagination offset
limit
integer
No
Maximum number of orders to return
Returns
[OrderResponse](#orderresponse)
getTags
Peers may call getTags to get all available tags for a token.
Parameters
Returns
string[]
IndexingERC20
addOrderERC20
Peers may call addOrderERC20 to add an ERC20 order to another peer.
Parameters
tags
string[]
No
Tags to associate with the order
Returns
boolean
getOrdersERC20
Peers may call getOrdersERC20 to query for ERC20 orders indexed by another peer.
Parameters
offset
integer
No
Pagination offset
limit
integer
No
Maximum number of orders to return
Returns
[OrderResponseERC20](#orderresponseerc20)
getTags
Peers may call getTags to get all available tags for a token.
Parameters
Returns
string[]
Types
Address
Ethereum address (20 bytes)
Bytes32
32-byte hex string
Amount
Numeric string representing an amount
ChainId
Blockchain network chain ID
SupportedProtocolInfo
Information about a supported trading protocol
TokenPair
A pair of tokens for trading
OrderERC20
Signed ERC20 order in AirSwap format
FullOrderERC20
Full ERC20 order including settlement information
FullOrder
Full order for NFT/ERC721 swaps
Pricing
Pricing information for a token pair
Levels
Array of price levels as [baseAmount, quoteAmount] tuples in wei
Formula
Pricing formula where x is the input amount (e.g., 'x*0.00053')
OrderFilter
Filter criteria for querying orders
Indexes
Index to sort orders by
Direction
Sort direction
OrderResponse
Response containing orders and pagination info
OrderResponseERC20
Response containing ERC20 orders and pagination info
Last updated