diff options
author | Sebastian <sebasjm@gmail.com> | 2023-06-20 11:50:04 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2023-06-20 11:50:34 -0300 |
commit | 9f07ab8d4a13d52d7fd61a3e9b8ddc423fee164e (patch) | |
tree | b14a56a1e1e46c89b4e8d7090bf2f4380f31be18 /packages/taler-util/src/wallet-types.ts | |
parent | ac9b4bfd0edc8d4f8c396837d2192fb6895e5b29 (diff) | |
download | wallet-core-9f07ab8d4a13d52d7fd61a3e9b8ddc423fee164e.tar.xz |
remove from float
Diffstat (limited to 'packages/taler-util/src/wallet-types.ts')
-rw-r--r-- | packages/taler-util/src/wallet-types.ts | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/packages/taler-util/src/wallet-types.ts b/packages/taler-util/src/wallet-types.ts index b17860fc8..5a87864fc 100644 --- a/packages/taler-util/src/wallet-types.ts +++ b/packages/taler-util/src/wallet-types.ts @@ -187,6 +187,31 @@ interface GetPlanForWalletInitiatedOperation { mode: TransactionAmountMode; } +export interface ConvertAmountRequest { + amount: AmountString; + type: TransactionAmountMode; +} + +export const codecForConvertAmountRequest = + buildCodecForObject<ConvertAmountRequest>() + .property("amount", codecForAmountString()) + .property( + "type", + codecForEither( + codecForConstString(TransactionAmountMode.Raw), + codecForConstString(TransactionAmountMode.Effective), + ), + ) + .build("ConvertAmountRequest"); + +export interface GetAmountRequest { + currency: string; +} + +export const codecForGetAmountRequest = buildCodecForObject<GetAmountRequest>() + .property("currency", codecForString()) + .build("GetAmountRequest"); + interface GetPlanToCompleteOperation { instructedAmount: AmountString; } @@ -328,6 +353,17 @@ export const codecForGetPlanForOperationResponse = .property("counterPartyAmount", codecOptional(codecForAmountString())) .build("GetPlanForOperationResponse"); +export interface AmountResponse { + effectiveAmount: AmountString; + rawAmount: AmountString; +} + +export const codecForAmountResponse = (): Codec<AmountResponse> => + buildCodecForObject<AmountResponse>() + .property("effectiveAmount", codecForAmountString()) + .property("rawAmount", codecForAmountString()) + .build("AmountResponse"); + export interface Balance { scopeInfo: ScopeInfo; available: AmountString; |