ArweaveKit Docs
  • ArweaveKit
    • Introduction
  • 🔐Wallets
    • Introduction to Wallets
    • Create Wallet
    • Get Wallet Address
    • Get Wallet Balance
    • Wallet Plugins
  • 💳ARWEAVE WALLET KIT
    • Introduction to Arweave Wallet Kit
    • Setup
    • Connect Button
    • Hooks
    • Customization
  • 🏦Transactions
    • Introduction to Transactions
    • Create Transaction
    • Sign Transaction
    • Post Transaction
    • Get Transaction Status
    • Get Transaction
    • Create and Post Transaction with Othent
    • Transaction Plugins
  • 📄SMART CONTRACTS
    • Introduction to Smart Contracts
    • Create Contract
    • Write Contract
    • Read Contract State
    • View Contract State
    • Write Contract with Othent
    • Read Contract with Othent
    • Smart Contract Plugins
  • ✅AUTH
    • Introduction to Auth
    • Connect
    • Disconnect
    • Get Active Address
    • Get Permissions
    • Get Wallet Names
    • Get All Addresses
    • Get Active Public Key
    • Is Installed
    • Log In with Othent
    • Log Out with Othent
    • Get User Details with Othent
    • Auth Plugins
  • 🔐Encryption
    • Introduction to Encryption
    • Encrypt Data with AES
    • Decrypt Data with AES
    • Encrypt AES Key with RSA
    • Decrypt AES Key with RSA
    • Encryption Plugins
  • 🌐GRAPHQL
    • Introduction to GraphQL
    • Query All Arweave Transactions
    • Query Arweave Data
    • Query Arweave Transactions
    • GraphQL Plugins
  • 🗺️RoadMap
    • Features
  • 📘REFERENCES
    • ArweaveKit in Browser Environments
  • 🛠️SUPPORTING TOOLS
    • Arweave StarterKit
Powered by GitBook
On this page
  • Basic Syntax
  • Input Parameters
  • Returned Data

Was this helpful?

  1. Wallets

Create Wallet

Creating an Arweave wallet

PreviousIntroduction to WalletsNextGet Wallet Address

Last updated 3 months ago

Was this helpful?

The createWallet function creates a new wallet capable of interacting with Arweave and Arweave based applications.

The created wallet does not have any tokens or assets in it. For transactions, the wallet may need to be supplied with funds.

Basic Syntax

The function is called as follows:

import { createWallet } from 'arweavekit/wallet'

const wallet = await createWallet({params});

Input Parameters

The following params are available for this function and they must be passed in as an object:

  • seedPhrase: boolean (optional) : Returns the seed phrase of the newly created wallet if set to true.

  • environment: 'local' | 'mainnet' (optional) : The environment for creating the wallet. The wallet created is funded with 1000000000000 Winston for the local environment. Wallets created on the mainnet need to be funded separately.

An arlocal instance must be running on port 1984 for the function to work with the local environment. And any funds in the wallet will be available only as long as the same instance of arlocal is running. To create one, simply run npx arlocal in the command line. Learn more about arlocal .

Winston is the smallest possible unit of AR, similar to a in Bitcoin, or in Ethereum.

1 AR = 1000000000000 Winston (12 zeros) and 1 Winston = 0.000000000001 AR.

Example
const wallet = await createWallet({
    seedPhrase: true,
    environment: 'local',
});

This creates a new wallet on the local network that is pre-funded with 1000000000000 Winston (1 AR) and returns the seedPhrase for the same along with the private key and wallet address.

Returned Data

The function call returns the following data:

{
key: { KEY_OBJECT },
walletAddress: 'WALLET_ADDRESS',
seedPhrase: '12_WORD_SEED_PHRASE'
}

The key provides access to a wallet and any assets associated with it. It is crucial to keep the key secure and not publish it anywhere.

Store the value of key in a file with the .json extension for later use.

  • walletAddress: string: The wallet address is derived from the public key by truncating it down to 43 characters.

  • seedPhrase: string (optional) : This is a 12 word string that can be used to recover a wallet and any assets associated with it.

It is is crucial to keep the seed phrase secure and not publish it anywhere.

The seed phrase is returned only if the input parameter is set to true.

key: JWKInterface : The private key is a JSON object. Read more about the Arweave compatible key format .

🔐
here
satoshi
wei
here