# next.js build output
.next
+
+dist
import BigNumber from 'bignumber.js'
-import * as blake from 'blakejs'
import { Ed25519 } from './ed25519'
import { NanoAddress } from './nano-address'
import NanoConverter from './nano-converter'
import { Convert } from './util/convert'
+const blake = require('blakejs')
+
export default class BlockSigner {
nanoAddress = new NanoAddress()
-import * as blake from 'blakejs'
import { Convert } from './util/convert'
import { Curve25519 } from './util/curve25519'
+const blake = require('blakejs')
+
export class Ed25519 {
curve: Curve25519
-import * as blake from 'blakejs'
import { Convert } from './util/convert'
+const blake = require('blakejs')
+
export class NanoAddress {
readonly alphabet = '13456789abcdefghijkmnopqrstuwxyz'
/**
* Converts the input value to the wanted unit
*
- * @param input {BigNumber} value
- * @param inputUnit {Unit} the unit to convert from
- * @param outputUnit {Unit} the unit to convert to
+ * @param input {string | BigNumber} value
+ * @param inputUnit {string} the unit to convert from
+ * @param outputUnit {string} the unit to convert to
*/
- static convert(input: BigNumber, inputUnit: string, outputUnit: string): string {
+ static convert(input: string | BigNumber, inputUnit: string, outputUnit: string): string {
let value = new BigNumber(input.toString())
switch (inputUnit) {
}
}
- unpack25519(o: Int32Array, n: Int32Array): void {
+ unpack25519(o: Int32Array, n: Uint8Array): void {
for (let i = 0; i < 16; i++) {
o[i] = n[2 * i] + (n[2 * i + 1] << 8)
}
o[15] &= 0x7fff
}
- unpackNeg(r: Int32Array[], p: Int32Array): number {
+ unpackNeg(r: Int32Array[], p: Uint8Array): number {
const t = this.gf(),
chk = this.gf(),
num = this.gf(),
"lockfileVersion": 1,
"requires": true,
"dependencies": {
+ "@types/bignumber.js": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/@types/bignumber.js/-/bignumber.js-5.0.0.tgz",
+ "integrity": "sha512-0DH7aPGCClywOFaxxjE6UwpN2kQYe9LwuDQMv+zYA97j5GkOMo8e66LYT+a8JYU7jfmUFRZLa9KycxHDsKXJCA==",
+ "dev": true,
+ "requires": {
+ "bignumber.js": "9.0.0"
+ }
+ },
"@types/node": {
"version": "12.7.12",
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.7.12.tgz",
"resolved": "https://registry.npmjs.org/bignumber/-/bignumber-1.1.0.tgz",
"integrity": "sha1-5qsKdD2l8+oBjlwXWX0SH3howVk="
},
+ "bignumber.js": {
+ "version": "9.0.0",
+ "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.0.0.tgz",
+ "integrity": "sha512-t/OYhhJ2SD+YGBQcjY8GzzDHEk9f3nerxjtfa6tlMXfe7frs/WozhvCNoGvpM0P3bNf3Gq5ZRMlGr5f3r4/N8A==",
+ "dev": true
+ },
"blakejs": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/blakejs/-/blakejs-1.1.0.tgz",
},
"main": "index.js",
"scripts": {
+ "build": "tsc",
"test": "echo \"Error: no test specified\" && exit 1"
},
"dependencies": {
- "bignumber": "^1.1.0",
- "blakejs": "^1.1.0"
+ "bignumber": "1.1.0",
+ "blakejs": "1.1.0"
},
"devDependencies": {
- "@types/node": "^12.7.12",
+ "@types/bignumber.js": "5.0.0",
+ "@types/node": "12.7.12",
"typescript": "3.6.3"
}
}
"strict": true,
"esModuleInterop": true,
"downlevelIteration": true,
+ "strictNullChecks": false,
"types": [
- "node",
- "index.d.ts"
+ "node"
],
"lib": [
"es2017"