@iov/crypto
Advanced tools
Comparing version 0.14.5 to 0.15.0
@@ -11,5 +11,5 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const encoding_1 = require("@iov/encoding"); | ||
const BN = require("bn.js"); | ||
const elliptic = require("elliptic"); | ||
const encoding_1 = require("@iov/encoding"); | ||
const secp256k1signature_1 = require("./secp256k1signature"); | ||
@@ -36,5 +36,3 @@ const secp256k1 = new elliptic.ec("secp256k1"); | ||
} | ||
/* eslint-disable @typescript-eslint/no-object-literal-type-assertion */ | ||
// tslint:disable-next-line:no-object-literal-type-assertion | ||
return { | ||
const out = { | ||
privkey: encoding_1.Encoding.fromHex(keypair.getPrivate("hex")), | ||
@@ -47,3 +45,3 @@ // encodes uncompressed as | ||
}; | ||
/* eslint-enable @typescript-eslint/no-object-literal-type-assertion */ | ||
return out; | ||
}); | ||
@@ -50,0 +48,0 @@ } |
#!/usr/bin/env node | ||
require("source-map-support").install(); | ||
const defaultSpecReporterConfig = require("../../jasmine-spec-reporter.config.json"); | ||
@@ -18,16 +19,9 @@ // setup Jasmine | ||
// setup console reporter | ||
const JasmineConsoleReporter = require("jasmine-console-reporter"); | ||
const consoleReporter = new JasmineConsoleReporter({ | ||
colors: 1, // (0|false)|(1|true)|2 | ||
cleanStack: 1, // (0|false)|(1|true)|2|3 | ||
verbosity: 4, // (0|false)|1|2|(3|true)|4 | ||
listStyle: "indent", // "flat"|"indent" | ||
activity: true, | ||
emoji: true, | ||
}); | ||
// setup reporter | ||
const { SpecReporter } = require("jasmine-spec-reporter"); | ||
const reporter = new SpecReporter({ ...defaultSpecReporterConfig }); | ||
// initialize and execute | ||
jasmine.env.clearReporters(); | ||
jasmine.addReporter(consoleReporter); | ||
jasmine.addReporter(reporter); | ||
jasmine.execute(); |
{ | ||
"name": "@iov/crypto", | ||
"version": "0.14.5", | ||
"version": "0.15.0", | ||
"description": "Cryptography resources for IOV projects", | ||
@@ -33,3 +33,3 @@ "author": "IOV SAS <admin@iov.one>", | ||
"dependencies": { | ||
"@iov/encoding": "^0.14.5", | ||
"@iov/encoding": "^0.15.0", | ||
"bip39": "^2.5.0", | ||
@@ -48,3 +48,3 @@ "bn.js": "^4.11.8", | ||
}, | ||
"gitHead": "1f4d0497bfd5b28fbe9684921529ddbb8b943746" | ||
"gitHead": "6705df135a4d75a8d9198a38c99399411aaab8bf" | ||
} |
@@ -1,6 +0,7 @@ | ||
import { Encoding } from "@iov/encoding"; | ||
import BN = require("bn.js"); | ||
import elliptic = require("elliptic"); | ||
import { As } from "type-tagger"; | ||
import { Encoding } from "@iov/encoding"; | ||
import { ExtendedSecp256k1Signature, Secp256k1Signature } from "./secp256k1signature"; | ||
@@ -11,8 +12,9 @@ | ||
export declare const Secp256k1KeypairSymbol: unique symbol; | ||
export type Secp256k1Keypair = typeof Secp256k1KeypairSymbol & { | ||
interface Keypair { | ||
readonly pubkey: Uint8Array; | ||
readonly privkey: Uint8Array; | ||
}; | ||
} | ||
export type Secp256k1Keypair = Keypair & As<"secp256k1-keypair">; | ||
export class Secp256k1 { | ||
@@ -38,5 +40,3 @@ public static async makeKeypair(privkey: Uint8Array): Promise<Secp256k1Keypair> { | ||
/* eslint-disable @typescript-eslint/no-object-literal-type-assertion */ | ||
// tslint:disable-next-line:no-object-literal-type-assertion | ||
return { | ||
const out: Keypair = { | ||
privkey: Encoding.fromHex(keypair.getPrivate("hex")), | ||
@@ -48,4 +48,4 @@ // encodes uncompressed as | ||
pubkey: Encoding.fromHex(keypair.getPublic().encode("hex")), | ||
} as Secp256k1Keypair; | ||
/* eslint-enable @typescript-eslint/no-object-literal-type-assertion */ | ||
}; | ||
return out as Secp256k1Keypair; | ||
} | ||
@@ -52,0 +52,0 @@ |
@@ -12,4 +12,4 @@ const packageJson = require("./package.json"); | ||
excludeExternals: true, | ||
excludeNotExported: true, | ||
excludePrivate: true, | ||
excludeNotExported: true, | ||
}; |
@@ -0,7 +1,8 @@ | ||
import { As } from "type-tagger"; | ||
import { ExtendedSecp256k1Signature, Secp256k1Signature } from "./secp256k1signature"; | ||
export declare const Secp256k1KeypairSymbol: unique symbol; | ||
export declare type Secp256k1Keypair = typeof Secp256k1KeypairSymbol & { | ||
interface Keypair { | ||
readonly pubkey: Uint8Array; | ||
readonly privkey: Uint8Array; | ||
}; | ||
} | ||
export declare type Secp256k1Keypair = Keypair & As<"secp256k1-keypair">; | ||
export declare class Secp256k1 { | ||
@@ -13,1 +14,2 @@ static makeKeypair(privkey: Uint8Array): Promise<Secp256k1Keypair>; | ||
} | ||
export {}; |
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
979549
12700
+ Added@iov/encoding@0.15.0(transitive)
- Removed@iov/encoding@0.14.5(transitive)
Updated@iov/encoding@^0.15.0