Overview
RelayerClient handles communication with a relayer proxy for fee-sponsored transactions. It’s created automatically when you pass relayerUrl to SmartAccountKit, and accessed via kit.relayer.
Via SmartAccountKit (Recommended)
Configure arelayerUrl and the SDK handles routing automatically:
Direct Usage
send()
Submit a transaction via func + auth (for invokeHostFunction flows). The relayer wraps it in a fee bump and sponsors fees.
sendXdr()
Submit a fully signed transaction XDR. Used for deployments and other non-invoke flows.
Response
Error Codes
| Code | Description |
|---|---|
NETWORK_ERROR | Could not reach the relayer |
SUBMISSION_FAILED | Relayer received the request but the transaction failed |
INVALID_REQUEST | Malformed request |
TIMEOUT | Relayer did not respond in time |