Skip to content

Conversation

@pavanjoshi914
Copy link
Contributor

@pavanjoshi914 pavanjoshi914 commented Sep 15, 2025

  1. we cant add conditionals directly in state level to check if mnemonic is present or not as it breaks other connectors
  2. update connector config to use mnemonic passed from account variable
  3. I have to introduce new script to encrypt mnemonic ( we store mnemonic encrypted and when account variable is saved it should have encrypted one and we have decrypt mechanism in settings page when its shown )
  4. but spark don't accepts this encrypted mnemonic so the flow is:: generate and encrypt mnemonic at screen level --> pass to connector when initializing --> decrypt and pass it to initialized method and then rest of the flows such as mnemonic showing in settings page will work

other connectors were broken cause of mnemonic conditionals directly included in state
@pavanjoshi914 pavanjoshi914 changed the title feat: add spark connector (spark init failing) feat: mnemonic generation for spark connector Sep 15, 2025
setLoading(true);

const mnemonic = await api.generateMnemonic();
const encryptedMnemonic = await api.encryptMnemonic(mnemonic);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this OK? I saw we have an existing setMnemonic function which will also derive the nostr key

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we can't use that though because we need the account to be properly setup before validating it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yess! at this stage there is no account stored in db. so we can't use that script

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But what about the nostr key? do we need to do anything there?

Copy link
Contributor

@rolznz rolznz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

@rolznz rolznz merged commit 7d6751d into feat/spark Sep 17, 2025
6 checks passed
@rolznz rolznz deleted the mnemonic-generation-flow branch September 17, 2025 04:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants