add default exports, clear dist before compile

This commit is contained in:
Miro Metsänheimo 2019-10-18 19:03:17 +03:00
commit 7928ad9cb1
13 changed files with 31 additions and 28 deletions

View file

@ -1,5 +1,5 @@
import { AddressGenerator } from './lib/address-generator'
import { AddressImporter, Account, Wallet } from './lib/address-importer'
import AddressGenerator from './lib/address-generator'
import AddressImporter, { Account, Wallet } from './lib/address-importer'
import BlockSigner, { TransactionBlock, RepresentativeBlock, SignedBlock } from './lib/block-signer'
import BigNumber from 'bignumber.js'
import NanoConverter from './lib/nano-converter'

View file

@ -1,10 +1,10 @@
import Bip32KeyDerivation from './bip32-key-derivation'
import Bip39Mnemonic from './bip39-mnemonic'
import { Ed25519 } from './ed25519'
import { NanoAddress } from './nano-address'
import Ed25519 from './ed25519'
import NanoAddress from './nano-address'
import { Wallet } from './address-importer'
export class AddressGenerator {
export default class AddressGenerator {
/**
* Generates the wallet

View file

@ -1,9 +1,9 @@
import Bip32KeyDerivation from './bip32-key-derivation'
import Bip39Mnemonic from './bip39-mnemonic'
import { Ed25519 } from './ed25519'
import { NanoAddress } from './nano-address'
import Ed25519 from './ed25519'
import NanoAddress from './nano-address'
export class AddressImporter {
export default class AddressImporter {
fromMnemonic(mnemonic: string, seedPassword = ''): Wallet {
const bip39 = new Bip39Mnemonic(seedPassword)

View file

@ -1,7 +1,6 @@
import { Convert } from './util/convert'
//@ts-ignore
import { enc, algo } from 'crypto-js'
import Convert from './util/convert'
const ED25519_CURVE = 'ed25519 seed'
const HARDENED_OFFSET = 0x80000000

View file

@ -1,6 +1,6 @@
import Convert from './util/convert'
import Util from './util/util'
import words from './words'
import { Util } from './util/util'
import { Convert } from './util/convert'
//@ts-ignore
import { algo, enc, lib, PBKDF2, SHA256 } from 'crypto-js'

View file

@ -1,8 +1,8 @@
import BigNumber from 'bignumber.js'
import { Ed25519 } from './ed25519'
import { NanoAddress } from './nano-address'
import Convert from './util/convert'
import Ed25519 from './ed25519'
import NanoAddress from './nano-address'
import NanoConverter from './nano-converter'
import { Convert } from './util/convert'
//@ts-ignore
import { blake2b, blake2bInit, blake2bUpdate, blake2bFinal } from 'blakejs'

View file

@ -1,10 +1,10 @@
import { Convert } from './util/convert'
import { Curve25519 } from './util/curve25519'
import Convert from './util/convert'
import Curve25519 from './util/curve25519'
//@ts-ignore
import { blake2b } from 'blakejs'
export class Ed25519 {
export default class Ed25519 {
curve: Curve25519
X: Int32Array

View file

@ -1,9 +1,9 @@
import { Convert } from './util/convert'
import Convert from './util/convert'
//@ts-ignore
import { blake2b } from 'blakejs'
export class NanoAddress {
export default class NanoAddress {
readonly alphabet = '13456789abcdefghijkmnopqrstuwxyz'
readonly prefix = 'nano_'

View file

@ -1,4 +1,4 @@
export class Convert {
export default class Convert {
/**
* Convert a string (UTF-8 encoded) to a byte array

View file

@ -1,6 +1,6 @@
import { Util } from './util'
import Util from './util'
export class Curve25519 {
export default class Curve25519 {
gf0: Int32Array
gf1: Int32Array

View file

@ -1,4 +1,4 @@
export class Util {
export default class Util {
/**
* Time constant comparison of two arrays

View file

@ -1,7 +1,7 @@
{
"name": "nanocurrency-web",
"version": "1.0.3",
"description": "Toolset for Nano cryptocurrency client side offline integrations",
"version": "1.0.4",
"description": "Toolkit for Nano cryptocurrency client side offline integrations",
"author": "Miro Metsänheimo <miro@metsanheimo.fi>",
"license": "MIT",
"homepage": "https://github.com/numsu/nanocurrency-web-js#readme",
@ -16,13 +16,16 @@
"nano",
"currency",
"mnemonic",
"crypto"
"crypto",
"wallet",
"block",
"sign"
],
"main": "dist/index.js",
"types": "dist/index.d.ts",
"unpkg": "dist/index.min.js",
"scripts": {
"build": "tsc && npm run build:webpack",
"build": "rm -rf dist && tsc && npm run build:webpack",
"build:webpack": "webpack",
"test": "mocha --reporter spec"
},

View file

@ -8,6 +8,7 @@
"esModuleInterop": true,
"downlevelIteration": true,
"strictNullChecks": false,
"forceConsistentCasingInFileNames": true,
"types": [
"node"
],