@0xcert/ethereum-utils
Advanced tools
Comparing version 0.0.0-alpha to 0.0.0-alpha10
export * from './lib/abi'; | ||
export * from './lib/normalize-address'; | ||
export * from './lib/sha'; | ||
export * from './lib/big-number'; |
@@ -8,3 +8,3 @@ "use strict"; | ||
__export(require("./lib/normalize-address")); | ||
__export(require("./lib/sha")); | ||
__export(require("./lib/big-number")); | ||
//# sourceMappingURL=index.js.map |
@@ -1,4 +0,2 @@ | ||
export declare function encodeFunctionCall(abi: any, data: any): any; | ||
export declare function encodeParameters(abi: any, data: any): any; | ||
export declare function decodeParameters(abi: any, data: any): any; | ||
export declare function decodeParameter(type: string, data: any): any; | ||
export declare function encodeParameters(types: any, values: any): any; | ||
export declare function decodeParameters(types: any, data: any): any; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const eth = require("web3-eth-abi"); | ||
function encodeFunctionCall(abi, data) { | ||
return eth.encodeFunctionCall(abi, data); | ||
const abi_coder_1 = require("ethers/utils/abi-coder"); | ||
const coder = new abi_coder_1.AbiCoder(); | ||
function encodeParameters(types, values) { | ||
return coder.encode(types, values); | ||
} | ||
exports.encodeFunctionCall = encodeFunctionCall; | ||
function encodeParameters(abi, data) { | ||
return eth.encodeParameters(abi, data); | ||
} | ||
exports.encodeParameters = encodeParameters; | ||
function decodeParameters(abi, data) { | ||
const output = eth.decodeParameters(abi, data); | ||
return output; | ||
function decodeParameters(types, data) { | ||
return coder.decode(types, data); | ||
} | ||
exports.decodeParameters = decodeParameters; | ||
function decodeParameter(type, data) { | ||
return eth.decodeParameter(type, data); | ||
} | ||
exports.decodeParameter = decodeParameter; | ||
//# sourceMappingURL=abi.js.map |
@@ -1,1 +0,1 @@ | ||
export declare function normalizeAddress(address: any): any; | ||
export declare function normalizeAddress(address: string): any; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const address_1 = require("ethers/utils/address"); | ||
function normalizeAddress(address) { | ||
if (!address) { | ||
return address; | ||
} | ||
else { | ||
return address.toLowerCase(); | ||
} | ||
return address_1.getAddress(address); | ||
} | ||
exports.normalizeAddress = normalizeAddress; | ||
//# sourceMappingURL=normalize-address.js.map |
{ | ||
"files": { | ||
"packages/0xcert-ethereum-utils/nodemon.json": "82b893373db9861f1df4b55d8ea68a5d37b118de", | ||
"packages/0xcert-ethereum-utils/package.json": "b6b41df3afcc03b178b2ecd91f66b38769b2ac16", | ||
"packages/0xcert-ethereum-utils/src/index.ts": "496aa52d350408a3807496bcb72deeec1a32249b", | ||
"packages/0xcert-ethereum-utils/src/lib/abi.ts": "ff40889d558e848ae1c88ac833952ca85378a240", | ||
"packages/0xcert-ethereum-utils/src/lib/normalize-address.ts": "298f0d0dfd374ef8039ed334614be4a82923d0d3", | ||
"packages/0xcert-ethereum-utils/src/lib/sha.ts": "961948fda25711783927f414711102feb284f1c6", | ||
"packages/0xcert-ethereum-utils/src/tests/index.test.ts": "4158bc2c5b392389a4edcfd938158a0acad3a9e2", | ||
"packages/0xcert-ethereum-utils/tsconfig.json": "4aeac3c20e45b7e477e82012eb7788f7dbb11bf3", | ||
"common/config/rush/npm-shrinkwrap.json": "a5435cdcfc7dc44cd84ebeab1176982d5a7724bc" | ||
}, | ||
"files": {}, | ||
"arguments": "npm run clean; npx tsc " | ||
} |
{ | ||
"name": "@0xcert/ethereum-utils", | ||
"version": "0.0.0-alpha", | ||
"description": "Ethereum utils for 0xcert protocol.", | ||
"version": "0.0.0-alpha10", | ||
"description": "General Ethereum utility module with helper functions for the Ethereum blockchain.", | ||
"main": "./dist/index.js", | ||
@@ -10,3 +10,3 @@ "types": "./dist/index.d.ts", | ||
"build": "npm run clean; npx tsc", | ||
"test": "npx specron test" | ||
"test": "npx nyc npx specron test" | ||
}, | ||
@@ -24,15 +24,61 @@ "specron": { | ||
}, | ||
"nyc": { | ||
"extension": [ | ||
".ts" | ||
], | ||
"require": [ | ||
"ts-node/register" | ||
], | ||
"exclude": [ | ||
"src/tests" | ||
] | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/0xcert/framework.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/0xcert/framework/issues" | ||
}, | ||
"homepage": "https://github.com/0xcert/framework#readme", | ||
"keywords": [ | ||
"0xcert", | ||
"framework", | ||
"protocol", | ||
"asset", | ||
"value", | ||
"values", | ||
"currency", | ||
"token", | ||
"non-fungible", | ||
"fungible", | ||
"erc-721", | ||
"erc-20", | ||
"blockchain", | ||
"javascript", | ||
"typescript", | ||
"nodejs", | ||
"vuejs", | ||
"nuxtjs", | ||
"npm", | ||
"libraries", | ||
"smart-contract", | ||
"ethereum", | ||
"zxc" | ||
], | ||
"license": "MIT", | ||
"devDependencies": { | ||
"@0xcert/ethereum-sandbox": "0.0.0-alpha4", | ||
"@specron/cli": "^0.3.0", | ||
"@specron/spec": "^0.3.0", | ||
"solc": "^0.5.1", | ||
"@0xcert/ethereum-sandbox": "0.0.0-alpha10", | ||
"@specron/cli": "^0.5.1", | ||
"@specron/spec": "^0.5.1", | ||
"nyc": "^13.1.0", | ||
"solc": "0.5.1", | ||
"ts-node": "^7.0.1", | ||
"typescript": "^3.1.1", | ||
"web3": "^1.0.0-beta.36" | ||
"web3": "^1.0.0-beta.36", | ||
"@0xcert/utils": "0.0.0-alpha10" | ||
}, | ||
"dependencies": { | ||
"web3-eth-abi": "^1.0.0-beta.36" | ||
"ethers": "4.0.0-beta.1" | ||
} | ||
} |
export * from './lib/abi'; | ||
export * from './lib/normalize-address'; | ||
export * from './lib/sha'; | ||
export * from './lib/big-number'; |
@@ -1,30 +0,11 @@ | ||
// TODO: Refacto all !!!!!!! | ||
import { AbiCoder } from 'ethers/utils/abi-coder'; | ||
import * as eth from 'web3-eth-abi'; | ||
const coder = new AbiCoder(); | ||
export function encodeFunctionCall(abi: any, data: any) { | ||
return eth.encodeFunctionCall(abi, data); | ||
export function encodeParameters(types: any, values: any) { | ||
return coder.encode(types, values); | ||
} | ||
export function encodeParameters(abi: any, data: any) { | ||
return eth.encodeParameters(abi, data); | ||
export function decodeParameters(types: any, data: any) { | ||
return coder.decode(types, data); | ||
} | ||
export function decodeParameters(abi: any, data: any) { | ||
const output = eth.decodeParameters(abi, data); | ||
// for (const i in abi) { | ||
// switch(abi[i].type) { | ||
// case 'uint256': | ||
// output[i] = new Big(output[i]); | ||
// break; | ||
// } | ||
// } | ||
return output; | ||
} | ||
export function decodeParameter(type: string, data: any) { | ||
return eth.decodeParameter(type, data); | ||
} | ||
@@ -0,1 +1,3 @@ | ||
import { getAddress } from 'ethers/utils/address'; | ||
/** | ||
@@ -5,9 +7,4 @@ * | ||
*/ | ||
export function normalizeAddress(address) { | ||
if (!address) { | ||
return address; | ||
} | ||
else { | ||
return address.toLowerCase(); | ||
} | ||
export function normalizeAddress(address: string) { | ||
return getAddress(address); | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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 README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
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
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
13182
35
135
1
1
1
8
0
9
1
+ Addedethers@4.0.0-beta.1
+ Added@types/node@10.17.60(transitive)
+ Addedaes-js@3.0.0(transitive)
+ Addedelliptic@6.3.3(transitive)
+ Addedethers@4.0.0-beta.1(transitive)
+ Addedhash.js@1.1.3(transitive)
+ Addedjs-sha3@0.5.7(transitive)
+ Addedscrypt-js@2.0.3(transitive)
+ Addedsetimmediate@1.0.4(transitive)
+ Addeduuid@2.0.1(transitive)
+ Addedxmlhttprequest@1.8.0(transitive)
- Removedweb3-eth-abi@^1.0.0-beta.36
- Removed@ethereumjs/rlp@4.0.1(transitive)
- Removed@ethereumjs/util@8.1.0(transitive)
- Removed@ethersproject/abi@5.7.0(transitive)
- Removed@ethersproject/abstract-provider@5.7.0(transitive)
- Removed@ethersproject/abstract-signer@5.7.0(transitive)
- Removed@ethersproject/address@5.7.0(transitive)
- Removed@ethersproject/base64@5.7.0(transitive)
- Removed@ethersproject/bignumber@5.7.0(transitive)
- Removed@ethersproject/bytes@5.7.0(transitive)
- Removed@ethersproject/constants@5.7.0(transitive)
- Removed@ethersproject/hash@5.7.0(transitive)
- Removed@ethersproject/keccak256@5.7.0(transitive)
- Removed@ethersproject/logger@5.7.0(transitive)
- Removed@ethersproject/networks@5.7.1(transitive)
- Removed@ethersproject/properties@5.7.0(transitive)
- Removed@ethersproject/rlp@5.7.0(transitive)
- Removed@ethersproject/signing-key@5.7.0(transitive)
- Removed@ethersproject/strings@5.7.0(transitive)
- Removed@ethersproject/transactions@5.7.0(transitive)
- Removed@ethersproject/web@5.7.1(transitive)
- Removed@noble/curves@1.4.2(transitive)
- Removed@noble/hashes@1.4.01.7.1(transitive)
- Removed@scure/base@1.1.9(transitive)
- Removed@scure/bip32@1.4.0(transitive)
- Removed@scure/bip39@1.3.0(transitive)
- Removedbn.js@4.11.65.2.1(transitive)
- Removedelliptic@6.5.4(transitive)
- Removedethereum-bloom-filters@1.2.0(transitive)
- Removedethereum-cryptography@2.2.1(transitive)
- Removedethjs-unit@0.1.6(transitive)
- Removedhash.js@1.1.7(transitive)
- Removedhmac-drbg@1.0.1(transitive)
- Removedis-hex-prefixed@1.0.0(transitive)
- Removedjs-sha3@0.8.0(transitive)
- Removedmicro-ftch@0.3.1(transitive)
- Removedminimalistic-crypto-utils@1.0.1(transitive)
- Removednumber-to-bn@1.7.0(transitive)
- Removedrandombytes@2.1.0(transitive)
- Removedsafe-buffer@5.2.1(transitive)
- Removedstrip-hex-prefix@1.0.0(transitive)
- Removedutf8@3.0.0(transitive)
- Removedweb3-eth-abi@1.10.4(transitive)
- Removedweb3-utils@1.10.4(transitive)