diff options
author | Florian Dold <florian@dold.me> | 2023-05-05 14:56:28 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2023-05-05 14:56:33 +0200 |
commit | 9a412260f3b0a53b1508e2db8724a0c58ce080cf (patch) | |
tree | 40c495c9ec97ab8e2631076eeec2c8165a561d88 /packages/taler-util/src/merchant-api-types.ts | |
parent | 990b056071fd0b3879d4366ff3dd625aa3265738 (diff) | |
download | wallet-core-9a412260f3b0a53b1508e2db8724a0c58ce080cf.tar.xz |
adapt to merchant API breaking changes
Diffstat (limited to 'packages/taler-util/src/merchant-api-types.ts')
-rw-r--r-- | packages/taler-util/src/merchant-api-types.ts | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/packages/taler-util/src/merchant-api-types.ts b/packages/taler-util/src/merchant-api-types.ts index 61002191a..d7a5cf576 100644 --- a/packages/taler-util/src/merchant-api-types.ts +++ b/packages/taler-util/src/merchant-api-types.ts @@ -44,6 +44,9 @@ import { TalerProtocolDuration, codecForTimestamp, TalerProtocolTimestamp, + WireAccount, + codecForWireAccount, + codecForList, } from "@gnu-taler/taler-util"; export interface MerchantPostOrderRequest { @@ -75,11 +78,12 @@ export interface MerchantPostOrderResponse { token?: ClaimToken; } -export const codecForMerchantPostOrderResponse = (): Codec<MerchantPostOrderResponse> => - buildCodecForObject<MerchantPostOrderResponse>() - .property("order_id", codecForString()) - .property("token", codecOptional(codecForString())) - .build("PostOrderResponse"); +export const codecForMerchantPostOrderResponse = + (): Codec<MerchantPostOrderResponse> => + buildCodecForObject<MerchantPostOrderResponse>() + .property("order_id", codecForString()) + .property("token", codecOptional(codecForString())) + .build("PostOrderResponse"); export const codecForMerchantRefundDetails = (): Codec<RefundDetails> => buildCodecForObject<RefundDetails>() @@ -351,7 +355,6 @@ export interface MerchantTemplateContractDetails { } export interface MerchantTemplateAddDetails { - // Template ID to use. template_id: string; @@ -365,4 +368,19 @@ export interface MerchantTemplateAddDetails { // Additional information in a separate template. template_contract: MerchantTemplateContractDetails; -}
\ No newline at end of file +} + +export interface MerchantReserveCreateConfirmation { + // Public key identifying the reserve. + reserve_pub: EddsaPublicKeyString; + + // Wire accounts of the exchange where to transfer the funds. + accounts: WireAccount[]; +} + +export const codecForMerchantReserveCreateConfirmation = + (): Codec<MerchantReserveCreateConfirmation> => + buildCodecForObject<MerchantReserveCreateConfirmation>() + .property("accounts", codecForList(codecForWireAccount())) + .property("reserve_pub", codecForString()) + .build("MerchantReserveCreateConfirmation"); |