conflux-web-utils
Advanced tools
Comparing version 0.1.15-alpha.0 to 1.2.2-alpha.0
{ | ||
"name": "conflux-web-utils", | ||
"version": "0.1.15-alpha.0", | ||
"description": "Collection of utility functions used in conflux-web.js.", | ||
"repository": "https://github.com/Conflux-Chain/ConfluxWeb/tree/master/packages/conflux-web-utils", | ||
"version": "1.2.2-alpha.0", | ||
"description": "Collection of utility functions used in conflux-web.", | ||
"repository": "https://github.com/Conflux-Chain/ConfluxWeb/tree/conflux-web-1.2.1/packages/conflux-web-utils", | ||
"license": "LGPL-3.0", | ||
"main": "dist/conflux-web-utils.cjs.js", | ||
"module": "dist/conflux-web-utils.esm.js", | ||
"browser": "dist/conflux-web-utils.umd.js", | ||
"scripts": { | ||
"build": "rollup -c", | ||
"dev": "rollup -c -w", | ||
"test": "jest", | ||
"dtslint": "dtslint types --onlyTestTsNext" | ||
"engines": { | ||
"node": ">=8.0.0" | ||
}, | ||
"types": "types/index.d.ts", | ||
"main": "src/index.js", | ||
"dependencies": { | ||
"@babel/runtime": "^7.3.1", | ||
"@types/bn.js": "^4.11.4", | ||
"@types/node": "^10.12.18", | ||
"bn.js": "4.11.8", | ||
"confluxjs-unit": "*", | ||
"eth-lib": "0.2.8", | ||
"lodash": "^4.17.11", | ||
"eth-lib": "0.2.7", | ||
"ethjs-unit": "0.1.6", | ||
"number-to-bn": "1.7.0", | ||
"randomhex": "0.1.5", | ||
"utf8": "2.1.1" | ||
"underscore": "1.9.1", | ||
"utf8": "3.0.0" | ||
}, | ||
"devDependencies": { | ||
"crypto-js": "3.1.9-1", | ||
"definitelytyped-header-parser": "^1.0.1", | ||
"dtslint": "0.4.2" | ||
}, | ||
"files": [ | ||
"dist", | ||
"types/index.d.ts" | ||
], | ||
"gitHead": "321bbe5fcd40edebce07b544836bb5f201947a94" | ||
"gitHead": "5867aaed668598b8531a372128e7c0b84d975e99" | ||
} |
# conflux-web-utils | ||
This is a sub package of [ConfluxWeb.js][repo] | ||
This is a sub package of [conflux-web][repo] | ||
This contains useful utility functions for Dapp developers. | ||
Please read the [documentation][docs] for more. | ||
## Installation | ||
### Node.js | ||
```bash | ||
@@ -13,14 +16,24 @@ npm install conflux-web-utils | ||
### In the Browser | ||
Build running the following in the [conflux-web][repo] repository: | ||
```bash | ||
npm run-script build-all | ||
``` | ||
Then include `dist/conflux-web-utils.js` in your html file. | ||
This will expose the `ConfluxWebUtils` object on the window object. | ||
## Usage | ||
Import all of the utils functions | ||
```js | ||
import * as Utils from 'conflux-web-utils'; | ||
console.log(Utils); | ||
> { | ||
sha3: Function, | ||
soliditySha3: Function, | ||
isAddress: Function, | ||
// in node.js | ||
var ConfluxWebUtils = require('conflux-web-utils'); | ||
console.log(ConfluxWebUtils); | ||
{ | ||
sha3: function(){}, | ||
soliditySha3: function(){}, | ||
isAddress: function(){}, | ||
... | ||
@@ -30,15 +43,6 @@ } | ||
Import what you need | ||
```js | ||
import { asciiToHex } from 'conflux-web-utils'; | ||
[docs]: https://phabricator.conflux-chain.org/w/javascript_api/ | ||
[repo]: https://github.com/Conflux-Chain/ConfluxWeb/tree/conflux-web-1.2.1 | ||
console.log(asciiToHex('I have 100!')); | ||
> "0x49206861766520313030e282ac" | ||
``` | ||
## Types | ||
All the typescript typings are placed in the types folder. | ||
[repo]: https://github.com/Conflux-Chain/ConfluxWeb |
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
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
Wildcard dependency
QualityPackage has a dependency with a floating version range. This can cause issues if the dependency publishes a new major version.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
7
0
1
47
35199
992
1
+ Addedethjs-unit@0.1.6
+ Addedunderscore@1.9.1
+ Addedeth-lib@0.2.7(transitive)
+ Addedethjs-unit@0.1.6(transitive)
+ Addedunderscore@1.9.1(transitive)
+ Addedutf8@3.0.0(transitive)
- Removed@babel/runtime@^7.3.1
- Removed@types/bn.js@^4.11.4
- Removed@types/node@^10.12.18
- Removedconfluxjs-unit@*
- Removedlodash@^4.17.11
- Removed@babel/runtime@7.26.0(transitive)
- Removed@types/bn.js@4.11.6(transitive)
- Removed@types/node@10.17.60(transitive)
- Removedconfluxjs-unit@0.0.4(transitive)
- Removedeth-lib@0.2.8(transitive)
- Removedlodash@4.17.21(transitive)
- Removedregenerator-runtime@0.14.1(transitive)
- Removedutf8@2.1.1(transitive)
Updatedeth-lib@0.2.7
Updatedutf8@3.0.0