solana-labs / solana-web3.js

Solana JavaScript SDK
https://solana-labs.github.io/solana-web3.js
MIT License
2.27k stars 894 forks source link

`programId` field missing in the `TokenBalance` type. #3091

Open kyee-rs opened 3 months ago

kyee-rs commented 3 months ago

Overview

type TokenBalance = {
    accountIndex: number;
    mint: string;
    owner?: string;
    uiTokenAmount: TokenAmount;
};

This type lacks the programId field specified here. However I can not spot the place in code where that type is being generated so I can not make a pull request.

Steps to reproduce

  1. Open the node_modules/@solana/web3.js/lib/index.d.ts (Line 2263 on v1.95.2)

Description of bug

-

buffalojoec commented 3 months ago

Since you've mentioned version 1.95, that change has to be made on the maintenance/v1.x branch. Everything in master is >2.0.

You can find the type here. https://github.com/solana-labs/solana-web3.js/blob/34866e187fbb5309971e4458babda7b3ffedfdd1/src/connection.ts#L1049-L1054

If you're interested in opening a PR, that would be great! Just make sure to update the superstruct validation (field is optional). Thanks!

andiz2 commented 2 weeks ago

I can take care of this