diff options
Diffstat (limited to 'packages/taler-util/src/wallet-types.ts')
-rw-r--r-- | packages/taler-util/src/wallet-types.ts | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/packages/taler-util/src/wallet-types.ts b/packages/taler-util/src/wallet-types.ts index 8ccc93c38..583d5dff5 100644 --- a/packages/taler-util/src/wallet-types.ts +++ b/packages/taler-util/src/wallet-types.ts @@ -46,7 +46,7 @@ import { codecOptional, renderContext, } from "./codec.js"; -import { CurrencySpecification } from "./index.js"; +import { CurrencySpecification, WithdrawalOperationStatus } from "./index.js"; import { VersionMatchResult } from "./libtool-version.js"; import { PaytoUri } from "./payto.js"; import { AgeCommitmentProof } from "./taler-crypto.js"; @@ -71,10 +71,12 @@ import { } from "./taler-types.js"; import { AbsoluteTime, + Duration, TalerPreciseTimestamp, TalerProtocolDuration, TalerProtocolTimestamp, codecForAbsoluteTime, + codecForDuration, codecForTimestamp, } from "./time.js"; import { @@ -575,11 +577,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 */ @@ -942,13 +944,14 @@ export interface PreparePayResultAlreadyConfirmed { } export interface BankWithdrawDetails { - selectionDone: boolean; - transferDone: boolean; + status: WithdrawalOperationStatus, amount: AmountJson; senderWire?: string; suggestedExchange?: string; confirmTransferUrl?: string; wireTypes: string[]; + operationId: string, + apiBaseUrl: string, } export interface AcceptWithdrawalResponse { @@ -1799,6 +1802,7 @@ export const codecForApplyRefundFromPurchaseIdRequest = export interface GetWithdrawalDetailsForUriRequest { talerWithdrawUri: string; restrictAge?: number; + notifyChangeFromPendingTimeoutMs?: number; } export const codecForGetWithdrawalDetailsForUri = @@ -1806,6 +1810,7 @@ export const codecForGetWithdrawalDetailsForUri = buildCodecForObject<GetWithdrawalDetailsForUriRequest>() .property("talerWithdrawUri", codecForString()) .property("restrictAge", codecOptional(codecForNumber())) + .property("notifyChangeFromPendingTimeoutMs", codecOptional(codecForNumber())) .build("GetWithdrawalDetailsForUriRequest"); export interface ListKnownBankAccountsRequest { @@ -2185,6 +2190,9 @@ export interface TxIdResponse { } export interface WithdrawUriInfoResponse { + operationId: string; + status: WithdrawalOperationStatus, + confirmTransferUrl?: string; amount: AmountString; defaultExchangeBaseUrl?: string; possibleExchanges: ExchangeListItem[]; @@ -2193,6 +2201,14 @@ export interface WithdrawUriInfoResponse { export const codecForWithdrawUriInfoResponse = (): Codec<WithdrawUriInfoResponse> => buildCodecForObject<WithdrawUriInfoResponse>() + .property("operationId", codecForString()) + .property("confirmTransferUrl", codecOptional(codecForString())) + .property("status", codecForEither( + codecForConstString("pending"), + codecForConstString("selected"), + codecForConstString("aborted"), + codecForConstString("confirmed"), + )) .property("amount", codecForAmountString()) .property("defaultExchangeBaseUrl", codecOptional(codecForString())) .property("possibleExchanges", codecForList(codecForExchangeListItem())) |