diff options
author | Florian Dold <florian.dold@gmail.com> | 2020-09-01 19:56:08 +0530 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2020-09-01 19:56:08 +0530 |
commit | 7f4ebca0c4330805ea8f3821dba075b34dd2be58 (patch) | |
tree | 39e9c0994969565ab9a227494beaf5e830315e9a /packages/taler-wallet-core/src/types/walletTypes.ts | |
parent | 62406304d9a81a08797c09f5151de74d8ca43fe8 (diff) | |
download | wallet-core-7f4ebca0c4330805ea8f3821dba075b34dd2be58.tar.xz |
validation
Diffstat (limited to 'packages/taler-wallet-core/src/types/walletTypes.ts')
-rw-r--r-- | packages/taler-wallet-core/src/types/walletTypes.ts | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/packages/taler-wallet-core/src/types/walletTypes.ts b/packages/taler-wallet-core/src/types/walletTypes.ts index 89c8b4a8b..dbaefae3b 100644 --- a/packages/taler-wallet-core/src/types/walletTypes.ts +++ b/packages/taler-wallet-core/src/types/walletTypes.ts @@ -180,10 +180,10 @@ export interface BalancesResponse { export const codecForBalance = (): Codec<Balance> => buildCodecForObject<Balance>() .property("available", codecForString()) - .property("hasPendingTransactions", codecForBoolean) + .property("hasPendingTransactions", codecForBoolean()) .property("pendingIncoming", codecForString()) .property("pendingOutgoing", codecForString()) - .property("requiresUserInput", codecForBoolean) + .property("requiresUserInput", codecForBoolean()) .build("Balance"); export const codecForBalancesResponse = (): Codec<BalancesResponse> => @@ -413,7 +413,7 @@ export const codecForPreparePayResultAlreadyConfirmed = (): Codec< ) .property("amountEffective", codecForAmountString()) .property("amountRaw", codecForAmountString()) - .property("paid", codecForBoolean) + .property("paid", codecForBoolean()) .property("contractTerms", codecForAny()) .property("contractTermsHash", codecForString()) .build("PreparePayResultAlreadyConfirmed"); @@ -843,3 +843,27 @@ export const codecForWithdrawTestBalance = (): Codec< .property("bankBaseUrl", codecForString()) .property("exchangeBaseUrl", codecForString()) .build("WithdrawTestBalanceRequest"); + +export interface ApplyRefundResponse { + contractTermsHash: string; + + proposalId: string; + + amountEffectivePaid: AmountString; + + amountRefundGranted: AmountString; + + amountRefundGone: AmountString; + + pendingAtExchange: boolean; +} + +export const codecForApplyRefundResponse = (): Codec<ApplyRefundResponse> => + buildCodecForObject<ApplyRefundResponse>() + .property("amountEffectivePaid", codecForAmountString()) + .property("amountRefundGone", codecForAmountString()) + .property("amountRefundGranted", codecForAmountString()) + .property("contractTermsHash", codecForString()) + .property("pendingAtExchange", codecForBoolean()) + .property("proposalId", codecForString()) + .build("ApplyRefundResponse"); |