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
Convert Caip10AddressesPipe to Caip10AddressesSchema and infer type from it
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
Caip10AddressesPipe
toCaip10AddressesSchema
and infer type from it