initialize
request-for-quote
among its list of supported protocols.getSignerSideOrder
senderAmount
the server returns a signed order with a signerAmount
. The client is selling to the server.getSenderSideOrder
signerAmount
the server returns a signed order with a senderAmount
. The client is buying from the server.getSignerSideOrder
or getSenderSideOrder
as JSON-RPC requests.Swap
event on success. The light
function is gas more efficient, whereas the swap
function provides protocol fee rebates to staked AST holders. Either function can settle a properly signed order.Swap
event with the nonce they provided to the client.initialize
last-look
among its list of supported protocols. Additional params may be included for the swapContract
the server intends to use, the senderWallet
the server intends to use, and optionally a senderServer
if the server is not receiving consider
calls over the socket and instead an alternative JSON-RPC over HTTP endpoint. The initialize method either returns true
or throws an error if something went wrong on the client side.subscribe
unsubscribe
updatePricing
true
if accepted by the client.consider
senderServer
this method is to be called on that URL via JSON-RPC over HTTP. Returns boolean true
if accepted by the server.1000
USDT into WETH. Client looks up baseToken USDT and quoteToken WETH and uses the bid
levels above. The first 100
would be multiplied by 0.00053
and second 900
would be multiplied by 0.00061
for a total of 0.602
WETH.1
WETH into USDT. Client looks up baseToken WETH and quoteToken USDT and uses the bid
levels above. The first 0.5
would be multiplied by 2000
and second 0.5
would be multiplied by 2010
for a total of 2005
USDT.1000
USDT. Client looks up baseToken USDT and quoteToken WETH and uses the ask
levels above. The first 100
would be multiplied by 0.00055
and second 90 would be multiplied by 0.00067
for a total of 0.658
WETH.1
WETH. Client looks up baseToken WETH and quoteToken USDT and uses the ask
levels above. The first 0.5
would be multiplied by 2001
and second 90 would be multiplied by 2015
for a total WETH amount of 2008
USDT.x
is provided by the client.1000
USDT into WETH. Client looks up baseToken USDT and quoteToken WETH and uses the bid
levels above. 1000
is multiplied by 0.00053
for a total of 0.53
WETH.1
WETH into USDT. Client looks up baseToken WETH and quoteToken USDT and uses the bid
levels above. 1
is multiplied by 2000
for a total of 2000
WETH.1000
USDT. Client looks up baseToken USDT and quoteToken WETH and uses the ask
levels above. 1000
is multiplied by 0.00055
for a total of 0.55
WETH.1
WETH. Client looks up baseToken WETH and quoteToken USDT and uses the ask
levels above. 1
is multiplied by 2001
for a total of 2001
WETH.initialize
notification to the client.light
function on the Swap contract, which emits a Swap
event on success.Swap
event with the nonce they provided to the server.