🔗near
Description
The getKeys
function is an asynchronous function that generates a new key pair and creates a new account on the NEAR blockchain.
Parameters
Parameter | Data Type | Description |
---|---|---|
| string | The mnemonic phrase used to generate the key pair for the new account. |
| string | The desired account name for the new account. |
Response
Field | Data Type | Description |
---|---|---|
| number | A status code indicating the result of the operation. 1 for success, 0 for error. |
| object | An object containing the generated public and private keys for the new account. |
| string | The generated public key for the new account. |
| string | The generated private key for the new account. |
Example Request and Response
Prerequisites
Before making requests with Nest SDK, you must have it installed.
You can install Nest SDK using either npm
or yarn
. Use the following commands to install Nest SDK:
Request
Here is an example of how to make a getKeys
request using the Nest SDK:
Response
Use Cases
Crypto Wallet: Crypto wallets can use this function to generate private keys and corresponding public addresses for their users.
Testing: Blockchain developers can use this function to generate private keys and addresses for testing and development purposes.
Last updated