Keypair
- Creates an instance of
WalletKeypar
using password.
This method is used to restore a wallet keypair. The Keypair contains some essential information, such as:- address
- public key
- key store
and so on, and it is used for pretty much any personalized operation that user can do using FindoraSdk
<string>
- Password to be used to generate an encrypted KeyStore
Promise<WalletKeypar>
- An instance ofWalletKeypar
const password = "qsjEI%123";
// Create a wallet info object using given password
const walletPair = await Keypair.createKeypair(password);
- Get wallet address by given public key
Using this function user can retreive the wallet address by given public key
<string>
- Public key
Promise<string>
- A wallet address.
const pubkey = "qsjEI%123";
// Get wallet address by public key
const walletAddress = await Keypair.getAddressByPublicKey(pubkey);
- Create an instance of
LightWalletKeypair
using given wallet address.
This method is used to create a light version of the WalletKeypar using given wallet address.The LightWalletKeypair contains two essential information:- address
- public key
It's a light version of the WalletKeypar, containing only address and publickey
<string>
- Wallet address
Promise<LightWalletKeypair>
- An instance ofLightWalletKeypair
.
const address = "fra234xfde4";
// Create a LightWalletKeypair object using given address
const lightWalletKeypair = await Keypair.getAddressPublicAndKey(address);
- Creates an array of Mnemonic phrases.
This method is used to creates an array of Mnemonic phrases.
<number>
- Desired length of mnemonic phrases. It can only be 12/15/18/21/24.<string>
- (optional) Default isen
.
Promise<LightWalletKeypair>
- An instance ofLightWalletKeypair
.
const desiredLength = 24;
// Create a wallet info object using given password
const mnemonic = await Keypair.getMnemonic(desiredLength);
- Creates an instance of
WalletKeypar
using Mnemonic and password.
This method is used to restore a wallet keypair. The Keypair contains some essential information, such as:- address
- public key
- key store
and so on, and it is used for pretty much any personalized operation that user can do using FindoraSdk
<string[]>
- mnemonic words<string>
- Password to be used to generate an encrypted KeyStore
Promise<WalletKeypar>
- An instance ofWalletKeypar
.
const password = "qsjEI%123";
const mnemonic = ["Apple", "Orange", "Banana"];
// Create a wallet info object using given Mnemonic and password
const walletPair = await Keypair.restoreFromMnemonic(mnemonic, password);
- Creates an instance of
WalletKeypar
using given private key and password.
This method is used to restore a wallet keypair. The Keypair contains some essential information, such as:- address
- public key
- key store
and so on, and it is used for pretty much any personalized operation that user can do using FindoraSdk
<string>
- Private key<string>
- Password to be used to generate an encrypted KeyStore
Promise<WalletKeypar>
- An instance ofWalletKeypar
.
const password = "qsjEI%123";
const pkey = "XXXXXXXXXX";
// Create a wallet info object using given private key and password
const walletInfo = await Keypair.restoreFromPrivateKey(pkey, password);
Last modified 4mo ago