{"id":27608124,"url":"https://github.com/merklejerk/send-ether","last_synced_at":"2025-04-22T22:22:53.754Z","repository":{"id":32902349,"uuid":"145583813","full_name":"merklejerk/send-ether","owner":"merklejerk","description":"Simple CLI tool to send Ethereum ether with a private key, mnemonic, or keystore.","archived":false,"fork":false,"pushed_at":"2023-01-23T21:02:38.000Z","size":342,"stargazers_count":8,"open_issues_count":7,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-21T11:19:43.701Z","etag":null,"topics":["cli","ens","es2017","ether","ethereum","private-key","self-signed","send","transfer","wallet"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/merklejerk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-08-21T15:30:53.000Z","updated_at":"2024-02-09T12:11:23.000Z","dependencies_parsed_at":"2023-02-13T03:15:23.315Z","dependency_job_id":null,"html_url":"https://github.com/merklejerk/send-ether","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/merklejerk%2Fsend-ether","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/merklejerk%2Fsend-ether/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/merklejerk%2Fsend-ether/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/merklejerk%2Fsend-ether/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/merklejerk","download_url":"https://codeload.github.com/merklejerk/send-ether/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250332387,"owners_count":21413201,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","ens","es2017","ether","ethereum","private-key","self-signed","send","transfer","wallet"],"created_at":"2025-04-22T22:22:53.282Z","updated_at":"2025-04-22T22:22:53.725Z","avatar_url":"https://github.com/merklejerk.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![build status](https://travis-ci.org/merklejerk/send-ether.svg?branch=master)](https://travis-ci.org/merklejerk/send-ether)\n[![npm package](https://badge.fury.io/js/send-ether.svg)](https://www.npmjs.com/package/send-ether)\n\n# send-ether\nA simple CLI tool for sending Ethereum ether using any of the following:\n\n- A wallet's private key\n- A keystore file\n- An HD wallet mnemonic phrase\n- A provider (node) wallet address\n\nFor the ERC20 token version of this package, check out\n[send-tokens](https://github.com/merklejerk/send-tokens).\n\n### Contents\n\n- [Installation](#installation)\n- [Examples](#examples)\n- [All Options](#all-options)\n- [JSON Logs](#json-logs)\n- [ENS Names](#ens-names)\n- [Library Usage](#library-usage)\n\n## Installation\n```bash\nnpm install -g send-ether\n# or\nyarn global add send-ether\n```\n\n## Examples\n```bash\n# Recipient of ether. May also be an ENS name.\nDST='0x0420DC92A955e3e139b52142f32Bd54C6D46c023'\n# Sending wallet's private key.\nPRIVATE_KEY='0x52c251b9e04740157471a724e9a3210b83fac5834b29c89d5bd57661bd2a7057'\n# Sending wallet's HD mnemonic.\nMNEMONIC='butter crepes sugar flour eggs milk ...'\n\n# Send 100.2 ether to and address,\n# on the mainnet, using a wallet's private key\n$ send-ether --key $PRIVATE_KEY $DST 100.2\n\n# Send 5.2 gwei (5.2e-9 ether) to an address, on ropsten,\n# using an HD wallet mnemonic\n$ send-ether --network ropsten --mnemonic \"$MNEMONIC\" $DST 5.2 -d 9\n\n# Send 10 wei (100e-18 ether) to an address, on the mainnet,\n# using a keystore file.\n$ send-ether --keystore './path/to/keystore.json' --password 'secret' $DST 10 -d 0\n\n# Send 1.5 ether to an address, on the provider's network,\n# using the provider's default wallet, and wait for 3 confirmations.\n$ send-ether --provider 'http://localhost:8545' --confirmations 3 $DST 1.5\n```\n\n## All Options\n```\n$ send-ether --help\nUsage: send-ether [options] \u003cto\u003e \u003camount\u003e\n\nOptions:\n\n  -v, --version               output the version number\n  -d, --decimals \u003cn\u003e          decimal places amount is expressed in (default: 18)\n  -k, --key \u003chex\u003e             sending wallet's private key\n  -f, --key-file \u003cfile\u003e       sending wallet's private key file\n  -s, --keystore-file \u003cfile\u003e  sending wallet's keystore file\n  --password \u003cpassword\u003e       keystore file password\n  -m, --mnemonic \u003cphrase\u003e     sending wallet's HD wallet phrase\n  --mnemonic-index \u003cn\u003e        sending wallet's HD wallet account index (default: 0)\n  -a, --account \u003chex\u003e         sending wallet's account address (provider wallet)\n  -c, --confirmations \u003cn\u003e     number of confirmations to wait for before returning (default: 0)\n  -p, --provider \u003curi\u003e        provider URI\n  -n, --network \u003cname\u003e        network name\n  -G, --gas-price \u003cgwei\u003e      explicit gas price, in gwei (e.g., 20)\n  -l, --log \u003cfile\u003e            append a JSON log to a file\n  --no-confirm                bypass input confirmation\n  -h, --help                  output usage information\n```\n\n## JSON Logs\nIf you pass the `--log` option, a JSON object describing the transfer\nwill be appended to a file when the transaction is mined, one object per line.\n\n##### Log Entries\nLog entries follow this structure:\n```js\n{\n   // Unique transfer ID to identify related logs.\n   id: '88fdd8a4b8084c36',\n   // UNIX time.\n   time: 1532471209842,\n   // Address of sender.\n   from: '0x0420DC92A955e3e139b52142f32Bd54C6D46c023',\n   // Address of recipient.\n   to: '0x2621Ea417659Ad69BAE66AF05eBE5788e533E5e8',\n   // Amount of ether sent (in weis).\n   amount: '20',\n   // Transaction ID of transfer.\n   txId: '0xd9255f8365305ebffd77cb30d09f82745eaa232e42739f5fc2788fa46f1347e3',\n   // Block number where the transfer was mined.\n   block: 4912040,\n   // Gas used.\n   gas: 40120\n}\n```\n\n## ENS Names\nAnywhere you can pass an address, you can also pass an ENS name, like\n`'ethereum.eth'`, and the it will automatically be resolved to a real\naddress.\n\nENS resolution only works on the mainnet, rinkeby, and ropsten, and the name\nmust be fully registered with the ENS contract and a resolver.\n\n\n## Library Usage\nThe `send-ether` package can be used as a library through the `sendEther()`\nfunction.\n\n`sendEther()` asynchronously resolves to a\n[transaction receipt](https://web3js.readthedocs.io/en/1.0/web3-eth.html#eth-gettransactionreceipt-return)\nonce the transaction has been mined (or confirmed, if the\n`confirmations` option is \u003e 0).\n\n#### sendEther() Examples\n\n```js\nconst {sendEther} = require('send-ether');\n// Recipient of ether.\nconst RECIPIENT = '0x0420DC92A955e3e139b52142f32Bd54C6D46c023';\n\n// Sending wallet's private key.\nconst PRIVATE_KEY = '0x52c251b9e04740157471a724e9a3210b83fac5834b29c89d5bd57661bd2a7057';\n// Send 100.5 ether to someone using a private key and wait for\n// it to be mined.\nlet receipt = await sendEther(RECIPIENT, '100.5',\n  {key: PRIVATE_KEY});\n\n// Sending wallet's mnemonic.\nconst MNEMONIC = 'butter crepes sugar flour eggs milk ...';\n// Send 32 wei (32e-18) to someone using a (BIP39) mnemonic phrase\n// and wait for it to be mined and confirmed 3 times.\nreceipt = await sendEther(RECIPIENT, '32',\n  {mnemonic: MNEMONIC, confirmations: 3, decimals: 0});\n\n// Sending wallet's keystore file contents as a string.\nconst KEYSTORE = '{...}';\n// Keystore password.\nconst PASSWORD = 'secret';\n// Send 20.1 gwei (1e-9) to someone using a keystore file,\n// print the transaction ID when it's available, and wait for it to be mined.\nreceipt = await sendEther(RECIPIENT, '20.1', {\n    keystore: KEYSTORE,\n    password: PASSWORD,\n    decimals: 9,\n    onTxId: console.log\n  });\n```\n\n#### Full sendEther() Options\n\n```js\nconst {sendEther} = require('send-ether');\n// Send AMOUNT ether to RECIPIENT.\n{tx: Object} = async sendEther(\n  // Address of recipient.\n  // Should be a hex string ('0x...')\n  RECIPIENT: String,\n  // Amount of ether to send. Units depend on `decimals` option.\n  // Should be a base-10 decimal string (e.g., '1234.567').\n  AMOUNT: String,\n  // Options object\n  {\n    // Suppress output.\n    quiet: Boolean,\n    // If specified, append to a JSON log file at this path.\n    log: String,\n    // Call this function, passing the transaction hash/ID of the transaction\n    // once it becomes available (transaction is posted to the blockchain but\n    // not yet mined).\n    onTxId: Function,\n    // Decimal places of amount.\n    // E.g., 18 for whole ether, 0 for wei or smallest decimals.\n    // Defaults to 18.\n    decimals: Number,\n    // If connecting to a custom provider (e.g., a private node), this\n    // can be the set to the address of an unlocked wallet on the provider\n    // from which to send the ether.\n    account: String,\n    // Hex-encoded 32-byte private key of sender (e.g., '0x1234...').\n    key: String,\n    // BIP39 mnemonic phrase of sender.\n    mnemonic: String,\n    // Sender's Mnemonic account index. Defaults to 0.\n    mnemonicIndex: Number,\n    // Sender's JSON-encoded keystore file contents.\n    keystore: String,\n    // Sender's keystore file path.\n    keystoreFile: String,\n    // Keystore password.\n    password: String,\n    // Ethereum network to use. May be 'main', 'ropsten', 'rinkeby', or 'kovan'.\n    // Defaults to 'main',\n    network: String,\n    // Gas price for the transaction.\n    // Should be a number in gweis.\n    // Defaults to current network gas price.\n    gasPrice: Number,\n    // Number of confirmations to wait for after the transaction is mined.\n    // Maximum of 12. Defaults to 0 (no confirmations).\n    confirmations: Number,\n    // Infura API key to use.\n    infuraKey: String,\n    // Custom provider. May either be a URI (e.g., http://localhost:8545) or\n    // a Provider object from Web3.\n    provider: String | Object,\n    // Custom web3 object.\n    web3: Object\n  });\n```\n\n#### toWallet()\nAnother exposed library function is `toWallet()`, which returns an address\n\u0026 private key pair from a private key, mnemonic, or keystore. Below are the\nfull options.\n\n```js\nconst {toWallet} = require('send-ether');\n// Convert a private key, mnemonic, or keystore to an address and private-key\n// pair object. Both fields will be a hex-encoded string.\n{address: String, key: String} = toWallet({\n    // Hex-encoded 32-byte private key of sender (e.g., '0x1234...').\n    key: String,\n    // BIP39 mnemonic phrase.\n    mnemonic: String,\n    // Mnemonic account index. Defaults to 0.\n    mnemonicIndex: Number,\n    // JSON-encoded keystore file contents.\n    keystore: String,\n    // Keystore password (if `keystore` is passed).\n    password: String\n  });\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmerklejerk%2Fsend-ether","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmerklejerk%2Fsend-ether","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmerklejerk%2Fsend-ether/lists"}