diff options
author | Florian Dold <florian@dold.me> | 2023-11-22 15:20:10 +0100 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2023-11-22 17:08:15 +0100 |
commit | bd37a0b04123d734e1e3fae105f0d9c24279629f (patch) | |
tree | 31f03c2acd3c1f123f8762391456b1aa22df9803 /packages/taler-util/src/taler-types.ts | |
parent | 32182fb1b912e1136ba933c4a4f204e6e2f33de2 (diff) | |
download | wallet-core-bd37a0b04123d734e1e3fae105f0d9c24279629f.tar.xz |
wallet-core: implement and test currency conversion withdrawals
Diffstat (limited to 'packages/taler-util/src/taler-types.ts')
-rw-r--r-- | packages/taler-util/src/taler-types.ts | 41 |
1 files changed, 40 insertions, 1 deletions
diff --git a/packages/taler-util/src/taler-types.ts b/packages/taler-util/src/taler-types.ts index f21efc516..e32c5a99d 100644 --- a/packages/taler-util/src/taler-types.ts +++ b/packages/taler-util/src/taler-types.ts @@ -41,6 +41,10 @@ import { codecOptional, } from "./codec.js"; import { strcmp } from "./helpers.js"; +import { + CurrencySpecification, + codecForCurrencySpecificiation, +} from "./index.js"; import { AgeCommitmentProof, Edx25519PublicKeyEnc } from "./taler-crypto.js"; import { codecForAbsoluteTime, @@ -1756,7 +1760,6 @@ export interface MerchantAbortPayRefundSuccessStatus { exchange_pub: string; } - export interface FutureKeysResponse { future_denoms: any[]; @@ -2375,3 +2378,39 @@ export const codecForExchangeWireAccount = (): Codec<ExchangeWireAccount> => .property("master_sig", codecForString()) .property("payto_uri", codecForString()) .build("WireAccount"); + +export type Integer = number; + +export interface BankConversionInfoConfig { + // libtool-style representation of the Bank protocol version, see + // https://www.gnu.org/software/libtool/manual/html_node/Versioning.html#Versioning + // The format is "current:revision:age". + version: string; + + // Name of the API. + name: "taler-conversion-info"; + + regional_currency: string; + + fiat_currency: string; + + // Currency used by this bank. + regional_currency_specification: CurrencySpecification; + + // External currency used during conversion. + fiat_currency_specification: CurrencySpecification; +} + +export const codecForBankConversionInfoConfig = + (): Codec<BankConversionInfoConfig> => + buildCodecForObject<BankConversionInfoConfig>() + .property("name", codecForConstString("taler-conversion-info")) + .property("version", codecForString()) + .property("fiat_currency", codecForString()) + .property("regional_currency", codecForString()) + .property("fiat_currency_specification", codecForCurrencySpecificiation()) + .property( + "regional_currency_specification", + codecForCurrencySpecificiation(), + ) + .build("BankConversionInfoConfig"); |