add default exports, clear dist before compile
This commit is contained in:
parent
adb5b78202
commit
7928ad9cb1
13 changed files with 31 additions and 28 deletions
4
index.ts
4
index.ts
|
|
@ -1,5 +1,5 @@
|
||||||
import { AddressGenerator } from './lib/address-generator'
|
import AddressGenerator from './lib/address-generator'
|
||||||
import { AddressImporter, Account, Wallet } from './lib/address-importer'
|
import AddressImporter, { Account, Wallet } from './lib/address-importer'
|
||||||
import BlockSigner, { TransactionBlock, RepresentativeBlock, SignedBlock } from './lib/block-signer'
|
import BlockSigner, { TransactionBlock, RepresentativeBlock, SignedBlock } from './lib/block-signer'
|
||||||
import BigNumber from 'bignumber.js'
|
import BigNumber from 'bignumber.js'
|
||||||
import NanoConverter from './lib/nano-converter'
|
import NanoConverter from './lib/nano-converter'
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
import Bip32KeyDerivation from './bip32-key-derivation'
|
import Bip32KeyDerivation from './bip32-key-derivation'
|
||||||
import Bip39Mnemonic from './bip39-mnemonic'
|
import Bip39Mnemonic from './bip39-mnemonic'
|
||||||
import { Ed25519 } from './ed25519'
|
import Ed25519 from './ed25519'
|
||||||
import { NanoAddress } from './nano-address'
|
import NanoAddress from './nano-address'
|
||||||
import { Wallet } from './address-importer'
|
import { Wallet } from './address-importer'
|
||||||
|
|
||||||
export class AddressGenerator {
|
export default class AddressGenerator {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generates the wallet
|
* Generates the wallet
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
import Bip32KeyDerivation from './bip32-key-derivation'
|
import Bip32KeyDerivation from './bip32-key-derivation'
|
||||||
import Bip39Mnemonic from './bip39-mnemonic'
|
import Bip39Mnemonic from './bip39-mnemonic'
|
||||||
import { Ed25519 } from './ed25519'
|
import Ed25519 from './ed25519'
|
||||||
import { NanoAddress } from './nano-address'
|
import NanoAddress from './nano-address'
|
||||||
|
|
||||||
export class AddressImporter {
|
export default class AddressImporter {
|
||||||
|
|
||||||
fromMnemonic(mnemonic: string, seedPassword = ''): Wallet {
|
fromMnemonic(mnemonic: string, seedPassword = ''): Wallet {
|
||||||
const bip39 = new Bip39Mnemonic(seedPassword)
|
const bip39 = new Bip39Mnemonic(seedPassword)
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
import { Convert } from './util/convert'
|
|
||||||
|
|
||||||
//@ts-ignore
|
//@ts-ignore
|
||||||
import { enc, algo } from 'crypto-js'
|
import { enc, algo } from 'crypto-js'
|
||||||
|
import Convert from './util/convert'
|
||||||
|
|
||||||
const ED25519_CURVE = 'ed25519 seed'
|
const ED25519_CURVE = 'ed25519 seed'
|
||||||
const HARDENED_OFFSET = 0x80000000
|
const HARDENED_OFFSET = 0x80000000
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
|
import Convert from './util/convert'
|
||||||
|
import Util from './util/util'
|
||||||
import words from './words'
|
import words from './words'
|
||||||
import { Util } from './util/util'
|
|
||||||
import { Convert } from './util/convert'
|
|
||||||
|
|
||||||
//@ts-ignore
|
//@ts-ignore
|
||||||
import { algo, enc, lib, PBKDF2, SHA256 } from 'crypto-js'
|
import { algo, enc, lib, PBKDF2, SHA256 } from 'crypto-js'
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
import BigNumber from 'bignumber.js'
|
import BigNumber from 'bignumber.js'
|
||||||
import { Ed25519 } from './ed25519'
|
import Convert from './util/convert'
|
||||||
import { NanoAddress } from './nano-address'
|
import Ed25519 from './ed25519'
|
||||||
|
import NanoAddress from './nano-address'
|
||||||
import NanoConverter from './nano-converter'
|
import NanoConverter from './nano-converter'
|
||||||
import { Convert } from './util/convert'
|
|
||||||
|
|
||||||
//@ts-ignore
|
//@ts-ignore
|
||||||
import { blake2b, blake2bInit, blake2bUpdate, blake2bFinal } from 'blakejs'
|
import { blake2b, blake2bInit, blake2bUpdate, blake2bFinal } from 'blakejs'
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
import { Convert } from './util/convert'
|
import Convert from './util/convert'
|
||||||
import { Curve25519 } from './util/curve25519'
|
import Curve25519 from './util/curve25519'
|
||||||
|
|
||||||
//@ts-ignore
|
//@ts-ignore
|
||||||
import { blake2b } from 'blakejs'
|
import { blake2b } from 'blakejs'
|
||||||
|
|
||||||
export class Ed25519 {
|
export default class Ed25519 {
|
||||||
|
|
||||||
curve: Curve25519
|
curve: Curve25519
|
||||||
X: Int32Array
|
X: Int32Array
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
import { Convert } from './util/convert'
|
import Convert from './util/convert'
|
||||||
|
|
||||||
//@ts-ignore
|
//@ts-ignore
|
||||||
import { blake2b } from 'blakejs'
|
import { blake2b } from 'blakejs'
|
||||||
|
|
||||||
export class NanoAddress {
|
export default class NanoAddress {
|
||||||
|
|
||||||
readonly alphabet = '13456789abcdefghijkmnopqrstuwxyz'
|
readonly alphabet = '13456789abcdefghijkmnopqrstuwxyz'
|
||||||
readonly prefix = 'nano_'
|
readonly prefix = 'nano_'
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
export class Convert {
|
export default class Convert {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert a string (UTF-8 encoded) to a byte array
|
* Convert a string (UTF-8 encoded) to a byte array
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import { Util } from './util'
|
import Util from './util'
|
||||||
|
|
||||||
export class Curve25519 {
|
export default class Curve25519 {
|
||||||
|
|
||||||
gf0: Int32Array
|
gf0: Int32Array
|
||||||
gf1: Int32Array
|
gf1: Int32Array
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
export class Util {
|
export default class Util {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Time constant comparison of two arrays
|
* Time constant comparison of two arrays
|
||||||
|
|
|
||||||
11
package.json
11
package.json
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "nanocurrency-web",
|
"name": "nanocurrency-web",
|
||||||
"version": "1.0.3",
|
"version": "1.0.4",
|
||||||
"description": "Toolset for Nano cryptocurrency client side offline integrations",
|
"description": "Toolkit for Nano cryptocurrency client side offline integrations",
|
||||||
"author": "Miro Metsänheimo <miro@metsanheimo.fi>",
|
"author": "Miro Metsänheimo <miro@metsanheimo.fi>",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"homepage": "https://github.com/numsu/nanocurrency-web-js#readme",
|
"homepage": "https://github.com/numsu/nanocurrency-web-js#readme",
|
||||||
|
|
@ -16,13 +16,16 @@
|
||||||
"nano",
|
"nano",
|
||||||
"currency",
|
"currency",
|
||||||
"mnemonic",
|
"mnemonic",
|
||||||
"crypto"
|
"crypto",
|
||||||
|
"wallet",
|
||||||
|
"block",
|
||||||
|
"sign"
|
||||||
],
|
],
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"types": "dist/index.d.ts",
|
"types": "dist/index.d.ts",
|
||||||
"unpkg": "dist/index.min.js",
|
"unpkg": "dist/index.min.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "tsc && npm run build:webpack",
|
"build": "rm -rf dist && tsc && npm run build:webpack",
|
||||||
"build:webpack": "webpack",
|
"build:webpack": "webpack",
|
||||||
"test": "mocha --reporter spec"
|
"test": "mocha --reporter spec"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
"downlevelIteration": true,
|
"downlevelIteration": true,
|
||||||
"strictNullChecks": false,
|
"strictNullChecks": false,
|
||||||
|
"forceConsistentCasingInFileNames": true,
|
||||||
"types": [
|
"types": [
|
||||||
"node"
|
"node"
|
||||||
],
|
],
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue