safe-global / safe-client-gateway

Serves as a bridge for the Safe{Wallet} clients (Android, iOS, Web)
https://docs.safe.global
MIT License
27 stars 64 forks source link

Convert CAIP-10 address validation to schema #2110

Closed iamacook closed 4 days ago

iamacook commented 1 week ago

Summary

We currently validate CAIP-10 addresses with a custom pipe. Whilst this works, it does not throw our custom error used for validation detection (ZodErrorWithCode).

This converts the pipe to a new schema, called within a ValidationPipe. This therefore means the correct error is thrown, and can be detected.

Changes