-
Notifications
You must be signed in to change notification settings - Fork 910
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added programId field in TokenBalance type #3592
Added programId field in TokenBalance type #3592
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding this property to the TypeScript type is insufficient to vend it to the caller.
Look here:
To get your PRs in faster, make sure to test your changes, to write down in your PR description exactly what you did, and to paste in the results as proof that the code works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To get your PRs in faster, make sure to test your changes, to write down in your PR description exactly what you did, and to paste in the results as proof that the code works.
Doing this will make it really easy for me to accept your PR with high confidence.
-
Run code quality scripts
pnpm test:lint && pnpm test:typecheck && pnpm test:prettier
-
Build the code
pnpm compile:js && pnpm compile:typedefs
-
Start a REPL
pnpm node > const { Connection } = require('./lib/index.cjs.js'); > const connection = new Connection('https://api.devnet.solana.com');
-
Do your testing. Use the
connection
instance to make a query, show that theprogramId
field materializes on the response, and that there are no fatals. Paste all of your steps and results into the PR description.
src/connection.ts
Outdated
@@ -2330,6 +2331,7 @@ const TokenBalanceResult = pick({ | |||
accountIndex: number(), | |||
mint: string(), | |||
owner: optional(string()), | |||
programId:optional(string()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can see that you haven't run any tests or build scripts, because this line of code isn't formatted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost!
The data structure you edited is called TokenBalance
You can see it in use here:
And here:
Those properties are materialized here:
And here:
Look at all of the RPC calls that materialize ConfirmedTransactionMetaResult
and ParsedConfirmedTransactionMetaResult
.
You'll see that one such call is this one:
So find out where that is used:
And there we have an actual RPC call you can make; getTransaction()
. There are many others, but this is one. You could conceive of a transaction that you could get, then check result.meta.postTokenBalances
to see if you got the new property!
Just make sure you actually use a transaction that involves SPL tokens, or that array will be empty and you won't learn anything.
Beautiful. Thank you! |
526ce5f
into
solana-labs:maintenance/v1.x
🎉 This PR is included in version 1.95.5 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Thank you so much @steveluscher |
Because there has been no activity on this PR for 14 days since it was merged, it has been automatically locked. Please open a new issue if it requires a follow up. |
Tackles the issue (#3091)
Done proper linting , built and complied properly , also tested to see if programId returns as expected ,
also added the screenshots
Please tell me if I am missing something and Thank you for being patient and helping me through this.