Skip to content

WebSockets

The relayer is setup to receive WebSockets connections at the endpoint /ws.

Clients can issue requests to the relayer by sending appropriately formatted data.

Websockets Requests

Send Transaction to EVM Network

The most fundamental aspect of a relayer, is to send transactions on behalf of clients.

relayWithdraw

Data Formatting

{
    evm: {
        chain: <string>
        contract: <string>
        proof: <string>
        root: <string>
        nullifierHash: <string>
        recipient: <string>
        relayer: <string>
        fee: <string>
        refund: <string>
    }
}

Field Explanations

  • chain: The name of the chain to withdraw from.
  • contract: The contract address to withdraw from.
  • proof: The client-side generated proof from secret values. The proof should be generated with appropriate relayer and fee values from the info query.
  • root: The historical merkle root for which the proof was constructed.
  • nullifierHash: The hash of one of the secret values, nullifier, for which the mixer can mark a commitment as spent.
  • recipient: The address for which the funds (denomination - fee) will be sent.
  • relayer: The address for which the fee will be sent.
  • fee: The amount to provide to the relayer.
  • refund: Should be '0' for native tokens, and equivalent to the denomination for ERC20 mixers.