Comparing version 0.2.6 to 0.2.7
{ | ||
"name": "bancorx", | ||
"version": "0.2.6", | ||
"version": "0.2.7", | ||
"description": "BancorX Utility", | ||
"main": "index.js", | ||
"main": "build/index.js", | ||
"types": "index.d.ts", | ||
"files": [ | ||
"index.js", | ||
"index.d.ts", | ||
"index.js.map" | ||
"build" | ||
], | ||
@@ -27,12 +25,19 @@ "keywords": [ | ||
}, | ||
"dependencies": {}, | ||
"dependencies": { | ||
"eos-common": "^0.1.36", | ||
"underscore": "^1.9.1" | ||
}, | ||
"devDependencies": { | ||
"@types/jest": "*", | ||
"@types/underscore": "^1.9.3", | ||
"documentation": "*", | ||
"jest": "*", | ||
"prettier": "^1.18.2", | ||
"ts-jest": "*", | ||
"ts-node": "*", | ||
"tslint": "*", | ||
"tslint-config-prettier": "^1.18.0", | ||
"tslint-plugin-prettier": "^2.0.1", | ||
"typescript": "*" | ||
} | ||
} |
@@ -56,2 +56,4 @@ # BancorX utility | ||
| MEV | eosvegascoin | bancorc11134 | 4 | | ||
| SENSE | sensegenesis | bnr512553153 | 4 | | ||
| USDT | tethertether | bancorc11232 | 4 | | ||
@@ -74,9 +76,9 @@ ## Get Relay Balances | ||
- [bancorFormula](#bancorformula) | ||
- [calculateReturn](#calculateReturn) | ||
- [Parameters](#parameters) | ||
- [Examples](#examples) | ||
- [bancorInverseFormula](#bancorinverseformula) | ||
- [calculateCost](#calculateCost) | ||
- [Parameters](#parameters-1) | ||
- [Examples](#examples-1) | ||
- [parseMemo](#parsememo) | ||
- [composeMemo](#composememo) | ||
- [Parameters](#parameters-2) | ||
@@ -90,3 +92,3 @@ - [Examples](#examples-2) | ||
### bancorFormula | ||
### calculateReturn | ||
@@ -106,5 +108,5 @@ Bancor Formula | ||
- `balanceFrom` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** from token balance in the relay | ||
- `balanceTo` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** to token balance in the relay | ||
- `amount` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** amount to convert | ||
- `balanceFrom` **[Asset](https://github.com/EOS-Nation/eos-common#constructor)** from token balance in the relay | ||
- `balanceTo` **[Asset](https://github.com/EOS-Nation/eos-common#constructor)** to token balance in the relay | ||
- `amount` **[Asset](https://github.com/EOS-Nation/eos-common#constructor)** amount to convert | ||
@@ -114,13 +116,13 @@ #### Examples | ||
```javascript | ||
const balanceFrom = 77814.0638 // EOS | ||
const balanceTo = 429519.5539120331 // BNT | ||
const amount = 1 | ||
const balanceFrom = split(`77814.0638 EOS`) | ||
const balanceTo = split(`429519.5539120331 BNT`) | ||
const amount = split(`1.0000 EOS`) | ||
bancorx.bancorFormula(balanceFrom, balanceTo, amount) | ||
bancorx.calculateReturn(balanceFrom, balanceTo, amount) | ||
// => 5.519748143058556 | ||
``` | ||
Returns **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** computed amount | ||
Returns **[Asset](https://github.com/EOS-Nation/eos-common#constructor)** computed amount | ||
### bancorInverseFormula | ||
### calculateCost | ||
@@ -140,5 +142,5 @@ Bancor Inverse Formula | ||
- `balanceFrom` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** from token balance in the relay | ||
- `balanceTo` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** to token balance in the relay | ||
- `amountDesired` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** amount to desired | ||
- `balanceFrom` **[Asset](https://github.com/EOS-Nation/eos-common#constructor)** from token balance in the relay | ||
- `balanceTo` **[Asset](https://github.com/EOS-Nation/eos-common#constructor)** to token balance in the relay | ||
- `amountDesired` **[Asset](https://github.com/EOS-Nation/eos-common#constructor)** amount to desired | ||
@@ -148,13 +150,13 @@ #### Examples | ||
```javascript | ||
const balanceFrom = 77814.0638 // EOS | ||
const balanceTo = 429519.5539120331 // BNT | ||
const amountDesired = 1 | ||
const balanceFrom = split(`77814.0638 EOS`) | ||
const balanceTo = split(`429519.5539120331 BNT`) | ||
const amountDesired = split(`1.0000 EOS`) | ||
bancorx.bancorInverseFormula(balanceFrom, balanceTo, amountDesired) | ||
bancorx.calculateCost(balanceFrom, balanceTo, amountDesired) | ||
// => 0.18116577989712823 | ||
``` | ||
Returns **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** computed desired amount | ||
Returns **[Asset](https://github.com/EOS-Nation/eos-common#constructor)** computed desired amount | ||
### parseMemo | ||
### composeMemo | ||
@@ -177,7 +179,7 @@ Parse Memo | ||
// Single converter (BNT => CUSD) | ||
bancorx.parseMemo([CUSD], "3.17", "<account>") | ||
bancorx.composeMemo([CUSD], "3.17", "<account>") | ||
// => "1,bancorc11144 CUSD,3.17,<account>" | ||
// Multi converter (EOS => BNT => CUSD) | ||
bancorx.parseMemo([BNT, CUSD], "3.17", "<account>") | ||
bancorx.composeMemo([BNT, CUSD], "3.17", "<account>") | ||
// => "1,bnt2eoscnvrt BNT bancorc11144 CUSD,3.17,<account>" | ||
@@ -184,0 +186,0 @@ ``` |
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
44819
15
686
212
2
11
1
+ Addedeos-common@^0.1.36
+ Addedunderscore@^1.9.1
+ Addeddecimal.js@10.4.3(transitive)
+ Addedeos-common@0.1.36(transitive)
+ Addedunderscore@1.13.7(transitive)