diff --git a/package.json b/package.json index 47bfa35..fb06a38 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,8 @@ "build-dashboard": "cd src/frontend/dashboard; npm run build; cp -r dist/dashboard/* ../../../static", "build-widget": "rollup -c src/frontend/widget/rollup.config.js; mkdir -p plugins/PluginManager; cp FrontendPlugin.js plugins/PluginManager", "clean": "rm -rf lib static plugins data conf dist widget .rpt2_cache *.js *.ts src/frontend/dashboard/dist", - "update-frontblock": "rm -rf node_modules/frontblock*; npm install" + "update-frontblock": "rm -rf node_modules/frontblock*; npm install", + "webpack": "webpack --entry ./lib/FrontblockLib.js --output ./FrontblockLib.min.js" }, "repository": { "type": "git", diff --git a/src/frontend/dashboard/angular.json b/src/frontend/dashboard/angular.json index 6d6286e..7e5f0e9 100644 --- a/src/frontend/dashboard/angular.json +++ b/src/frontend/dashboard/angular.json @@ -35,7 +35,7 @@ "scripts": [ "node_modules/systemjs/dist/system.js", "node_modules/@webcomponents/custom-elements/custom-elements.min.js", - "node_modules/@clr/icons/clr-icons.min.js" + "node_modules/@clr/icons/clr-icons.min.js" ] }, "configurations": { diff --git a/src/frontend/dashboard/package-lock.json b/src/frontend/dashboard/package-lock.json index a71f301..5c4df88 100644 --- a/src/frontend/dashboard/package-lock.json +++ b/src/frontend/dashboard/package-lock.json @@ -2588,6 +2588,17 @@ "bsert": "~0.0.10" } }, + "btc-hdkey": { + "version": "0.0.17", + "resolved": "https://registry.npmjs.org/btc-hdkey/-/btc-hdkey-0.0.17.tgz", + "integrity": "sha512-1hzd8DeK/cjrBY6nJ+LenBTGL5rQ+dFBaDEoDSmQ/7zvV3EoV9rsa/aYLLke0Q5XPfbxC1lV/Ro5KpNULA7EYQ==", + "requires": { + "bip39": "^3.0.2", + "bitcoinjs-lib": "^5.1.3", + "bsert": "0.0.10", + "hdkey": "^1.1.1" + } + }, "buffer": { "version": "4.9.1", "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.1.tgz", @@ -2973,6 +2984,11 @@ } } }, + "coinselect": { + "version": "3.1.11", + "resolved": "https://registry.npmjs.org/coinselect/-/coinselect-3.1.11.tgz", + "integrity": "sha1-4fBjvRpYgvZzXuBRm52LWsSpMJk=" + }, "coinstring": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/coinstring/-/coinstring-2.3.0.tgz", diff --git a/src/frontend/dashboard/package.json b/src/frontend/dashboard/package.json index d89051f..6a197f8 100644 --- a/src/frontend/dashboard/package.json +++ b/src/frontend/dashboard/package.json @@ -24,12 +24,16 @@ "@clr/icons": "^2.1.1", "@clr/ui": "^2.1.1", "@webcomponents/custom-elements": "^1.0.0", + "btc-hdkey": "0.0.17", + "coinselect": "^3.1.11", "frontblock": "latest", "frontblock-generic": "^0.22.0", "key-file-storage": "^2.2.4", + "node-fetch": "^2.6.0", "rxjs": "~6.5.2", "systemjs": "^0.21.3", "tslib": "^1.9.0", + "uuid": "^3.3.2", "zone.js": "~0.10.1" }, "devDependencies": { diff --git a/src/frontend/dashboard/src/app/ApiClient/apiclient-consumptions.component.ts b/src/frontend/dashboard/src/app/ApiClient/apiclient-consumptions.component.ts index 480536f..2c524a1 100644 --- a/src/frontend/dashboard/src/app/ApiClient/apiclient-consumptions.component.ts +++ b/src/frontend/dashboard/src/app/ApiClient/apiclient-consumptions.component.ts @@ -1,40 +1,16 @@ import { Component, OnInit, isDevMode } from '@angular/core'; -import { SubscriptionResponse, parseResponse, SuccessResponse } from 'frontblock-generic/Types.js'; +import { SubscriptionResponse, parseResponse, SuccessResponse, Coin } from 'frontblock-generic/Types.js'; +import { default as uuid } from 'uuid/v4' -const fb = !isDevMode() ? window["fb"] : { - ApiClient: { - setConfig: async () => { - await new Promise((resolve, reject) => { - setTimeout(() => { - resolve('Promise A win!'); - }, 500) - }) - }, - getConsumptions: async () => { - return await new Promise((resolve, reject) => { - setTimeout(() => { - resolve([new SubscriptionResponse("654", "321"), new SubscriptionResponse("456", "123")]); - }, 500) - }) - }, - getSubscriptions: async () => { - return await new Promise((resolve, reject) => { - setTimeout(() => { - resolve([new SubscriptionResponse("321"), new SubscriptionResponse("123")]); - }, 500) - }) - }, - unsubscribe: (uid) => new SuccessResponse(), - quit: (uid) => new SuccessResponse() - } -} +declare const fb + @Component({ - selector: 'consumptions', - template: ` + selector: 'consumers', + template: `
+ Unconfirmed: {{balance.unconfirmed}}
+ Estimated total: {{balance.total}}
+
+ A menemonic is a collection of words that is supposed to be easier to remember than a complex seed. It may be used to reconstruct the private key. +
++ Enter your menemonic below or generate a new one. +
+ ++ If you entered a menemonic in the previous step, a seed was generated from it. +
++ If you would like to use your own seed enter it below. Use something sufficiently hard to guess. +
+ ++ Accepts keys in the xpub and xprv (BIP32) format +
+ +| Type | +Value | +
|---|---|
| menemonic | +{{menemonic}} | +
| seed | + +|
| xpub | + +|
| xprv | + +