depay-blockchain-token
Advanced tools
Comparing version 0.10.0 to 0.11.0
@@ -165,2 +165,8 @@ 'use strict'; | ||
Token.BigNumber = async ({ amount, blockchain, address }) => { | ||
let token = new Token({ blockchain, address }); | ||
let decimals = await token.decimals(); | ||
return ethers.ethers.BigNumber.from(amount).mul(ethers.ethers.BigNumber.from(10).pow(decimals)) | ||
}; | ||
exports.Token = Token; |
@@ -161,2 +161,8 @@ import { call } from 'depay-blockchain-call'; | ||
Token.BigNumber = async ({ amount, blockchain, address }) => { | ||
let token = new Token({ blockchain, address }); | ||
let decimals = await token.decimals(); | ||
return ethers.BigNumber.from(amount).mul(ethers.BigNumber.from(10).pow(decimals)) | ||
}; | ||
export { Token }; |
@@ -164,2 +164,8 @@ (function (global, factory) { | ||
Token.BigNumber = async ({ amount, blockchain, address }) => { | ||
let token = new Token({ blockchain, address }); | ||
let decimals = await token.decimals(); | ||
return ethers.ethers.BigNumber.from(amount).mul(ethers.ethers.BigNumber.from(10).pow(decimals)) | ||
}; | ||
exports.Token = Token; | ||
@@ -166,0 +172,0 @@ |
{ | ||
"name": "depay-blockchain-token", | ||
"moduleName": "BlockchainToken", | ||
"version": "0.10.0", | ||
"version": "0.11.0", | ||
"description": "JavaScript library providing basic functionalities to work with tokens.", | ||
@@ -6,0 +6,0 @@ "main": "dist/cjs/index.js", |
@@ -29,3 +29,3 @@ ## Quickstart | ||
### initalize | ||
### initalize (new) | ||
@@ -65,2 +65,14 @@ ```javascript | ||
### BigNumber | ||
Provides the BigNumber amount for a given token (based on the tokens decimals) based on a humand readable amount: | ||
```javascript | ||
Token.BigNumber({ | ||
amount: 1, | ||
blockchain: 'ethereum', | ||
address: '0xa0bed124a09ac2bd941b10349d8d224fe3c955eb' | ||
}) // BigNumber '1000000000000000000' | ||
``` | ||
## Development | ||
@@ -67,0 +79,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
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
16862
484
90