UNPKG

@codegame.dev/wallet-cli

Version:

A CLI tool for managing wallets across multiple blockchains, supporting operations like wallet creation, balance checking, transfers, and fee estimation.

107 lines (100 loc) 2.47 kB
import evm from "./evm"; import ton from "./ton"; import tron from "./tron"; export type GetBalanceParams = { coin: string, address: string, tokenAddress?: string, jsonRpcProvider: string, chainDecimals: number testnet: boolean delay: number } export type GetBalanceResponse = { success: boolean, coin_balance?: string, token_balance?: string, code?: string, message?: string, } export type TransferParams = { coin: string, mnemonic: string, secretKey: Uint8Array, fromAddress: string, toAddress: string, amount: string, tokenAddress?: string, jsonRpcProvider: string, chainDecimals: number testnet: boolean delay: number } export type TransferResponse = { success: boolean, hash?: string, fee?: string, code?: string, message?: string, } export type EstimateFeeParams = { coin: string, mnemonic: string, secretKey: Uint8Array, fromAddress: string, toAddress: string, amount: string, tokenAddress?: string, jsonRpcProvider: string, chainDecimals: number testnet: boolean delay: number } export type EstimateFeeResponse = { success: boolean, fee?: string, code?: string, message?: string, } export default [ { id: "ethereum", json_rpc_provider: "https://ethereum-rpc.publicnode.com", json_rpc_test_provider: "https://ethereum-sepolia-rpc.publicnode.com", group: "evm", decimals: 18, api: evm }, { id: "smartChain", json_rpc_provider: "https://bsc-rpc.publicnode.com", json_rpc_test_provider: "https://data-seed-prebsc-1-s1.binance.org:8545", group: "evm", decimals: 18, api: evm }, { id: "polygon", json_rpc_provider: "https://polygon-bor-rpc.publicnode.com", json_rpc_test_provider: "https://polygon-amoy-bor-rpc.publicnode.com", group: "evm", decimals: 18, api: evm }, { id: "tron", json_rpc_provider: "https://api.trongrid.io", json_rpc_test_provider: "https://api.shasta.trongrid.io", group: "tron", decimals: 6, api: tron }, { id: "ton", json_rpc_provider: "https://toncenter.com/api/v2/jsonRPC", json_rpc_test_provider: "https://testnet.toncenter.com/api/v2/jsonRPC", group: "ton", decimals: 9, api: ton } ]