Moving-Castles / this-cursed-machine

Body horror fulfilment center simulator
MIT License
23 stars 3 forks source link

Adapt onboarding to account-kit #250

Closed pwrstudio closed 2 weeks ago

pwrstudio commented 1 month ago

I am working on integrating account-kit on this branch: https://github.com/Moving-Castles/this-cursed-machine/tree/account-kit-3

It works fairly well. The modal is set up and returns a viem wallet client.

What we would like to do is integrate this with our existing onboarding.

Right now we call the mud setup here: https://github.com/Moving-Castles/this-cursed-machine/blob/21c206bb6cc43135774a523c65e6769347b9b2fd/packages/client/src/svelte/App.svelte#L82

This will create a burner wallet, and fund it from a faucet if we are on garnet.

If the environment is ENVIRONMENT.REDSTONE or ENVIRONMENT.GARNET_WALLET we want to prompt the user to connect their wallet etc.. in this place in the spawn sequence: https://github.com/Moving-Castles/this-cursed-machine/blob/21c206bb6cc43135774a523c65e6769347b9b2fd/packages/client/src/svelte/components/Spawn/narrative.ts#L91

Otherwise we would like to keep the burner and skip the account-kit modal.

For localhost it would be great to have a url param to toggle the account-kit modal, for testing. If not set we use the burner.

I guess this would mean either moving the mud-setup function call to after the account-kit modal or replacing the wallet client after we get it back. The latter would be preferable to us.