npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

xdex

v1.0.3

Published

multi-dex

Readme

Testing

git clone https://github.com/kemargrant/xdex

npm test

Usage

npm install xdex
var xdex = require('xdex')
var switcheoTest = new xdex.switcheo({
	NEO:{
		wif:"Your neo wif",
		api:"test-api.switcheo.network || api.switcheo.network"
		contract:"a195c1549e7da61b8da315765a790ac7e7633b82 || 48756743d524af03aa75729e911651ffd3cbe7d8"
	}
})

Switcheo Methods

https://docs.switcheo.network

List balances

var balance = await switcheoTest.balances.list_balances({
	addresses: ["67655526ea983cf4a1841775d4d018afd9731904"],
	contract_hashes: ["a195c1549e7da61b8da315765a790ac7e7633b82"],
})

or

switcheoTest.balances.list_balances({
	addresses: ["67655526ea983cf4a1841775d4d018afd9731904"],
	contract_hashes: ["a195c1549e7da61b8da315765a790ac7e7633b82"],
})
.then(console.log)
.catch(console.error)

Cancel

Should create a cancellation

var order = await switcheoTest.orders.create_order({
  pair: 'SWTH_NEO',
  blockchain: 'neo',
  side: 'sell',
  price: 100,
  want_amount: 100,
  use_native_tokens: true,
  order_type: 'limit',
})

or

switcheoTest.orders.create_order({
  pair: 'SWTH_NEO',
  blockchain: 'neo',
  side: 'sell',
  price: 100,
  want_amount: 100,
  use_native_tokens: true,
  order_type: 'limit',
})
.then(console.log)
.catch(console.error)

Execute a cancellation

var order = await switcheoTest.orders.create_order({
  pair: 'SWTH_NEO',
  blockchain: 'neo',
  side: 'sell',
  price: 100,
  want_amount: 100,
  use_native_tokens: true,
  order_type: 'limit',
})
var execute = await switcheoTest.orders.execute_order(order);

or

switcheoTest.orders.create_order({
  pair: 'SWTH_NEO',
  blockchain: 'neo',
  side: 'sell',
  price: 100,
  want_amount: 100,
  use_native_tokens: true,
  order_type: 'limit',
})
.then(switcheoTest.orders.execute_order)
.then(console.log)
.catch(console.error)		

Deposits

Should create a deposit

var deposit = await switcheoTest.deposit.create_deposits({
  blockchain: 'neo',
  asset_id: 'SWTH',
  amount: 2,
})

or

switcheoTest.deposit.create_deposits({
  blockchain: 'neo',
  asset_id: 'SWTH',
  amount: 2,
})
.then(console.log)
.catch(console.error)	

Execute a deposit

var deposit = await switcheoTest.deposit.create_deposits({
  blockchain: 'neo',
  asset_id: 'SWTH',
  amount: 2,
})
var executed = await switcheoTest.deposit.execute_deposits(deposit);

or

switcheoTest.deposit.create_deposits({
  blockchain: 'neo',
  asset_id: 'SWTH',
  amount: 2,
})
.then(switcheoTest.deposit.execute_deposit)
.then(console.log)
.catch(console.error)	

Tickers

Should return candlestick chart data filtered by url parameters

var candles = await switcheoTest.tickers.candlesticks({
	"pair": "SWTH_NEO",
	"interval": 1,
	"start_time": new Date().getTime()/1000 - 360,
	"end_time": new Date().getTime()/1000,
	"contract_hash": "a195c1549e7da61b8da315765a790ac7e7633b82"
})

or

switcheoTest.tickers.candlesticks({
	"pair": "SWTH_NEO",
	"interval": 1,
	"start_time": new Date().getTime()/1000 - 360,
	"end_time": new Date().getTime()/1000,
	"contract_hash": "a195c1549e7da61b8da315765a790ac7e7633b82"
})
.then(console.log)
.catch(console.error)	

Should return 24-hour data for all pairs and markets

var pairs = await switcheoTest.tickers.last_24_hours()

or

switcheoTest.tickers.last_24_hours()	
.then(console.log)
.catch(console.error)	

Should return last price of given symbol(s). Defaults to all symbols

var price = await switcheoTest.tickers.last_price();

or

switcheoTest.tickers.last_price();
.then(console.log)
.catch(console.error)	

Offers

Should retrieves the best 70 offers (per side) on the offer book

var book =  await switcheoTest.offers.list_offers({
  "blockchain": "neo",
  "pair": "SWTH_GAS",
})

or

switcheoTest.offers.list_offers({
  "blockchain": "neo",
  "pair": "SWTH_GAS",
})
.then(console.log)
.catch(console.error)	

Orders

Should return orders from a specific address filtered by the given parameters

var orders = await switcheoTest.orders.list_orders({
  "address": "87cf67daa0c1e9b6caa1443cf5555b09cb3f8e5f",
  "contract_hash": "a195c1549e7da61b8da315765a790ac7e7633b82"
})

or

switcheoTest.orders.list_orders({
  "address": "87cf67daa0c1e9b6caa1443cf5555b09cb3f8e5f",
  "contract_hash": "a195c1549e7da61b8da315765a790ac7e7633b82"
})
.then(console.log)
.catch(console.error)	

Should creates an order which can be executed

var order = await switcheoTest.orders.create_order({
  pair: 'SWTH_NEO',
  blockchain: 'neo',
  side: 'sell',
  price: 1,
  want_amount: 1,
  use_native_tokens: true,
  order_type: 'limit',
})

or

switcheoTest.orders.create_order({
  pair: 'SWTH_NEO',
  blockchain: 'neo',
  side: 'sell',
  price: 1,
  want_amount: 1,
  use_native_tokens: true,
  order_type: 'limit',
})
.then(console.log)
.catch(console.error)	

Should execute an order

var order = await switcheoTest.orders.create_order({
  pair: 'SWTH_NEO',
  blockchain: 'neo',
  side: 'sell',
  price: 1,
  want_amount: 100,
  use_native_tokens: true,
  order_type: 'limit',
})
var ordered = await switcheoTest.orders.execute_order(order);

or

switcheoTest.orders.create_order({
  pair: 'SWTH_NEO',
  blockchain: 'neo',
  side: 'sell',
  price: 1,
  want_amount: 100,
  use_native_tokens: true,
  order_type: 'limit',
})
.then(switcheoTest.orders.execute_order)
.then(console.log)
.catch(console.error)	

Trades

Should retrieves trades that have already occurred on Switcheo Exchange filtered by the request parameters.

var trades = await switcheoTest.trades.list_trades({
  "blockchain": "neo",
  "pair": "SWTH_NEO",
  "contract_hash": "a195c1549e7da61b8da315765a790ac7e7633b82"
})

or

switcheoTest.trades.list_trades({
  "blockchain": "neo",
  "pair": "SWTH_NEO",
  "contract_hash": "a195c1549e7da61b8da315765a790ac7e7633b82"
})
.then(console.log)
.catch(console.error)	

Withdrawals

Should create a withdrawal transaction

var withdrawal = await switcheoTest.withdrawal.create_withdrawal({
	  blockchain: 'neo',
	  asset_id: 'SWTH',
	  amount: 2,
})

or

switcheoTest.withdrawal.create_withdrawal({
	  blockchain: 'neo',
	  asset_id: 'SWTH',
	  amount: 2,
})
.then(console.log)
.catch(console.error)	

Should execute a withdrawal

var withdrawal = await switcheoTest.withdrawal.create_withdrawal({
  blockchain: 'neo',
  asset_id: 'SWTH',
  amount: 2,
})
var withdrawn = switcheoTest.withdrawal.execute_withdrawl(withdrawal)

or

switcheoTest.withdrawal.execute_withdrawl(withdrawal);
		witcheoTest.withdrawal.create_withdrawal({
  blockchain: 'neo',
  asset_id: 'SWTH',
  amount: 2,
})
.then(switcheoTest.withdrawal.execute_withdrawl)
.then(console.log)
.catch(console.error)