summaryrefslogtreecommitdiff
path: root/packages/taler-util/src/walletTypes.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2022-09-05 18:12:30 +0200
committerFlorian Dold <florian@dold.me>2022-09-13 16:10:41 +0200
commit13e7a674778754c0ed641dfd428e3d6b2b71ab2d (patch)
treef2a0e5029305a9b818416fd94908ef77cdd7446f /packages/taler-util/src/walletTypes.ts
parentf9f2911c761af1c8ed1c323dcd414cbaa9eeae7c (diff)
downloadwallet-core-13e7a674778754c0ed641dfd428e3d6b2b71ab2d.tar.gz
wallet-core-13e7a674778754c0ed641dfd428e3d6b2b71ab2d.tar.bz2
wallet-core-13e7a674778754c0ed641dfd428e3d6b2b71ab2d.zip
wallet-core: uniform retry handling
Diffstat (limited to 'packages/taler-util/src/walletTypes.ts')
-rw-r--r--packages/taler-util/src/walletTypes.ts84
1 files changed, 43 insertions, 41 deletions
diff --git a/packages/taler-util/src/walletTypes.ts b/packages/taler-util/src/walletTypes.ts
index a993f29a0..c10e3be40 100644
--- a/packages/taler-util/src/walletTypes.ts
+++ b/packages/taler-util/src/walletTypes.ts
@@ -32,7 +32,12 @@ import {
codecForAmountJson,
codecForAmountString,
} from "./amounts.js";
-import { AbsoluteTime, codecForAbsoluteTime, codecForTimestamp, TalerProtocolTimestamp } from "./time.js";
+import {
+ AbsoluteTime,
+ codecForAbsoluteTime,
+ codecForTimestamp,
+ TalerProtocolTimestamp,
+} from "./time.js";
import {
buildCodecForObject,
codecForString,
@@ -797,46 +802,43 @@ const codecForExchangeTos = (): Codec<ExchangeTos> =>
.property("content", codecOptional(codecForString()))
.build("ExchangeTos");
-export const codecForFeeDescriptionPair =
- (): Codec<FeeDescriptionPair> =>
- buildCodecForObject<FeeDescriptionPair>()
- .property("value", codecForAmountJson())
- .property("from", codecForAbsoluteTime)
- .property("until", codecForAbsoluteTime)
- .property("left", codecOptional(codecForAmountJson()))
- .property("right", codecOptional(codecForAmountJson()))
- .build("FeeDescriptionPair");
-
-export const codecForFeeDescription =
- (): Codec<FeeDescription> =>
- buildCodecForObject<FeeDescription>()
- .property("value", codecForAmountJson())
- .property("from", codecForAbsoluteTime)
- .property("until", codecForAbsoluteTime)
- .property("fee", codecOptional(codecForAmountJson()))
- .build("FeeDescription");
-
-
-export const codecForFeesByOperations =
- (): Codec<OperationMap<FeeDescription[]>> =>
- buildCodecForObject<OperationMap<FeeDescription[]>>()
- .property("deposit", codecForList(codecForFeeDescription()))
- .property("withdraw", codecForList(codecForFeeDescription()))
- .property("refresh", codecForList(codecForFeeDescription()))
- .property("refund", codecForList(codecForFeeDescription()))
- .build("FeesByOperations");
-
-export const codecForExchangeFullDetails =
- (): Codec<ExchangeFullDetails> =>
- buildCodecForObject<ExchangeFullDetails>()
- .property("currency", codecForString())
- .property("exchangeBaseUrl", codecForString())
- .property("paytoUris", codecForList(codecForString()))
- .property("tos", codecForExchangeTos())
- .property("auditors", codecForList(codecForExchangeAuditor()))
- .property("wireInfo", codecForWireInfo())
- .property("feesDescription", codecForFeesByOperations())
- .build("ExchangeFullDetails");
+export const codecForFeeDescriptionPair = (): Codec<FeeDescriptionPair> =>
+ buildCodecForObject<FeeDescriptionPair>()
+ .property("value", codecForAmountJson())
+ .property("from", codecForAbsoluteTime)
+ .property("until", codecForAbsoluteTime)
+ .property("left", codecOptional(codecForAmountJson()))
+ .property("right", codecOptional(codecForAmountJson()))
+ .build("FeeDescriptionPair");
+
+export const codecForFeeDescription = (): Codec<FeeDescription> =>
+ buildCodecForObject<FeeDescription>()
+ .property("value", codecForAmountJson())
+ .property("from", codecForAbsoluteTime)
+ .property("until", codecForAbsoluteTime)
+ .property("fee", codecOptional(codecForAmountJson()))
+ .build("FeeDescription");
+
+export const codecForFeesByOperations = (): Codec<
+ OperationMap<FeeDescription[]>
+> =>
+ buildCodecForObject<OperationMap<FeeDescription[]>>()
+ .property("deposit", codecForList(codecForFeeDescription()))
+ .property("withdraw", codecForList(codecForFeeDescription()))
+ .property("refresh", codecForList(codecForFeeDescription()))
+ .property("refund", codecForList(codecForFeeDescription()))
+ .build("FeesByOperations");
+
+export const codecForExchangeFullDetails = (): Codec<ExchangeFullDetails> =>
+ buildCodecForObject<ExchangeFullDetails>()
+ .property("currency", codecForString())
+ .property("exchangeBaseUrl", codecForString())
+ .property("paytoUris", codecForList(codecForString()))
+ .property("tos", codecForExchangeTos())
+ .property("auditors", codecForList(codecForExchangeAuditor()))
+ .property("wireInfo", codecForWireInfo())
+ .property("feesDescription", codecForFeesByOperations())
+ .build("ExchangeFullDetails");
export const codecForExchangeListItem = (): Codec<ExchangeListItem> =>
buildCodecForObject<ExchangeListItem>()