This file contains hidden or 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 hidden or 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
| /*USAGE: | |
| npm install ws lodash async moment crc-32 | |
| mkdir logs | |
| node bfx_test_book.js BTCUSD | |
| */ | |
| const WS = require('ws') | |
| const _ = require('lodash') | |
| const async = require('async') | |
| const fs = require('fs') |
This file contains hidden or 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
| /*USAGE: | |
| npm install ws lodash async moment crc-32 | |
| mkdir logs | |
| node bfx_test_book.js BTCUSD | |
| */ | |
| const WS = require('ws') | |
| const _ = require('lodash') | |
| const async = require('async') | |
| const fs = require('fs') |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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) |
NewerOlder