State: Draft
Based on the Peatio Stable branch
To the coin daemon's {coin}.conf file, include the -walletnotify command:
# Notify when receiving coins
| 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/" |
| 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()); | |
| }); |
State: Draft
Based on the Peatio Stable branch
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; |
| 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 |