scientistnik / btsdex

Package for work with BitShares DEX
MIT License
21 stars 27 forks source link

Invalid URL #3

Closed wmbutler closed 6 years ago

wmbutler commented 6 years ago

I'm getting the following with your example:

BBUTLER-MAC:xtrade bbutler$ node index.js
{ node: 'wss://bitshares.openledger.info/ws' } 'Failed to initialize with error' 'Invalid url'
(node:31221) UnhandledPromiseRejectionWarning: Error: Invalid url
const BitShares = require('btsdex')
KEY = 'redacted'

BitShares.init({node:'wss://bitshares.openledger.info/ws'})

async function startAfterConnected() {
  let bot = new BitShares('billbutler-trade1',KEY)

  let iam = await BitShares.accounts['billbutler-trade1'];
  let orders = await BitShares.db.get_full_accounts([iam.id],false);

  orders = orders[0][1].limit_orders;
  let order = orders[0].sell_price;
  console.log(order)
}

BitShares.subscribe('connected',startAfterConnected)
BitShares.connect()

I tried with a couple other URL's as well.

scientistnik commented 6 years ago

Sorry, I don't update README. Now you need use:

BitShares.init('wss://bitshares.openledger.info/ws')