Toroforge Collective
  • Welcome to ToroForge Collective
  • Getting Started
    • Quickstart
    • SDKs
      • Javascript
        • Wallet Management
        • Token & Balances
        • Fiat Deposit & Verification
        • KYC & Identity
        • Transfers
        • Blockchain Queries
        • Utilities & Helpers
        • Full Reference
      • Flutter
  • Resources
    • Smart Contracts
    • Community
Powered by GitBook
On this page
  • 🔐 Wallet Management
  • 🧱 Features & Usage
  • 🧩 Best Practices
  • 📎 Related Sections
  1. Getting Started
  2. SDKs
  3. Javascript

Wallet Management

🔐 Wallet Management

The ToroForge Node.js SDK offers complete tools for managing user wallets on the Toronet blockchain — including creation, import, name registration (TNS), password verification, and key access.


📘 What You Can Do

  • Create a new Toronet wallet

  • Assign a Toronet Naming System (TNS) name

  • Import an existing wallet using a private key

  • Verify wallet password integrity

  • Retrieve wallet keys securely


🧱 Features & Usage


✅ Create a New Wallet

Generate a new wallet address by providing a secure password.

import { createWallet } from 'torosdk';

const walletAddress = await createWallet({
  password: 'securePassword123',
});

Returns a Toronet-compatible wallet address.


🧠 Assign a TNS (Toronet Name)

Once a wallet is created, you can register a human-readable name for the address.

import { setTNSName } from 'torosdk';

await setTNSName({
  address: '0xWalletAddress',
  password: 'securePassword123',
  username: 'exampleName',
});

Names are unique and can be used across the Toronet ecosystem.


🔁 Import Wallet From Private Key

If a user already has a private key, import it into the SDK with a new password.

import { importWalletFromPrivateKeyAndPassword } from 'torosdk';

const address = await importWalletFromPrivateKeyAndPassword({
  pvkey: 'yourPrivateKeyHere',
  password: 'newWalletPassword',
});

🔒 Verify Wallet Password

Check whether a given password is valid for a Toronet address.

import { verifyWalletPassword } from 'torosdk';

const isValid = await verifyWalletPassword({
  address: '0xWalletAddress',
  password: 'testPassword',
});

Returns true or false.


🔑 Retrieve Wallet Key

Use this only when absolutely necessary (e.g. for backup or migrations):

import { getWalletKey } from 'torosdk';

const keyInfo = await getWalletKey({
  address: '0xWalletAddress',
});
console.log(keyInfo); // { pubkey, privkey }

⚠️ Always store keys securely. Never expose them on the frontend.


🧩 Best Practices

  • Always encrypt passwords in transit and storage.

  • Use environment variables for admin credentials when working with wallet APIs that require authorization.

  • Avoid calling getWalletKey() on the client side.


📎 Related Sections


PreviousJavascriptNextToken & Balances

Last updated 11 days ago

Token & Balance Queries
KYC Verification
Fiat Deposits