Closed gaylonalfano closed 2 years ago
Hi @gaylonalfano my apologies for my late reaction, I was some days off because vacations. Thanks so much for reaching me out, I will try to explain one by one your questions:
walletStore
it not the same than workSpace
. Both are Svelte stores but the first is the wallet itself, or in other words, the store is loaded every time you connect your wallet. The second one is a store mounted after the connection too, but with some useful data to be shared among your components. Why are they separated? workSpace
store is different when you work with Anchor or Solana, and I didn't want to contaminate the walletStore
with data with another purpose. Please, let me know if you have more questions. You can find me on Discord too silvestrevivo#8027
Thank you for the reply! I've been experimenting with this for the past few days and have gradually learned the differences between the two, but thank you for clarifying!
One question I have for you is how would you recommend using this wallet adapter when dealing with multiple Anchor programs inside a single repo?
Here's my working example for reference but just curious if this is a good approach. You'll see I've cloned your other project dapp-scaffold-svelte into a starter Anchor project (anchor init
). I then created multiple generic programs using anchor new [program-name]
. I had to reset the AnchorConnectionProvider
inside new routes to update the Anchor workspace. So far it seems to work just fine, but curious if this is how you'd do something like this?
I really love the simplicity of Svelte for my simple needs, so thank you again for integrating it so nicely with Anchor! Really has sped up my development. Ciao for now!
I think your approach is correct, but if I am not wrong, you can not use at the same time different anchor programs injected in the front end. The way to switch between contracts in the frontend is importing the IDL of each of the contracts. Does that make sense for your problem?
Yes, this is what I've been experimenting with and so far it's working well swapping in/out IDLs. I'm not sure if this is a sound approach, but it's working well and it's nice for me to experiment with various simple programs via the frontend/UI.
Again, thank you so much for your contributions! It's very educational for me reading through your code!
Hi there! Fantastic adapter and thank you so much for putting this together! I didn't know where best to reach out (if there is a Discord server or something, please let me know). A few quick questions for you:
Again, thank you so much for this helpful package and thanks for clarifying these questions for me.
Cheers!