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

bancorx

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bancorx - npm Package Compare versions

Comparing version 0.2.6 to 0.2.7

build/AbstractBancorCalculator.d.ts

17

package.json
{
"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 @@ ```

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