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.
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.
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.
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.
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.
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.
getSignerSideOrderERC20(
chainId: [ChainId](#chainid), // The blockchain network chain ID
swapContract: [Address](#address), // Address of the AirSwap SwapERC20 contract
senderAmount: [Amount](#amount), // Amount of tokens the sender will provide (in wei)
signerToken: [Address](#address), // Address of the token the signer will provide
senderToken: [Address](#address), // Address of the token the sender will provide
senderWallet: [Address](#address), // Address of the sender's wallet
minExpiry?: [Amount](#amount), // Minimum expiry in seconds (optional)
proxyingFor?: [Address](#address), // Address being proxied for (optional)
): [OrderERC20](#ordererc20)
getSenderSideOrderERC20(
chainId: [ChainId](#chainid), // The blockchain network chain ID
swapContract: [Address](#address), // Address of the AirSwap SwapERC20 contract
signerAmount: [Amount](#amount), // Amount of tokens the signer will provide (in wei)
signerToken: [Address](#address), // Address of the token the signer will provide
senderToken: [Address](#address), // Address of the token the sender will provide
senderWallet: [Address](#address), // Address of the sender's wallet
minExpiry?: [Amount](#amount), // Minimum expiry in seconds (optional)
proxyingFor?: [Address](#address), // Address being proxied for (optional)
): [OrderERC20](#ordererc20)
getPricingERC20(
pairs: [TokenPair](#tokenpair)[], // Array of token pairs to get pricing for
minExpiry?: [Amount](#amount), // Minimum expiry in seconds (optional)
): [Pricing](#pricing)[]
getAllPricingERC20(
): [Pricing](#pricing)[]
subscribePricingERC20(
pairs: [TokenPair](#tokenpair)[], // Array of token pairs to subscribe to
minExpiry?: [Amount](#amount), // Minimum expiry in seconds (optional)
): [Pricing](#pricing)[]
unsubscribePricingERC20(
pairs: [TokenPair](#tokenpair)[], // Array of token pairs to unsubscribe from
): boolean
unsubscribeAllPricingERC20(
): boolean
setPricingERC20(
pricing: [Pricing](#pricing)[], // Array of pricing updates
): boolean
considerOrderERC20(
nonce: [Amount](#amount), // Unique order nonce
expiry: [Amount](#amount), // Order expiry timestamp
signerWallet: [Address](#address), // Address of the signer's wallet
signerToken: [Address](#address), // Address of the token the signer will provide
signerAmount: [Amount](#amount), // Amount of tokens the signer will provide
senderToken: [Address](#address), // Address of the token the sender will provide
senderAmount: [Amount](#amount), // Amount of tokens the sender will provide
v: [Amount](#amount), // ECDSA signature recovery parameter
r: [Bytes32](#bytes32), // ECDSA signature r parameter
s: [Bytes32](#bytes32), // ECDSA signature s parameter
): boolean
addOrder(
order: [FullOrder](#fullorder), // The full order to add
tags?: string[], // Tags to associate with the order
): boolean
getOrders(
filter: [OrderFilter](#orderfilter), // Filter criteria for orders
offset?: integer, // Pagination offset
limit?: integer, // Maximum number of orders to return
by?: [Indexes](#indexes), // Index to sort by
direction?: [Direction](#direction), // Sort direction
): [OrderResponse](#orderresponse)
addOrderERC20(
order: [FullOrderERC20](#fullordererc20), // The full ERC20 order to add
tags?: string[], // Tags to associate with the order
): boolean
getOrdersERC20(
filter: [OrderFilter](#orderfilter), // Filter criteria for orders
offset?: integer, // Pagination offset
limit?: integer, // Maximum number of orders to return
by?: [Indexes](#indexes), // Index to sort by
direction?: [Direction](#direction), // Sort direction
): [OrderResponseERC20](#orderresponseerc20)