solana-program-library icon indicating copy to clipboard operation
solana-program-library copied to clipboard

token-js: Properly support `OptionalNonZeroPubkey`

Open joncinque opened this issue 2 years ago • 0 comments

Problem

In order to pack things efficiently and properly use the bytemuck Zeroable and Pod traits, the extensions use OptionalNonZeroPubkey, which maps to None if the pubkey is all zeroes, and Some(pubkey) for all other values. Unfortunately, these are all currently mapped as PublicKey in token-js.

Solution

Map these types to PublicKey? with the proper conversions.

joncinque avatar Jun 17 '22 21:06 joncinque