Skip to main content

Method Signature

align.blockchain.wallets.create(): Promise<Wallet>

Parameters

This method takes no parameters. It always generates a fresh, random wallet.

Returns

Returns a Wallet object containing:
address
string
The public wallet address (e.g., 0x742d...)
privateKey
string
The private key used for signing transactions. Keep this secret!
mnemonic
string
The 12-word recovery phrase. Store this securely - it cannot be recovered if lost!

Example

import Align from "@tolbel/align";

const align = new Align({
  apiKey: process.env.ALIGN_API_KEY!,
  environment: "sandbox",
});

// Create a new random wallet
const wallet = await align.blockchain.wallets.create();

console.log(`Address: ${wallet.address}`);
console.log(`Private Key: ${wallet.privateKey}`);
console.log(`Mnemonic: ${wallet.mnemonic}`);
Security Warning: The privateKey and mnemonic give full access to the wallet’s funds. Never expose them in client-side code or logs. Store them securely (e.g., encrypted database, environment variables).