You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use coption / COption
I use the code provided by the doc
Code used:
import*asweb3from'@solana/web3.js';import*asbeetfrom'@metaplex-foundation/beet';import*asbeetSolanafrom'@metaplex-foundation/beet-solana';typeInstructionArgs={authority: web3.PublicKey;maybePublickKey: beet.COption<web3.PublicKey>;};// Uses the BeetArgsStruct wrapper around BeetStructconstcreateStruct=newbeet.BeetArgsStruct<InstructionArgs>([['authority',beetSolana.publicKey],['maybePublickKey',beet.coption(beetSolana.publicKey)],],'InstructionArgs');
But I have a typescript error on beet.coption(beetSolana.publicKey)
Do you have any idea where it came from?
Error:
Type 'FixableBeet<COption<PublicKey>, Partial<COption<PublicKey>>>' is missing the following properties from type 'BeetReadWrite<COption<PublicKey>, Partial<COption<PublicKey>>>': write, read, byteSize
The text was updated successfully, but these errors were encountered:
olivbau
changed the title
Trying to use coption
Trying to use coption / COption
Jan 27, 2023
This error message is indicating that the coption function is returning a FixableBeet type instead of a BeetReadWrite type. This is likely due to a version mismatch between the @metaplex-foundation/beet and @metaplex-foundation/beet-solana packages.
Try updating both packages to the latest version and see if the error persists. You can do this by running the following command in your terminal:
I'm trying to use
coption
/COption
I use the code provided by the doc
Code used:
But I have a typescript error on
beet.coption(beetSolana.publicKey)
Do you have any idea where it came from?
Error:
The text was updated successfully, but these errors were encountered: