🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

torosdk

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

torosdk

A comprehensive Node.js library for interacting with the Toronet blockchain. This package simplifies wallet management, TNS setup, balance queries, fiat deposits, inter-wallet transfers, KYC verification, and smart contract deployment on Toronet's EVM-com

Source
npmnpm
Version
0.0.6
Version published
Weekly downloads
25
-13.79%
Maintainers
1
Weekly downloads
 
Created
Source
# Toronet SDK

## Overview

The Toronet SDK is a TypeScript-based toolkit for interacting with the Toronet blockchain. It empowers developers to manage wallets, query blockchain data, handle fiat transactions, verify user identity, and more — all from a developer-friendly interface.

---

## Features

- **Wallet Management**
  - Create wallets and set Toronet Naming System (TNS) names.
  - Import wallet using private key and password.
  - Verify wallet password integrity.

- **Blockchain Queries**
  - Get latest block data.
  - Retrieve blockchain status.
  - Fetch historical blocks and transactions.

- **Token Balance Queries**
  - Retrieve balances for NGN, USD, KSH, and ToroG tokens.

- **Fiat Deposits (Multi-Currency)**
  - Initialize and verify fiat deposits using whitelisted project credentials.
  - Supported currencies: NGN, EUR, USD, GBP, KSH, ZAR.

- **KYC Verification**
  - Perform identity verification.
  - Check if a wallet address is KYC verified.

- **Exchange Rate Queries**
  - Fetch exchange rates for supported fiat and crypto assets.

---

## Installation

```bash
npm install torosdk

Usage

🔐 Create a Wallet

import { createWallet } from "torosdk";

const walletAddress = await createWallet({
  password: "securePassword123"
});
console.log("Wallet Address:", walletAddress);

🔑 Import Wallet from Private Key

import { importWalletFromPrivateKeyAndPassword } from "torosdk";

const address = await importWalletFromPrivateKeyAndPassword({
  pvkey: "yourPrivateKeyHere",
  password: "yourPasswordHere"
});
console.log("Imported Wallet Address:", address);

🔒 Verify Wallet Password

import { verifyWalletPassword } from "torosdk";

const isValid = await verifyWalletPassword({
  address: "0xYourAddress",
  password: "yourPassword"
});
console.log("Password is correct:", isValid);

📦 Get Wallet Key

import { getWalletKey } from "torosdk";

const key = await getWalletKey({
  address: "0xYourWalletAddress"
});
console.log("Wallet Key:", key);

📊 Blockchain Status & Latest Block

import { getBlockchainStatus, getLatestBlockData } from "torosdk";

const status = await getBlockchainStatus();
console.log("Blockchain Status:", status);

const block = await getLatestBlockData();
console.log("Latest Block:", block);

💰 Get Token Balances

import { getBalance } from "torosdk";

const balances = await getBalance({
  address: "0xYourWalletAddress"
});
console.log("Token Balances:", balances);

🧾 KYC Verification

🔹 Before using this feature, ensure that you have the correct admin credentials.
KYC is required for transactions.

import { performKYCForCustomer, isAddressKYCVerified } from "torosdk";

const kycparams = {
  firstName: "John",
  middleName: "Doe",
  lastName: "Doe",
  bvn: "123456789",
  currency: "NGN",
  phoneNumber: "08012345678",
  dob: "1990-01-01",
  address: "0xYourWalletAddress",
  admin: "yourWhitelistedAdminAddress",
  adminpwd: "yourAdminPassword",
};

const isKYCSuccessful = await performKYCForCustomer(kycparams);
console.log("KYC Successful:", isKYCSuccessful);

const isVerified = await isAddressKYCVerified({
  address: "0xYourWalletAddress"
});
console.log("KYC Verified:", isVerified);

💸 Fiat Deposit (Multi-Currency)

🔹 Before using this feature, you must register as a project at https://payments.connectw.com/ to get admin credentials.

import { depositFunds } from "torosdk";
import { Currency } from "torosdk/types";

const depositDetails = await depositFunds({
  userAddress: "0xYourWalletAddress",
  username: "testUser",
  amount: "1000",
  currency: Currency.Kenyan_Shilling,
  admin: "adminAddr",
  adminpwd: "@adminPassword"
});
console.log("Deposit Info:", depositDetails);

🔁 Blockchain Queries

import { getSupportedAssetsExchangeRates, getBlocksData, getBlockchainTransactions } from "torosdk";

// Exchange rates
const rates = await getSupportedAssetsExchangeRates();
console.log("Exchange Rates:", rates);

// Get blocks
const blocks = await getBlocksData(5); // last 5 blocks
console.log("Blocks:", blocks);

// Get transactions
const txs = await getBlockchainTransactions(10);
console.log("Transactions:", txs);

Supported Currencies

export enum Currency {
  Naira = "NGN",
  Euro = "EUR",
  Dollar = "USD",
  Pound = "GBP",
  Kenyan_Shilling = "KSH",
  South_African_Rand = "ZAR",
}

Folder Structure

src/
├── api/                
│   ├── account.ts           
│   ├── balance.ts           
│   ├── blockchain.ts        
│   ├── keystore.ts          
│   ├── payments.ts          
│   ├── kyc.ts               
│   └── config.ts            
│
├── query/                  # On-chain data queries
│   └── queries.ts          
│
├── services/               # Business logic
│   ├── walletService.ts    
│   ├── balanceService.ts   
│   ├── paymentService.ts   
│   ├── kycService.ts       
│   ├── blockchainService.ts
│   └── utils.ts            
│
├── types/                  # Global types and enums
├── utils/                 
├── index.ts                # SDK entry

Contribution

We welcome contributions from the community!

  • Fork the repo
  • Create a feature branch
  • Submit a PR with detailed explanation

License

MIT License – see LICENSE file.

Support

Join our developer community on Discord.


---

Let me know if you’d like to break this into multiple docs (like `Getting Started`, `API Reference`, etc.) or generate typed docs from the code itself!

FAQs

Package last updated on 30 Mar 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts