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
Right now, the deck editor is saving the deck locally in-memory - see webdev/src/_app.tsx. Instead, we would like to save the deck on-chain. There seems to be functionality already in place for this that is being used by contracts/src/DeckAirdrop.sol & webapp/src/hooks/useFableWrite.ts.
It also makes sense for the player to be able to name their decks, but the data structure for a deck is just a set of card - not including a name.
This is done when:
The player is able to save their deck onchain from the deck editor.
The deck data structure is updated to include a name.
The deck is no longer saved locally in _app.tsx and the related "todo" is removed.
All the player's decks are loaded and displayed when they navigate to the collection view.
The text was updated successfully, but these errors were encountered:
For reads, we could a bit of architecturing to avoid excessive data fetches, but let's keep things simple for now. You can use the wagmi autogenerated React hooks, here's an example of such from the collection page.
Regarding which contract functions to call, it's all in the Inventory contract., it should be pretty self-explanatory (addCard, getDeck, etc)
You might need to modify those and the Deck structure to add deck names saved on the blockchain.
Don't hesitate to hit me up if you have any question!
Right now, the deck editor is saving the deck locally in-memory - see webdev/src/_app.tsx. Instead, we would like to save the deck on-chain. There seems to be functionality already in place for this that is being used by contracts/src/DeckAirdrop.sol & webapp/src/hooks/useFableWrite.ts.
It also makes sense for the player to be able to name their decks, but the data structure for a deck is just a set of card - not including a name.
This is done when:
The text was updated successfully, but these errors were encountered: