diff options
Diffstat (limited to 'packages/taler-util/src/wallet-types.ts')
-rw-r--r-- | packages/taler-util/src/wallet-types.ts | 54 |
1 files changed, 39 insertions, 15 deletions
diff --git a/packages/taler-util/src/wallet-types.ts b/packages/taler-util/src/wallet-types.ts index d472af187..d23780145 100644 --- a/packages/taler-util/src/wallet-types.ts +++ b/packages/taler-util/src/wallet-types.ts @@ -54,7 +54,7 @@ import { canonicalizeBaseUrl, } from "./index.js"; import { VersionMatchResult } from "./libtool-version.js"; -import { PaytoUri } from "./payto.js"; +import { PaytoString, PaytoUri, codecForPaytoString } from "./payto.js"; import { AgeCommitmentProof } from "./taler-crypto.js"; import { TalerErrorCode } from "./taler-error-codes.js"; import { @@ -229,11 +229,13 @@ interface GetPlanForWalletInitiatedOperation { export interface ConvertAmountRequest { amount: AmountString; type: TransactionAmountMode; + depositPaytoUri: PaytoString; } export const codecForConvertAmountRequest = buildCodecForObject<ConvertAmountRequest>() .property("amount", codecForAmountString()) + .property("depositPaytoUri", codecForPaytoString()) .property( "type", codecForEither( @@ -663,11 +665,11 @@ export interface CoinDumpJson { withdrawal_reserve_pub: string | undefined; coin_status: CoinStatus; spend_allocation: - | { - id: string; - amount: AmountString; - } - | undefined; + | { + id: string; + amount: AmountString; + } + | undefined; /** * Information about the age restriction */ @@ -801,7 +803,7 @@ export const codecForPreparePayResultPaymentPossible = ) .build("PreparePayResultPaymentPossible"); -export interface BalanceDetails { } +export interface BalanceDetails {} /** * Detailed reason for why the wallet's balance is insufficient. @@ -984,9 +986,14 @@ export interface PreparePayResultAlreadyConfirmed { export interface BankWithdrawDetails { status: WithdrawalOperationStatus; - amount: AmountJson; + currency: string; + amount: AmountJson | undefined; + editableAmount: boolean; + maxAmount: AmountJson | undefined; + wireFee: AmountJson | undefined; senderWire?: string; - suggestedExchange?: string; + exchange?: string; + editableExchange: boolean; confirmTransferUrl?: string; wireTypes: string[]; operationId: string; @@ -1331,6 +1338,7 @@ export enum ExchangeTosStatus { Pending = "pending", Proposed = "proposed", Accepted = "accepted", + MissingTos = "missing-tos", } export enum ExchangeEntryStatus { @@ -1846,18 +1854,16 @@ export interface GetWithdrawalDetailsForAmountRequest { export interface PrepareBankIntegratedWithdrawalRequest { talerWithdrawUri: string; - selectedExchange?: string; } export const codecForPrepareBankIntegratedWithdrawalRequest = (): Codec<PrepareBankIntegratedWithdrawalRequest> => buildCodecForObject<PrepareBankIntegratedWithdrawalRequest>() .property("talerWithdrawUri", codecForString()) - .property("selectedExchange", codecOptional(codecForString())) .build("PrepareBankIntegratedWithdrawalRequest"); export interface PrepareBankIntegratedWithdrawalResponse { - transactionId?: string; + transactionId: TransactionIdStr; info: WithdrawUriInfoResponse; } @@ -1883,6 +1889,13 @@ export interface AcceptBankIntegratedWithdrawalRequest { talerWithdrawUri: string; exchangeBaseUrl: string; forcedDenomSel?: ForcedDenomSel; + /** + * Amount to withdraw. + * If the bank's withdrawal operation uses a fixed amount, + * this field must either be left undefined or its value must match + * the amount from the withdrawal operation. + */ + amount?: AmountString; restrictAge?: number; } @@ -1892,6 +1905,7 @@ export const codecForAcceptBankIntegratedWithdrawalRequest = .property("exchangeBaseUrl", codecForCanonBaseUrl()) .property("talerWithdrawUri", codecForString()) .property("forcedDenomSel", codecForAny()) + .property("amount", codecOptional(codecForAmountString())) .property("restrictAge", codecOptional(codecForNumber())) .build("AcceptBankIntegratedWithdrawalRequest"); @@ -2047,7 +2061,7 @@ export interface CheckPayTemplateRequest { export type CheckPayTemplateReponse = { templateDetails: TalerMerchantApi.WalletTemplateDetails; supportedCurrencies: string[]; -} +}; export const codecForCheckPayTemplateRequest = (): Codec<CheckPayTemplateRequest> => @@ -2352,8 +2366,13 @@ export interface WithdrawUriInfoResponse { operationId: string; status: WithdrawalOperationStatus; confirmTransferUrl?: string; - amount: AmountString; + currency: string; + amount: AmountString | undefined; + editableAmount: boolean; + maxAmount: AmountString | undefined; + wireFee: AmountString | undefined; defaultExchangeBaseUrl?: string; + editableExchange: boolean; possibleExchanges: ExchangeListItem[]; } @@ -2371,7 +2390,12 @@ export const codecForWithdrawUriInfoResponse = codecForConstString("confirmed"), ), ) - .property("amount", codecForAmountString()) + .property("amount", codecOptional(codecForAmountString())) + .property("maxAmount", codecOptional(codecForAmountString())) + .property("wireFee", codecOptional(codecForAmountString())) + .property("currency", codecForString()) + .property("editableAmount", codecForBoolean()) + .property("editableExchange", codecForBoolean()) .property("defaultExchangeBaseUrl", codecOptional(codecForCanonBaseUrl())) .property("possibleExchanges", codecForList(codecForExchangeListItem())) .build("WithdrawUriInfoResponse"); |