Fractal
  • Overview
  • Basics
    • Architecture
  • Key Concepts
    • Fractal Confluence: The EVM Layer
    • The Confluence Bridge
    • Fractal Spring: The UTXO Layer
      • Concepts
      • Technical Specifications
    • Staking
      • Overview
      • EVM Staking
        • UTXO Staking and EVM Staking
      • Consensus
      • Rewards
      • Penalties
  • Developers
    • Acquire Testnet FRA
    • EVM Tools & Tutorials
      • Contract Deployment
        • Ganache
        • Hardhat
        • Remix
        • Truffle
        • Waffle
      • The Graph
    • Developer SDKs
      • UTXO Native Chain SDK
        • Fractal Spring (UTXO Layer) SDK Installation
        • Developer Tools
          • Fractal CLI Tool
        • UTXO API Reference
          • Account
          • Keypair
          • Network
          • Asset
          • Staking
          • Transaction
          • Helpers
      • The Confluence Bridge SDK
    • EVM References
      • Metamask
      • Local Development Network Setup
      • EVM API Reference
      • Precompiled Contracts
  • Network Settings
    • Contract Addresses
    • Network Settings
  • User Guides
    • Fractal Wallet Guides
      • MetaMask
        • Download
        • Configure (Auto)
        • Configure (Manual)
      • Fractal Wallet
        • Download
        • New Wallet
        • Transfer Tokens in the Fractal Wallet
        • The Confluence Bridge
        • Adding Custom Assets to the Fractal Wallet
        • Manage Assets
      • Ledger Hardware Wallet
    • Acquire FRA
    • Explore Testnet
    • Acquire FRA (Testnet)
    • Stake FRA
    • How to Use Block Explorers
    • Bridging Tokens to Fractal
  • Validator Materials
    • Validator Setup Guides
      • System Requirements
      • Acquire a Server
      • Validator Toolbox Setup
        • New Build
        • Existing Build
        • Additional Info
      • Manual Setup
      • Automated Setup (Deprecated)
    • Upgrade Guides
      • Node Upgrade (Toolbox)
      • Node Upgrade (Manual)
      • fn CLI Upgrade (Wallet)
    • Operational Guides
      • Emergency Recovery
      • Data Backup
      • CLI Staking
Powered by GitBook
On this page
  1. Developers
  2. Developer SDKs
  3. UTXO Native Chain SDK
  4. UTXO API Reference

Keypair

PreviousAccountNextNetwork

Last updated 1 year ago

createKeypair

- 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 FractalSdk

Parameters:

  • <string> - Password to be used to generate an encrypted KeyStore

Results:

  • Promise<WalletKeypar> - An instance of WalletKeypar

Example:

const password = "qsjEI%123";

// Create a wallet info object using given password
const walletPair = await Keypair.createKeypair(password);

getAddressByPublicKey

- Get wallet address by given public key Using this function user can retrieve 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 the address and public key

  • <string> - Wallet address

  • Promise<LightWalletKeypair> - An instance of LightWalletKeypair.

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 create an array of Mnemonic phrases.

  • <number> - Desired length of mnemonic phrases. It can only be 12/15/18/21/24.

  • <string> - (optional) Default is en.

  • Promise<LightWalletKeypair> - An instance of LightWalletKeypair.

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. It is used for almost any personalized operation that the user can do using FindoraSdk

  • <string[]> - mnemonic words

  • <string> - Password to be used to generate an encrypted KeyStore

  • Promise<WalletKeypar> - An instance of WalletKeypar.

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 of WalletKeypar.

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);

Parameters:

Results:

Example:

getAddressPublicAndKey

Parameters:

Results:

Example:

getMnemonic

Parameters:

Results:

Example:

restoreFromMnemonic

Parameters:

Results:

Example:

restoreFromPrivateKey

Parameters:

Results:

Example:

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​