From 4178dcadc6a6a856a754e3a370c22fa342735e42 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Fri, 24 Mar 2017 17:54:22 +0100 Subject: add auditor editing --- src/wallet.ts | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) (limited to 'src/wallet.ts') diff --git a/src/wallet.ts b/src/wallet.ts index a2d9e2ad9..506cde1f4 100644 --- a/src/wallet.ts +++ b/src/wallet.ts @@ -37,6 +37,8 @@ import { RefreshSessionRecord, ReserveCreationInfo, ReserveRecord, + CurrencyRecord, + AuditorRecord, WalletBalance, WalletBalanceEntry, WireInfo, DenominationRecord, DenominationStatus, denominationRecordFromKeys, @@ -202,17 +204,6 @@ export interface NonceRecord { pub: string; } -export interface AuditorRecord { - baseUrl: string; - auditorPub: string; - expirationStamp: number; -} - -export interface CurrencyRecord { - name: string; - fractionalDigits: number; - auditors: AuditorRecord[]; -} export interface ConfigRecord { key: string; @@ -1714,6 +1705,21 @@ export class Wallet { .toArray(); } + async getCurrencies(): Promise { + return this.q() + .iter(Stores.currencies) + .flatMap((e) => [e]) + .toArray(); + } + + async updateCurrency(currencyRecord: CurrencyRecord): Promise { + console.log("updating currency to", currencyRecord); + await this.q() + .put(Stores.currencies, currencyRecord) + .finish(); + this.notifier.notify(); + } + async getReserves(exchangeBaseUrl: string): Promise { return this.q() .iter(Stores.reserves) -- cgit v1.2.3