diff options
author | Florian Dold <florian.dold@gmail.com> | 2017-03-24 17:54:22 +0100 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2017-03-24 17:54:22 +0100 |
commit | 4178dcadc6a6a856a754e3a370c22fa342735e42 (patch) | |
tree | 686ff11f152eab5cace57ef55154084475ed3ce5 /src/wallet.ts | |
parent | df87dc0242caab05cb27623edf000625d1a7f039 (diff) | |
download | wallet-core-4178dcadc6a6a856a754e3a370c22fa342735e42.tar.xz |
add auditor editing
Diffstat (limited to 'src/wallet.ts')
-rw-r--r-- | src/wallet.ts | 28 |
1 files changed, 17 insertions, 11 deletions
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<CurrencyRecord[]> { + return this.q() + .iter<CurrencyRecord>(Stores.currencies) + .flatMap((e) => [e]) + .toArray(); + } + + async updateCurrency(currencyRecord: CurrencyRecord): Promise<void> { + console.log("updating currency to", currencyRecord); + await this.q() + .put(Stores.currencies, currencyRecord) + .finish(); + this.notifier.notify(); + } + async getReserves(exchangeBaseUrl: string): Promise<ReserveRecord[]> { return this.q() .iter<ReserveRecord>(Stores.reserves) |