Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@waves/assets-pairs-order

Package Overview
Dependencies
Maintainers
7
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@waves/assets-pairs-order

![Build Status](https://api.travis-ci.org/wavesplatform/assets-pairs-order.svg?branch=master)

  • 2.3.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
18
increased by200%
Maintainers
7
Weekly downloads
 
Created
Source

Utility for ordering pair of assets in (amount_asset, price_asset)

Build Status

Accepts:

orderPairs(string, string)
orderPairs([string, string])
orderPairs([string, string], [string, string], ...)
orderPairs([[string, string], [string, string], ...])

Returns:

[
  [amount_asset1, price_asset1],
  [amount_asset2, price_asset2],
  ...
]

Example:

yarn add @waves/assets-pairs-order
import orderPairs from '@waves/assets-pairs-order'

orderPairs(
  'DNhP2zAH5HM1kdUSmxcBqs8RP4vvUgRFc1YgAKkfPmPD',
  'FxSm86qcEw8wGfpX3T7X5fsnuK5XxYA6ZfVYJja29vMA'
)

/* [
    [
      'DNhP2zAH5HM1kdUSmxcBqs8RP4vvUgRFc1YgAKkfPmPD',
      'FxSm86qcEw8wGfpX3T7X5fsnuK5XxYA6ZfVYJja29vMA',
    ]
  ]
*/


// Or you can pass in array of pairs

orderPairs([
  ['DNhP2zAH5HM1kdUSmxcBqs8RP4vvUgRFc1YgAKkfPmPD', 'FxSm86qcEw8wGfpX3T7X5fsnuK5XxYA6ZfVYJja29vMA'],
  ['FxSm86qcEw8wGfpX3T7X5fsnuK5XxYA6ZfVYJja29vMA','DNhP2zAH5HM1kdUSmxcBqs8RP4vvUgRFc1YgAKkfPmPD']
])
/* [
    [
      'DNhP2zAH5HM1kdUSmxcBqs8RP4vvUgRFc1YgAKkfPmPD',
      'FxSm86qcEw8wGfpX3T7X5fsnuK5XxYA6ZfVYJja29vMA',
    ],
    [
      'DNhP2zAH5HM1kdUSmxcBqs8RP4vvUgRFc1YgAKkfPmPD',
      'FxSm86qcEw8wGfpX3T7X5fsnuK5XxYA6ZfVYJja29vMA',
    ]
  ]
*/

You can redefine predefinedList property: (By default it's MAINNET_DATA)

import orderPairs from '@waves/assets-pairs-order';
orderPairs.predefinedList = ['2', '1'];

orderPairs([['1','2']])
/* [
    [
      '1',
      '2',
    ]
  ]
*/

FAQs

Package last updated on 19 Apr 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc