chaingate
TypeScript icon, indicating that this package has built-in type declarations

0.5.1 • Public • Published

🔗 ChainGate

A comprehensive TypeScript cryptocurrency framework for connecting to and executing transactions on multiple blockchains. Your private keys remain securely on your device, and all transaction signing is handled offline to ensure the highest level of security.

Bitcoin • Ethereum • Bnb • Dogecoin • Avalanche • Litecoin • Bitcoin Cash • Polygon • Arbitrum • Fantom • Base • Bitcoin Testnet

Version Test Build Build Web

banner.png

Installation

npm i chaingate

Get your API key now for free at https://chaingate.dev

Features

  • 💻❤️🌐 NodeJS & Browser compatible
  • 🔌 Plug and Play Wallet:
    • 🆕 Create new wallet from mnemonic (BIP39 phrase)
    • 📥 Import any wallet:
      • 📜 BIP39 (mnemonic)
      • 🔑 Private keys (hex string or Uint8Array)
      • 🌱 Seeds (raw format)
      • 🔐 Ethereum-like or DEX-like keystores
    • 🗺️ HD Wallet support (BIP32 derivation paths)
  • 🔗 Multi-Chain Functionality:
    • 🔄 Access multiple blockchains with the same library
    • 💱 Retrieve balances (BTC, ETH, BNB, etc.)
    • 📡 Create and broadcast transactions
    • 📏 Get blockchain info (block height, transaction details, etc.)
  • 🔮 Fee Estimation / Gas Prediction: Accurately predict fees for transactions

Warning
Use of this blockchain library is at your own risk. There are no warranties or liabilities assumed, and data accuracy is not guaranteed.

Basic Example

import { initializeWallet } from 'chaingate'

// Create a new wallet
const { wallet, phrase } = await initializeWallet.create({
  apiKey: 'YOUR_API_KEY'
})

// Access Bitcoin functionality
const bitcoin = wallet.currency('bitcoin')
console.log('BTC Address:', await bitcoin.getAddress())

// Check balance
const balance = await bitcoin.getBalance()
console.log('Balance:', balance.confirmed.baseAmount.str)

// Example transaction (see docs for full implementation)
const recipient = 'bc1q...'
const amount = await bitcoin.amount('0.001', 'btc')
const transfer = await bitcoin.createTransfer(recipient, amount)
const fees = await transfer.getSuggestedFees()

if (fees.normal.enoughFunds) {
  const txId = await transfer.broadcast('normal')
  console.log('Transaction ID:', txId)
}

For advanced usage, multichain operations, and API reference, visit the official documentation at docs.chaingate.dev.

Package Sidebar

Install

npm i chaingate

Weekly Downloads

38,522

Version

0.5.1

License

Apache-2.0

Unpacked Size

340 kB

Total Files

264

Last publish

Collaborators

  • drakensoftware