This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| |
import java.util.Date; | |
| |
import javax.crypto.Mac; | |
import javax.crypto.spec.SecretKeySpec; | |
| |
import com.squareup.okhttp.MediaType; | |
import com.squareup.okhttp.OkHttpClient; | |
import com.squareup.okhttp.Request; | |
import com.squareup.okhttp.RequestBody; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const dgram = require('dgram') | |
const UInt64BE = require('int64-buffer').Uint64BE | |
const BN = require('bignumber.js') | |
const _ = require('lodash') | |
const process = require('process') | |
const PORT = 30000 | |
const MULTICAST_ADDR = '233.255.255.255' | |
const nBN = v => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
INSTALL DEPENDENCIES: | |
$ npm install request | |
CONFIGURE: | |
set `apiKey` and `apiSecret` variables | |
RUN: | |
node bfx-pulse-rest-v2-del.js | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
INSTALL DEPENDENCIES: | |
$ npm install request | |
CONFIGURE: | |
set `apiKey` and `apiSecret` variables | |
RUN: | |
node bfx-pulse-rest-v2-write.js | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs') | |
const crypto = require('crypto') | |
const request = require('request') | |
const apiKey = '...' | |
const apiSecret = '...' | |
const url = 'v2/auth/w/expo/notify' | |
const nonce = (Date.now() * 1000).toString() | |
const body = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# frozen_string_literal: true | |
def http_get(url) | |
HTTParty.get(url) | |
rescue => e | |
-1 | |
end | |
# takes in a string pair and timeframe in minutes to use to calculate vwap | |
# example vwap_bittrex("BTC-LTC", 15) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// INSTALL | |
// requirements: node.js interpreter | |
// run: npm install ws | |
const WebSocket = require('ws') | |
const crypto = require('crypto') | |
const fs = require('fs') | |
const w1_apiKey = 'API_KEY' | |
const w1_apiSecret = 'API_SECRET' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// INSTALL | |
// requirements: node.js interpreter | |
// run: npm install ws | |
// Subscribe to BTCUSD book on Bitfinex's WebSocket v2 | |
const WS = require('ws') | |
const w = new WS("wss://api-pub.bitfinex.com/ws/2") | |
w.onmessage = function(msg) { console.log(Date.now(), msg.data) } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
mkdir bfx_test | |
cd bfx_test | |
// save this script as run.js, and add your api key/secret | |
npm install ws | |
npm install async | |
node run.js | |
*/ | |
const WebSocket = require('ws'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
npm install ws request crc-32 | |
*/ | |
const WebSocket = require('ws') | |
const request = require('request') | |
const CRC = require('crc-32') | |
const LIMIT_CHAN = 250 |
NewerOlder