-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Motivation
The Solana RPC method accountSubscribe does provide a way to pass encoding so should the JS SDK
Example use case
solanaConnection.onAccountChange(
publicKey,
(updatedProgramInfo, context) =>
console.log(updatedProgramInfo.data),
"confirmed"
);The way this function has the commitment arguement it should have one for encoding too. Maybe just make the third arguement take an object with commitment and encoding as two fields of it.
Right now the data the above code logs is like -
<Buffer 06 00 00 00 00 00 00 00 fe 00 00 00 00 00 00 00 07 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 09 00 00 00 00 00 00 00 09 00 00 00 00 00 00 00 01 00 ... 702 more bytes>
This data can't be much used and JSON data will be much more appreciated like the accountSubscribe method returns.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request