Skip to content

Instantly share code, notes, and snippets.

/// SEE doc.zebitex.com for availble channels
const WebSocket = require('ws')
const ws = new WebSocket('wss://pusher-stage.zebitex.com/app/pusher_key?protocol=7&client=js&version=5.0.3&flash=false'); // ws.zebitex.com for prod
ws.on('open', function open() {
//// once connected : {"event":"pusher:connection_established","data":"{\"socket_id\":\"6.625468\",\"activity_timeout\":120}"}
const socket_id= "6.625468"
const info = await zebitex.command_rest.getSessionInfo()
//// info payload : {"sn":"ZEBXXXXXXXXTEX","isVerified":true,"isCorporate":false,"email":"user@domain.tld","lang":null,"nickname":"nick","canChangePassword":true,"isApplicationVerified":true,"emailNotifications":true,"pushNotifications":true,"productAnnouncementsNotifications":true,"mfa":{"enabled":false,"passed":false}}
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
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())
@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
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;
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'),
module.exports = {
bitcoin: {
messagePrefix: '\x18Bitcoin Signed Message:\n',
bech32: 'bc',
bip32: {
public: 0x0488b21e,
private: 0x0488ade4
},
pubKeyHash: 0x00,
scriptHash: 0x05,
@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
@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());
});
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/"