@waves/assets-pairs-order
Advanced tools
Comparing version 3.1.0 to 3.2.0
{ | ||
"name": "@waves/assets-pairs-order", | ||
"version": "3.1.0", | ||
"version": "3.2.0", | ||
"main": "src/index.js", | ||
@@ -12,5 +12,5 @@ "types": "src/index.d.ts", | ||
"scripts": { | ||
"build:umd": "rollup -c rollup.umd.js", | ||
"build:browser": "rollup -c rollup.config.js", | ||
"test": "jest", | ||
"prepublish": "yarn test && yarn build:umd" | ||
"prepublish": "yarn test && yarn build:browser" | ||
}, | ||
@@ -31,8 +31,8 @@ "devDependencies": { | ||
"rollup-plugin-node-builtins": "^2.1.2", | ||
"rollup-plugin-node-globals": "^1.2.0", | ||
"rollup-plugin-node-resolve": "^3.3.0" | ||
}, | ||
"dependencies": { | ||
"bs58": "^4.0.1", | ||
"ramda": "^0.25.0" | ||
"bs58": "^4.0.1" | ||
} | ||
} |
# Utility for ordering pair of assets in (amount_asset, price_asset) | ||
![Build Status](https://api.travis-ci.org/wavesplatform/assets-pairs-order.svg?branch=master) | ||
## Example: | ||
``` | ||
``` | ||
yarn add @waves/assets-pairs-order | ||
``` | ||
```javascript | ||
import { createOrderPairs, MAINNET_DATA } from '@waves/assets-pairs-order' | ||
import { createOrderPair, MAINNET_DATA } from '@waves/assets-pairs-order' | ||
const orderPair = createOrderPairs(MAINNET_DATA); | ||
orderPairs( | ||
const orderPair = createOrderPair(MAINNET_DATA); | ||
orderPair( | ||
'DNhP2zAH5HM1kdUSmxcBqs8RP4vvUgRFc1YgAKkfPmPD', | ||
@@ -22,1 +25,6 @@ 'FxSm86qcEw8wGfpX3T7X5fsnuK5XxYA6ZfVYJja29vMA' | ||
*/ | ||
## Browser | ||
For using in browser include dist/browser.js | ||
``` |
const Base58 = require('bs58'); | ||
const { curry } = require('ramda'); | ||
const MAINNET_RAW_DATA = require('./mainnet.json'); | ||
@@ -27,3 +26,21 @@ const { compareUint8Arrays, isPair, isEmptyArray } = require('./utils'); | ||
}; | ||
const curry = function(f) { | ||
var slice = Array.prototype.slice, | ||
self = f, | ||
totalargs = self.length, | ||
partial = function(args, fn) { | ||
return function() { | ||
return fn.apply({}, args.concat(slice.call(arguments))); | ||
}; | ||
}, | ||
fn = function() { | ||
var args = slice.call(arguments); | ||
return args.length < totalargs | ||
? partial(args, fn) | ||
: self.apply({}, slice.apply(arguments, [0, totalargs])); | ||
}; | ||
return fn; | ||
}; | ||
module.exports.createOrderPair = curry(orderPair); | ||
module.exports.MAINNET_DATA = MAINNET_DATA; |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
235266
1
2205
30
15
1
- Removedramda@^0.25.0
- Removedramda@0.25.0(transitive)