⛏️createWallet

Description

The createWallet function generates a new mnemonic that can be used to create a new cryptocurrency wallet. The mnemonic is a randomly generated sequence of words that can be used to generate a hierarchical deterministic wallet, allowing for easy backup and recovery of the wallet.

Parameters

This function does not take any parameters.

Response

Field
Data Type
Description

code

number

Indicates whether the function was successful or not. A value of 1 indicates success, while a value of 0 indicates failure.

result

string

If the code is 1, then this field contains the generated mnemonic. If the code is 0, then this field will be empty.

error

string

If the code is 0, then this field contains the error message. If the code is 1, then this field will be empty.

Example Request and Response

Prerequisites

Before making requests with Volary SDK, you must have it installed.

You can install Volary SDK using either npm or yarn. Use the following commands to install Volary SDK:

npm install @nest25/wallet-lib
OR
yarn add @nest25/wallet-lib

Next, install tiny-secp256k1 npm package in order to create a new wallet:

Request

Here is an example of how to make a createWallet request using the Volary SDK:

Response

Use Cases

  • Cryptocurrency Wallets: This function can be used by cryptocurrency wallets to generate a new wallet and associated mnemonic for the user.

  • Blockchain Development: This function can be used by developers building blockchain applications to generate new wallets for testing and development purposes.

Last updated