Skip to content

Wrong return type for connection.getParsedBlock() when transactionDetails is full #3773

@pedrobranco

Description

@pedrobranco

Hello team,

When using the method connection.getParsedBlock() with the option rawConfig with property transactionDetails: 'full', the return type definition is ParsedAccountsModeBlockResponse, which should be the full object ParsedBlockResponse according to the JSON RPC documentation, the following comment here and the function body here:

  /**
   * Level of transaction detail to return, either "full", "accounts", "signatures", or "none". If
   * parameter not provided, the default detail level is "full". If "accounts" are requested,
   * transaction details only include signatures and an annotated list of accounts in each
   * transaction. Transaction metadata is limited to only: fee, err, pre_balances, post_balances,
   * pre_token_balances, and post_token_balances.
   */
  transactionDetails?: 'accounts' | 'full' | 'none' | 'signatures';

I can open a PR with the fix replacing the default return value to Promise<ParsedBlockResponse>.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions