Skip to content

Instantly share code, notes, and snippets.

Kyle Honeycutt coinables

Block or report user

Report or block coinables

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@coinables
coinables / transaction.js
Created Jun 14, 2019
Create a testnet key pair
View transaction.js
let bitcoin = require("bitcoinjs-lib");
function getNewAddress(){
let NETWORK = bitcoin.networks.testnet; //main net bitcoin.networks.bitcoin
let wif = bitcoin.ECPair.makeRandom({network: NETWORK}).toWIF();
let keyPair = bitcoin.ECPair.fromWIF(wif, NETWORK);
//p2pkh
let p2pkhAddr = keyPair.getAddress();
@coinables
coinables / index.html
Created Jun 13, 2018
lightning nodes & edges
View index.html
<!DOCTYPE html>
<html>
<head>
<!-- START SIGMA IMPORTS -->
<script src="../src/sigma.core.js"></script>
<script src="../src/conrad.js"></script>
<script src="../src/utils/sigma.utils.js"></script>
<script src="../src/utils/sigma.polyfills.js"></script>
<script src="../src/sigma.settings.js"></script>
<script src="../src/classes/sigma.classes.dispatcher.js"></script>
View nodes.json
{ "nodes" :
[
{ "nodeid" : "028e5a8e86540f703e1f58880d35d1e318a54c27d84ec1edbcde04a78ed4469a1e", "alias" : "???? EXANTE", "color" : "007f39", "last_timestamp" : 1516636793, "addresses" :
[
{ "type" : "ipv4", "address" : "148.251.53.235", "port" : 9735 } ] },
{ "nodeid" : "03867da6ba2e32bd6e6e32de8cc010711eeabd73235d6e49544a9229b02b3d35a2", "alias" : "WEIRDARK", "color" : "03867d", "last_timestamp" : 1516844101, "addresses" :
[ ] },
{ "nodeid" : "03b81284c8aba3409cd3720a96089011f4bd6512017ae7f81bf4175a9d22def343", "alias" : "EksiSozlukLN", "color" : "316293", "last_timestamp" : 1517650435, "addresses" :
[
{ "type" : "ipv4", "address" : "188.166.88.130", "port" : 9735 } ] },
View channels.json
This file has been truncated, but you can view the full file.
{ "channels" :
[
{ "source" : "028e5a8e86540f703e1f58880d35d1e318a54c27d84ec1edbcde04a78ed4469a1e", "destination" : "035f1498c929d4cefba4701ae36a554691f526ff60b1766badd5a49b3c8b68e1d8", "short_channel_id" : "505198:1139:1", "flags" : 0, "active" : true, "public" : true, "last_update" : 1516847709, "base_fee_millisatoshi" : 546000, "fee_per_millionth" : 10, "delay" : 14 },
{ "source" : "028e5a8e86540f703e1f58880d35d1e318a54c27d84ec1edbcde04a78ed4469a1e", "destination" : "02f6725f9c1c40333b67faea92fd211c183050f28df32cac3f9d69685fe9665432", "short_channel_id" : "505206:1066:1", "flags" : 0, "active" : true, "public" : true, "last_update" : 1516636771, "base_fee_millisatoshi" : 546000, "fee_per_millionth" : 10, "delay" : 14 },
View gist:775a696d068425aa361c70e810d9cd60
$apikey = "your_key";
$apisecret = "your_secret":
function bittrexbalance($apikey, $apisecret){
$nonce=time();
$uri='https://bittrex.com/api/v1.1/account/getbalances?apikey='.$apikey.'&nonce='.$nonce;
$sign=hash_hmac('sha512',$uri,$apisecret);
$ch = curl_init($uri);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('apisign:'.$sign));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
View gist:3505fa0c65031894325af9b954ea5bff
const express = require("express");
const request = require("request");
const bodyparser = require("body-parser");
const bitcore = require("bitcore-lib");
const app = express();
app.use(
bodyparser.urlencoded({
extended: true
View gist:ffa33d3a1983b12bfdb68fcdac71ca99
<html>
Create Brain Wallet
<h1>BTC USD Converter</h1>
<input type="text" id="btc" value="1" onkeyup="return btcusd();" onchange="return btcusd();"> =
<input type="text" id="usd" value="<%= lastPrice %>" onkeyup="return usdbtc();" onchange="return usdbtc();">
<script>
function btcusd(){
let market_price = <%= lastPrice %>;
let btc_value = document.getElementById("btc").value;
let calc = btc_value * market_price;
@coinables
coinables / test.php
Created May 3, 2018
coinpayments api generate new address example
View test.php
<?php
// This example will create a new deposit address for a desired currency
// Link to the related documentation https://www.coinpayments.net/apidoc-get-deposit-address
////////////////////////////////////////////////////
// Fill these in from your API Keys page
$public_key = '';
$private_key = '';
@coinables
coinables / gist:c9f853ad863de09df006ad03e1f297e7
Created Nov 24, 2017
SegWit Private Key Sweep in NodeJS With BitcoinJS
View gist:c9f853ad863de09df006ad03e1f297e7
var bitcoin = require("bitcoinjs-lib");
var request = require("request");
//push transaction
function pushTX(pload, callback){
request({
url: "https://api.blockcypher.com/v1/btc/main/txs/push",
method: "POST",
json: true,
headers: {"content-type": "application/json"},
View gist:eb5d2af7a18cdaf19164b04309ea19d8
<?php
$APIkey = "yourAPIkey"; //change to your apikey
$ClientId = "yourClientId"; //change to your clientID
$secret = "yourAPIsecret"; //change to your API secret, provided when you get your API key
$nonce = microtime();
$Data = $nonce.$APIkey.$ClientId;
$hmac = base64_encode(hash_hmac('sha256', $Data, $secret, true));
You can’t perform that action at this time.