]> zoso.dev Git - libnemo.git/commitdiff
working tsc build
authorMiro Metsänheimo <miro@metsanheimo.fi>
Wed, 9 Oct 2019 18:31:40 +0000 (21:31 +0300)
committerMiro Metsänheimo <miro@metsanheimo.fi>
Wed, 9 Oct 2019 18:31:40 +0000 (21:31 +0300)
.gitignore
lib/block-signer.ts
lib/ed25519.ts
lib/nano-address.ts
lib/nano-converter.ts
lib/util/curve25519.ts
package-lock.json
package.json
tsconfig.json

index ad46b30886fa350c1f59761b100e5e4b01f9a7ec..e4f46fdac3ffb0ae9fa867c763a8daf74c71c1c7 100644 (file)
@@ -59,3 +59,5 @@ typings/
 
 # next.js build output
 .next
+
+dist
index 0ee3734e6955d0d7624dce86ae6184bcc50b2569..d3fdb8dc331266efe00dd8264c6685c749c9eeff 100644 (file)
@@ -1,10 +1,11 @@
 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()
index 9a11a225f9ce65068a78e3ddb7f5403764b549ae..b03b4844df711680e316889fa473c73905504eff 100644 (file)
@@ -1,7 +1,8 @@
-import * as blake from 'blakejs'
 import { Convert } from './util/convert'
 import { Curve25519 } from './util/curve25519'
 
+const blake = require('blakejs')
+
 export class Ed25519 {
 
        curve: Curve25519
index 6db5c9c914bd4e86eb0ace2e163940b5ceacf2f6..7a4e9e4aa6e9dd667ad7ec43fccc044b10646e73 100644 (file)
@@ -1,6 +1,7 @@
-import * as blake from 'blakejs'
 import { Convert } from './util/convert'
 
+const blake = require('blakejs')
+
 export class NanoAddress {
 
        readonly alphabet = '13456789abcdefghijkmnopqrstuwxyz'
index 6f8ece3a82209d83589c931a6d38911d8d6e1175..0ce45b4dcbe6c7e0f94654c00274f8dd9f14063f 100644 (file)
@@ -5,11 +5,11 @@ export default class NanoConverter {
        /**
         * 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) {
index 21ed61f414a3fa9e0ba57701bfd28464c6a03375..56a9a69e36c40a770af1d3a1d15060a1806fd4d8 100644 (file)
@@ -555,7 +555,7 @@ export class Curve25519 {
                }
        }
 
-       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)
                }
@@ -563,7 +563,7 @@ export class Curve25519 {
                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(),
index 7783b0d83fbd5fd8380b58e1579ed66d64c36630..a71d636b54f0816b015e95b8b4ec96f4d598c2e0 100644 (file)
@@ -4,6 +4,15 @@
        "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",
index 4bf00151feb025781be0dd5985ec533a83b025ac..c76f3493de96cb73fc917d69fb4c9821d699eea4 100644 (file)
        },
        "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"
        }
 }
index e3007c06ec9f6c2463bd0467bae2f55580e12341..8c3ddd8f807e2d908103fe98c40d1694eb697f87 100644 (file)
@@ -7,9 +7,9 @@
                "strict": true,
                "esModuleInterop": true,
                "downlevelIteration": true,
+               "strictNullChecks": false,
                "types": [
-                       "node",
-                       "index.d.ts"
+                       "node"
                ],
                "lib": [
                        "es2017"