From 4c03a1200eb947a0ed13f78b46fd670601b8cb80 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Mon, 1 May 2017 04:05:16 +0200 Subject: implement payback (with rudimentary UI) --- src/cryptoApi.ts | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) (limited to 'src/cryptoApi.ts') diff --git a/src/cryptoApi.ts b/src/cryptoApi.ts index 5657d74d6..8dd14392a 100644 --- a/src/cryptoApi.ts +++ b/src/cryptoApi.ts @@ -22,13 +22,20 @@ import { - PreCoinRecord, CoinRecord, ReserveRecord, AmountJson, - DenominationRecord + PreCoinRecord, + CoinRecord, + ReserveRecord, + AmountJson, + DenominationRecord, + PaybackRequest, + RefreshSessionRecord, + WireFee, + PayCoinInfo, } from "./types"; -import {OfferRecord} from "./wallet"; -import {CoinWithDenom} from "./wallet"; -import {PayCoinInfo} from "./types"; -import {RefreshSessionRecord, WireFee} from "./types"; +import { + OfferRecord, + CoinWithDenom, +} from "./wallet"; interface WorkerState { @@ -230,6 +237,10 @@ export class CryptoApi { return this.doRpc("hashString", 1, str); } + hashDenomPub(denomPub: string): Promise { + return this.doRpc("hashDenomPub", 1, denomPub); + } + isValidDenom(denom: DenominationRecord, masterPub: string): Promise { return this.doRpc("isValidDenom", 2, denom, masterPub); @@ -256,6 +267,10 @@ export class CryptoApi { return this.doRpc("rsaUnblind", 4, sig, bk, pk); } + createPaybackRequest(coin: CoinRecord, preCoin: PreCoinRecord): Promise { + return this.doRpc("createPaybackRequest", 1, coin, preCoin); + } + createRefreshSession(exchangeBaseUrl: string, kappa: number, meltCoin: CoinRecord, -- cgit v1.2.3