Big sed
Some checks are pending
CodeQL / Analyze (push) Waiting to run
Docker Hub / build_and_push (push) Waiting to run
Electron App Release / pre_build (push) Waiting to run
Electron App Release / release (AppImage, linux, checksums, checksums, false, ubuntu-20.04) (push) Blocked by required conditions
Electron App Release / release (dmg, mac, checksums, checksums, false, macos-11) (push) Blocked by required conditions
Electron App Release / release (exe, windows, checksums, checksums, true, windows-2022) (push) Blocked by required conditions
GitHub Pages / build-and-deploy (push) Waiting to run
Linting / lint (push) Waiting to run

This commit is contained in:
Minecon724 2025-10-16 20:37:04 +02:00
commit a3d31e263d
Signed by untrusted user who does not match committer: m
GPG key ID: A02E6E67AB961189
54 changed files with 886 additions and 739 deletions

View file

@ -0,0 +1,26 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/javascript-node
{
"name": "Node.js",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/javascript-node:1-22-bookworm",
// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "yarn install",
// Configure tool-specific properties.
"customizations" : {
"jetbrains" : {
"backend" : "WebStorm"
}
},
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}

3
.npmrc Normal file
View file

@ -0,0 +1,3 @@
registry=https://registry.npmjs.org
@dncurrency:registry=https://git.m724.eu/api/packages/dn724/npm/

View file

@ -1,5 +1,5 @@
# build the angular app
FROM node:16 AS build
FROM docker.io/node:lts AS build
WORKDIR /usr/src/app
RUN apt-get update && apt-get install -y \
libudev-dev \
@ -10,6 +10,6 @@ COPY . .
RUN npm run wallet:build
# build the nginx hosting container
FROM nginx:1.21-alpine
FROM docker.io/nginx:stable-alpine
COPY .docker/nginx.conf /etc/nginx/nginx.conf
COPY --from=build /usr/src/app/dist /usr/share/nginx/html
COPY --from=build /usr/src/app/dist /usr/share/nginx/html

View file

@ -13,7 +13,7 @@ const log = require('electron-log');
let showUpdateErrors = false;
let saveTimeout = null;
let isDownloading = false;
const nano_schemes = ['nano', 'nanorep', 'nanoseed', 'nanokey', 'nanosign', 'nanoprocess'];
const nano_schemes = ['dn', 'dnrep', 'dnseed', 'dnkey', 'dnsign', 'dnprocess'];
/**
* By default, the logger writes logs to the following locations:

1113
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -37,6 +37,8 @@
"@angular/platform-browser-dynamic": "^13.1.1",
"@angular/router": "^13.1.1",
"@angular/service-worker": "^13.1.1",
"@dncurrency/nanocurrency": "^2.5.0",
"@dncurrency/nanocurrency-web": "^1.4.3",
"@ledgerhq/hw-transport": "^6.27.1",
"@ledgerhq/hw-transport-node-ble": "^6.27.1",
"@ledgerhq/hw-transport-node-hid": "^6.27.1",
@ -66,8 +68,6 @@
"hermes-channel": "0.0.6",
"hw-app-nano": "^1.3.0",
"nano-base32": "^1.0.1",
"nanocurrency": "^2.5.0",
"nanocurrency-web": "^1.4.3",
"ngx-clipboard": "^12.3.0",
"node-hid": "^2.2.0",
"qrcode": "^1.4.4",

View file

@ -24,7 +24,7 @@
<div class="balance-column">
<ng-container *ngIf="(walletService.wallet.updatingBalance === false) else balanceLoading">
<div class="balance primary">
{{ wallet.selectedAccount.balance | rai: 'mnano,true' | amountsplit: 0 }}{{ wallet.selectedAccount.balance | rai: 'mnano,true' | amountsplit: 1 }} XNO
{{ wallet.selectedAccount.balance | rai: 'mnano,true' | amountsplit: 0 }}{{ wallet.selectedAccount.balance | rai: 'mnano,true' | amountsplit: 1 }} DNC
</div>
<div class="balance converted">{{ wallet.selectedAccount.balanceFiat | fiat: settings.settings.displayCurrency }}</div>
</ng-container>
@ -42,7 +42,7 @@
</div>
<div class="balance-column">
<ng-container *ngIf="(walletService.wallet.updatingBalance === false) else balanceLoading">
<div class="balance primary">{{ wallet.balance | rai: 'mnano,true' | amountsplit: 0 }}{{ wallet.balance | rai: 'mnano,true' | amountsplit: 1 }} XNO</div>
<div class="balance primary">{{ wallet.balance | rai: 'mnano,true' | amountsplit: 0 }}{{ wallet.balance | rai: 'mnano,true' | amountsplit: 1 }} DNC</div>
<div class="balance converted">{{ wallet.balanceFiat | fiat: settings.settings.displayCurrency }}</div>
</ng-container>
<ng-template #balanceLoading>
@ -63,9 +63,9 @@
<div class="balance primary">
<span class="incoming-label" *ngIf="account.pending.gt(0)">
<span class="text-snippet">{{ 'general.new' | transloco }}</span>
<span class="text-full">+{{ account.pending | rai: 'mnano,true' | amountsplit: 0 }}{{ account.pending | rai: 'mnano,true' | amountsplit: 1 }} XNO</span>
<span class="text-full">+{{ account.pending | rai: 'mnano,true' | amountsplit: 0 }}{{ account.pending | rai: 'mnano,true' | amountsplit: 1 }} DNC</span>
</span>
{{ account.balance | rai: 'mnano,true' | amountsplit: 0 }}{{ account.balance | rai: 'mnano,true' | amountsplit: 1 }} XNO
{{ account.balance | rai: 'mnano,true' | amountsplit: 0 }}{{ account.balance | rai: 'mnano,true' | amountsplit: 1 }} DNC
</div>
<div class="balance converted">{{ account.balanceFiat | fiat: settings.settings.displayCurrency }}</div>
</ng-container>
@ -124,7 +124,7 @@
<div class="account-balances">
<ng-container *ngIf="( ( node.status && (wallet.balanceInitialized === true) ) || !isConfigured() ) else balancesLoading">
<div class="balance-container primary">
<div class="currency-name">XNO</div>
<div class="currency-name">DNC</div>
<div class="amount-container">
<div class="amount-integer">{{ (wallet.selectedAccount !== null ? wallet.selectedAccount.balance : wallet.balance) | rai: 'mnano,true' | amountsplit: 0 }}</div>
<div class="amount-fractional">{{ (wallet.selectedAccount !== null ? wallet.selectedAccount.balance : wallet.balance) | rai: 'mnano,true' | amountsplit: 1 }}</div>
@ -176,7 +176,7 @@
</div>
<div class="account-balances">
<div class="balance-container primary">
<div class="currency-name">XNO</div>
<div class="currency-name">DNC</div>
<div class="amount-container">
<div class="amount-integer">{{ (wallet.selectedAccount ? wallet.selectedAccount.pending : wallet.pending) | rai: 'mnano,true' | amountsplit: 0 }}</div>
<div class="amount-fractional">{{ (wallet.selectedAccount ? wallet.selectedAccount.pending : wallet.pending) | rai: 'mnano,true' | amountsplit: 1 }}</div>
@ -276,10 +276,7 @@
</div>
<div class="uk-width-1-3 uk-text-center community-column">
<div class="icons-row">
<a href="https://github.com/Nault/Nault" uk-icon="icon: github-alt; ratio: 1.2;" uk-tooltip title="View our GitHub" class="footer-link" target="_blank" rel="noopener noreferrer"></a>
<a href="https://chat.nano.org" uk-tooltip title="Join our community on Discord" class="footer-link discord-icon" target="_blank" rel="noopener noreferrer">
<svg width="28" height="28" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 245 240"><path class="st0" d="M104.4 103.9c-5.7 0-10.2 5-10.2 11.1s4.6 11.1 10.2 11.1c5.7 0 10.2-5 10.2-11.1.1-6.1-4.5-11.1-10.2-11.1zM140.9 103.9c-5.7 0-10.2 5-10.2 11.1s4.6 11.1 10.2 11.1c5.7 0 10.2-5 10.2-11.1s-4.5-11.1-10.2-11.1z"/><path class="st0" d="M189.5 20h-134C44.2 20 35 29.2 35 40.6v135.2c0 11.4 9.2 20.6 20.5 20.6h113.4l-5.3-18.5 12.8 11.9 12.1 11.2 21.5 19V40.6c0-11.4-9.2-20.6-20.5-20.6zm-38.6 130.6s-3.6-4.3-6.6-8.1c13.1-3.7 18.1-11.9 18.1-11.9-4.1 2.7-8 4.6-11.5 5.9-5 2.1-9.8 3.5-14.5 4.3-9.6 1.8-18.4 1.3-25.9-.1-5.7-1.1-10.6-2.7-14.7-4.3-2.3-.9-4.8-2-7.3-3.4-.3-.2-.6-.3-.9-.5-.2-.1-.3-.2-.4-.3-1.8-1-2.8-1.7-2.8-1.7s4.8 8 17.5 11.8c-3 3.8-6.7 8.3-6.7 8.3-22.1-.7-30.5-15.2-30.5-15.2 0-32.2 14.4-58.3 14.4-58.3 14.4-10.8 28.1-10.5 28.1-10.5l1 1.2c-18 5.2-26.3 13.1-26.3 13.1s2.2-1.2 5.9-2.9c10.7-4.7 19.2-6 22.7-6.3.6-.1 1.1-.2 1.7-.2 6.1-.8 13-1 20.2-.2 9.5 1.1 19.7 3.9 30.1 9.6 0 0-7.9-7.5-24.9-12.7l1.4-1.6s13.7-.3 28.1 10.5c0 0 14.4 26.1 14.4 58.3 0 0-8.5 14.5-30.6 15.2z"/></svg>
</a>
<a href="https://git.m724.eu/dn724/dnault" uk-icon="icon: github-alt; ratio: 1.2;" uk-tooltip title="View our source" class="footer-link" target="_blank" rel="noopener noreferrer"></a>
</div>
<div class="section-caption">Community</div>
</div>

View file

@ -305,7 +305,7 @@ export class AppComponent implements OnInit {
if (!searchData.length) return;
const isValidNanoAccount = (
( searchData.startsWith('xrb_') || searchData.startsWith('nano_') )
( searchData.startsWith('xrb_') || searchData.startsWith('nano_') || searchData.startsWith('dn_'))
&& this.util.account.isValidAccount(searchData)
);

View file

@ -22,7 +22,7 @@
<div class="account-balances">
<ng-container *ngIf="!loadingAccountDetails else cardBalancesLoading">
<div class="balance-container primary">
<div class="currency-name">XNO</div>
<div class="currency-name">DNC</div>
<div class="amount-container">
<div class="amount-integer">{{ !account ? 0 : (account.balance || 0 | rai: 'mnano,true') | amountsplit: 0 }}</div>
<div class="amount-fractional">{{ !account ? 0 : (account.balance || 0 | rai: 'mnano,true') | amountsplit: 1 }}</div>
@ -388,7 +388,7 @@
<span class="uk-text-small">{{ 'general.blockactions.ready-to-receive' | transloco }}</span><br>
<span class="amount-integer">{{ pending.amount | rai: 'mnano,true' | amountsplit: 0 }}</span>
<span class="amount-fractional">{{ pending.amount | rai: 'mnano,true' | amountsplit: 1 }}</span>
<span class="currency-name">XNO</span>
<span class="currency-name">DNC</span>
<div class="compact-actions-date">
<ng-template [ngTemplateOutlet]="transactionActionsOrDate"></ng-template>
</div>
@ -484,7 +484,7 @@
</ng-container>
<span class="amount-integer">{{ history.amount | rai: 'mnano,true' | amountsplit: 0 }}</span>
<span class="amount-fractional">{{ history.amount | rai: 'mnano,true' | amountsplit: 1 }}</span>
<span class="currency-name">XNO</span>
<span class="currency-name">DNC</span>
<div class="compact-actions-date text-half-muted">
<ng-template [ngTemplateOutlet]="transactionActionsOrDate"></ng-template>
</div>
@ -609,7 +609,7 @@
</div>
<div class="uk-width-1-1" style="margin-top: 10px;" *ngIf="settings.settings.displayCurrency">
<div class="uk-width-1-1 uk-inline">
<a class="uk-form-icon uk-link-reset uk-link-muted" style="padding-left: 7px;" uk-tooltip title="Last Price: {{ price.price.lastPrice | fiat: settings.settings.displayCurrency }} / XNO">{{ settings.settings.displayCurrency | currencySymbol }}</a>
<a class="uk-form-icon uk-link-reset uk-link-muted" style="padding-left: 7px;" uk-tooltip title="Last Price: {{ price.price.lastPrice | fiat: settings.settings.displayCurrency }} / DNC">{{ settings.settings.displayCurrency | currencySymbol }}</a>
<input [(ngModel)]="amountFiat" (input)="syncNanoPrice()" style="padding-left: 50px !important;" class="uk-input" id="form-horizontal-text-fiat" type="text" placeholder="Amount of {{ settings.settings.displayCurrency }} to send">
</div>
</div>
@ -626,8 +626,8 @@
<div class="uk-form-controls">
<div class="form-input-destination uk-inline uk-width-1-1">
<a class="uk-form-icon uk-form-icon-flip" uk-icon="icon: camera" (click)="openQR('rep1','account')" uk-tooltip title="Scan from QR code"></a>
<input (blur)="validateRepresentative()" (input)="searchRepresentatives()" (focus)="searchRepresentatives()" (keyup.enter)="generateChange()" [(ngModel)]="representativeModel" class="uk-input" [ngClass]="{ 'uk-form-success': repStatus === 2, 'uk-form-danger': repStatus === 0 }" id="form-horizontal-text3" type="text" placeholder="nano_abc...123" #repInput>
<input (blur)="validateRepresentative()" (input)="searchRepresentatives()" (focus)="searchRepresentatives()" (keyup.enter)="generateChange()" [(ngModel)]="representativeModel" class="uk-input" [ngClass]="{ 'uk-form-success': repStatus === 2, 'uk-form-danger': repStatus === 0 }" id="form-horizontal-text3" type="text" placeholder="dn_abc...123" #repInput>
<div *ngIf="(representativeResults$ | async).length" [hidden]="!showRepresentatives" class="nlt-dropdown uk-animation-slide-down-small uk-width-1-1 uk-card uk-card-default uk-card-body uk-position-absolute" style="z-index: 15000">
<ul class="uk-nav uk-nav-default">
<li class="uk-nav-header">Representative List Results</li>

View file

@ -13,7 +13,7 @@ import * as QRCode from 'qrcode';
import BigNumber from 'bignumber.js';
import {RepresentativeService} from '../../services/representative.service';
import {BehaviorSubject} from 'rxjs';
import * as nanocurrency from 'nanocurrency';
import * as nanocurrency from '@dncurrency/nanocurrency';
import {NinjaService} from '../../services/ninja.service';
import { QrModalService } from '../../services/qr-modal.service';
import { TranslocoService } from '@ngneat/transloco';
@ -81,9 +81,7 @@ export class AccountDetailsComponent implements OnInit, OnDestroy {
showAddressBook = false;
addressBookMatch = '';
amounts = [
{ name: 'XNO', shortName: 'XNO', value: 'mnano' },
{ name: 'knano', shortName: 'knano', value: 'knano' },
{ name: 'nano', shortName: 'nano', value: 'nano' },
{ name: 'DNC', shortName: 'DNC', value: 'mnano' }
];
selectedAmount = this.amounts[0];
@ -1008,7 +1006,7 @@ export class AccountDetailsComponent implements OnInit, OnDestroy {
const isValid = this.util.account.isValidAccount(this.toAccountID);
if (!isValid) return this.notifications.sendWarning(`To account address is not valid`);
if (!this.accountID || !this.toAccountID) return this.notifications.sendWarning(`From and to account are required`);
if (!this.validateAmount()) return this.notifications.sendWarning(`Invalid XNO Amount`);
if (!this.validateAmount()) return this.notifications.sendWarning(`Invalid DNC Amount`);
this.qrCodeImageBlock = null;
@ -1028,7 +1026,7 @@ export class AccountDetailsComponent implements OnInit, OnDestroy {
const nanoAmount = this.rawAmount.div(this.nano);
if (this.amount < 0 || rawAmount.lessThan(0)) return this.notifications.sendWarning(`Amount is invalid`);
if (from.balanceBN.minus(rawAmount).lessThan(0)) return this.notifications.sendError(`From account does not have enough XNO`);
if (from.balanceBN.minus(rawAmount).lessThan(0)) return this.notifications.sendError(`From account does not have enough DNC`);
// Determine a proper raw amount to show in the UI, if a decimal was entered
this.amountRaw = this.rawAmount.mod(this.nano);
@ -1042,7 +1040,7 @@ export class AccountDetailsComponent implements OnInit, OnDestroy {
const defaultRepresentative = this.settings.settings.defaultRepresentative || this.nanoBlock.getRandomRepresentative();
const representative = from.representative || defaultRepresentative;
const blockData = {
account: this.accountID.replace('xrb_', 'nano_').toLowerCase(),
account: this.accountID.replace('xrb_', 'nano_').replace('nano_', 'dn_').toLowerCase(),
previous: from.frontier,
representative: representative,
balance: remainingDecimal,
@ -1063,7 +1061,7 @@ export class AccountDetailsComponent implements OnInit, OnDestroy {
if (!('contents' in previousBlockInfo)) return this.notifications.sendError(`Previous block not found`);
const jsonBlock = JSON.parse(previousBlockInfo.contents);
const blockDataPrevious = {
account: jsonBlock.account.replace('xrb_', 'nano_').toLowerCase(),
account: jsonBlock.account.replace('xrb_', 'nano_').replace('nano_', 'dn_').toLowerCase(),
previous: jsonBlock.previous,
representative: jsonBlock.representative,
balance: jsonBlock.balance,
@ -1100,7 +1098,7 @@ export class AccountDetailsComponent implements OnInit, OnDestroy {
const newBalanceDecimal = newBalance.toString(10);
const blockData = {
account: this.accountID.replace('xrb_', 'nano_').toLowerCase(),
account: this.accountID.replace('xrb_', 'nano_').replace('nano_', 'dn_').toLowerCase(),
previous: previousBlock,
representative: representative,
balance: newBalanceDecimal,
@ -1124,7 +1122,7 @@ export class AccountDetailsComponent implements OnInit, OnDestroy {
if (!('contents' in previousBlockInfo)) return this.notifications.sendError(`Previous block not found`);
const jsonBlock = JSON.parse(previousBlockInfo.contents);
blockDataPrevious = {
account: jsonBlock.account.replace('xrb_', 'nano_').toLowerCase(),
account: jsonBlock.account.replace('xrb_', 'nano_').replace('nano_', 'dn_').toLowerCase(),
previous: jsonBlock.previous,
representative: jsonBlock.representative,
balance: jsonBlock.balance,
@ -1165,7 +1163,7 @@ export class AccountDetailsComponent implements OnInit, OnDestroy {
const balance = new BigNumber(account.balance);
const balanceDecimal = balance.toString(10);
const blockData = {
account: this.accountID.replace('xrb_', 'nano_').toLowerCase(),
account: this.accountID.replace('xrb_', 'nano_').replace('nano_', 'dn_').toLowerCase(),
previous: account.frontier,
representative: this.representativeModel,
balance: balanceDecimal,
@ -1188,7 +1186,7 @@ export class AccountDetailsComponent implements OnInit, OnDestroy {
if (!('contents' in previousBlockInfo)) return this.notifications.sendError(`Previous block not found`);
const jsonBlock = JSON.parse(previousBlockInfo.contents);
const blockDataPrevious = {
account: jsonBlock.account.replace('xrb_', 'nano_').toLowerCase(),
account: jsonBlock.account.replace('xrb_', 'nano_').replace('nano_', 'dn_').toLowerCase(),
previous: jsonBlock.previous,
representative: jsonBlock.representative,
balance: jsonBlock.balance,

View file

@ -1,6 +1,6 @@
<div class="uk-animation-slide-left-small" uk-grid>
<div class="uk-width-1-1">
<div class="uk-margin-bottom" uk-grid>
<div class="uk-width-expand@s uk-width-1-1">
<h2 class="uk-heading-divider uk-text-truncate">
@ -47,12 +47,12 @@
<div class="account-amounts-primary uk-width-1-1">
<div *ngIf="account.pending.gt(0)" class="incoming-label">
<div class="text-snippet">{{ 'general.new' | transloco }}</div>
<div class="text-full">+{{ account.pending | rai: 'mnano,true' | amountsplit: 0 }}{{ account.pending | rai: 'mnano,true' | amountsplit: 1 }} XNO</div>
<div class="text-full">+{{ account.pending | rai: 'mnano,true' | amountsplit: 0 }}{{ account.pending | rai: 'mnano,true' | amountsplit: 1 }} DNC</div>
</div>
<span class="amounts" [title]="( account.balanceRaw.gt(0) ? ( '+' + ( account.balanceRaw.toString(10) ) + ' raw' ) : '' )">
<span class="amount-integer">{{ account.balance | rai: 'mnano,true' | amountsplit: 0 }}</span>
<span class="amount-fractional">{{ account.balance | rai: 'mnano,true' | amountsplit: 1 }}</span>
<span class="currency-name">XNO</span>
<span class="currency-name">DNC</span>
</span>
</div>
<div class="account-amounts-converted uk-width-1-1 text-half-muted">

View file

@ -1,6 +1,6 @@
<div class="uk-animation-slide-left-small" uk-grid *transloco="let t">
<div class="uk-width-1-1" id="address-book-sortable">
<div class="uk-margin-bottom" uk-grid>
<div class="uk-width-expand@s uk-width-1-1">
<h2 class="uk-heading-divider uk-text-truncate">
@ -28,11 +28,11 @@
<span [title]="( totalTrackedBalanceRaw.gt(0) ? ( '+' + ( totalTrackedBalanceRaw.toString(10) ) + ' raw' ) : '' )">
<span class="amount-integer">{{ totalTrackedBalance | rai: 'mnano,true' | amountsplit: 0 }}</span>
<span class="amount-fractional">{{ totalTrackedBalance | rai: 'mnano,true' | amountsplit: 1 }}</span>
<span class="currency-name">XNO</span>
<span class="currency-name">DNC</span>
</span>
<div *ngIf="totalTrackedPending.gt(0)" class="incoming-label">
<div class="text-snippet">{{ 'general.new' | transloco }}</div>
<div class="text-full">+{{ totalTrackedPending | rai: 'mnano,true' | amountsplit: 0 }}{{ totalTrackedPending | rai: 'mnano,true' | amountsplit: 1 }} XNO</div>
<div class="text-full">+{{ totalTrackedPending | rai: 'mnano,true' | amountsplit: 0 }}{{ totalTrackedPending | rai: 'mnano,true' | amountsplit: 1 }} DNC</div>
</div>
<div class="account-amounts-converted uk-width-1-1 text-half-muted">
{{ totalTrackedBalanceFiat | fiat: appSettings.settings.displayCurrency }}
@ -109,11 +109,11 @@
<span [title]="( accounts[addressBook.account]?.balanceRaw.gt(0) ? ( '+' + ( accounts[addressBook.account]?.balanceRaw.toString(10) ) + ' raw' ) : '' )">
<span class="amount-integer">{{ accounts[addressBook.account]?.balance | rai: 'mnano,true' | amountsplit: 0 }}</span>
<span class="amount-fractional">{{ accounts[addressBook.account]?.balance | rai: 'mnano,true' | amountsplit: 1 }}</span>
<span class="currency-name">XNO</span>
<span class="currency-name">DNC</span>
</span>
<div *ngIf="accounts[addressBook.account]?.pending.gt(0)" class="incoming-label">
<div class="text-snippet">New</div>
<div class="text-full">+{{ accounts[addressBook.account]?.pending | rai: 'mnano,true' | amountsplit: 0 }}{{ accounts[addressBook.account]?.pending | rai: 'mnano,true' | amountsplit: 1 }} XNO</div>
<div class="text-full">+{{ accounts[addressBook.account]?.pending | rai: 'mnano,true' | amountsplit: 0 }}{{ accounts[addressBook.account]?.pending | rai: 'mnano,true' | amountsplit: 1 }} DNC</div>
</div>
</div>
<div class="account-amounts-converted uk-width-1-1 text-half-muted">
@ -163,7 +163,7 @@
<div class="uk-form-controls">
<div class="uk-inline uk-width-1-1">
<a class="uk-form-icon uk-form-icon-flip" uk-icon="icon: camera" (click)="openQR('account1','account')" uk-tooltip [title]="t('general.scan-qr-code')" *ngIf="creatingNewEntry"></a>
<input type="text" class="uk-input" id="new-address-account" [(ngModel)]="newAddressAccount" [disabled]="!creatingNewEntry" placeholder="nano_abc123">
<input type="text" class="uk-input" id="new-address-account" [(ngModel)]="newAddressAccount" [disabled]="!creatingNewEntry" placeholder="dn_abc123">
</div>
</div>
</div>

View file

@ -286,7 +286,7 @@ export class AddressBookComponent implements OnInit, AfterViewInit, OnDestroy {
}
// Remove spaces and convert to nano prefix
this.newAddressAccount = this.newAddressAccount.replace(/ /g, '').replace('xrb_', 'nano_');
this.newAddressAccount = this.newAddressAccount.replace(/ /g, '').replace('xrb_', 'nano_').replace('nano_', 'dn_');
// If the name has been changed, make sure no other entries are using that name
if ( (this.newAddressName !== this.previousAddressName) && this.addressBookService.nameExists(this.newAddressName) ) {

View file

@ -26,7 +26,7 @@
</div>
</div>
<div class="uk-width-1-1">
<div class="uk-width-1-1" style="display: none;">
<div class="uk-form-horizontal">
<div class="uk-margin">
@ -224,7 +224,7 @@
<div class="uk-inline uk-width-1-1">
<a class="uk-form-icon uk-form-icon-flip" uk-icon="icon: camera" (click)="openQR('rep1','account')" uk-tooltip [title]="t('general.scan-qr-code')"></a>
<input (blur)="validateRepresentative()" (input)="searchRepresentatives()" (focus)="searchRepresentatives()" [(ngModel)]="defaultRepresentative" class="uk-input" [ngClass]="{ 'uk-form-success': repStatus === 2, 'uk-form-danger': repStatus === 0 }" id="form-horizontal-text3" type="text" [placeholder]="t('configure-app.leave-blank-to-use-a-recommended-one')" #repInput>
<div *ngIf="(representativeResults$ | async).length" [hidden]="!showRepresentatives" class="nlt-dropdown uk-animation-slide-down-small uk-width-1-1 uk-card uk-card-default uk-card-body uk-position-absolute" style="z-index: 15000">
<ul class="uk-nav uk-nav-default">
<li class="uk-nav-header">{{ 'representative-search.representative-list-results' | transloco }}</li>

View file

@ -47,9 +47,7 @@ export class ConfigureAppComponent implements OnInit {
selectedLanguage = this.languages[0].id;
denominations = [
{ name: 'XNO', value: 'mnano' },
{ name: 'knano', value: 'knano' },
{ name: 'nano', value: 'nano' },
{ name: 'DNC', value: 'mnano' }
];
selectedDenomination = this.denominations[0].value;
@ -61,39 +59,6 @@ export class ConfigureAppComponent implements OnInit {
currencies = [
{ name: this.translocoService.translate('configure-app.currencies.none'), value: '' },
{ name: 'USD - US Dollar', value: 'USD' },
{ name: 'BTC - Bitcoin', value: 'BTC' },
{ name: 'AUD - Australian Dollar', value: 'AUD' },
{ name: 'BRL - Brazilian Real', value: 'BRL' },
{ name: 'CAD - Canadian Dollar', value: 'CAD' },
{ name: 'CHF - Swiss Franc', value: 'CHF' },
{ name: 'CLP - Chilean Peso', value: 'CLP' },
{ name: 'CNY - Chinese Yuan', value: 'CNY' },
{ name: 'CZK - Czech Koruna', value: 'CZK' },
{ name: 'DKK - Danish Krown', value: 'DKK' },
{ name: 'EUR - Euro', value: 'EUR' },
{ name: 'GBP - British Pound', value: 'GBP' },
{ name: 'HKD - Hong Kong Dollar', value: 'HKD' },
{ name: 'HUF - Hungarian Forint', value: 'HUF' },
{ name: 'IDR - Indonesian Rupiah', value: 'IDR' },
{ name: 'ILS - Israeli New Shekel', value: 'ILS' },
{ name: 'INR - Indian Rupee', value: 'INR' },
{ name: 'JPY - Japanese Yen', value: 'JPY' },
{ name: 'KRW - South Korean Won', value: 'KRW' },
{ name: 'MXN - Mexican Peso', value: 'MXN' },
{ name: 'MYR - Malaysian Ringgit', value: 'MYR' },
{ name: 'NOK - Norwegian Krone', value: 'NOK' },
{ name: 'NZD - New Zealand Dollar', value: 'NZD' },
{ name: 'PHP - Philippine Piso', value: 'PHP' },
{ name: 'PKR - Pakistani Rupee', value: 'PKR' },
{ name: 'PLN - Polish Zloty', value: 'PLN' },
{ name: 'RUB - Russian Ruble', value: 'RUB' },
{ name: 'SEK - Swedish Krona', value: 'SEK' },
{ name: 'SGD - Singapore Dollar', value: 'SGD' },
{ name: 'THB - Thai Baht', value: 'THB' },
{ name: 'TRY - Turkish Lira', value: 'TRY' },
{ name: 'TWD - New Taiwan Dollar', value: 'TWD' },
{ name: 'ZAR - South African Rand', value: 'ZAR' },
];
selectedCurrency = this.currencies[0].value;

View file

@ -5,7 +5,7 @@ import * as bip39 from 'bip39';
import {LedgerService, LedgerStatus} from '../../services/ledger.service';
import { QrModalService } from '../../services/qr-modal.service';
import {UtilService} from '../../services/util.service';
import { wallet } from 'nanocurrency-web';
import { wallet } from '@dncurrency/nanocurrency-web';
import { TranslocoService } from '@ngneat/transloco';
enum panels {

View file

@ -9,7 +9,7 @@
<div class="uk-width-1-1 narrow-div">
<div class="uk-form-horizontal">
<div class="uk-margin">
<label class="uk-form-label" for="mnano">XNO <span uk-icon="icon: info;" uk-tooltip title="The main unit used in nano wallets and exchanges."></span></label>
<label class="uk-form-label" for="mnano">DNC <span uk-icon="icon: info;" uk-tooltip title="The main unit used in nano wallets and exchanges."></span></label>
<div class="uk-form-controls">
<div uk-grid>
<div class="uk-width-1-1">
@ -27,7 +27,7 @@
<div class="uk-width-1-1 narrow-div">
<div class="uk-form-horizontal">
<div class="uk-margin">
<label class="uk-form-label" for="raw">raw <span uk-icon="icon: info;" uk-tooltip title="The smallest possible unit of XNO."></span></label>
<label class="uk-form-label" for="raw">raw <span uk-icon="icon: info;" uk-tooltip title="The smallest possible unit of DNC."></span></label>
<div class="uk-form-controls">
<div uk-grid>
<div class="uk-width-1-1">
@ -63,6 +63,5 @@
</div>
</div>
</div>
</div>

View file

@ -1,7 +1,7 @@
import { Component, OnInit, OnDestroy } from '@angular/core';
import {UtilService} from '../../services/util.service';
import {AppSettingsService} from '../../services/app-settings.service';
import * as nanocurrency from 'nanocurrency';
import * as nanocurrency from '@dncurrency/nanocurrency';
import {PriceService} from '../../services/price.service';
import { BigNumber } from 'bignumber.js';
import {NotificationService} from '../../services/notification.service';

View file

@ -1,4 +1,4 @@
<span class="nano-address-prefix"><span class="nano-prefix">nano_</span>{{ firstCharacters }}</span>
<span class="nano-address-prefix"><span class="nano-prefix">dn_</span>{{ firstCharacters }}</span>
<span
[class]="{ 'nano-address-middle': true, 'uk-text-truncate': (middle === 'auto') }"
[class.is-off]="( middle === 'off' )"

View file

@ -23,7 +23,7 @@ export class NanoAccountIdComponent implements OnChanges {
const accountID = this.accountID;
const openingChars = 10;
const closingChars = 5;
this.firstCharacters = accountID?.split('').slice(0, openingChars).join('').replace('nano_', '');
this.firstCharacters = accountID?.split('').slice(0, openingChars).join('').replace('nano_', '').replace('dn_', '');
this.lastCharacters = accountID?.split('').slice(-closingChars).join('');
if (this.middle !== 'off') {
this.middleCharacters = accountID?.split('').slice(openingChars, -closingChars).join('');

View file

@ -121,7 +121,7 @@
<div class="amount" *ngIf="isReceivableTransaction || isSendTransaction || isReceiveTransaction">
<span class="amount-integer">{{ transaction.amount | rai: 'mnano,true' | amountsplit: 0 }}</span>
<span class="amount-fractional">{{ transaction.amount | rai: 'mnano,true' | amountsplit: 1 }}</span>
<span class="currency-name">XNO</span>
<span class="currency-name">DNC</span>
</div>
</div>
<div class="column account-date uk-text-truncate">

View file

@ -94,7 +94,7 @@
<div class="uk-margin">
<label class="uk-form-label" for="new-address-account">Address</label>
<div class="uk-form-controls">
<input type="text" class="uk-input" id="new-address-account" [(ngModel)]="newRepAccount" [disabled]="!creatingNewEntry" placeholder="nano_abc123">
<input type="text" class="uk-input" id="new-address-account" [(ngModel)]="newRepAccount" [disabled]="!creatingNewEntry" placeholder="dn_abc123">
</div>
</div>

View file

@ -130,7 +130,7 @@
<label class="uk-form-label" for="account">Account</label>
<div class="uk-form-controls">
<select class="uk-select" id="account" [(ngModel)]="csvAccount">
<option *ngFor="let account of accounts" [value]="account.id">{{account.addressBookName ? account.addressBookName + ' - ' : '#' + account.index + ' - ' }} {{ account.id | squeeze }} ({{ account.balance | rai: 'mnano,true' | amountsplit: 0 }}{{ account.balance | rai: 'mnano,true' | amountsplit: 1 }} XNO)</option>
<option *ngFor="let account of accounts" [value]="account.id">{{account.addressBookName ? account.addressBookName + ' - ' : '#' + account.index + ' - ' }} {{ account.id | squeeze }} ({{ account.balance | rai: 'mnano,true' | amountsplit: 0 }}{{ account.balance | rai: 'mnano,true' | amountsplit: 1 }} DNC)</option>
</select>
</div>
</div>

View file

@ -62,7 +62,7 @@
<div *ngIf="showAddBox" class="uk-inline uk-width-1-1">
<a class="uk-form-icon uk-form-icon-flip second-icon" uk-icon="icon: plus" (click)="addAccount()" uk-tooltip title="Add address"></a>
<a class="uk-form-icon uk-form-icon-flip" uk-icon="icon: camera" (click)="openQR('accountAdd','account')" uk-tooltip title="Scan from QR code"></a>
<input (input)="validateAccountAdd()" (keyup.enter)="addAccount()" [(ngModel)]="accountAdd" class="uk-input" [ngClass]="{ 'uk-form-danger': accountAddStatus === 0 }" type="text" placeholder="nano_1abc..." autocomplete="off" #accountAddFocus>
<input (input)="validateAccountAdd()" (keyup.enter)="addAccount()" [(ngModel)]="accountAdd" class="uk-input" [ngClass]="{ 'uk-form-danger': accountAddStatus === 0 }" type="text" placeholder="dn_1abc..." autocomplete="off" #accountAddFocus>
</div>
</li>
</ul>
@ -97,7 +97,7 @@
</p>
</div>
</div>
<div class="uk-inline uk-width-1-1">
<div uk-grid>
<div class="uk-width-1-3@l uk-width-1-1">
@ -114,7 +114,7 @@
<div class="uk-card-header uk-form-horizontal">
<h4>2 - Create a Multisig Transaction</h4>
<p>Create a SEND, RECEIVE or CHANGE block using the Remote Signing method.</p>
<div class="uk-form-horizontal">
<div class="uk-margin">
<label class="uk-form-label" for="form-horizontal-text2">Multisig Address</label>
@ -122,7 +122,7 @@
<div class="uk-inline uk-width-1-1">
<a class="uk-form-icon uk-form-icon-flip" uk-icon="icon: camera" (click)="openQR('multisig','account')" uk-tooltip title="Scan from QR code"></a>
<a *ngIf="multisigAccount !== ''" class="uk-form-icon uk-form-icon-flip second-icon" ngxClipboard [cbContent]="multisigAccount" (cbOnSuccess)="copied()" uk-icon="icon: copy" title="Copy Account" uk-tooltip></a>
<input (input)="validateMultisig()" (keyup.enter)="navigateAccount()" [(ngModel)]="multisigAccount" class="uk-input" [ngClass]="{ 'uk-form-success': multisigAccountStatus === 1, 'uk-form-danger': multisigAccountStatus === 0 }" type="text" placeholder="nano_1abc..." autocomplete="off">
<input (input)="validateMultisig()" (keyup.enter)="navigateAccount()" [(ngModel)]="multisigAccount" class="uk-input" [ngClass]="{ 'uk-form-success': multisigAccountStatus === 1, 'uk-form-danger': multisigAccountStatus === 0 }" type="text" placeholder="dn_1abc..." autocomplete="off">
</div>
</div>
</div>
@ -138,7 +138,7 @@
<div class="uk-card-header uk-form-horizontal">
<h4>3 - Multisig for Participants</h4>
<p>If multiple co-signers, enter the data that was shared with you to participate in the signing procedure.</p>
<div class="uk-form-horizontal">
<div class="uk-margin">
<label class="uk-form-label" for="form-horizontal-text2">Signing Data</label>

View file

@ -55,12 +55,12 @@ export class MultisigComponent implements OnInit {
this.notificationService.sendWarning('Invalid nano address!', {identifier: 'account-invalid'});
return;
}
if (this.storedAccounts.includes(this.accountAdd.replace('xrb_', 'nano_').toLocaleLowerCase())) {
if (this.storedAccounts.includes(this.accountAdd.replace('xrb_', 'nano_').replace('nano_', 'dn_').toLocaleLowerCase())) {
this.notificationService.removeNotification('account-added');
this.notificationService.sendWarning('Account already added!', {identifier: 'account-added'});
return;
}
this.storedAccounts.push(this.accountAdd.replace('xrb_', 'nano_').toLocaleLowerCase());
this.storedAccounts.push(this.accountAdd.replace('xrb_', 'nano_').replace('nano_', 'dn_').toLocaleLowerCase());
this.accountAdd = '';
this.accountAddStatus = null;
this.showAddBox = false;

View file

@ -20,7 +20,7 @@ export class QrModalComponent implements OnInit {
@Input() type: QRType;
availableDevices: MediaDeviceInfo[];
currentDevice: MediaDeviceInfo = null;
nano_scheme = /^(xrb|nano|nanorep|nanoseed|nanokey):.+$/g;
nano_scheme = /^(xrb|nano|dn|dnrep|dnseed|dnkey):.+$/g;
formatsEnabled: BarcodeFormat[] = [
BarcodeFormat.CODE_128,
@ -75,9 +75,9 @@ export class QrModalComponent implements OnInit {
const url = new URL(resultString);
content = url.pathname;
if (['nano:', 'nanorep:', 'xrb:'].includes(url.protocol) && this.util.account.isValidAccount(url.pathname)) {
if (['nano:', 'nanorep:', 'xrb:', 'dn:', 'dnrep:'].includes(url.protocol) && this.util.account.isValidAccount(url.pathname)) {
type = 'account';
} else if (['nanoseed:', 'nanokey:'].includes(url.protocol) && this.util.nano.isValidHash(url.pathname)) {
} else if (['nanoseed:', 'nanokey:', 'dnseed:', 'dnkey:'].includes(url.protocol) && this.util.nano.isValidHash(url.pathname)) {
type = 'hash';
}
} else {

View file

@ -46,7 +46,7 @@
{{ recentlyCopiedAccountAddress ? 'Copied!' : 'Copy address' }}
</button>
</ng-template>
<div class="uk-margin-bottom uk-flex uk-flex-between">
<h2 class="uk-flex-1 uk-heading-divider uk-margin-remove">Receive Nano</h2>
<div class="uk-flex-none uk-visible@s uk-flex uk-flex-top uk-margin-medium-left">
@ -64,21 +64,21 @@
<div class="form-account">
<select id="form-horizontal-select" class="uk-select" [(ngModel)]="pendingAccountModel" (change)="onSelectedAccountChange(pendingAccountModel)">
<option [value]="0">All Accounts</option>
<option *ngFor="let account of accounts" [value]="account.id">{{account.addressBookName ? account.addressBookName + ' - ' : '#' + account.index + ' - ' }} {{ account.id | squeeze }} ({{ account.balance | rai: 'mnano,true' | amountsplit: 0 }}{{ account.balance | rai: 'mnano,true' | amountsplit: 1 }} XNO)</option>
<option *ngFor="let account of accounts" [value]="account.id">{{account.addressBookName ? account.addressBookName + ' - ' : '#' + account.index + ' - ' }} {{ account.id | squeeze }} ({{ account.balance | rai: 'mnano,true' | amountsplit: 0 }}{{ account.balance | rai: 'mnano,true' | amountsplit: 1 }} DNC)</option>
</select>
</div>
</div>
<div class="uk-margin">
<label for="form-horizontal-amount" class="uk-form-label label-block">Requested Amount <span class="uk-text-muted label-optional">optional</span></label>
<div class="form-amount">
<div class="uk-width-1-1 uk-inline">
<label class="uk-form-icon uk-link-reset uk-link-muted xno-symbol" for="form-horizontal-amount"></label>
<input [(ngModel)]="amountNano" [ngClass]="{ 'uk-form-danger': !validNano }" [attr.disabled]="pendingAccountModel == '0' || null" autocomplete="off" class="uk-input" id="form-horizontal-amount" (input)="nanoAmountChange()" style="padding-left: 52px !important;" type="number" step="any" placeholder="Amount of XNO" maxlength="40">
<input [(ngModel)]="amountNano" [ngClass]="{ 'uk-form-danger': !validNano }" [attr.disabled]="pendingAccountModel == '0' || null" autocomplete="off" class="uk-input" id="form-horizontal-amount" (input)="nanoAmountChange()" style="padding-left: 52px !important;" type="number" step="any" placeholder="Amount of DNC" maxlength="40">
</div>
<div style="margin-top: 10px;" *ngIf="settings.settings.displayCurrency">
<div class="uk-width-1-1 uk-inline">
<a class="uk-form-icon uk-link-reset uk-link-muted fiat-currency-ticker" uk-tooltip title="Last Price: {{ price.price.lastPrice | fiat: settings.settings.displayCurrency }} / XNO">{{ settings.settings.displayCurrency | currencySymbol }}</a>
<a class="uk-form-icon uk-link-reset uk-link-muted fiat-currency-ticker" uk-tooltip title="Last Price: {{ price.price.lastPrice | fiat: settings.settings.displayCurrency }} / DNC">{{ settings.settings.displayCurrency | currencySymbol }}</a>
<input [(ngModel)]="amountFiat" [ngClass]="{ 'uk-form-danger': !validFiat }" [attr.disabled]="pendingAccountModel == '0' || null" autocomplete="off" (input)="fiatAmountChange()" style="padding-left: 52px !important;" class="uk-input" id="form-horizontal-text-fiat" type="number" step="any" placeholder="Amount of {{ settings.settings.displayCurrency }}">
</div>
</div>
@ -124,7 +124,7 @@
</div>
</div>
</div>
</div>
</div>
</div>
@ -253,7 +253,7 @@
<span class="uk-text-small">Ready to receive</span><br>
<span class="amount-integer">{{ pending.amount | rai: 'mnano,true' | amountsplit: 0 }}</span>
<span class="amount-fractional">{{ pending.amount | rai: 'mnano,true' | amountsplit: 1 }}</span>
<span class="currency-name">XNO</span>
<span class="currency-name">DNC</span>
<div class="compact-actions-date">
<ng-template [ngTemplateOutlet]="transactionActions"></ng-template>
</div>
@ -277,7 +277,7 @@
<table class="uk-table uk-table-striped uk-table-small" *ngIf="settings.settings.minimumReceive">
<thead>
<tr class="uk-alert uk-alert-primary missing-accounts-hint">
<td colspan="4" style="text-align: center;"><span uk-icon="icon: info"></span> Minimum Receive is set to <a class="hint-action" routerLink="/configure-app" routerLinkActive="active" *ngIf="( util.nano.mnanoToRaw(this.settings.settings.minimumReceive).toFixed().length > 24 ) else amountInRaw">{{ util.nano.mnanoToRaw(this.settings.settings.minimumReceive).toFixed() | rai: 'mnano,true' | amountsplit: 0 }}{{ util.nano.mnanoToRaw(this.settings.settings.minimumReceive).toFixed() | rai: 'mnano,true' | amountsplit: 1 }} XNO</a><ng-template #amountInRaw><a class="hint-action" routerLink="/configure-app" routerLinkActive="active">{{ util.nano.mnanoToRaw(this.settings.settings.minimumReceive).toFixed() }} raw</a></ng-template>, transactions below this amount will be hidden.</td>
<td colspan="4" style="text-align: center;"><span uk-icon="icon: info"></span> Minimum Receive is set to <a class="hint-action" routerLink="/configure-app" routerLinkActive="active" *ngIf="( util.nano.mnanoToRaw(this.settings.settings.minimumReceive).toFixed().length > 24 ) else amountInRaw">{{ util.nano.mnanoToRaw(this.settings.settings.minimumReceive).toFixed() | rai: 'mnano,true' | amountsplit: 0 }}{{ util.nano.mnanoToRaw(this.settings.settings.minimumReceive).toFixed() | rai: 'mnano,true' | amountsplit: 1 }} DNC</a><ng-template #amountInRaw><a class="hint-action" routerLink="/configure-app" routerLinkActive="active">{{ util.nano.mnanoToRaw(this.settings.settings.minimumReceive).toFixed() }} raw</a></ng-template>, transactions below this amount will be hidden.</td>
</tr>
</thead>
</table>
@ -385,12 +385,12 @@
<div class="form-amount">
<div class="uk-width-1-1 uk-inline">
<label class="uk-form-icon uk-link-reset uk-link-muted xno-symbol" for="form-horizontal-amount"></label>
<input [(ngModel)]="amountNano" [ngClass]="{ 'uk-form-danger': !validNano }" [attr.disabled]="pendingAccountModel == '0' || null" autocomplete="off" class="uk-input" id="form-horizontal-amount" (input)="nanoAmountChange()" style="padding-left: 52px !important;" type="number" step="any" placeholder="Amount of XNO" maxlength="40">
<input [(ngModel)]="amountNano" [ngClass]="{ 'uk-form-danger': !validNano }" [attr.disabled]="pendingAccountModel == '0' || null" autocomplete="off" class="uk-input" id="form-horizontal-amount" (input)="nanoAmountChange()" style="padding-left: 52px !important;" type="number" step="any" placeholder="Amount of DNC" maxlength="40">
</div>
<div style="margin-top: 10px;" *ngIf="settings.settings.displayCurrency">
<p class="text-half-muted" style="margin: 0 0 14px 0;">or</p>
<div class="uk-width-1-1 uk-inline">
<a class="uk-form-icon uk-link-reset uk-link-muted fiat-currency-ticker" uk-tooltip title="Last Price: {{ price.price.lastPrice | fiat: settings.settings.displayCurrency }} / XNO">{{ settings.settings.displayCurrency | currencySymbol }}</a>
<a class="uk-form-icon uk-link-reset uk-link-muted fiat-currency-ticker" uk-tooltip title="Last Price: {{ price.price.lastPrice | fiat: settings.settings.displayCurrency }} / DNC">{{ settings.settings.displayCurrency | currencySymbol }}</a>
<input [(ngModel)]="amountFiat" [ngClass]="{ 'uk-form-danger': !validFiat }" [attr.disabled]="pendingAccountModel == '0' || null" autocomplete="off" (input)="fiatAmountChange()" style="padding-left: 52px !important;" class="uk-input" id="form-horizontal-text-fiat" type="number" step="any" placeholder="Amount of {{ settings.settings.displayCurrency }}">
</div>
</div>
@ -409,7 +409,7 @@
<ng-container *ngIf="(inMerchantModeQR === true)">
<p class="uk-text-large uk-margin-remove-bottom">Send</p>
<p class="uk-text-large uk-text-primary uk-margin-remove-top" *ngIf="(amountNano === '')">
<span class="merchant-mode-currency-name">XNO</span>
<span class="merchant-mode-currency-name">DNC</span>
</p>
<p class="uk-text-large uk-text-primary uk-margin-remove-top" *ngIf="(amountNano !== '')">
<span
@ -418,7 +418,7 @@
<span
class="merchant-mode-amount-fractional"
>{{ merchantModeRawRequestedQR | rai: 'mnano,true' | amountsplit: 1 }}</span>
<span class="merchant-mode-currency-name merchant-mode-currency-margin">XNO</span>
<span class="merchant-mode-currency-name merchant-mode-currency-margin">DNC</span>
</p>
<p class="text-half-muted" style="margin: -16px 0 10px 0;">to</p>
<app-nano-account-id
@ -467,7 +467,7 @@
<span
class="merchant-mode-amount-fractional"
>{{ prompt.amountRaw | rai: 'mnano,true' | amountsplit: 1 }}</span>
<span class="merchant-mode-currency-name merchant-mode-currency-margin">XNO</span>
<span class="merchant-mode-currency-name merchant-mode-currency-margin">DNC</span>
</p>
<div
*ngIf="prompt.amountHiddenRaw.gt(0)"
@ -537,7 +537,7 @@
<span
class="merchant-mode-amount-fractional"
>{{ merchantModeRawReceivedTotal | rai: 'mnano,true' | amountsplit: 1 }}</span>
<span class="merchant-mode-currency-name merchant-mode-currency-margin">XNO</span>
<span class="merchant-mode-currency-name merchant-mode-currency-margin">DNC</span>
</p>
<div
*ngIf="merchantModeRawReceivedTotalHiddenRaw.gt(0)"
@ -556,12 +556,12 @@
'Amount Requested: '
+ ( merchantModeRawRequestedTotal | rai: 'mnano,true' | amountsplit: 0 )
+ ( merchantModeRawRequestedTotal | rai: 'mnano,true' | amountsplit: 1 )
+ ' XNO'
+ ' DNC'
+ '\n\n'
+ 'Amount Paid: '
+ ( merchantModeRawReceivedTotal | rai: 'mnano,true' | amountsplit: 0 )
+ ( merchantModeRawReceivedTotal | rai: 'mnano,true' | amountsplit: 1 )
+ ' XNO'
+ ' DNC'
+ '\n\n'
+ 'Transaction ID\'s:'
+ '\n- '

View file

@ -20,7 +20,7 @@
<div class="uk-form-controls">
<div class="uk-inline uk-width-1-1">
<a class="uk-form-icon uk-form-icon-flip" uk-icon="icon: camera" (click)="openQR('account1','account')" uk-tooltip title="Scan from QR code"></a>
<input (blur)="validateDestination()" (input)="searchAddressBook()" (focus)="searchAddressBook()" (keyup.enter)="start()" [(ngModel)]="toAccountID" class="uk-input" [ngClass]="{ 'uk-form-success': toAccountStatus === 1, 'uk-form-danger': toAccountStatus === 0 }" type="text" placeholder="nano_1abc..." autocomplete="off">
<input (blur)="validateDestination()" (input)="searchAddressBook()" (focus)="searchAddressBook()" (keyup.enter)="start()" [(ngModel)]="toAccountID" class="uk-input" [ngClass]="{ 'uk-form-success': toAccountStatus === 1, 'uk-form-danger': toAccountStatus === 0 }" type="text" placeholder="dn_1abc..." autocomplete="off">
<div *ngIf="(addressBookResults$ | async).length" [hidden]="!showAddressBook" class="nlt-dropdown uk-animation-slide-down-small uk-width-1-1 uk-card uk-card-default uk-card-body uk-position-absolute" style="z-index: 15000">
<ul class="uk-nav uk-nav-default">
@ -43,7 +43,7 @@
<h4>STEP 2 - Sign Block (Offline Device)</h4>
<p><a routerLink="/qr-scan" routerLinkActive="active">Scan the unsigned QR code</a> from Step 1 <strong>OR</strong> paste the block below. Sign it using a key owning the account from step 1.<br>
Nault can optionally be set in Offline Mode from the <a routerLink="/configure-app" routerLinkActive="active">Server Configuration</a> to avoid network notifications.</p>
<div class="uk-form-horizontal">
<div class="uk-margin">
<label class="uk-form-label" for="form-horizontal-text2">Unsigned block from step 1</label>

View file

@ -1,6 +1,6 @@
<div class="uk-animation-slide-left-small" uk-grid>
<div class="uk-width-1-1">
<div class="uk-margin-bottom" uk-grid>
<div class="uk-width-expand@s uk-width-1-1">
<h2 class="uk-heading-divider uk-text-truncate">Representatives</h2>
@ -74,7 +74,7 @@
<div class="amounts">
<span class="amount-integer">{{ rep.delegatedWeight | rai: 'mnano,true' | amountsplit: 0 }}</span>
<span class="amount-fractional">{{ rep.delegatedWeight | rai: 'mnano,true' | amountsplit: 1 }}</span>
<span class="currency-name">XNO</span>
<span class="currency-name">DNC</span>
</div>
</td>
</tr>
@ -97,7 +97,7 @@
<div class="amounts">
<span class="amount-integer">{{ delegatingAccount.balance | rai: 'mnano,true' | amountsplit: 0 }}</span>
<span class="amount-fractional">{{ delegatingAccount.balance | rai: 'mnano,true' | amountsplit: 1 }}</span>
<span class="currency-name">XNO</span>
<span class="currency-name">DNC</span>
</div>
</td>
</tr>
@ -136,7 +136,7 @@
<select class="uk-select" [(ngModel)]="changeAccountID" (change)="newAccountID()" id="form-horizontal-select">
<option [value]="null">Select Accounts to Change</option>
<option [value]="'all'">All Current Accounts</option>
<option *ngFor="let account of walletService.wallet.accounts" [value]="account.id">{{account.addressBookName ? account.addressBookName + ' - ' : '#' + account.index + ' - ' }} {{ account.id | squeeze }} ({{ account.balance | rai: 'mnano,true' | amountsplit: 0 }}{{ account.balance | rai: 'mnano,true' | amountsplit: 1 }} XNO)</option>
<option *ngFor="let account of walletService.wallet.accounts" [value]="account.id">{{account.addressBookName ? account.addressBookName + ' - ' : '#' + account.index + ' - ' }} {{ account.id | squeeze }} ({{ account.balance | rai: 'mnano,true' | amountsplit: 0 }}{{ account.balance | rai: 'mnano,true' | amountsplit: 1 }} DNC)</option>
</select>
<ul class="uk-list uk-list-striped">
<li *ngFor="let account of selectedAccounts">

View file

@ -22,7 +22,7 @@
<label class="uk-form-label" for="form-horizontal-select">From Account</label>
<div class="uk-form-controls">
<select class="form-select-source uk-select" [(ngModel)]="fromAccountID" (change)="resetRaw()" id="form-horizontal-select">
<option *ngFor="let account of accounts" [value]="account.id">{{account.addressBookName ? account.addressBookName + ' - ' : '#' + account.index + ' - ' }} {{ account.id | squeeze }} ({{ account.balance | rai: 'mnano,true' | amountsplit: 0 }}{{ account.balance | rai: 'mnano,true' | amountsplit: 1 }} XNO)</option>
<option *ngFor="let account of accounts" [value]="account.id">{{account.addressBookName ? account.addressBookName + ' - ' : '#' + account.index + ' - ' }} {{ account.id | squeeze }} ({{ account.balance | rai: 'mnano,true' | amountsplit: 0 }}{{ account.balance | rai: 'mnano,true' | amountsplit: 1 }} DNC)</option>
</select>
</div>
</div>
@ -84,7 +84,7 @@
<select required class="form-select-destination uk-select" [(ngModel)]="toOwnAccountID" id="form-horizontal-select">
<option value="" disabled selected hidden>Account to transfer to</option>
<ng-container *ngFor="let account of accounts">
<option [value]="account.id" *ngIf="account.id !== fromAccountID">{{account.addressBookName ? account.addressBookName + ' - ' : '#' + account.index + ' - ' }} {{ account.id | squeeze }} ({{ account.balance | rai: 'mnano,true' | amountsplit: 0 }}{{ account.balance | rai: 'mnano,true' | amountsplit: 1 }} XNO)</option>
<option [value]="account.id" *ngIf="account.id !== fromAccountID">{{account.addressBookName ? account.addressBookName + ' - ' : '#' + account.index + ' - ' }} {{ account.id | squeeze }} ({{ account.balance | rai: 'mnano,true' | amountsplit: 0 }}{{ account.balance | rai: 'mnano,true' | amountsplit: 1 }} DNC)</option>
</ng-container>
</select>
</div>
@ -110,7 +110,7 @@
<div class="uk-width-1-1" style="margin-top: 10px;" *ngIf="settings.settings.displayCurrency">
<div class="uk-width-1-1 uk-inline">
<a class="uk-form-icon uk-link-reset uk-link-muted fiat-currency-ticker" uk-tooltip title="Last Price: {{ price.price.lastPrice | fiat: settings.settings.displayCurrency }} / XNO">{{ settings.settings.displayCurrency | currencySymbol }}</a>
<a class="uk-form-icon uk-link-reset uk-link-muted fiat-currency-ticker" uk-tooltip title="Last Price: {{ price.price.lastPrice | fiat: settings.settings.displayCurrency }} / DNC">{{ settings.settings.displayCurrency | currencySymbol }}</a>
<input [(ngModel)]="amountFiat" (input)="syncNanoPrice()" style="padding-left: 52px !important;" class="uk-input" id="form-horizontal-text-fiat" type="number" step="any" placeholder="Amount of {{ settings.settings.displayCurrency }}">
</div>
</div>
@ -157,11 +157,11 @@
<div class="block-amount-primary uk-text-danger">
<span class="amount-integer">{{ rawAmount | rai: 'mnano,true' | amountsplit: 0 }}</span>
<span class="amount-fractional">{{ rawAmount | rai: 'mnano,true' | amountsplit: 1 }}</span>
<span class="currency-name">XNO</span>
<span class="currency-name">DNC</span>
</div>
<div *ngIf="amountExtraRaw.gt(0)" class="uk-text-small text-half-muted" style="margin: 2px 0 -2px 0;">+{{ amountExtraRaw.toString(10) }} raw</div>
<div style="margin: 8px 0 -1px 0;" class="text-half-muted" *ngIf="settings.settings.displayCurrency">{{ amountFiat | fiat: settings.settings.displayCurrency }}</div>
<div style="margin: 1px 0 -1px 0;" class="uk-text-muted" *ngIf="settings.settings.displayCurrency">{{ price.price.lastPrice | fiat: settings.settings.displayCurrency }} / XNO</div>
<div style="margin: 1px 0 -1px 0;" class="uk-text-muted" *ngIf="settings.settings.displayCurrency">{{ price.price.lastPrice | fiat: settings.settings.displayCurrency }} / DNC</div>
</div>
</div>
@ -193,7 +193,7 @@
<span class="balance-amount-primary">
<span class="amount-integer">{{ (fromAccount.balance || 0) | rai: 'mnano,true' | amountsplit: 0 }}</span>
<span class="amount-fractional">{{ (fromAccount.balance || 0) | rai: 'mnano,true' | amountsplit: 1 }}</span>
<span class="currency-name">XNO</span>
<span class="currency-name">DNC</span>
</span>
</span>
</div>
@ -204,7 +204,7 @@
<span class="amount-sign">-</span>
<span class="amount-integer">{{ rawAmount | rai: 'mnano,true' | amountsplit: 0 }}</span>
<span class="amount-fractional">{{ rawAmount | rai: 'mnano,true' | amountsplit: 1 }}</span>
<span class="currency-name">XNO</span>
<span class="currency-name">DNC</span>
</span>
</span>
</div>
@ -240,7 +240,7 @@
<span class="balance-amount-primary">
<span class="amount-integer">{{ (toAccount.balance || 0) | rai: 'mnano,true' | amountsplit: 0 }}</span>
<span class="amount-fractional">{{ (toAccount.balance || 0) | rai: 'mnano,true' | amountsplit: 1 }}</span>
<span class="currency-name">XNO</span>
<span class="currency-name">DNC</span>
</span>
</span>
</div>
@ -251,7 +251,7 @@
<span class="amount-sign">+</span>
<span class="amount-integer">{{ rawAmount | rai: 'mnano,true' | amountsplit: 0 }}</span>
<span class="amount-fractional">{{ rawAmount | rai: 'mnano,true' | amountsplit: 1 }}</span>
<span class="currency-name">XNO</span>
<span class="currency-name">DNC</span>
</span>
</span>
</div>

View file

@ -15,7 +15,7 @@ import { QrModalService } from '../../services/qr-modal.service';
import { environment } from 'environments/environment';
import { TranslocoService } from '@ngneat/transloco';
import { HttpClient } from '@angular/common/http';
import * as nanocurrency from 'nanocurrency';
import * as nanocurrency from '@dncurrency/nanocurrency';
const nacl = window['nacl'];
@ -56,9 +56,7 @@ export class SendComponent implements OnInit {
addressAliasMatch = '';
amounts = [
{ name: 'XNO', shortName: 'XNO', value: 'mnano' },
{ name: 'knano', shortName: 'knano', value: 'knano' },
{ name: 'nano', shortName: 'nano', value: 'nano' },
{ name: 'DNC', shortName: 'DNC', value: 'mnano' }
];
selectedAmount = this.amounts[0];
@ -234,7 +232,7 @@ export class SendComponent implements OnInit {
if (this.util.account.isValidAccount(url.pathname)) {
const amountAsRaw = url.searchParams.get('amount');
const amountAsXNO = (
const amountAsDNC = (
amountAsRaw
? nanocurrency.convert(
amountAsRaw, {
@ -249,7 +247,7 @@ export class SendComponent implements OnInit {
() => {
this.updateQueries({
to: url.pathname,
amount: amountAsXNO,
amount: amountAsDNC,
});
},
10
@ -559,7 +557,7 @@ export class SendComponent implements OnInit {
return this.notificationService.sendWarning(`From and to account are required`);
}
if (!this.validateAmount()) {
return this.notificationService.sendWarning(`Invalid XNO amount`);
return this.notificationService.sendWarning(`Invalid DNC amount`);
}
this.preparingTransaction = true;
@ -588,7 +586,7 @@ export class SendComponent implements OnInit {
return this.notificationService.sendWarning(`Amount is invalid`);
}
if (from.balanceBN.minus(rawAmount).lessThan(0)) {
return this.notificationService.sendError(`From account does not have enough XNO`);
return this.notificationService.sendError(`From account does not have enough DNC`);
}
// Determine a proper raw amount to show in the UI, if a decimal was entered

View file

@ -20,10 +20,10 @@
<div class="block-amount-primary" [class.uk-text-danger]="txType == txTypes.send" [class.uk-text-success]="txType == txTypes.receive">
<span class="amount-integer">{{ rawAmount | rai: 'mnano,true' | amountsplit: 0 }}</span>
<span class="amount-fractional">{{ rawAmount | rai: 'mnano,true' | amountsplit: 1 }}</span>
<span class="currency-name">XNO</span>
<span class="currency-name">DNC</span>
</div>
<div style="margin: 8px 0 -1px 0;" class="text-half-muted" *ngIf="settings.settings.displayCurrency && amountFiat !== null">{{ amountFiat | fiat: settings.settings.displayCurrency }}</div>
<div style="margin: 1px 0 -1px 0;" class="uk-text-muted" *ngIf="settings.settings.displayCurrency && amountFiat !== null">{{ price.price.lastPrice | fiat: settings.settings.displayCurrency }} / XNO</div>
<div style="margin: 1px 0 -1px 0;" class="uk-text-muted" *ngIf="settings.settings.displayCurrency && amountFiat !== null">{{ price.price.lastPrice | fiat: settings.settings.displayCurrency }} / DNC</div>
</div>
</div>
</div>
@ -57,7 +57,7 @@
<span class="balance-amount-primary">
<span class="amount-integer">{{ fromAccountBalance ? (fromAccountBalance | rai: 'mnano,true' | amountsplit: 0) : 'N/A' }}</span>
<span class="amount-fractional">{{ fromAccountBalance ? (fromAccountBalance | rai: 'mnano,true' | amountsplit: 1) : '' }}</span>
<span class="currency-name">{{ fromAccountBalance ? 'XNO' : '' }}</span>
<span class="currency-name">{{ fromAccountBalance ? 'DNC' : '' }}</span>
</span>
</span>
</div>
@ -68,7 +68,7 @@
<span class="amount-sign">-</span>
<span class="amount-integer">{{ rawAmount | rai: 'mnano,true' | amountsplit: 0 }}</span>
<span class="amount-fractional">{{ rawAmount | rai: 'mnano,true' | amountsplit: 1 }}</span>
<span class="currency-name">XNO</span>
<span class="currency-name">DNC</span>
</span>
</span>
</div>
@ -119,7 +119,7 @@
<span class="balance-amount-primary">
<span class="amount-integer">{{ toAccountBalance && txType === txTypes.receive ? (toAccountBalance | rai: 'mnano,true' | amountsplit: 0) : 'N/A' }}</span>
<span class="amount-fractional">{{ toAccountBalance && txType === txTypes.receive ? (toAccountBalance | rai: 'mnano,true' | amountsplit: 1) : '' }}</span>
<span class="currency-name">{{ toAccountBalance && txType === txTypes.receive ? 'XNO' : '' }}</span>
<span class="currency-name">{{ toAccountBalance && txType === txTypes.receive ? 'DNC' : '' }}</span>
</span>
</span>
</div>
@ -130,7 +130,7 @@
<span class="amount-sign">+</span>
<span class="amount-integer">{{ rawAmount | rai: 'mnano,true' | amountsplit: 0 }}</span>
<span class="amount-fractional">{{ rawAmount | rai: 'mnano,true' | amountsplit: 1 }}</span>
<span class="currency-name">XNO</span>
<span class="currency-name">DNC</span>
</span>
</span>
</div>
@ -368,7 +368,7 @@
</div>
<div class="uk-modal-body modal-qr-body">
<p><a routerLink="/qr-scan" routerLinkActive="active" class="uk-modal-close">Scan</a> the signed QR with an online Nault, or copy the "Signed Block" to <a routerLink="/remote-signing" routerLinkActive="active" class="uk-modal-close">Step 3</a>.</p>
<div *ngIf="qrString && finalSignature" class="uk-width-1-1 uk-text-center" style="display: flex; justify-content: center;">
<span class="uk-text-small" uk-tooltip title="Signed block string to be copied to remote device" style="overflow-wrap: anywhere;"><strong>Signed Block</strong></span>
<ul class="uk-iconnav" style="padding-left: 0;">

View file

@ -13,10 +13,10 @@ import {ApiService} from '../../services/api.service';
import {PriceService} from '../../services/price.service';
import * as QRCode from 'qrcode';
import * as bip39 from 'bip39';
import * as bip39Wallet from 'nanocurrency-web';
import * as bip39Wallet from '@dncurrency/nanocurrency-web';
import { QrModalService } from '../../services/qr-modal.service';
import hermes from 'hermes-channel';
import * as nanocurrency from 'nanocurrency';
import * as nanocurrency from '@dncurrency/nanocurrency';
import { MusigService } from '../../services/musig.service';
import { environment } from 'environments/environment';
@ -369,7 +369,7 @@ export class SignComponent implements OnInit {
switch (this.signTypeSelected) {
// wallet
case this.signTypes[0]:
this.walletAccount = this.accounts.find(a => a.id.replace('xrb_', 'nano_') === this.signatureAccount);
this.walletAccount = this.accounts.find(a => a.id.replace('xrb_', 'nano_').replace('nano_', 'dn_') === this.signatureAccount);
if (!this.walletAccount) {
this.signatureMessage = 'Could not find a matching wallet account to sign with. Make sure it\'s added under your accounts';
} else {
@ -436,9 +436,9 @@ export class SignComponent implements OnInit {
}
if (this.txType === TxType.send || this.txType === TxType.change) {
this.signatureAccount = this.fromAccountID.replace('xrb_', 'nano_').toLowerCase();
this.signatureAccount = this.fromAccountID.replace('xrb_', 'nano_').replace('nano_', 'dn_').toLowerCase();
} else if (this.txType === TxType.receive || this.txType === TxType.open) {
this.signatureAccount = this.toAccountID.replace('xrb_', 'nano_').toLowerCase();
this.signatureAccount = this.toAccountID.replace('xrb_', 'nano_').replace('nano_', 'dn_').toLowerCase();
}
if (this.shouldSign) {

View file

@ -44,7 +44,7 @@
<label class="uk-form-label" for="destination-account">Local Destination <span uk-icon="icon: info;" uk-tooltip title="Local accounts that can be used as destination for the swept funds. Make sure you are able to unlock your Nault wallet."></span></label>
<div class="uk-form-controls">
<select class="uk-select" id="destination-account" [(ngModel)]="myAccountModel" (change)="setDestination(myAccountModel)">
<option *ngFor="let account of accounts" [value]="account.id">{{account.addressBookName ? account.addressBookName + ' - ' : '#' + account.index + ' - ' }} {{ account.id | squeeze }} ({{ account.balance | rai: 'mnano,true' | amountsplit: 0 }}{{ account.balance | rai: 'mnano,true' | amountsplit: 1 }} XNO)</option>
<option *ngFor="let account of accounts" [value]="account.id">{{account.addressBookName ? account.addressBookName + ' - ' : '#' + account.index + ' - ' }} {{ account.id | squeeze }} ({{ account.balance | rai: 'mnano,true' | amountsplit: 0 }}{{ account.balance | rai: 'mnano,true' | amountsplit: 1 }} DNC)</option>
<option [value]="0">Custom Destination</option>
</select>
</div>
@ -60,7 +60,7 @@
<div uk-grid>
<div class="uk-width-1-1">
<div class="uk-inline uk-width-1-1">
<input [(ngModel)]="destinationAccount" class="uk-input uk-margin-small-bottom {{validDestination ? '':'uk-form-danger'}}" id="custom-destination" type="text" (ngModelChange)="destinationChange(destinationAccount)" placeholder="nano_abc..123">
<input [(ngModel)]="destinationAccount" class="uk-input uk-margin-small-bottom {{validDestination ? '':'uk-form-danger'}}" id="custom-destination" type="text" (ngModelChange)="destinationChange(destinationAccount)" placeholder="dn_abc..123">
</div>
</div>
</div>
@ -117,7 +117,7 @@
</div>
<div class="uk-width-1-1">
<textarea [(ngModel)]="output" rows="4" readOnly #outputarea class="uk-input uk-margin-small-bottom" placeholder="The output log will be visible here"></textarea>
<textarea [(ngModel)]="output" rows="4" readOnly #outputarea class="uk-input uk-margin-small-bottom" placeholder="The output log will be visible here"></textarea>
</div>
</div>
</div>

View file

@ -7,8 +7,8 @@ import {UtilService, TxType} from '../../services/util.service';
import {WorkPoolService} from '../../services/work-pool.service';
import {AppSettingsService} from '../../services/app-settings.service';
import {NanoBlockService} from '../../services/nano-block.service';
import * as nanocurrency from 'nanocurrency';
import { wallet } from 'nanocurrency-web';
import * as nanocurrency from '@dncurrency/nanocurrency';
import { wallet } from '@dncurrency/nanocurrency-web';
import * as bip39 from 'bip39';
import {Router} from '@angular/router';
@ -379,8 +379,8 @@ export class SweeperComponent implements OnInit {
raw = this.util.big.add(raw, data.blocks[key].amount);
}.bind(this));
const nanoAmount = this.util.nano.rawToMnano(raw);
const pending = {count: Object.keys(data.blocks).length, raw: raw, XNO: nanoAmount, blocks: data.blocks};
const row = 'Found ' + pending.count + ' pending containing total ' + pending.XNO + ' XNO';
const pending = {count: Object.keys(data.blocks).length, raw: raw, DNC: nanoAmount, blocks: data.blocks};
const row = 'Found ' + pending.count + ' pending containing total ' + pending.DNC + ' DNC';
this.appendLog(row);
// create receive blocks for all pending

View file

@ -49,7 +49,7 @@
>
<span class="amount-integer">{{ transaction?.amount | rai: 'mnano,true' | amountsplit: 0 }}</span>
<span class="amount-fractional">{{ transaction?.amount | rai: 'mnano,true' | amountsplit: 1 }}</span>
<span class="currency-name">XNO</span>
<span class="currency-name">DNC</span>
</div>
<div *ngIf="amountRaw.gt(0)" class="uk-text-small text-half-muted" style="margin: 2px 0 -2px 0;">+{{ amountRaw.toString(10) }} raw</div>
</div>
@ -157,7 +157,7 @@
<div class="balance-amount-primary uk-text-truncate">
<span class="amount-integer">{{ ( isStateBlock ? getBalanceFromDec(transaction?.contents?.balance) : getBalanceFromHex(transaction?.contents?.balance )) | rai: 'mnano,true' | amountsplit: 0 }}</span>
<span class="amount-fractional">{{ ( isStateBlock ? getBalanceFromDec(transaction?.contents?.balance) : getBalanceFromHex(transaction?.contents?.balance )) | rai: 'mnano,true' | amountsplit: 1 }}</span>
<span class="currency-name">XNO</span>
<span class="currency-name">DNC</span>
</div>
<div class="uk-text-small block-hash-monospace"><span class="text-half-muted" style="margin-right: 4px;">=</span>{{ transaction?.contents?.balance }} raw</div>
</div>

View file

@ -8,12 +8,12 @@ export class NoPaddingZerosPipe implements PipeTransform {
const sig = input.split('.')[0];
const frac = input.split('.')[1].replace(/0+$/g, '');
// 1.000000 XNO >> 1 XNO
// 1.000000 DNC >> 1 DNC
if (!frac) {
return sig;
}
// 0.002200 >> 0.0022 XNO
// 0.002200 >> 0.0022 DNC
return `${sig}.${frac}`;
}
}

View file

@ -17,18 +17,16 @@ export class RaiPipe implements PipeTransform {
switch (denomination.toLowerCase()) {
default:
case 'xrb': return `${(value / this.mrai).toFixed(6)}${!hideText ? ' XNO' : ''}`;
case 'xrb': return `${(value / this.mrai).toFixed(6)}${!hideText ? ' DNC' : ''}`;
case 'mnano':
const hasRawValue = (value / this.rai) % 1;
if (hasRawValue) {
// New more precise toFixed function, but bugs on huge raw numbers
const newVal = value / this.mrai < 0.000001 ? 0 : value / this.mrai;
return `${this.toFixed(newVal, this.precision)}${!hideText ? ' XNO' : ''}`;
return `${this.toFixed(newVal, this.precision)}${!hideText ? ' DNC' : ''}`;
} else {
return `${(value / this.mrai).toFixed(6)}${!hideText ? ' XNO' : ''}`;
return `${(value / this.mrai).toFixed(6)}${!hideText ? ' DNC' : ''}`;
}
case 'knano': return `${(value / this.krai).toFixed(3)}${!hideText ? ' knano' : ''}`;
case 'nano': return `${(value / this.rai).toFixed(0)}${!hideText ? ' nano' : ''}`;
case 'raw': return `${value}${!hideText ? ' raw' : ''}`;
case 'dynamic':
const rai = (value / this.rai);

View file

@ -42,6 +42,9 @@ export class AddressBookService {
if (entry.account.indexOf('xrb_') !== -1) {
entry.account = entry.account.replace('xrb_', 'nano_');
}
if (entry.account.indexOf('nano_') !== -1) {
entry.account = entry.account.replace('nano_', 'dn_');
}
return entry;
});

View file

@ -40,7 +40,7 @@ export class AppSettingsService {
displayDenomination: 'mnano',
// displayPrefix: 'xrb',
walletStore: 'localStorage',
displayCurrency: 'USD',
displayCurrency: '',
defaultRepresentative: null,
lockOnClose: 1,
lockInactivityMinutes: 30,
@ -70,45 +70,13 @@ export class AppSettingsService {
shouldRandom: false,
},
{
name: 'XNOPay UK 1',
value: 'xnopay-uk-1',
api: 'https://uk1.public.xnopay.com/proxy',
ws: 'wss://uk1.public.xnopay.com/ws',
name: 'dn724 (NL)',
value: 'dn724-nl',
api: 'https://coin.m724.dn42/rpc',
ws: 'wss://coin.m724.dn42/rpc/ws',
auth: null,
shouldRandom: true,
},
{
name: 'Rainstorm City',
value: 'rainstorm',
api: 'https://rainstorm.city/api',
ws: 'wss://rainstorm.city/websocket',
auth: null,
shouldRandom: true,
},
{
name: 'NanOslo',
value: 'nanoslo',
api: 'https://nanoslo.0x.no/proxy',
ws: 'wss://nanoslo.0x.no/websocket',
auth: null,
shouldRandom: true,
},
{
name: 'SomeNano',
value: 'somenano',
api: 'https://node.somenano.com/proxy',
ws: 'wss://node.somenano.com/websocket',
auth: null,
shouldRandom: true,
},
{
name: 'SpyNano (New Node - Use with caution)',
value: 'spynano',
api: 'https://node.spynano.org/proxy',
ws: 'wss://node.spynano.org/websocket',
auth: null,
shouldRandom: false,
},
{
name: 'Custom',
value: 'custom',
@ -133,7 +101,7 @@ export class AppSettingsService {
acc.push( server.api.replace(/https?:\/\//g, '') );
return acc;
}, [
'node.somenano.com'
'coin.m724.dn42'
]);
constructor(

View file

@ -17,7 +17,7 @@ export class DeeplinkService {
) { }
navigate(deeplink: string): boolean {
const nano_scheme = /^(nano|nanorep|nanoseed|nanokey|nanosign|nanoprocess|https):.+$/g;
const nano_scheme = /^(nano|nanorep|nanoseed|nanokey|nanosign|nanoprocess|https|dn|dnrep|dnseed|dnkey|dnsign|dnprocess):.+$/g;
if (this.util.account.isValidAccount(deeplink)) {
// Got address, routing to send...

View file

@ -3,7 +3,7 @@ import {UtilService} from './util.service';
import { NotificationService } from './notification.service';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Observable } from 'rxjs';
import * as nanocurrency from 'nanocurrency';
import * as nanocurrency from '@dncurrency/nanocurrency';
import { environment } from 'environments/environment';
const base32 = require('nano-base32');
@ -140,24 +140,24 @@ export class MusigService {
const pubkeys = [];
for (let address of addresses) {
address = address.trim();
if (!address.startsWith('xrb_') && !address.startsWith('nano_')) {
throw new Error('Nano addresses must start with xrb_ or nano_');
if (!address.startsWith('xrb_') && !address.startsWith('nano_') && !address.startsWith('dn_')) {
throw new Error('DNcoin addresses must start with dn_ or xrb_ or nano_');
}
address = address.split('_', 2)[1];
try {
const bytes = base32.decode(address);
if (bytes.length !== 37) {
throw new Error('Wrong nano address length');
throw new Error('Wrong DNcoin address length');
}
const pubkey = bytes.subarray(0, 32);
const checksum_ = this.util.account.getAccountChecksum(pubkey);
if (!this.util.array.equalArrays(bytes.subarray(32), checksum_)) {
throw new Error('Invalid nano address checksum');
throw new Error('Invalid DNcoin address checksum');
}
pubkeys.push(pubkey);
} catch (err_) {
console.error(err_.toString());
throw new Error('Invalid nano address (bad character?)');
throw new Error('Invalid DNcoin address (bad character?)');
}
}
const pubkeyPtrs = this.wasm.musig_malloc(pubkeys.length * 4);
@ -188,7 +188,7 @@ export class MusigService {
for (let i = 0; i < 5; i++) {
fullAddress[32 + i] = checksum[i];
}
const fullAddressFinal = 'nano_' + base32.encode(fullAddress);
const fullAddressFinal = 'dn_' + base32.encode(fullAddress);
console.log('Multisig Account: ' + fullAddressFinal);
this.wasm.musig_free(outPtr);
return {'multisig': fullAddressFinal, 'pubkey': aggPubkey};

View file

@ -8,29 +8,20 @@ import {AppSettingsService} from './app-settings.service';
import {LedgerService} from './ledger.service';
import { WalletAccount } from './wallet.service';
import {BehaviorSubject} from 'rxjs';
import { tools as nanocurrencyWebTools } from 'nanocurrency-web';
import { tools as nanocurrencyWebTools } from '@dncurrency/nanocurrency-web';
const nacl = window['nacl'];
@Injectable()
export class NanoBlockService {
representativeAccounts = [
'nano_1x7biz69cem95oo7gxkrw6kzhfywq4x5dupw4z1bdzkb74dk9kpxwzjbdhhs', // NanoCrawler
'nano_1zuksmn4e8tjw1ch8m8fbrwy5459bx8645o9euj699rs13qy6ysjhrewioey', // Nanowallets.guide
'nano_3chartsi6ja8ay1qq9xg3xegqnbg1qx76nouw6jedyb8wx3r4wu94rxap7hg', // Nano Charts
'nano_1iuz18n4g4wfp9gf7p1s8qkygxw7wx9qfjq6a9aq68uyrdnningdcjontgar', // NanoTicker / Ricki
'nano_3msc38fyn67pgio16dj586pdrceahtn75qgnx7fy19wscixrc8dbb3abhbw6', // gr0vity
'nano_3patrick68y5btibaujyu7zokw7ctu4onikarddphra6qt688xzrszcg4yuo', // Patrick
'nano_1tk8h3yzkibbsti8upkfa69wqafz6mzfzgu8bu5edaay9k7hidqdunpr4tb6', // rsnano
'nano_3ekb6tp8ixtkibimyygepgkwckzhds9basxd5zfue4efjnxaan77gsnanick', // Nanick
'nano_1xckpezrhg56nuokqh6t1stjca67h37jmrp9qnejjkfgimx1msm9ehuaieuq', // Flying Amigos
'nano_3n7ky76t4g57o9skjawm8pprooz1bminkbeegsyt694xn6d31c6s744fjzzz', // Humble Nano
'nano_1wenanoqm7xbypou7x3nue1isaeddamjdnc3z99tekjbfezdbq8fmb659o7t', // WeNano
'nano_1piiiebxxjn5r35eob6zfnsr9dqqysyd95z3sq1gsafuhgk6mi4s9f4xg6rh', // dn724 #1
'nano_1w7crtqfea1mda7qcr7dfdfu9qptqgewn3rtks331om5whf6gg5i1qen1mif', // dn724 #2
];
zeroHash = '0000000000000000000000000000000000000000000000000000000000000000';
// https://docs.nano.org/releases/network-upgrades/#epoch-blocks
epochV2SignerAccount = 'nano_3qb6o6i1tkzr6jwr5s7eehfxwg9x6eemitdinbpi7u8bjjwsgqfj4wzser3x';
epochV2SignerAccount = 'nano_17ds7reko4gjri8kzpqbmekh45z7eqkmwsmoth49jbbx6wat3onf16dojuyp';
newOpenBlock$: BehaviorSubject<boolean|false> = new BehaviorSubject(false);

View file

@ -40,7 +40,7 @@ export class NotificationService {
this.sendWarning(
`<b>Notice:</b> You may experience issues using a Ledger device with Google Chrome. ` +
`If you do please use Brave/Opera browser or ` +
`<a href="https://github.com/Nault/Nault/releases" target="_blank" rel="noopener noreferrer">Nault Desktop</a>.`,
`<a href="https://git.m724.eu/dn724/dnault" target="_blank" rel="noopener noreferrer">Nault Desktop</a>.`,
{ length: 0, identifier: 'chrome-ledger' }
);
}

View file

@ -5,7 +5,6 @@ import {BehaviorSubject} from 'rxjs';
@Injectable()
export class PriceService {
storeKey = `nanovault-price`;
apiUrl = `https://api.coingecko.com/api/v3/coins/nano?localization=false&tickers=false&market_data=true&community_data=false&developer_data=false&sparkline=false`;
price = {
lastPrice: 0,
@ -18,35 +17,15 @@ export class PriceService {
}
async getPrice(currency = 'USD') {
if (!currency) return; // No currency defined, do not refetch
const response: any = await this.http.get(`${this.apiUrl}`).toPromise();
if (!response) {
return this.price.lastPrice;
}
const quote = response.market_data.current_price;
const currencyPrice = quote[currency.toLowerCase()];
const btcPrice = quote.btc;
this.price.lastPrice = currencyPrice;
this.price.lastPriceBTC = btcPrice;
this.savePrice();
this.lastPrice$.next(currencyPrice);
return this.price.lastPrice;
}
loadSavedPrice() {
const priceData = localStorage.getItem(this.storeKey);
if (!priceData) return false;
this.price = JSON.parse(priceData);
}
savePrice() {
localStorage.setItem(this.storeKey, JSON.stringify(this.price));
}
}

View file

@ -378,6 +378,9 @@ export class RepresentativeService {
if (entry.id.indexOf('xrb_') !== -1) {
entry.id = entry.id.replace('xrb_', 'nano_');
}
if (entry.id.indexOf('nano_') !== -1) {
entry.id = entry.id.replace('nano_', 'dn_');
}
return entry;
});
@ -458,39 +461,6 @@ export class RepresentativeService {
// Bad representatives hardcoded to be avoided. Not visible in the user rep list
// eslint-disable-next-line @typescript-eslint/member-ordering
nfReps = [
{
id: 'nano_3arg3asgtigae3xckabaaewkx3bzsh7nwz7jkmjos79ihyaxwphhm6qgjps4',
name: 'Nano Foundation #1',
},
{
id: 'nano_1stofnrxuz3cai7ze75o174bpm7scwj9jn3nxsn8ntzg784jf1gzn1jjdkou',
name: 'Nano Foundation #2',
},
{
id: 'nano_1q3hqecaw15cjt7thbtxu3pbzr1eihtzzpzxguoc37bj1wc5ffoh7w74gi6p',
name: 'Nano Foundation #3',
},
{
id: 'nano_3dmtrrws3pocycmbqwawk6xs7446qxa36fcncush4s1pejk16ksbmakis78m',
name: 'Nano Foundation #4',
},
{
id: 'nano_3hd4ezdgsp15iemx7h81in7xz5tpxi43b6b41zn3qmwiuypankocw3awes5k',
name: 'Nano Foundation #5',
},
{
id: 'nano_1awsn43we17c1oshdru4azeqjz9wii41dy8npubm4rg11so7dx3jtqgoeahy',
name: 'Nano Foundation #6',
},
{
id: 'nano_1anrzcuwe64rwxzcco8dkhpyxpi8kd7zsjc1oeimpc3ppca4mrjtwnqposrs',
name: 'Nano Foundation #7',
},
{
id: 'nano_1hza3f7wiiqa7ig3jczyxj5yo86yegcmqk3criaz838j91sxcckpfhbhhra1',
name: 'Nano Foundation #8',
},
];
nfReps = [];
}

View file

@ -1,7 +1,7 @@
import { Injectable } from '@angular/core';
import * as blake from 'blakejs';
import {BigNumber} from 'bignumber.js';
import * as nanocurrency from 'nanocurrency';
import * as nanocurrency from '@dncurrency/nanocurrency';
const nacl = window['nacl'];
const STATE_BLOCK_PREAMBLE = '0000000000000000000000000000000000000000000000000000000000000006';
@ -293,7 +293,7 @@ function generateAccountKeyPair(accountSecretKeyBytes, expanded = false) {
return nacl.sign.keyPair.fromSecretKey(accountSecretKeyBytes, expanded);
}
function getPublicAccountID(accountPublicKeyBytes, prefix = 'nano') {
function getPublicAccountID(accountPublicKeyBytes, prefix = 'dn') {
const accountHex = util.uint8.toHex(accountPublicKeyBytes);
const keyBytes = util.uint4.toUint8(util.hex.toUint4(accountHex)); // For some reason here we go from u, to hex, to 4, to 8??
const checksum = util.uint5.toString(util.uint4.toUint5(util.uint8.toUint4(blake.blake2b(keyBytes, null, 5).reverse())));
@ -345,11 +345,7 @@ function getAccountPublicKey(account) {
}
function setPrefix(account, prefix = 'xrb') {
if (prefix === 'nano') {
return account.replace('xrb_', 'nano_');
} else {
return account.replace('nano_', 'xrb_');
}
return account;
}
/**

View file

@ -214,17 +214,17 @@ export class WalletService {
if (transaction.block.subtype === 'send') {
// Incoming transaction
if (this.addressBook.getTransactionTrackingById(addressLink)) {
this.notifications.sendInfo(`Tracked address ${accountHrefLink} can now receive ${trackedAmount} XNO`, { length: 10000 });
this.notifications.sendInfo(`Tracked address ${accountHrefLink} can now receive ${trackedAmount} DNC`, { length: 10000 });
console.log(`Tracked incoming block to: ${address} - Ӿ${trackedAmount}`);
}
// Outgoing transaction
if (this.addressBook.getTransactionTrackingById(address)) {
this.notifications.sendInfo(`Tracked address ${accountHref} sent ${trackedAmount} XNO`, { length: 10000 });
this.notifications.sendInfo(`Tracked address ${accountHref} sent ${trackedAmount} DNC`, { length: 10000 });
console.log(`Tracked send block from: ${address} - Ӿ${trackedAmount}`);
}
} else if (transaction.block.subtype === 'receive' && this.addressBook.getTransactionTrackingById(address)) {
// Receive transaction
this.notifications.sendInfo(`Tracked address ${accountHref} received incoming ${trackedAmount} XNO`, { length: 10000 });
this.notifications.sendInfo(`Tracked address ${accountHref} received incoming ${trackedAmount} DNC`, { length: 10000 });
console.log(`Tracked receive block to: ${address} - Ӿ${trackedAmount}`);
} else if (transaction.block.subtype === 'change' && this.addressBook.getTransactionTrackingById(address)) {
// Change transaction
@ -320,6 +320,9 @@ export class WalletService {
if (account.id.indexOf('xrb_') !== -1) {
account.id = account.id.replace('xrb_', 'nano_');
}
if (account.id.indexOf('nano_') !== -1) {
account.id = account.id.replace('nano_', 'dn_');
}
return account;
});
@ -515,7 +518,7 @@ export class WalletService {
} else if (this.wallet.type === 'ledger') {
const account: any = await this.ledgerService.getLedgerAccount(index);
accountAddress = account.address.replace('xrb_', 'nano_');
accountAddress = account.address.replace('xrb_', 'nano_').replace('nano_', 'dn_');
accountPublicKey = account.publicKey.toUpperCase();
} else {
@ -597,7 +600,7 @@ export class WalletService {
const account: any = await this.ledgerService.getLedgerAccount(index);
const accountID = account.address;
const nanoAccountID = accountID.replace('xrb_', 'nano_');
const nanoAccountID = accountID.replace('xrb_', 'nano_').replace('nano_', 'dn_');
const addressBookName = this.addressBook.getAccountName(nanoAccountID);
const newAccount: WalletAccount = {
@ -1054,7 +1057,7 @@ export class WalletService {
const receiveAmount = this.util.nano.rawToMnano(nextBlock.amount);
this.notifications.removeNotification('success-receive');
this.notifications.sendSuccess(`Successfully received ${receiveAmount.isZero() ? '' : this.noZerosPipe.transform(receiveAmount.toFixed(6)) } XNO!`, { identifier: 'success-receive' });
this.notifications.sendSuccess(`Successfully received ${receiveAmount.isZero() ? '' : this.noZerosPipe.transform(receiveAmount.toFixed(6)) } DNC!`, { identifier: 'success-receive' });
// remove after processing
// list also updated with reloadBalances but not if called too fast

View file

@ -61,8 +61,8 @@
</div>
<h2>{{ 'welcome.any-device-anywhere.title' | transloco }}</h2>
<p>{{ 'welcome.any-device-anywhere.1' | transloco }}</p>
<p>{{ 'welcome.any-device-anywhere.2.1' | transloco }} <a href="https://github.com/Nault/Nault/releases" target="_blank" rel="noopener noreferrer">{{ 'welcome.any-device-anywhere.2.2-link-github-releases' | transloco }}</a>{{ 'welcome.any-device-anywhere.2.3' | transloco }}</p>
<p>{{ 'welcome.any-device-anywhere.3.1' | transloco }} <a href="https://github.com/Nault/Nault" target="_blank" rel="noopener noreferrer">{{ 'welcome.any-device-anywhere.3.2-link-github' | transloco }}</a>{{ 'welcome.any-device-anywhere.3.3' | transloco }}</p>
<p>{{ 'welcome.any-device-anywhere.2.1' | transloco }} <a href="https://git.m724.eu/dn724/dnault" target="_blank" rel="noopener noreferrer">{{ 'welcome.any-device-anywhere.2.2-link-github-releases' | transloco }}</a>{{ 'welcome.any-device-anywhere.2.3' | transloco }}</p>
<p>{{ 'welcome.any-device-anywhere.3.1' | transloco }} <a href="https://git.m724.eu/dn724/dnault" target="_blank" rel="noopener noreferrer">{{ 'welcome.any-device-anywhere.3.2-link-github' | transloco }}</a>{{ 'welcome.any-device-anywhere.3.3' | transloco }}</p>
</div>
<div class="feature uk-card-body uk-card-default">
@ -90,7 +90,7 @@
</svg>
</div>
<h2>{{ 'welcome.any-node-always-available.title' | transloco }}</h2>
<p>{{ 'welcome.any-node-always-available.1.1' | transloco }} <a href="https://nault.cc" target="_blank" rel="noopener noreferrer">{{ 'welcome.any-node-always-available.1.2-link-nault' | transloco }}</a> {{ 'welcome.any-node-always-available.1.3' | transloco }} <a href="https://github.com/Nault/Nault/releases" target="_blank" rel="noopener noreferrer">{{ 'welcome.any-node-always-available.1.4-link-github-releases' | transloco }}</a> {{ 'welcome.any-node-always-available.1.5' | transloco }} <a href="https://github.com/Nault/Nault#web-app" target="_blank" rel="noopener noreferrer">{{ 'welcome.any-node-always-available.1.6-link-github-web-app' | transloco }}</a>{{ 'welcome.any-node-always-available.1.7' | transloco }}</p>
<p>{{ 'welcome.any-node-always-available.1.1' | transloco }} <a href="https://nault.cc" target="_blank" rel="noopener noreferrer">{{ 'welcome.any-node-always-available.1.2-link-nault' | transloco }}</a> {{ 'welcome.any-node-always-available.1.3' | transloco }} <a href="https://git.m724.eu/dn724/dnault" target="_blank" rel="noopener noreferrer">{{ 'welcome.any-node-always-available.1.4-link-github-releases' | transloco }}</a> {{ 'welcome.any-node-always-available.1.5' | transloco }} <a href="https://git.m724.eu/dn724/dnault#web-app" target="_blank" rel="noopener noreferrer">{{ 'welcome.any-node-always-available.1.6-link-github-web-app' | transloco }}</a>{{ 'welcome.any-node-always-available.1.7' | transloco }}</p>
<p>{{ 'welcome.any-node-always-available.2.1' | transloco }} <a href="https://docs.nano.org/running-a-node/overview/" target="_blank" rel="noopener noreferrer">{{ 'welcome.any-node-always-available.2.2-link-nano-node' | transloco }}</a> {{ 'welcome.any-node-always-available.2.3' | transloco }}</p>
</div>

View file

@ -190,7 +190,7 @@
"leave-blank-to-use-a-recommended-one": "Leave blank to use a recommended one",
"lock-after-inactivity": "Lock After Inactivity",
"min-receive-amount": "Min. Receive Amount",
"minimum-nano-amount-to-receive-transactions-below-this": "Minimum XNO amount to receive. Transactions below this amount will be ignored by the wallet both for receiving and in the transactions list. Set to blank or 0 to accept all transactions.",
"minimum-nano-amount-to-receive-transactions-below-this": "Minimum DNC amount to receive. Transactions below this amount will be ignored by the wallet both for receiving and in the transactions list. Set to blank or 0 to accept all transactions.",
"multiplier-options": {
"default-1x-or-1-64x": "Default (1x or 1/64x)"
},

View file

@ -1,7 +1,7 @@
const NanoCurrency = require('nanocurrency')
const NanoCurrency = require('@dncurrency/nanocurrency')
// When the parent theard requires it, render the HTML
self.addEventListener("message", async (message) => {
const { blockHash, workerIndex, workerCount, workThreshold } = message.data;
const result = await NanoCurrency.computeWork(blockHash, { workThreshold, workerIndex, workerCount });
self.postMessage(result);
});
});

View file

@ -1,5 +1,5 @@
export const environment = {
production: true,
desktop: true,
donationAddress: 'nano_3niceeeyiaa86k58zhaeygxfkuzgffjtwju9ep33z9c8qekmr3iuc95jbqc8',
donationAddress: 'dn_17ds7reko4gjri8kzpqbmekh45z7eqkmwsmoth49jbbx6wat3onf16dojuyp',
};

View file

@ -1,5 +1,5 @@
export const environment = {
production: true,
desktop: false,
donationAddress: 'nano_3niceeeyiaa86k58zhaeygxfkuzgffjtwju9ep33z9c8qekmr3iuc95jbqc8',
donationAddress: 'dn_17ds7reko4gjri8kzpqbmekh45z7eqkmwsmoth49jbbx6wat3onf16dojuyp',
};

View file

@ -6,5 +6,5 @@
export const environment = {
production: false,
desktop: false,
donationAddress: 'nano_3niceeeyiaa86k58zhaeygxfkuzgffjtwju9ep33z9c8qekmr3iuc95jbqc8',
donationAddress: 'dn_17ds7reko4gjri8kzpqbmekh45z7eqkmwsmoth49jbbx6wat3onf16dojuyp',
};