Skip to content
Functioncustom-idv0.3.0

decodeFor

Decode a wire against several customIds at once, for a handler serving more than one.

Matching runs on the prefix. The result pairs the matched prefix with that definition's own params. Switching on prefix narrows both together.

Throws:

  • The invalid error from setCustomIdErrors when no definition owns the wire.

  • What decode throws when the matched definition rejects the wire.

decodeFor<Defs>(
    defs: Defs,
    wire: string
): DecodedRoute<Defs>

Defs

Defs

defs

defs: Defs

The customId definitions to try, in order.

wire

wire: string

The customId string from the interaction.