Skip to content

Instantly share code, notes, and snippets.

View coinables's full-sized avatar
💭
@coinables on Twitter

coinableS coinables

💭
@coinables on Twitter
View GitHub Profile
Verifying that +coinables is my blockchain ID. https://onename.com/coinables
@coinables
coinables / example.html
Created June 20, 2017 03:01
coincap.io with socket.io example
<!DOCTYPE html>
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.0.3/socket.io.js"></script>
</head>
<body>
<script type="text/javascript">
var socket = io.connect('http://socket.coincap.io');
socket.on('trades', function (tradeMsg) {
<?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));
@coinables
coinables / gist:c9f853ad863de09df006ad03e1f297e7
Created November 24, 2017 22:26
SegWit Private Key Sweep in NodeJS With BitcoinJS
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"},
@coinables
coinables / test.php
Created May 3, 2018 02:15
coinpayments api generate new address example
<?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 = '';
<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;
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
$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);
@coinables
coinables / channels.json
Created June 13, 2018 04:40
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 },
{ "source" : "028e5a8e86540f703e1f58880d35d1e318a54c27d84ec1edbcde04a78ed4469a1e", "destination" : "0387e3780a4325eb38421fb83000a6f6c0ffa4a69ea0c81db3f00e8e5015c9e8a1", "short_channel_id" : "505207:2408:1", "flags" : 0, "active" : true, "public" : true, "last_update" : 1516864360
@coinables
coinables / nodes.json
Created June 13, 2018 04:41
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 } ] },