Skip to content

Instantly share code, notes, and snippets.

@ang-st
ang-st / look ok
Created March 18, 2015 02:48
ooops rlp
vagrant@packer-debian-7:~/code/pyethereum$ epm refs
Available refs:
chain1 : thelonious/f858469a00e80e4f5eb536501eb7d98c7e1cc432
vm-std : thelonious/0177c9a9777437eaeb024ebc2ea69d285121a89d
yes : thelonious/066fabcde43ec91da3d3da7f435b8d89af123355
vagrant@packer-debian-7:~/code/pyethereum$ python tt.py thelonious/f858469a00e80e4f5eb536501eb7d98c7e1cc432 #chain1
{
"address": "0000000000THISISDOUG",
import sys
import pprint
from pyethereum import *
try:
chain = "/home/vagrant/.decerver/blockchains/"+sys.argv[1].strip()+"/0/"
dbfile = chain +"database/"
genesis = chain +'genesis.json'
except:
chain = "/home/vagrant/.decerver/blockchains/thelonious/f858469a00e80e4f5eb536501eb7d98c7e1cc432/0/"
@ang-st
ang-st / tv.js
Created May 17, 2017 10:04
Trading view data
var util=require('util')
var WebSocketClient = require('websocket').client;
var client = new WebSocketClient();
var conn = null
var received = false
client.on('connectFailed', function(error) {
console.log('Connect Error: ' + error.toString());
});
@ang-st
ang-st / add-new-crypto-to-peatio.md
Created January 19, 2018 10:19 — forked from brossi/add-new-crypto-to-peatio.md
Adding A New Cryptocurrency to Peatio

State: Draft
Based on the Peatio Stable branch


Coin Daemon

To the coin daemon's {coin}.conf file, include the -walletnotify command:

# Notify when receiving coins
module.exports = {
bitcoin: {
messagePrefix: '\x18Bitcoin Signed Message:\n',
bech32: 'bc',
bip32: {
public: 0x0488b21e,
private: 0x0488ade4
},
pubKeyHash: 0x00,
scriptHash: 0x05,
coins = [('BTC', 'https://github.com/bitcoin/bitcoin/raw/master/src/chainparams.cpp'),
('TEST', 'https://github.com/bitcoin/bitcoin/raw/master/src/chainparams.cpp'),
('LTC',
'https://github.com/litecoin-project/litecoin/raw/master-0.10/src/chainparams.cpp'),
('DOGE',
'https://github.com/dogecoin/dogecoin/raw/master/src/chainparams.cpp'),
('RDD',
'https://github.com/reddcoin-project/reddcoin/raw/master/src/base58.h'),
('DASH', 'https://github.com/dashpay/dash/raw/master/src/chainparams.cpp'),
('PPC', 'https://github.com/belovachap/peercoin/raw/master/src/base58.h'),
const pkcs11 = require("pkcs11js");
const ffi = require("ffi");
const ref = require("ref");
const ArrayType = require('ref-array')
const StructType = require("ref-struct");
const KEYPAIR_ID = Buffer.from("GOST keypair");
// PKCS11 types
const CK_BYTE = ref.types.byte;
@ang-st
ang-st / zebitex-pusher.py
Created November 9, 2018 12:17
quick snippet to get streaming data from zebitex
import pysher
import sys,time
# Add a logging handler so we can see the raw communication data
import logging
root = logging.getLogger()
root.setLevel(logging.DEBUG)
ch = logging.StreamHandler(sys.stdout)
root.addHandler(ch)
global pysher
import nnpy #nanomsg
sub = nnpy.Socket(nnpy.AF_SP, nnpy.SUB)
sub.connect('ipc:///tmp/3-rrEWX7gc7D9mwcdrdBxBTdqh1a7WDVsMuadhTZgyXfFcRz45L-decisions')
#sub.connect('ipc:///tmp/3-11111111111111111111111111111111LpoYY-decisions')
x= sub.setsockopt(nnpy.SUB, nnpy.SUB_SUBSCRIBE, '')
print(sub.recv())
URL: /api/v1/orders/:id # retourne un ordre par son id
method : GET
required: id
example payload :
{"id":190,"side":"bid","price":"10.00","total":"10.00","amount":"1.00000000","filled":"0.00","base":"btc","quote":"eur","timestamp":1599559342,"type":"limit","state":"wait"}
URL: /api/v1/orders/opened?per=10&page=1
method: GET