From e6ed901626a5219a1d091f4f41654365d2c29531 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Sun, 19 Feb 2023 23:13:44 +0100 Subject: wallet-core: various p2p payment fixes --- packages/taler-util/src/wallet-types.ts | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'packages/taler-util/src/wallet-types.ts') diff --git a/packages/taler-util/src/wallet-types.ts b/packages/taler-util/src/wallet-types.ts index 06d76a6d4..5841b316e 100644 --- a/packages/taler-util/src/wallet-types.ts +++ b/packages/taler-util/src/wallet-types.ts @@ -2038,7 +2038,7 @@ export interface PreparePeerPushPaymentRequest { /** * Instructed amount. - * + * * FIXME: Allow specifying the instructed amount type. */ amount: AmountString; @@ -2092,7 +2092,14 @@ export interface CheckPeerPushPaymentResponse { export interface CheckPeerPullPaymentResponse { contractTerms: PeerContractTerms; + /** + * @deprecated Redundant field with bad name, will be removed soon. + */ amount: AmountString; + + amountRaw: AmountString; + amountEffective: AmountString; + peerPullPaymentIncomingId: string; } @@ -2161,25 +2168,23 @@ export const codecForAcceptPeerPullPaymentRequest = .build("AcceptPeerPllPaymentRequest"); export interface PreparePeerPullPaymentRequest { - exchangeBaseUrl: string; + exchangeBaseUrl?: string; amount: AmountString; } export const codecForPreparePeerPullPaymentRequest = (): Codec => buildCodecForObject() .property("amount", codecForAmountString()) - .property("exchangeBaseUrl", codecForString()) + .property("exchangeBaseUrl", codecOptional(codecForString())) .build("PreparePeerPullPaymentRequest"); export interface PreparePeerPullPaymentResponse { + exchangeBaseUrl: string; amountRaw: AmountString; amountEffective: AmountString; } export interface InitiatePeerPullPaymentRequest { - /** - * FIXME: Make this optional? - */ - exchangeBaseUrl: string; + exchangeBaseUrl?: string; partialContractTerms: PeerContractTerms; } @@ -2187,7 +2192,7 @@ export const codecForInitiatePeerPullPaymentRequest = (): Codec => buildCodecForObject() .property("partialContractTerms", codecForPeerContractTerms()) - .property("exchangeBaseUrl", codecForString()) + .property("exchangeBaseUrl", codecOptional(codecForString())) .build("InitiatePeerPullPaymentRequest"); export interface InitiatePeerPullPaymentResponse { -- cgit v1.2.3