One of the most useful Solana related tutorials. Thank you!
I have couple of questions though:
At this point I am getting an AccountNotProgramOwned error which I can understand why, but I don't know how to fix
How can we change the program so that it maintains the state between browser sessions? i.e if I close the browser, re-open and connect my wallet, it would restore my last state instead of starting from scratch?
sounds like a terrible idea for anything beyond a demo. What if the user clears his cookies or use another browser, then he loses his account data and starts from new? I could imagine that a base account could be generated from the public key of the provider/user to have something deterministic which can be safely retrieved and reused
EDIT: the method PublicKey.createWithSeed based on the user address, the program ID and a deterministic storage key that can be hardcoded in the front end app, is actually the solution to this
One of the most useful Solana related tutorials. Thank you!
I have couple of questions though:
local storage.
sounds like a terrible idea for anything beyond a demo. What if the user clears his cookies or use another browser, then he loses his account data and starts from new? I could imagine that a base account could be generated from the public key of the provider/user to have something deterministic which can be safely retrieved and reused
EDIT: the method
PublicKey.createWithSeed
based on the user address, the program ID and a deterministic storage key that can be hardcoded in the front end app, is actually the solution to thisI agree, just for demo purpose. Thanks for sharing the right way.
Have you managed to solve the AccountNotProgramOwned error? I seem to stuck on that error as well.