Skip to content
Functioncustom-idv0.2.7

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:

  • When no definition owns the wire, or when the matched one refuses it.

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.