@0xcert/utils
Advanced tools
Comparing version 0.0.0-alpha7 to 0.0.0-alpha8
@@ -5,4 +5,4 @@ { | ||
{ | ||
"version": "0.0.0-alpha7", | ||
"tag": "@0xcert/utils_v0.0.0-alpha7", | ||
"version": "0.0.0-alpha8", | ||
"tag": "@0xcert/utils_v0.0.0-alpha8", | ||
"date": "Thu, 22 Nov 2018 00:51:03 GMT", | ||
@@ -9,0 +9,0 @@ "comments": {} |
@@ -5,3 +5,3 @@ # Change Log - @0xcert/utils | ||
## 0.0.0-alpha7 | ||
## 0.0.0-alpha8 | ||
Thu, 22 Nov 2018 00:51:03 GMT | ||
@@ -8,0 +8,0 @@ |
export * from './methods/fetch'; | ||
export * from './methods/sha'; | ||
export * from './methods/keccak'; | ||
export * from './methods/to-float'; | ||
@@ -4,0 +5,0 @@ export * from './methods/to-integer'; |
@@ -8,2 +8,3 @@ "use strict"; | ||
__export(require("./methods/sha")); | ||
__export(require("./methods/keccak")); | ||
__export(require("./methods/to-float")); | ||
@@ -10,0 +11,0 @@ __export(require("./methods/to-integer")); |
@@ -1,1 +0,1 @@ | ||
export declare function sha(bits: any, message: any): Promise<any>; | ||
export declare function sha(bits: number, message: string): Promise<any>; |
@@ -8,2 +8,3 @@ "use strict"; | ||
ctx.true(!!utils.sha); | ||
ctx.true(!!utils.keccak256); | ||
ctx.true(!!utils.toFloat); | ||
@@ -10,0 +11,0 @@ ctx.true(!!utils.toInteger); |
@@ -1,3 +0,3 @@ | ||
import { Spec } from '@hayspec/spec'; | ||
import { Spec } from '@specron/spec'; | ||
declare const spec: Spec<{}>; | ||
export default spec; |
@@ -11,3 +11,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const spec_1 = require("@hayspec/spec"); | ||
const spec_1 = require("@specron/spec"); | ||
const fetch_1 = require("../../methods/fetch"); | ||
@@ -14,0 +14,0 @@ const spec = new spec_1.Spec(); |
@@ -1,3 +0,3 @@ | ||
import { Spec } from '@hayspec/spec'; | ||
import { Spec } from '@specron/spec'; | ||
declare const spec: Spec<{}>; | ||
export default spec; |
@@ -11,3 +11,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const spec_1 = require("@hayspec/spec"); | ||
const spec_1 = require("@specron/spec"); | ||
const sha_1 = require("../../methods/sha"); | ||
@@ -14,0 +14,0 @@ const spec = new spec_1.Spec(); |
{ | ||
"files": { | ||
"packages/0xcert-utils/CHANGELOG.json": "c1edecacb2a54f567645e15410a5d5d799c5d7d9", | ||
"packages/0xcert-utils/CHANGELOG.md": "499c65fc2daf2816694a25ef29b3eebe9e5ea334", | ||
"packages/0xcert-utils/README.md": "97cb6086d9f4d557e55bd27ab30f1ea053da99d3", | ||
"packages/0xcert-utils/CHANGELOG.json": "28050f4445518d0fc66232aae9d621ef6fa3a20f", | ||
"packages/0xcert-utils/CHANGELOG.md": "3bbc7cc2adcddea4389e571b192480b8601151c8", | ||
"packages/0xcert-utils/README.md": "2a5fb7bba1ba15ef2a13e750efc655cf3b313241", | ||
"packages/0xcert-utils/nodemon.json": "82b893373db9861f1df4b55d8ea68a5d37b118de", | ||
"packages/0xcert-utils/package.json": "0d1847f48aa69a595359a65f7366c4008da743e9", | ||
"packages/0xcert-utils/src/index.ts": "0a054c91431bdeb593b72bb7fda305d4ca6a4025", | ||
"packages/0xcert-utils/package.json": "6934f2094b2797a10250e2e4d29d1faae826a116", | ||
"packages/0xcert-utils/src/index.ts": "a40a59e4ffc9b7099602a46f9680dffb6e307f6e", | ||
"packages/0xcert-utils/src/methods/fetch.ts": "38bd72d299d314b21e6a559c87dbf8a10c24679d", | ||
"packages/0xcert-utils/src/methods/sha.ts": "6202bfe61b0f04840e3c022587262e18f65b194c", | ||
"packages/0xcert-utils/src/methods/keccak.ts": "01f81d68fb90e32e294274c1eb24a8878e6e9cd6", | ||
"packages/0xcert-utils/src/methods/sha.ts": "c3663ee29111e7fd1ae64273534d55b9b268fc57", | ||
"packages/0xcert-utils/src/methods/to-float.ts": "e44cc4338abf7d73ccabe640e3ead0abfe6dec44", | ||
@@ -16,5 +17,6 @@ "packages/0xcert-utils/src/methods/to-integer.ts": "4dc3f456314329cd7fe4eb8722dda9eac576e120", | ||
"packages/0xcert-utils/src/methods/to-tuple.ts": "41647ab4186866cf9370636975a3702ddd110ed2", | ||
"packages/0xcert-utils/src/tests/index.test.ts": "68036c543f5f05ade8559f09077d5422c5826cb0", | ||
"packages/0xcert-utils/src/tests/methods/fetch.test.ts": "50be3702384c701e1af9d848e6f03a1f0b83d20b", | ||
"packages/0xcert-utils/src/tests/methods/sha.test.ts": "85d6c28a9928192ed45a2ecded6c4c26ab1bac15", | ||
"packages/0xcert-utils/src/tests/index.test.ts": "22f6b1bc6af1a128709254518ffabed67923da46", | ||
"packages/0xcert-utils/src/tests/methods/fetch.test.ts": "b57c90997292c496a8a7be7d63801d20ba599c46", | ||
"packages/0xcert-utils/src/tests/methods/keccak.test.ts": "f4ebdc21c96bedfeabebeef6afc2282f66fd2485", | ||
"packages/0xcert-utils/src/tests/methods/sha.test.ts": "c8bb6efd1967107d42d38115484e4eb4eb109c52", | ||
"packages/0xcert-utils/src/tests/methods/to-float.test.ts": "a14d8363c793e28a9f4cf129f9a6c9942d81c3c8", | ||
@@ -26,5 +28,5 @@ "packages/0xcert-utils/src/tests/methods/to-integer.test.ts": "9319883c15171c0d302ad681874f1e57512f7a8e", | ||
"packages/0xcert-utils/tsconfig.json": "4aeac3c20e45b7e477e82012eb7788f7dbb11bf3", | ||
"common/config/rush/npm-shrinkwrap.json": "b5af47441ed8345fd5cfe61bc37d9d7008283a33" | ||
"common/config/rush/npm-shrinkwrap.json": "8f19ba9dbdefd16dc6af9aff055b174191c3e0b8" | ||
}, | ||
"arguments": "npm run clean && npx tsc " | ||
"arguments": "npx specron test " | ||
} |
{ | ||
"name": "@0xcert/utils", | ||
"version": "0.0.0-alpha7", | ||
"description": "Ethereum utils for 0xcert protocol.", | ||
"version": "0.0.0-alpha8", | ||
"description": "General utility module with common helper functions.", | ||
"main": "./dist/index.js", | ||
@@ -23,8 +23,42 @@ "types": "./dist/index.d.ts", | ||
}, | ||
"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": { | ||
"@specron/cli": "^0.5.0", | ||
"@specron/spec": "^0.5.0", | ||
"@specron/cli": "^0.5.1", | ||
"@specron/spec": "^0.5.1", | ||
"eth-lib": "0.1.27", | ||
"node-fetch": "^2.3.0", | ||
"solc": "^0.5.1", | ||
"solc": "0.5.1", | ||
"ts-node": "^7.0.1", | ||
@@ -31,0 +65,0 @@ "typescript": "^3.1.1", |
@@ -1,7 +0,7 @@ | ||
```ts | ||
import { Web3GenericProviderGenericProvider } from '@0xcert/web3-connectr'; | ||
<img src="https://github.com/0xcert/framework/raw/master/assets/cover-sub.png" /> | ||
const web3GenericProvider = new Web3GenericProviderGenericProvider({ | ||
web3Provider: 'http://localhost:8354', | ||
}); | ||
``` | ||
> General utility module with common helper functions. | ||
The [0xcert Framework](https://docs.0xcert.org) is a free and open-source JavaScript library that provides tools for building powerful decentralized applications. Please refer to the [official documentation](https://docs.0xcert.org) for more details. | ||
This module is one of the bricks of the [0xcert Framework](https://docs.0xcert.org). It's written with [TypeScript](https://www.typescriptlang.org) and it's actively maintained. The source code is available on [GitHub](https://github.com/0xcert/framework) where you can also find our [issue tracker](https://github.com/0xcert/framework/issues). |
export * from './methods/fetch'; | ||
export * from './methods/sha'; | ||
export * from './methods/keccak'; | ||
export * from './methods/to-float'; | ||
@@ -4,0 +5,0 @@ export * from './methods/to-integer'; |
/** | ||
* Converts a message into SHA256 hash string. | ||
* @param bits Number of bits (e.g. 256). | ||
* @param message Text message. | ||
*/ | ||
export async function sha(bits, message) { | ||
export async function sha(bits: number, message: string) { | ||
if (typeof window !== 'undefined') { | ||
@@ -7,0 +8,0 @@ const msgBuffer = new window['TextEncoder']('utf-8').encode(message); |
@@ -8,2 +8,3 @@ import { Spec } from '@specron/spec'; | ||
ctx.true(!!utils.sha); | ||
ctx.true(!!utils.keccak256); | ||
ctx.true(!!utils.toFloat); | ||
@@ -10,0 +11,0 @@ ctx.true(!!utils.toInteger); |
@@ -1,2 +0,2 @@ | ||
import { Spec } from '@hayspec/spec'; | ||
import { Spec } from '@specron/spec'; | ||
import { fetch } from '../../methods/fetch'; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
import { Spec } from '@hayspec/spec'; | ||
import { Spec } from '@specron/spec'; | ||
import { sha } from '../../methods/sha'; | ||
@@ -3,0 +3,0 @@ |
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
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
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
37241
82
596
1
1
8
0
8