mirror of
https://github.com/discountry/ritmex-bot.git
synced 2026-09-11 17:28:08 +00:00
commit
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
import ccxt from '../../js/ccxt.js'
|
||||
|
||||
console.log ('CCXT Version:', ccxt.version)
|
||||
|
||||
async function main () {
|
||||
|
||||
const exchange = new ccxt.okx ({
|
||||
|
||||
// edit for your credentials
|
||||
'apiKey': 'YOUR_API_KEY',
|
||||
'secret': 'YOUR_API_SECRET',
|
||||
'password': 'YOUR_API_PASSWORD',
|
||||
})
|
||||
|
||||
await exchange.loadMarkets ()
|
||||
|
||||
// if this script fails with a rate limiter error
|
||||
// uncomment the following line for debugging purposes
|
||||
|
||||
// exchange.verbose = true
|
||||
|
||||
while (true) {
|
||||
|
||||
try {
|
||||
|
||||
const trades = await exchange.fetchMyTrades ()
|
||||
console.log (new Date(), 'fetched', trades.length, 'trades')
|
||||
|
||||
} catch (e) {
|
||||
|
||||
console.log (e.constructor.name, e.message)
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
main ()
|
||||
Reference in New Issue
Block a user