Skip to content

Consider using type generics with the StacksTransactionWire type #1776

@aryzing

Description

@aryzing

Problem

Different transaction types often require dedicated code. However, even after checking the payload type, the payload needs to be kept in its own variable to preserve any type checks or assertions. There is no way to assert that a transaction has a given payload type

Solution

Introduce generics for transaction types. Something like

type StacksTransactionWire<TPayload = PayloadWire> = {
  payload: TPayload
  // ... other props
}

This would allow typing a given transaction's payload (and possibly other internal structures) without having to keep them as separate variables.

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureBrand new functionality. New pages, workflows, endpoints, etc.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions