diff options
author | Florian Dold <florian.dold@gmail.com> | 2020-08-12 19:45:34 +0530 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2020-08-12 19:45:34 +0530 |
commit | c5ec34136874be87210711fd65eea1c1a6feec50 (patch) | |
tree | b5795aeec939769e8c14ac7ecc2cfc4abf273282 /packages/taler-wallet-core/src/types | |
parent | 11fa3397053c16cfcbf594c1389a75eaad94a40e (diff) | |
download | wallet-core-0.7.1-dev.20.tar.xz |
add exchange management test casev0.7.1-dev.20
Diffstat (limited to 'packages/taler-wallet-core/src/types')
-rw-r--r-- | packages/taler-wallet-core/src/types/talerTypes.ts | 9 | ||||
-rw-r--r-- | packages/taler-wallet-core/src/types/walletTypes.ts | 12 |
2 files changed, 20 insertions, 1 deletions
diff --git a/packages/taler-wallet-core/src/types/talerTypes.ts b/packages/taler-wallet-core/src/types/talerTypes.ts index bb0118a78..99f44ea25 100644 --- a/packages/taler-wallet-core/src/types/talerTypes.ts +++ b/packages/taler-wallet-core/src/types/talerTypes.ts @@ -47,7 +47,7 @@ import { Duration, codecForDuration, } from "../util/time"; -import { ExchangeListItem } from "./walletTypes"; +import { ExchangeListItem, codecForExchangeListItem } from "./walletTypes"; import { codecForAmountString } from "../util/amounts"; /** @@ -940,6 +940,13 @@ export interface WithdrawUriInfoResponse { possibleExchanges: ExchangeListItem[]; } +export const codecForWithdrawUriInfoResponse = (): Codec<WithdrawUriInfoResponse> => + buildCodecForObject<WithdrawUriInfoResponse>() + .property("amount", codecForAmountString()) + .property("defaultExchangeBaseUrl", codecOptional(codecForString())) + .property("possibleExchanges", codecForList(codecForExchangeListItem())) + .build("WithdrawUriInfoResponse"); + /** * Response body for the following endpoint: * diff --git a/packages/taler-wallet-core/src/types/walletTypes.ts b/packages/taler-wallet-core/src/types/walletTypes.ts index ec57e7d2a..6f6340520 100644 --- a/packages/taler-wallet-core/src/types/walletTypes.ts +++ b/packages/taler-wallet-core/src/types/walletTypes.ts @@ -554,6 +554,18 @@ export interface ExchangeListItem { paytoUris: string[]; } +export const codecForExchangeListItem = (): Codec<ExchangeListItem> => + buildCodecForObject<ExchangeListItem>() + .property("currency", codecForString()) + .property("exchangeBaseUrl", codecForString()) + .property("paytoUris", codecForList(codecForString())) + .build("ExchangeListItem"); + +export const codecForExchangesListResponse = (): Codec<ExchangesListRespose> => + buildCodecForObject<ExchangesListRespose>() + .property("exchanges", codecForList(codecForExchangeListItem())) + .build("ExchangesListRespose"); + export interface AcceptManualWithdrawalResult { /** * Payto URIs that can be used to fund the withdrawal. |