0

We have an all frontend app built in react-native that is supposed to allow users to view their balances, NFTs, and send transactions. This all works when the client first imports their wallet as an instance of the Wallet is saved. However, I noticed that if they stop using the app and then open it again the Wallet instance turns into a plain Object with just _isSigner, address, and provider keys and that built in functions like "signTransaction" are now undefined.

When user imports wallet

Wallet {
    "_isSigner": true,
    "_mnemonic": [Function anonymous],
    "_signingKey": [Function anonymous],
    "address": "<address-here>",
    "provider": null,
  }

When user signs back in

Object {
  "_isSigner": true,
  "address": "<address-here>",
  "provider": null,
}

Since our app is all frontend is there a safe way to renew the wallet instance? I don't want to save their privateKey in a variable since it is all done on the frontend but right now that's the only way that I can figure out to re-create the wallet each time so that they can send transactions.

What is the suggested method for a persisting all-frontend app to keep a wallet instance active?

Jake Mulhern
  • 660
  • 5
  • 13

0 Answers0