CATProtocol / cat-token-box

A monorepo for packages implementing CAT protocol
https://catprotocol.org
MIT License
186 stars 129 forks source link

if i delete my wallet json,but i still have mnemonic,how to import it #53

Closed swzq121 closed 1 month ago

swzq121 commented 1 month ago

if i delete my wallet json,but i still have mnemonic,how to import it,wallet name is random,if i dont have wallet name,i will cant send my token

billyrestey commented 1 month ago

would be great to have multiple wallets at once, then define which wallet the commands are coming from.

at this point, we can assume having that seed is good enough to recover after removing it from the JSON.

somethingbeta commented 1 month ago

if i delete my wallet json,but i still have mnemonic,how to import it,wallet name is random,if i dont have wallet name,i will cant send my token

modify the code .. replace the bip.Mnemonic with your words .. and then run the cli create new .. it will use your words and you have a new wallet.json

you do this in create.commands.ts .. you see the mnemonic here stick your words in there .. compile run .. and then restore it to the original for safety

const wallet: Wallet = { accountPath: "m/86'/0'/0'/0/0", name: name, mnemonic: <======== };