Skip to content
Discussion options

You must be logged in to vote

Hello! I'm not sure I will answer your question completely, but I saw your discussion as I'm taking a look at nested codecs as well.
Your last suggestion caught my attention because I think here is a way to get the input and output schemas that you would like to access. As this is not directly documented, I am not sure they are considered "public", but they do exist.
Based on your last code snippet, this seems to work (at least at the type level, I didn't test the runtime)

const PublicKeySetCodec = z.codec(
  z.array(PublicKeyCodec.in),
  z.set(PublicKeyCodec.out),
  { ... }
);

Feel free to discard my comment if I'm off topic, I just thought this might help 🙂

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@0x009922
Comment options

@dosubot
Comment options

@0x009922
Comment options

@julienmonnard
Comment options

Answer selected by 0x009922
@0x009922
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants