Skip to main content

API Documentation

WebSocket API

Solver Register: GET /ws

Request Scheme

NameTypeDescription
typeStringType of request: "solver_register"
payloadObjectPayload
payload.solver_idStringId of solver
payload.solver_addressesString[]Addresses of solver in Ethereum and Solana chains
hashU256 as HEX StringHash for validity check of the first payload.solver_addresses
signatureObjectECDSA signature for validity check of the first payload.solver_addresses
signature.rU256 as HEX StringR component of ECDSA signature
signature.sU256 as HEX StringS component of ECDSA signature
signature.vU64V component of ECDSA signature

Request Example

{
"type": "solver_register",
"payload": {
"solver_id": "Solver No. 52",
"solver_addresses": [
"0xaAF737A96d9Fc3D5B8018264AB7DE03b785bAbC1", // Ethereum
"HEgX7JBvL156twQiLtnyTt3hn6djpXcBaduMb1FKfc4t" // Solana
]
},
"hash": "0x1af17a664e3fa8e419b8ba05c2a173169df76162a5a286e0c405b460d478f7ef",
"signature": {
"r": "0x0",
"s": "0x0",
"v": 0
}
}

Response Scheme

NameTypeDescription
typeStringType of response: ["solver_register_response", "error_response"]
messageStringMessage of response

Messages:

TypeMessage
"solver_register_response""Solver was successfully registered"
"error_response""solver_addresses array is empty"
"error_response""The signature does not match the expected address payload.solver_addresses[0]"
"error_response""Verification failed due to an error: Failed to recover address"
"error_response""Verification failed due to an error: Failed to parse expected address"

Response Example

{
"type": "solver_register_response",
"message": "Solver was successfully registered"
}

Auction: GET /ws

Request Scheme

NameTypeDescription
typeStringType of request: "auction"
payloadObjectPayload
payload.intent_idU256 as StringIntent Id
payload.solver_idStringSolver Id
payload.amountU256 as StringAmount
hashHEX U256 as StringHash for validity check of the solver address specified on Solver Register
signatureObjectECDSA signature for validity check of the solver address specified on Solver Register
signature.rHEX U256 as StringR component of ECDSA signature
signature.sHEX U256 as StringS component of ECDSA signature
signature.vU64V component of ECDSA signature

Request Example

{
"type": "auction",
"payload": {
"intent_id": "137",
"solver_id": "Solver No. 52",
"amount": "31"
},
"hash": "0x1af17a664e3fa8e419b8ba05c2a173169df76162a5a286e0c405b460d478f7ef",
"signature": {
"r": "0x0",
"s": "0x0",
"v": 0
}
}

Response Success Scheme

NameTypeDescription
typeStringType of response: "auction_response"
intent_idStringId of Intent
amountStringAmount
messageStringMessage of response

Messages

TypeMessage
"auction_response""You won this auction!"
"auction_response""You lost this auction."

Response Success Example

{
"type": "auction_response",
"intent_id": "137",
"amount": "31",
"message": "You won this auction!"
}

Response Error Scheme

NameTypeDescription
typeStringType of response: "error_response"
messageStringMessage of response

Messages

TypeMessage
"error_response""The signature does not match the expected address payload.solver_addresses[0]"
"error_response""No Ethereum solver address found for the given solver_id"
"error_response""No solver found for the given solver_id"
"error_response""Verification failed due to an error: Failed to recover address"
"error_response""Verification failed due to an error: Failed to parse expected address"
"error_response""Auction finished for this intent_id: intent_id"
"error_response""No auction found for this intent_id: intent_id"
"error_response""No solver participated in this auction for intent_id: intent_id"
"error_response""No intent found for the given intent_id: intent_id"
"error_response""Unsupported destination chain: intent.dst_chain"
"error_response""Invalid amount_in format for intent_id: intent_id"
"error_response""Invalid timeout format for intent_id: intent_id"
"error_response""Invalid amount format for intent_id: intent_id"
"error_response""Failed to update intent on Ethereum for intent_id intent_id"
"error_response""Solver address for intent.dst_chain not found"
"error_response""Error updating intent on intent.dst_chain with id intent_id"

Response Error Example

{
"type": "error_response",
"message": "No Ethereum solver address found for the given solver_id"
}