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 axios = require("axios") | |
const baseUrl = "https://api.zaif.jp/api/1/" | |
const fetchTicker = async (method, cc, lc) => { | |
const url = `${baseUrl}${method}/${cc}_${lc}` | |
console.log(url) | |
const ticker = await axios.get(url) | |
.then(res => res.data) | |
.catch(error => { |
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 axios = require("axios") | |
const baseUrl = "https://api.zaif.jp/api/1/" | |
const fetchTicker = async (method, cc, lc) => { | |
const url = `${baseUrl}${method}/${cc}_${lc}` | |
console.log(url) | |
const ticker = await axios.get(url) | |
.then(res => res.data) | |
.catch(error => { |
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 url = "wss://ws.zaif.jp/stream?currency_pair=btc_jpy" | |
const WebSocket = require('ws') | |
const wss = new WebSocket(url) | |
wss.on('open', () => { | |
console.log('Connection open') | |
}) | |
wss.on('close', () => { | |
console.log('Connection close') | |
}) | |
wss.on('message', (dataString) => { |
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 ccxt = require('ccxt') | |
const exchanges = ccxt.exchanges | |
console.log(exchanges) | |
console.log(`ccxt can be used in ${exchanges.length} exchanges.`) |
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 ccxt = require('ccxt'); | |
const zaif = new ccxt.zaif(); | |
(async () => { | |
const ticker = await zaif.fetchTicker('XEM/JPY'); | |
console.log(ticker); | |
})(); |
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 ccxt = require('ccxt') | |
const methodsExchangeHas = (exchange) => { | |
const exchangeObject = new ccxt[exchange] | |
const methods = exchangeObject.has | |
return methods | |
} | |
const japanExchanges = [ | |
'bitbank', | |
'bitflyer', | |
'coincheck', |
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 ccxt = require('ccxt'); | |
const defaultFetchTicker = async (exchange, ticker) => { | |
const exchangeObject = new ccxt[exchange]; | |
const tickerInfo = await exchangeObject.fetchTicker(ticker); | |
console.log(tickerInfo); | |
return tickerInfo; | |
} | |
const japanExchanges = [ | |
'bitbank', | |
'bitflyer', |
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 ccxt = require('ccxt'); | |
const zaif = new ccxt.zaif(); | |
(async () => { | |
const orderBook = await zaif.fetchOrderBook('XEM/JPY'); | |
console.log(orderBook); | |
})(); |
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
// Node.js + ts-nodeの環境で動作すると思います | |
import { | |
NEMLibrary, | |
NetworkTypes, | |
Address, | |
TransferTransaction, | |
TimeWindow, | |
EmptyMessage, | |
TransactionHttp, | |
XEM, |
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
#! /bin/bash | |
# symbol-bootstrap-0.2.0 | |
# initial startup script | |
# reference 1: https://nemlog.nem.social/blog/49345 | |
# reference 2: https://github.com/44uk/symbol-testnet-node-running-hands-on/blob/master/hands-on/index.md | |
# Execute as root | |
sudo su |
OlderNewer