-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
ts: minor update for Provider.publicKey #2665
Comments
This is a breaking change so it's not really a "minor update". |
@acheroncrypto what do you think if we only update the first bullet?
The above code throws this error due to mismatched type definition of
It would be beautiful if we could have these types matched together so that we do not create ugly code like below:
|
Does this not work if you use |
|
Please give an example on what you want to do. |
For example I wanted to implment a model where it reads & writes data from and to onchain in object oriented manner.
This will work for both wallet connected & not connected cases, while |
Thanks for the example! However, I generally side with not making breaking changes if the change doesn't bring massive advantages. I understood your problem but it doesn't seem like it would be too hard to fix it: const wallet = useAnchorWallet();
const provider = wallet
? new AnchorProvider(connection, wallet, opts)
: { connection };
const program = new Program(idl, provider); I'm not exactly sure how much breakage #2838 causes, which is why I'm hesitant. I also prefer optional |
Summary of Changes
Provider.publicKey
toPublicKey | null
so that it can be compatible with@solana/wallet-adapter-react
's WalletContextState.publicKeyChange type of first param ofAccountClient.createInstruction
fromSigner
intoPublicKey
sinceSigner
is never used forTransactionInstruction
The text was updated successfully, but these errors were encountered: