diff options
Diffstat (limited to 'packages/taler-wallet-core/src/types')
-rw-r--r-- | packages/taler-wallet-core/src/types/dbTypes.ts | 2 | ||||
-rw-r--r-- | packages/taler-wallet-core/src/types/talerTypes.ts | 38 | ||||
-rw-r--r-- | packages/taler-wallet-core/src/types/walletTypes.ts | 10 |
3 files changed, 31 insertions, 19 deletions
diff --git a/packages/taler-wallet-core/src/types/dbTypes.ts b/packages/taler-wallet-core/src/types/dbTypes.ts index 28842398b..148ec8c35 100644 --- a/packages/taler-wallet-core/src/types/dbTypes.ts +++ b/packages/taler-wallet-core/src/types/dbTypes.ts @@ -1274,7 +1274,7 @@ export interface WalletContractData { /** * Fulfillment URL, or the empty string if the order has no fulfillment URL. - * + * * Stored as a non-nullable string as we use this field for IndexedDB indexing. */ fulfillmentUrl: string; diff --git a/packages/taler-wallet-core/src/types/talerTypes.ts b/packages/taler-wallet-core/src/types/talerTypes.ts index 14e1b5751..b9e7fae4a 100644 --- a/packages/taler-wallet-core/src/types/talerTypes.ts +++ b/packages/taler-wallet-core/src/types/talerTypes.ts @@ -963,7 +963,9 @@ export interface WithdrawUriInfoResponse { possibleExchanges: ExchangeListItem[]; } -export const codecForWithdrawUriInfoResponse = (): Codec<WithdrawUriInfoResponse> => +export const codecForWithdrawUriInfoResponse = (): Codec< + WithdrawUriInfoResponse +> => buildCodecForObject<WithdrawUriInfoResponse>() .property("amount", codecForAmountString()) .property("defaultExchangeBaseUrl", codecOptional(codecForString())) @@ -1046,14 +1048,18 @@ export const codecForTax = (): Codec<Tax> => .property("tax", codecForString()) .build("Tax"); -export const codecForInternationalizedString = (): Codec<InternationalizedString> => - codecForMap(codecForString()); +export const codecForInternationalizedString = (): Codec< + InternationalizedString +> => codecForMap(codecForString()); export const codecForProduct = (): Codec<Product> => buildCodecForObject<Product>() .property("product_id", codecOptional(codecForString())) .property("description", codecForString()) - .property("description_i18n", codecOptional(codecForInternationalizedString())) + .property( + "description_i18n", + codecOptional(codecForInternationalizedString()), + ) .property("quantity", codecOptional(codecForNumber())) .property("unit", codecOptional(codecForString())) .property("price", codecOptional(codecForString())) @@ -1066,7 +1072,10 @@ export const codecForContractTerms = (): Codec<ContractTerms> => .property("order_id", codecForString()) .property("fulfillment_url", codecOptional(codecForString())) .property("fulfillment_message", codecOptional(codecForString())) - .property("fulfillment_message_i18n", codecOptional(codecForInternationalizedString())) + .property( + "fulfillment_message_i18n", + codecOptional(codecForInternationalizedString()), + ) .property("merchant_base_url", codecForString()) .property("h_wire", codecForString()) .property("auto_refund", codecOptional(codecForDuration)) @@ -1086,10 +1095,7 @@ export const codecForContractTerms = (): Codec<ContractTerms> => .property("merchant", codecForMerchantInfo()) .property("merchant_pub", codecForString()) .property("exchanges", codecForList(codecForExchangeHandle())) - .property( - "products", - codecOptional(codecForList(codecForProduct())), - ) + .property("products", codecOptional(codecForList(codecForProduct()))) .property("extra", codecForAny()) .build("ContractTerms"); @@ -1296,13 +1302,13 @@ export const codecForMerchantOrderStatusPaid = (): Codec< .build("MerchantOrderStatusPaid"); export const codecForMerchantOrderRefundPickupResponse = (): Codec< - MerchantOrderRefundResponse - > => - buildCodecForObject<MerchantOrderRefundResponse>() - .property("merchant_pub", codecForString()) - .property("refund_amount", codecForString()) - .property("refunds", codecForList(codecForMerchantCoinRefundStatus())) - .build("MerchantOrderRefundPickupResponse"); + MerchantOrderRefundResponse +> => + buildCodecForObject<MerchantOrderRefundResponse>() + .property("merchant_pub", codecForString()) + .property("refund_amount", codecForString()) + .property("refunds", codecForList(codecForMerchantCoinRefundStatus())) + .build("MerchantOrderRefundPickupResponse"); export const codecForMerchantOrderStatusUnpaid = (): Codec< MerchantOrderStatusUnpaid diff --git a/packages/taler-wallet-core/src/types/walletTypes.ts b/packages/taler-wallet-core/src/types/walletTypes.ts index 3182d50bb..89c8b4a8b 100644 --- a/packages/taler-wallet-core/src/types/walletTypes.ts +++ b/packages/taler-wallet-core/src/types/walletTypes.ts @@ -50,7 +50,11 @@ import { codecForAny, buildCodecForUnion, } from "../util/codec"; -import { AmountString, codecForContractTerms, ContractTerms } from "./talerTypes"; +import { + AmountString, + codecForContractTerms, + ContractTerms, +} from "./talerTypes"; /** * Response for the create reserve request to the wallet. @@ -831,7 +835,9 @@ export const withdrawTestBalanceDefaults = { exchangeBaseUrl: "https://exchange.test.taler.net/", }; -export const codecForWithdrawTestBalance = (): Codec<WithdrawTestBalanceRequest> => +export const codecForWithdrawTestBalance = (): Codec< + WithdrawTestBalanceRequest +> => buildCodecForObject<WithdrawTestBalanceRequest>() .property("amount", codecForString()) .property("bankBaseUrl", codecForString()) |