Skip to content

Instantly share code, notes, and snippets.

View pinhopro's full-sized avatar

Rodrigo Souza pinhopro

View GitHub Profile
Saque
"Timestamp"
"ID"
"UserID"
"PercentFeeDiscount"
"PercentFee"
"Username"
"BrokerUsername"
"IsConfirmed"
"Reason"
execution_reports = [
["2018-02-23 11:05:14,391", {"OrderID": 1459162339654, "ExecID": 1112052, "ExecType": "4", "OrdStatus": "4", "CumQty": 0, "Symbol": "BTCBRL", "OrderQty": 100000, "LastShares": 0, "LastPx": 0, "Price": 3386598000000, "TimeInForce": "1", "LeavesQty": 0, "MsgType": "8", "ExecSide": "2", "OrdType": "2", "CxlQty": 100000, "Side": "2", "ClOrdID": 9335905, "AvgPx": 0}],
["2018-02-23 11:05:14,604", {"OrderID": 1459162339656, "ExecID": 1112053, "ExecType": "0", "OrdStatus": "0", "CumQty": 0, "Symbol": "BTCBRL", "OrderQty": 100000, "LastShares": 0, "LastPx": 0, "Price": 3386596000000, "TimeInForce": "1", "LeavesQty": 100000, "MsgType": "8", "ExecSide": "2", "OrdType": "2", "CxlQty": 0, "Side": "2", "ClOrdID": 7297629, "AvgPx": 0}],
["2018-02-23 11:05:15,207", {"OrderID": 1459162339612, "ExecID": 1112054, "ExecType": "4", "OrdStatus": "4", "CumQty": 0, "Symbol": "BTCCLP", "OrderQty": 42890000, "LastShares": 0, "LastPx": 0, "Price": 748583000000000, "TimeInForce": "1", "LeavesQty": 0, "MsgT
2018-02-23 05:00:45,372 - IN,TRADE_IN_REQ,OPN,QHRDPHFMCEDDDHZ6
2018-02-23 05:00:45,372 - OUT,TRADE_IN_REP,OPN,QHRDPHFMCEDDDHZ6
2018-02-23 05:00:45,372 - IN,TRADE_IN_REQ,OPN,CLMTGNGEUQYVEKFW
2018-02-23 05:00:45,372 - OUT,TRADE_IN_REP,OPN,CLMTGNGEUQYVEKFW
2018-02-23 08:02:09,548 - IN,TRADE_IN_REQ,OPN,KQ3JX5RWL7KPAY5F
2018-02-23 08:02:09,548 - OUT,TRADE_IN_REP,OPN,KQ3JX5RWL7KPAY5F
2018-02-23 08:06:09,222 - IN,TRADE_IN_REQ,OPN,R4F57TSGZMDL4D66
2018-02-23 08:06:09,222 - OUT,TRADE_IN_REP,OPN,R4F57TSGZMDL4D66
2018-02-23 08:06:14,865 - IN,TRADE_IN_REQ,REQ,R4F57TSGZMDL4D66,{"Username": "mohsinmanj@gmail.com", "SecondFactor": "205722", "Origin": "https://urdubit.com", "FingerPrint": 1002208642, "UserReqID": 96245, "UserAgentLanguage": "en-US", "UserReqTyp": "1", "UserAgentPlatform": "Win32", "BrokerID": 8, "RemoteIP": "182.187.52.222", "UserAgentTimezoneOffset": -300, "GatewayID": "gw-2:ws_gateway_8448", "UserAgent": "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.167 Safari/537.36
{"Verified": 5, "UserID": 9, "TwoFactorEnabled": false, "EmailLang": "es", "IsBrokerUser": false, "Username": "chilebit:instant withdrawals", "IsMSB": true, "WithdrawFixedFee": null, "Broker": {"City": "New York", "SupportURL": "https://www.facebook.com/groups/blinktrade.support/", "State": "NY", "BusinessName": "Blinktrade, Inc.", "Email": "support@blinktrade.com", "Status": "1", "Currencies": "", "Address": "40 Broad St", "FeeStructure": [], "Lang": "en", "ranking": 1, "TakerTransactionFeeSell": 0, "VerificationForm": "https://secure.jotform.us/form/42275925807866??user_id={{UserID}}&username={{Username}}&broker_id={{to_BrokerID}}&broker_username={{to_BrokerUsername}}&email={{Email}}", "Country": "United States", "TakerTransactionFeeBuy": 0, "CryptoCurrencies": [{"Wallets": [{"managed_by": "Blinktrade", "signatures": [], "type": "cold", "multisig": false, "address": "16tdTifYyEMYGMqaFjgqS6oLQ7ZZLt4E8r"}, {"managed_by": "Blinktrade", "signatures": [], "type": "hot", "multisig": false, "address": "1LFHd1VnA92
GTMLULUIIMPMAO6C
D7FXTGIUVXO3AZMF
VHZEJ2T2VG5AZPWV
RDTOAYVB4ZLAVRAF
S4BN7IKXVTNLZVW6
FMST6SJ6CXPQ5AFW
HNEIXCPHGGHMWY2E
3G4G32SBUOGN2NMB
JHF5637XF4WRUI4Q
EFMKASNDZH2XBBT5
sys.path.insert( 0, os.path.join(ROOT_PATH, 'apps'))
sys.path.insert( 0, os.path.join(ROOT_PATH, 'libs'))
import zmq
from bitex.message import JsonMessage, InvalidMessageException
from bitex.zmq_client import TradeClient, TradeClientException
import os
import requests
import time
import datetime
import argparse
import unicodecsv as csv
def get_trades(currency="BRL", since=0, trade_list=[]):
headers = {
{
"api.label.error": "Label Required",
"api.title": "Developers",
"apikey.create.ipdescription1": "Enter a list of IP Address separated by comma (ie. 55.55.55.55, 44.44.44.44)\n that you want to white list.",
"apikey.create.ipdescription2": "Not specifying an IP Address means that you are allowing this API Key to\n be used from any IP",
"apikey.create.ipwhitelist": "IP whitelist",
"apikey.create.label": "Label",
"apikey.create.new": "Create new API Key",
"apikey.create.submit": "Create",
"apikey.create.title": "API Keys",
var os = require('os');
var util = require('util');
var Promise = require('promise');
var WebSocketClient = require('websocket').w3cwebsocket;
var macaddress = require('macaddress');
var dgram = require('dgram');
var ip = require('ip');
/**
/*
-----BEGIN ALGO DEFINITION-----
{
"id": "blinktrade",
"description": "Make sure your order is always on top",
"params": [
{"name":"side", "label":"Buy(1) / Sell(2)", "type":"number", "value":"1", "filter":"positive_number", "validator":"required; validateMin 1; validateMax 2; validateNumber;" },
{"name":"qty", "label":"Qty", "type":"number", "value":"" , "filter":"positive_number", "validator":"required; validateMin 0; validateNumber;" },
{"name":"min_price", "label":"Minimum Price", "type":"number", "value":"" , "filter":"positive_number", "validator":"required; validateMin 0; validateNumber;" },
{"name":"max_price", "label":"Maximum Price", "type":"number", "value":"" , "filter":"positive_number", "validator":"required; validateMin 0; validateNumber;" }