Function create_relayer

Source
pub async fn create_relayer<J, RR, TR, NR, NFR, SR, TCR, PR>(
    request: CreateRelayerRequest,
    state: ThinDataAppState<J, RR, TR, NR, NFR, SR, TCR, PR>,
) -> Result<HttpResponse, ApiError>
Expand description

Creates a new relayer.

§Arguments

  • request - The relayer creation request.
  • state - The application state containing the relayer repository.

§Returns

The created relayer or an error if creation fails.

§Validation

This endpoint performs comprehensive dependency validation before creating the relayer:

  • Signer Validation: Ensures the specified signer exists in the system
  • Signer Uniqueness: Validates that the signer is not already in use by another relayer on the same network
  • Notification Validation: If a notification ID is provided, validates it exists
  • Network Validation: Confirms the specified network exists for the given network type

All validations must pass before the relayer is created, ensuring referential integrity and security constraints.