solana-program-library
solana-program-library copied to clipboard
token-js: Properly support `OptionalNonZeroPubkey`
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.