Skip to content

Shield a deposit

Shield an authorized token deposit from its Ethereum deposit address.

Endpoint
POST /relayer/v1/deposits/shield

Examples

Save the request prepared by your wallet as shield-deposit.json.

cURL
curl -sS "https://api-testnet.veylor.cash/relayer/v1/deposits/shield" \
  -H 'Content-Type: application/json' \
  --data-binary @shield-deposit.json
HTTP 200
{
  "transactions": [
    "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
  ]
}

Request body

object · ShieldDeposit

Field JSON type Presence Meaning
chainId integer · Uint64 Required EIP-155 chain ID of the settlement network.
contract string · EthereumAddress Required Pinned Deposits contract.
from string · EthereumAddress Required Public deposit address that signed the authorization.
value string · DecimalUint128 Required Token amount to shield before fees, in base units.
validAfter integer · UnixSeconds Required Lower time bound of the token authorization, in Unix seconds.
validBefore integer · UnixSeconds Required Authorization expiry in Unix seconds.
note object · RelayerNote Required RAILGUN shield destination and ciphertext.
fee string · DecimalUint128 Required Authorized relayer fee in token base units.
signature string · EthereumSignature Required EIP-3009 ReceiveWithAuthorization signature from the deposit address.
Fields of note
Field JSON type Presence Meaning
npk string · Hex32 Required 32-byte note public key.
encryptedBundle array of string · Hex32 (exactly 3) Required Three ordered 32-byte ciphertext words.
shieldKey string · Hex32 Required 32-byte shield encryption public key.

Responses

HTTP 200

object · RelayerSent

Field JSON type Presence Meaning
transactions array of string · Hex32 Required Ethereum transaction hashes known to the relayer. Some idempotent operations can return an empty list.

Errors

HTTP Body Meaning
400 object · ErrorResponse Malformed input or a request rejected for this swap.
409 object · RelayerConflict A conflicting or already spent authorization may have transaction hashes to reconcile.
413 object · ErrorResponse The request exceeds the service’s body limit.
415 object · ErrorResponse Use Content-Type: application/json.
422 object · ErrorResponse The JSON fields or encoded values do not match the request type.
503 object · ErrorResponse Temporarily unavailable, throttled, or waiting for a chain event. Respect Retry-After when present. Retry-After — Seconds to wait before retrying, when supplied.
Other object · ErrorResponse Other service error. Read code and error.
ErrorResponse fields
Field JSON type Presence Meaning
code string · ErrorCode Required Machine-readable service error code.
error string Required Human-readable detail.
RelayerConflict fields
Field JSON type Presence Meaning
code string · ErrorCode Required Machine-readable cause, such as alreadySpent or conflict.
error string Required Human-readable detail.
transactions array of string · Hex32 Required Known Ethereum transaction hashes. Can be empty.