How To Use F-Kit Blueprints
Last updated
Last updated
The flow to create a new wallet is pretty straight forward
It is enough to call the “CreateNewWallet” function from the SolanaWalletManager.
From the returned Wallet object it is mandatory to set a new password: this can be done with the “SetPassword” function.
Then it is mandatory to generate a Mnemonic for the given Wallet. This can be done with the “GenerateMnemonic” function. The Sting returned is the “SeedPhrase” that can be used to restore the wallet.
The new Wallet needs at least an account. An account can be generated with the “GenerateNewAccount” function.
Finally, the created wallet can be saved to the local system. This is done with the “SetSaveSlotName” and “SaveWallet” functions. The SaveSlotName parameter is suggested to be a combination of the wallet name and the public key of the wallet.
A wallet can be recovered both with “PrivateKey” or “SeedPhrase”.
In order to restore a wallet you need to create a new Wallet object as shown in the first step of the “Create Wallet Flow”.
From the created Wallet object, you need to restore the Mnemonic
Then, in order to retrieve the accounts, a derivation path must be selected
Then it is needed to set a new password for the wallet and save it as seen in the “Create Wallet” flow.
From the created wallet object, it is enough to call the “ImportAccountFromPrivateKey”
Then it is needed to set a new password for the wallet and save it as seen in the “Create Wallet” flow.
In order to login to an existing wallet it is enought to retrieve the existing wallet from a “SaveSlotName” using the “GetOrCreateWallet” and then calll the “UnlockWallet” function providing the correct password.