var bitcore = require("bitcore-lib"); | |
var Buffer = require("buffer").Buffer; | |
var value = new Buffer.from("test", "utf8"); | |
var hash = bitcore.crypto.Hash.sha256(value); | |
// Compressed Key (nu skool) | |
var bn = bitcore.crypto.BN.fromBuffer(hash); | |
var privateKey = new bitcore.PrivateKey(bn); |
# Update brew | |
brew update | |
# Need postgres | |
brew install postgresql | |
# Install elixir | |
brew install elixir | |
# Install hex package manager |
'use strict'; | |
const crypto = require('crypto'); | |
const ENCRYPTION_KEY = process.env.ENCRYPTION_KEY; // Must be 256 bits (32 characters) | |
const IV_LENGTH = 16; // For AES, this is always 16 | |
function encrypt(text) { | |
let iv = crypto.randomBytes(IV_LENGTH); | |
let cipher = crypto.createCipheriv('aes-256-cbc', Buffer.from(ENCRYPTION_KEY), iv); |
const { Transaction } = require('bitcore-lib') | |
const { decrypt } = require('bip38') | |
const encryptedKey = '<private key beginning with 6>' | |
const password = '<private key password>' | |
const privateKey = decrypt(encryptedKey, password).privateKey | |
// Check UTXO info at https://insight.bitpay.com/api/addr/<origin address>/utxo | |
const utxo = { |
Firstly, what is <details>
<summary>
?
The HTML Details Element (
<details>
) creates a disclosure widget in which information is visible only when the widget is toggled into an "open" state. A summary or label can be provided using the<summary>
element. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details.
#!/bin/bash | |
# Description: | |
# Delete all `greenkeeper/*` branches of your remote. | |
# Instructions: | |
# Run the script with the `--help` flag. | |
ORIGIN=origin | |
DRY_RUN=0 | |
THIS=`basename "$0"` |
I recently stumbled upon Falsehoods programmers believe about time zones, which got a good laugh out of me. It reminded me of other great lists of falsehoods, such as about names or time, and made me look for an equivalent for Ethereum. Having found none, here is my humble contribution to this set.
Calling estimateGas
will return the gas required by my transaction
Calling estimateGas
will return the gas that your transaction would require if it were mined now. The current state of the chain may be very different to the state in which your tx will get mined. So when your tx i
If you have any issues with macOS, or need anything related to it check this documentation
Install Xcode Command Line tools :
The package that linked you here is now pure ESM. It cannot be require()
'd from CommonJS.
This means you have the following choices:
- Use ESM yourself. (preferred)
Useimport foo from 'foo'
instead ofconst foo = require('foo')
to import the package. You also need to put"type": "module"
in your package.json and more. Follow the below guide. - If the package is used in an async context, you could use
await import(…)
from CommonJS instead ofrequire(…)
. - Stay on the existing version of the package until you can move to ESM.