taler-docs

Documentation for GNU Taler components, APIs and protocols
Log | Files | Refs | README | LICENSE

commit 26cbc830f9aad8178d0413e6c608b442f757d0eb
parent 1db1852238f408684ace0ba94a22e9b819f909de
Author: Florian Dold <florian@dold.me>
Date:   Fri, 21 Aug 2026 10:26:16 +0200

update wallet-core docs

Diffstat:
Dextract-tsdefs/foo | 3562-------------------------------------------------------------------------------
Dextract-tsdefs/myout.md | 2517-------------------------------------------------------------------------------
Mwallet/wallet-core.md | 1192++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------------------
3 files changed, 873 insertions(+), 6398 deletions(-)

diff --git a/extract-tsdefs/foo b/extract-tsdefs/foo @@ -1,3562 +0,0 @@ -# Wallet-Core API Documentation -This file is auto-generated from [wallet-core](https://git.taler.net/wallet-core.git/tree/packages/taler-wallet-core/src/wallet-api-types.ts). -## Overview -### Unknown Group -* [InitWalletOp](#initwalletop) -* [GetVersionOp](#getversionop) -### Basic Wallet Information -* [GetBalancesOp](#getbalancesop) -* [GetBalancesDetailOp](#getbalancesdetailop) -### Managing Transactions -* [GetTransactionsOp](#gettransactionsop) -* [GetTransactionByIdOp](#gettransactionbyidop) -* [RetryPendingNowOp](#retrypendingnowop) -* [DeleteTransactionOp](#deletetransactionop) -* [RetryTransactionOp](#retrytransactionop) -* [AbortTransactionOp](#aborttransactionop) -* [SuspendTransactionOp](#suspendtransactionop) -* [ResumeTransactionOp](#resumetransactionop) -### Withdrawals -* [GetWithdrawalDetailsForAmountOp](#getwithdrawaldetailsforamountop) -* [GetWithdrawalDetailsForUriOp](#getwithdrawaldetailsforuriop) -* [AcceptBankIntegratedWithdrawalOp](#acceptbankintegratedwithdrawalop) -* [AcceptManualWithdrawalOp](#acceptmanualwithdrawalop) -### Merchant Payments -* [PreparePayForUriOp](#preparepayforuriop) -* [PreparePayForTemplateOp](#preparepayfortemplateop) -* [GetContractTermsDetailsOp](#getcontracttermsdetailsop) -* [ConfirmPayOp](#confirmpayop) -* [ApplyRefundOp](#applyrefundop) -* [ApplyRefundFromPurchaseIdOp](#applyrefundfrompurchaseidop) -* [PrepareRefundOp](#preparerefundop) -### Tipping -* [PrepareTipOp](#preparetipop) -* [AcceptTipOp](#accepttipop) -### Exchange Management -* [ListExchangesOp](#listexchangesop) -* [AddExchangeOp](#addexchangeop) -* [ListKnownBankAccountsOp](#listknownbankaccountsop) -* [AddKnownBankAccountsOp](#addknownbankaccountsop) -* [ForgetKnownBankAccountsOp](#forgetknownbankaccountsop) -* [SetExchangeTosAcceptedOp](#setexchangetosacceptedop) -* [GetExchangeTosOp](#getexchangetosop) -* [GetExchangeDetailedInfoOp](#getexchangedetailedinfoop) -* [ListCurrenciesOp](#listcurrenciesop) -### Deposits -* [GenerateDepositGroupTxIdOp](#generatedepositgrouptxidop) -* [CreateDepositGroupOp](#createdepositgroupop) -* [PrepareDepositOp](#preparedepositop) -### Backups -* [ExportBackupRecoveryOp](#exportbackuprecoveryop) -* [ImportBackupRecoveryOp](#importbackuprecoveryop) -* [RunBackupCycleOp](#runbackupcycleop) -* [ExportBackupOp](#exportbackupop) -* [AddBackupProviderOp](#addbackupproviderop) -* [RemoveBackupProviderOp](#removebackupproviderop) -* [GetBackupInfoOp](#getbackupinfoop) -* [SetWalletDeviceIdOp](#setwalletdeviceidop) -* [ExportBackupPlainOp](#exportbackupplainop) -### Peer Payments -* [CheckPeerPushDebitOp](#checkpeerpushdebitop) -* [InitiatePeerPushDebitOp](#initiatepeerpushdebitop) -* [PreparePeerPushCreditOp](#preparepeerpushcreditop) -* [ConfirmPeerPushCreditOp](#confirmpeerpushcreditop) -* [CheckPeerPullCreditOp](#checkpeerpullcreditop) -* [InitiatePeerPullCreditOp](#initiatepeerpullcreditop) -* [PreparePeerPullDebitOp](#preparepeerpulldebitop) -* [ConfirmPeerPullDebitOp](#confirmpeerpulldebitop) -### Data Validation -* [ValidateIbanOp](#validateibanop) -### Database Management -* [ExportDbOp](#exportdbop) -* [ImportDbOp](#importdbop) -* [ClearDbOp](#cleardbop) -* [RecycleOp](#recycleop) -### Testing and Debugging -* [ApplyDevExperimentOp](#applydevexperimentop) -* [RunIntegrationTestOp](#runintegrationtestop) -* [RunIntegrationTestV2Op](#runintegrationtestv2op) -* [TestCryptoOp](#testcryptoop) -* [WithdrawTestBalanceOp](#withdrawtestbalanceop) -* [WithdrawTestkudosOp](#withdrawtestkudosop) -* [TestPayOp](#testpayop) -* [WithdrawFakebankOp](#withdrawfakebankop) -* [GetPendingTasksOp](#getpendingtasksop) -* [DumpCoinsOp](#dumpcoinsop) -* [SetCoinSuspendedOp](#setcoinsuspendedop) -* [ForceRefreshOp](#forcerefreshop) -## Operation Reference -### InitWalletOp -```typescript -/** - * Initialize wallet-core. - * - * Must be the request before any other operations. - */ -export type InitWalletOp = { - op: WalletApiOperation.InitWallet; - request: InitRequest; - response: InitResponse; -}; -// InitWallet = "initWallet" - -``` -```typescript -export interface InitRequest { - skipDefaults?: boolean; -} - -``` -```typescript -export interface InitResponse { - versionInfo: WalletCoreVersion; -} - -``` - -### GetVersionOp -```typescript -export type GetVersionOp = { - op: WalletApiOperation.GetVersion; - request: EmptyObject; - response: WalletCoreVersion; -}; -// GetVersion = "getVersion" - -``` - -### GetBalancesOp -```typescript -/** - * Get current wallet balance. - */ -export type GetBalancesOp = { - op: WalletApiOperation.GetBalances; - request: EmptyObject; - response: BalancesResponse; -}; -// GetBalances = "getBalances" - -``` -```typescript -export interface BalancesResponse { - balances: Balance[]; -} - -``` -```typescript -export interface Balance { - scopeInfo: ScopeInfo; - available: AmountString; - pendingIncoming: AmountString; - pendingOutgoing: AmountString; - hasPendingTransactions: boolean; - requiresUserInput: boolean; -} - -``` -```typescript -export type ScopeInfo = - | { - type: ScopeType.Global; - currency: string; - } - | { - type: ScopeType.Exchange; - currency: string; - url: string; - } - | { - type: ScopeType.Auditor; - currency: string; - url: string; - }; - -``` - -### GetBalancesDetailOp -```typescript -export type GetBalancesDetailOp = { - op: WalletApiOperation.GetBalanceDetail; - request: GetBalanceDetailRequest; - response: MerchantPaymentBalanceDetails; -}; -// GetBalanceDetail = "getBalanceDetail" - -``` -```typescript -export interface GetBalanceDetailRequest { - currency: string; -} - -``` -```typescript -export interface MerchantPaymentBalanceDetails { - /** - * Balance of type "available" (see balance.ts for definition). - */ - balanceAvailable: AmountJson; - /** - * Balance of type "material" (see balance.ts for definition). - */ - balanceMaterial: AmountJson; - /** - * Balance of type "age-acceptable" (see balance.ts for definition). - */ - balanceAgeAcceptable: AmountJson; - /** - * Balance of type "merchant-acceptable" (see balance.ts for definition). - */ - balanceMerchantAcceptable: AmountJson; - /** - * Balance of type "merchant-depositable" (see balance.ts for definition). - */ - balanceMerchantDepositable: AmountJson; -} - -``` -```typescript -/** - * Non-negative financial amount. Fractional values are expressed as multiples - * of 1e-8. - */ -export interface AmountJson { - /** - * Value, must be an integer. - */ - readonly value: number; - /** - * Fraction, must be an integer. Represent 1/1e8 of a unit. - */ - readonly fraction: number; - /** - * Currency of the amount. - */ - readonly currency: string; -} - -``` - -### GetTransactionsOp -```typescript -/** - * Get transactions. - */ -export type GetTransactionsOp = { - op: WalletApiOperation.GetTransactions; - request: TransactionsRequest; - response: TransactionsResponse; -}; -// GetTransactions = "getTransactions" - -``` -```typescript -export interface TransactionsRequest { - /** - * return only transactions in the given currency - */ - currency?: string; - /** - * if present, results will be limited to transactions related to the given search string - */ - search?: string; - /** - * If true, include all refreshes in the transactions list. - */ - includeRefreshes?: boolean; -} - -``` -```typescript -export interface TransactionsResponse { - transactions: Transaction[]; -} - -``` - -### GetTransactionByIdOp -```typescript -export type GetTransactionByIdOp = { - op: WalletApiOperation.GetTransactionById; - request: TransactionByIdRequest; - response: Transaction; -}; -// GetTransactionById = "getTransactionById" - -``` -```typescript -export interface TransactionByIdRequest { - transactionId: string; -} - -``` - -### RetryPendingNowOp -```typescript -export type RetryPendingNowOp = { - op: WalletApiOperation.RetryPendingNow; - request: EmptyObject; - response: EmptyObject; -}; -// RetryPendingNow = "retryPendingNow" - -``` - -### DeleteTransactionOp -```typescript -/** - * Delete a transaction locally in the wallet. - */ -export type DeleteTransactionOp = { - op: WalletApiOperation.DeleteTransaction; - request: DeleteTransactionRequest; - response: EmptyObject; -}; -// DeleteTransaction = "deleteTransaction" - -``` -```typescript -export interface DeleteTransactionRequest { - transactionId: string; -} - -``` - -### RetryTransactionOp -```typescript -/** - * Immediately retry a transaction. - */ -export type RetryTransactionOp = { - op: WalletApiOperation.RetryTransaction; - request: RetryTransactionRequest; - response: EmptyObject; -}; -// RetryTransaction = "retryTransaction" - -``` -```typescript -export interface RetryTransactionRequest { - transactionId: string; -} - -``` - -### AbortTransactionOp -```typescript -/** - * Abort a transaction - * - * For payment transactions, it puts the payment into an "aborting" state. - */ -export type AbortTransactionOp = { - op: WalletApiOperation.AbortTransaction; - request: AbortTransactionRequest; - response: EmptyObject; -}; -// AbortTransaction = "abortTransaction" - -``` - -### SuspendTransactionOp -```typescript -/** - * Suspend a transaction - */ -export type SuspendTransactionOp = { - op: WalletApiOperation.SuspendTransaction; - request: AbortTransactionRequest; - response: EmptyObject; -}; -// SuspendTransaction = "suspendTransaction" - -``` - -### ResumeTransactionOp -```typescript -/** - * Resume a transaction - */ -export type ResumeTransactionOp = { - op: WalletApiOperation.ResumeTransaction; - request: AbortTransactionRequest; - response: EmptyObject; -}; -// ResumeTransaction = "resumeTransaction" - -``` - -### GetWithdrawalDetailsForAmountOp -```typescript -/** - * Get details for withdrawing a particular amount (manual withdrawal). - */ -export type GetWithdrawalDetailsForAmountOp = { - op: WalletApiOperation.GetWithdrawalDetailsForAmount; - request: GetWithdrawalDetailsForAmountRequest; - response: ManualWithdrawalDetails; -}; -// GetWithdrawalDetailsForAmount = "getWithdrawalDetailsForAmount" - -``` -```typescript -export interface GetWithdrawalDetailsForAmountRequest { - exchangeBaseUrl: string; - amount: string; - restrictAge?: number; -} - -``` -```typescript -export interface ManualWithdrawalDetails { - /** - * Did the user accept the current version of the exchange's - * terms of service? - */ - tosAccepted: boolean; - /** - * Amount that the user will transfer to the exchange. - */ - amountRaw: AmountString; - /** - * Amount that will be added to the user's wallet balance. - */ - amountEffective: AmountString; - /** - * Ways to pay the exchange. - */ - paytoUris: string[]; - /** - * If the exchange supports age-restricted coins it will return - * the array of ages. - */ - ageRestrictionOptions?: number[]; -} - -``` - -### GetWithdrawalDetailsForUriOp -```typescript -/** - * Get details for withdrawing via a particular taler:// URI. - */ -export type GetWithdrawalDetailsForUriOp = { - op: WalletApiOperation.GetWithdrawalDetailsForUri; - request: GetWithdrawalDetailsForUriRequest; - response: WithdrawUriInfoResponse; -}; -// GetWithdrawalDetailsForUri = "getWithdrawalDetailsForUri" - -``` -```typescript -export interface GetWithdrawalDetailsForUriRequest { - talerWithdrawUri: string; - restrictAge?: number; -} - -``` -```typescript -export interface WithdrawUriInfoResponse { - amount: AmountString; - defaultExchangeBaseUrl?: string; - possibleExchanges: ExchangeListItem[]; -} - -``` - -### AcceptBankIntegratedWithdrawalOp -```typescript -/** - * Accept a bank-integrated withdrawal. - */ -export type AcceptBankIntegratedWithdrawalOp = { - op: WalletApiOperation.AcceptBankIntegratedWithdrawal; - request: AcceptBankIntegratedWithdrawalRequest; - response: AcceptWithdrawalResponse; -}; -// AcceptBankIntegratedWithdrawal = "acceptBankIntegratedWithdrawal" - -``` -```typescript -export interface AcceptBankIntegratedWithdrawalRequest { - talerWithdrawUri: string; - exchangeBaseUrl: string; - forcedDenomSel?: ForcedDenomSel; - restrictAge?: number; -} - -``` -```typescript -export interface AcceptWithdrawalResponse { - reservePub: string; - confirmTransferUrl?: string; - transactionId: string; -} - -``` - -### AcceptManualWithdrawalOp -```typescript -/** - * Create a manual withdrawal. - */ -export type AcceptManualWithdrawalOp = { - op: WalletApiOperation.AcceptManualWithdrawal; - request: AcceptManualWithdrawalRequest; - response: AcceptManualWithdrawalResult; -}; -// AcceptManualWithdrawal = "acceptManualWithdrawal" - -``` -```typescript -export interface AcceptManualWithdrawalRequest { - exchangeBaseUrl: string; - amount: string; - restrictAge?: number; -} - -``` -```typescript -export interface AcceptManualWithdrawalResult { - /** - * Payto URIs that can be used to fund the withdrawal. - */ - exchangePaytoUris: string[]; - /** - * Public key of the newly created reserve. - */ - reservePub: string; - transactionId: string; -} - -``` - -### PreparePayForUriOp -```typescript -/** - * Prepare to make a payment based on a taler://pay/ URI. - */ -export type PreparePayForUriOp = { - op: WalletApiOperation.PreparePayForUri; - request: PreparePayRequest; - response: PreparePayResult; -}; -// PreparePayForUri = "preparePayForUri" - -``` -```typescript -export interface PreparePayRequest { - talerPayUri: string; -} - -``` - -### PreparePayForTemplateOp -```typescript -/** - * Prepare to make a payment based on a taler://pay-template/ URI. - */ -export type PreparePayForTemplateOp = { - op: WalletApiOperation.PreparePayForTemplate; - request: PreparePayTemplateRequest; - response: PreparePayResult; -}; -// PreparePayForTemplate = "preparePayForTemplate" - -``` -```typescript -export interface PreparePayTemplateRequest { - talerPayTemplateUri: string; - templateParams: Record<string, string>; -} - -``` - -### GetContractTermsDetailsOp -```typescript -export type GetContractTermsDetailsOp = { - op: WalletApiOperation.GetContractTermsDetails; - request: GetContractTermsDetailsRequest; - response: WalletContractData; -}; -// GetContractTermsDetails = "getContractTermsDetails" - -``` -```typescript -export interface GetContractTermsDetailsRequest { - proposalId: string; -} - -``` -```typescript -/** - * Data extracted from the contract terms that is relevant for payment - * processing in the wallet. - */ -export interface WalletContractData { - products?: Product[]; - summaryI18n: - | { - [lang_tag: string]: string; - } - | undefined; - /** - * Fulfillment URL, or the empty string if the order has no fulfillment URL. - * - * Stored as a non-nullable string as we use this field for IndexedDB indexing. - */ - fulfillmentUrl: string; - contractTermsHash: string; - fulfillmentMessage?: string; - fulfillmentMessageI18n?: InternationalizedString; - merchantSig: string; - merchantPub: string; - merchant: MerchantInfo; - amount: AmountString; - orderId: string; - merchantBaseUrl: string; - summary: string; - autoRefund: TalerProtocolDuration | undefined; - maxWireFee: AmountString; - wireFeeAmortization: number; - payDeadline: TalerProtocolTimestamp; - refundDeadline: TalerProtocolTimestamp; - allowedAuditors: AllowedAuditorInfo[]; - allowedExchanges: AllowedExchangeInfo[]; - timestamp: TalerProtocolTimestamp; - wireMethod: string; - wireInfoHash: string; - maxDepositFee: AmountString; - minimumAge?: number; - deliveryDate: TalerProtocolTimestamp | undefined; - deliveryLocation: Location | undefined; -} - -``` -```typescript -export interface AllowedAuditorInfo { - auditorBaseUrl: string; - auditorPub: string; -} - -``` -```typescript -export interface AllowedExchangeInfo { - exchangeBaseUrl: string; - exchangePub: string; -} - -``` - -### ConfirmPayOp -```typescript -/** - * Confirm a payment that was previously prepared with - * {@link PreparePayForUriOp} - */ -export type ConfirmPayOp = { - op: WalletApiOperation.ConfirmPay; - request: ConfirmPayRequest; - response: ConfirmPayResult; -}; -// ConfirmPay = "confirmPay" - -``` -```typescript -export interface ConfirmPayRequest { - proposalId: string; - sessionId?: string; - forcedCoinSel?: ForcedCoinSel; -} - -``` -```typescript -export type ConfirmPayResult = ConfirmPayResultDone | ConfirmPayResultPending; - -``` -```typescript -/** - * Result for confirmPay - */ -export interface ConfirmPayResultDone { - type: ConfirmPayResultType.Done; - contractTerms: MerchantContractTerms; - transactionId: string; -} - -``` -```typescript -export interface ConfirmPayResultPending { - type: ConfirmPayResultType.Pending; - transactionId: string; - lastError: TalerErrorDetail | undefined; -} - -``` - -### ApplyRefundOp -```typescript -/** - * Check for a refund based on a taler://refund URI. - */ -export type ApplyRefundOp = { - op: WalletApiOperation.ApplyRefund; - request: ApplyRefundRequest; - response: ApplyRefundResponse; -}; -// ApplyRefund = "applyRefund" - -``` -```typescript -export interface ApplyRefundRequest { - talerRefundUri: string; -} - -``` - -### ApplyRefundFromPurchaseIdOp -```typescript -export type ApplyRefundFromPurchaseIdOp = { - op: WalletApiOperation.ApplyRefundFromPurchaseId; - request: ApplyRefundFromPurchaseIdRequest; - response: ApplyRefundResponse; -}; -// ApplyRefundFromPurchaseId = "applyRefundFromPurchaseId" - -``` -```typescript -export interface ApplyRefundFromPurchaseIdRequest { - purchaseId: string; -} - -``` - -### PrepareRefundOp -```typescript -export type PrepareRefundOp = { - op: WalletApiOperation.PrepareRefund; - request: PrepareRefundRequest; - response: PrepareRefundResult; -}; -// PrepareRefund = "prepareRefund" - -``` -```typescript -export interface PrepareRefundRequest { - talerRefundUri: string; -} - -``` -```typescript -export interface PrepareRefundResult { - proposalId: string; - effectivePaid: AmountString; - gone: AmountString; - granted: AmountString; - pending: boolean; - awaiting: AmountString; - info: OrderShortInfo; -} - -``` - -### PrepareTipOp -```typescript -/** - * Query and store information about a tip. - */ -export type PrepareTipOp = { - op: WalletApiOperation.PrepareTip; - request: PrepareTipRequest; - response: PrepareTipResult; -}; -// PrepareTip = "prepareTip" - -``` -```typescript -export interface PrepareTipRequest { - talerTipUri: string; -} - -``` -```typescript -export interface PrepareTipResult { - /** - * Unique ID for the tip assigned by the wallet. - * Typically different from the merchant-generated tip ID. - */ - walletTipId: string; - /** - * Has the tip already been accepted? - */ - accepted: boolean; - /** - * Amount that the merchant gave. - */ - tipAmountRaw: AmountString; - /** - * Amount that arrived at the wallet. - * Might be lower than the raw amount due to fees. - */ - tipAmountEffective: AmountString; - /** - * Base URL of the merchant backend giving then tip. - */ - merchantBaseUrl: string; - /** - * Base URL of the exchange that is used to withdraw the tip. - * Determined by the merchant, the wallet/user has no choice here. - */ - exchangeBaseUrl: string; - /** - * Time when the tip will expire. After it expired, it can't be picked - * up anymore. - */ - expirationTimestamp: TalerProtocolTimestamp; -} - -``` - -### AcceptTipOp -```typescript -/** - * Accept a tip. - */ -export type AcceptTipOp = { - op: WalletApiOperation.AcceptTip; - request: AcceptTipRequest; - response: AcceptTipResponse; -}; -// AcceptTip = "acceptTip" - -``` -```typescript -export interface AcceptTipRequest { - walletTipId: string; -} - -``` -```typescript -export interface AcceptTipResponse { - transactionId: string; - next_url?: string; -} - -``` - -### ListExchangesOp -```typescript -/** - * List exchanges known to the wallet. - */ -export type ListExchangesOp = { - op: WalletApiOperation.ListExchanges; - request: EmptyObject; - response: ExchangesListResponse; -}; -// ListExchanges = "listExchanges" - -``` -```typescript -export interface ExchangesListResponse { - exchanges: ExchangeListItem[]; -} - -``` - -### AddExchangeOp -```typescript -/** - * Add / force-update an exchange. - */ -export type AddExchangeOp = { - op: WalletApiOperation.AddExchange; - request: AddExchangeRequest; - response: EmptyObject; -}; -// AddExchange = "addExchange" - -``` - -### ListKnownBankAccountsOp -```typescript -export type ListKnownBankAccountsOp = { - op: WalletApiOperation.ListKnownBankAccounts; - request: ListKnownBankAccountsRequest; - response: KnownBankAccounts; -}; -// ListKnownBankAccounts = "listKnownBankAccounts" - -``` -```typescript -export interface ListKnownBankAccountsRequest { - currency?: string; -} - -``` -```typescript -export interface KnownBankAccounts { - accounts: KnownBankAccountsInfo[]; -} - -``` -```typescript -export interface KnownBankAccountsInfo { - uri: PaytoUri; - kyc_completed: boolean; - currency: string; - alias: string; -} - -``` -```typescript -export type PaytoUri = - | PaytoUriUnknown - | PaytoUriIBAN - | PaytoUriTalerBank - | PaytoUriBitcoin; - -``` -```typescript -export interface PaytoUriUnknown extends PaytoUriGeneric { - isKnown: false; -} - -``` -```typescript -export interface PaytoUriGeneric { - targetType: string; - targetPath: string; - params: { - [name: string]: string; - }; -} - -``` -```typescript -export interface PaytoUriIBAN extends PaytoUriGeneric { - isKnown: true; - targetType: "iban"; - iban: string; - bic?: string; -} - -``` -```typescript -export interface PaytoUriTalerBank extends PaytoUriGeneric { - isKnown: true; - targetType: "x-taler-bank"; - host: string; - account: string; -} - -``` -```typescript -export interface PaytoUriBitcoin extends PaytoUriGeneric { - isKnown: true; - targetType: "bitcoin"; - segwitAddrs: Array<string>; -} - -``` - -### AddKnownBankAccountsOp -```typescript -export type AddKnownBankAccountsOp = { - op: WalletApiOperation.AddKnownBankAccounts; - request: AddKnownBankAccountsRequest; - response: EmptyObject; -}; -// AddKnownBankAccounts = "addKnownBankAccounts" - -``` -```typescript -export interface AddKnownBankAccountsRequest { - payto: string; - alias: string; - currency: string; -} - -``` - -### ForgetKnownBankAccountsOp -```typescript -export type ForgetKnownBankAccountsOp = { - op: WalletApiOperation.ForgetKnownBankAccounts; - request: ForgetKnownBankAccountsRequest; - response: EmptyObject; -}; -// ForgetKnownBankAccounts = "forgetKnownBankAccounts" - -``` -```typescript -export interface ForgetKnownBankAccountsRequest { - payto: string; -} - -``` - -### SetExchangeTosAcceptedOp -```typescript -/** - * Accept a particular version of the exchange terms of service. - */ -export type SetExchangeTosAcceptedOp = { - op: WalletApiOperation.SetExchangeTosAccepted; - request: AcceptExchangeTosRequest; - response: EmptyObject; -}; -// SetExchangeTosAccepted = "setExchangeTosAccepted" - -``` -```typescript -export interface AcceptExchangeTosRequest { - exchangeBaseUrl: string; - etag: string | undefined; -} - -``` - -### GetExchangeTosOp -```typescript -/** - * Get the current terms of a service of an exchange. - */ -export type GetExchangeTosOp = { - op: WalletApiOperation.GetExchangeTos; - request: GetExchangeTosRequest; - response: GetExchangeTosResult; -}; -// GetExchangeTos = "getExchangeTos" - -``` -```typescript -export interface GetExchangeTosRequest { - exchangeBaseUrl: string; - acceptedFormat?: string[]; -} - -``` -```typescript -export interface GetExchangeTosResult { - /** - * Markdown version of the current ToS. - */ - content: string; - /** - * Version tag of the current ToS. - */ - currentEtag: string; - /** - * Version tag of the last ToS that the user has accepted, - * if any. - */ - acceptedEtag: string | undefined; - /** - * Accepted content type - */ - contentType: string; - tosStatus: ExchangeTosStatus; -} - -``` - -### GetExchangeDetailedInfoOp -```typescript -/** - * Get the current terms of a service of an exchange. - */ -export type GetExchangeDetailedInfoOp = { - op: WalletApiOperation.GetExchangeDetailedInfo; - request: AddExchangeRequest; - response: ExchangeDetailedResponse; -}; -// GetExchangeDetailedInfo = "getExchangeDetailedInfo" - -``` -```typescript -export interface ExchangeDetailedResponse { - exchange: ExchangeFullDetails; -} - -``` -```typescript -export interface ExchangeFullDetails { - exchangeBaseUrl: string; - currency: string; - paytoUris: string[]; - tos: ExchangeTosStatusDetails; - auditors: ExchangeAuditor[]; - wireInfo: WireInfo; - denomFees: DenomOperationMap<FeeDescription[]>; - transferFees: Record<string, FeeDescription[]>; - globalFees: FeeDescription[]; -} - -``` -```typescript -export interface ExchangeTosStatusDetails { - acceptedVersion?: string; - currentVersion?: string; - contentType?: string; - content?: string; -} - -``` -```typescript -export interface WireInfo { - feesForType: WireFeeMap; - accounts: ExchangeAccount[]; -} - -``` -```typescript -/** - * Information about one of the exchange's bank accounts. - */ -export interface ExchangeAccount { - payto_uri: string; - master_sig: string; -} - -``` -```typescript -export interface FeeDescription { - group: string; - from: AbsoluteTime; - until: AbsoluteTime; - fee?: AmountString; -} - -``` - -### ListCurrenciesOp -```typescript -/** - * List currencies known to the wallet. - */ -export type ListCurrenciesOp = { - op: WalletApiOperation.ListCurrencies; - request: EmptyObject; - response: WalletCurrencyInfo; -}; -// ListCurrencies = "listCurrencies" - -``` -```typescript -export interface WalletCurrencyInfo { - trustedAuditors: { - currency: string; - auditorPub: string; - auditorBaseUrl: string; - }[]; - trustedExchanges: { - currency: string; - exchangeMasterPub: string; - exchangeBaseUrl: string; - }[]; -} - -``` - -### GenerateDepositGroupTxIdOp -```typescript -/** - * Generate a fresh transaction ID for a deposit group. - * - * The resulting transaction ID can be specified when creating - * a deposit group, so that the client can already start waiting for notifications - * on that specific deposit group before the GreateDepositGroup request returns. - */ -export type GenerateDepositGroupTxIdOp = { - op: WalletApiOperation.GenerateDepositGroupTxId; - request: EmptyObject; - response: TxIdResponse; -}; -// GenerateDepositGroupTxId = "generateDepositGroupTxId" - -``` -```typescript -export interface TxIdResponse { - transactionId: string; -} - -``` - -### CreateDepositGroupOp -```typescript -/** - * Create a new deposit group. - * - * Deposit groups are used to deposit multiple coins to a bank - * account, usually the wallet user's own bank account. - */ -export type CreateDepositGroupOp = { - op: WalletApiOperation.CreateDepositGroup; - request: CreateDepositGroupRequest; - response: CreateDepositGroupResponse; -}; -// CreateDepositGroup = "createDepositGroup" - -``` -```typescript -export interface CreateDepositGroupRequest { - /** - * Pre-allocated transaction ID. - * Allows clients to easily handle notifications - * that occur while the operation has been created but - * before the creation request has returned. - */ - transactionId?: string; - depositPaytoUri: string; - amount: AmountString; -} - -``` -```typescript -export interface CreateDepositGroupResponse { - depositGroupId: string; - transactionId: string; -} - -``` - -### PrepareDepositOp -```typescript -export type PrepareDepositOp = { - op: WalletApiOperation.PrepareDeposit; - request: PrepareDepositRequest; - response: PrepareDepositResponse; -}; -// PrepareDeposit = "prepareDeposit" - -``` -```typescript -export interface PrepareDepositRequest { - depositPaytoUri: string; - amount: AmountString; -} - -``` -```typescript -export interface PrepareDepositResponse { - totalDepositCost: AmountString; - effectiveDepositAmount: AmountString; - fees: DepositGroupFees; -} - -``` -```typescript -export interface DepositGroupFees { - coin: AmountString; - wire: AmountString; - refresh: AmountString; -} - -``` - -### ExportBackupRecoveryOp -```typescript -/** - * Export the recovery information for the wallet. - */ -export type ExportBackupRecoveryOp = { - op: WalletApiOperation.ExportBackupRecovery; - request: EmptyObject; - response: BackupRecovery; -}; -// ExportBackupRecovery = "exportBackupRecovery" - -``` - -### ImportBackupRecoveryOp -```typescript -/** - * Import recovery information into the wallet. - */ -export type ImportBackupRecoveryOp = { - op: WalletApiOperation.ImportBackupRecovery; - request: RecoveryLoadRequest; - response: EmptyObject; -}; -// ImportBackupRecovery = "importBackupRecovery" - -``` -```typescript -/** - * Load recovery information into the wallet. - */ -export interface RecoveryLoadRequest { - recovery: BackupRecovery; - strategy?: RecoveryMergeStrategy; -} - -``` -```typescript -/** - * Strategy for loading recovery information. - */ -export declare enum RecoveryMergeStrategy { - /** - * Keep the local wallet root key, import and take over providers. - */ - Ours = "ours", - /** - * Migrate to the wallet root key from the recovery information. - */ - Theirs = "theirs", -} - -``` - -### RunBackupCycleOp -```typescript -/** - * Manually make and upload a backup. - */ -export type RunBackupCycleOp = { - op: WalletApiOperation.RunBackupCycle; - request: RunBackupCycleRequest; - response: EmptyObject; -}; -// RunBackupCycle = "runBackupCycle" - -``` -```typescript -export interface RunBackupCycleRequest { - /** - * List of providers to backup or empty for all known providers. - */ - providers?: Array<string>; -} - -``` - -### ExportBackupOp -```typescript -export type ExportBackupOp = { - op: WalletApiOperation.ExportBackup; - request: EmptyObject; - response: EmptyObject; -}; -// ExportBackup = "exportBackup" - -``` - -### AddBackupProviderOp -```typescript -/** - * Add a new backup provider. - */ -export type AddBackupProviderOp = { - op: WalletApiOperation.AddBackupProvider; - request: AddBackupProviderRequest; - response: AddBackupProviderResponse; -}; -// AddBackupProvider = "addBackupProvider" - -``` -```typescript -export interface AddBackupProviderRequest { - backupProviderBaseUrl: string; - name: string; - /** - * Activate the provider. Should only be done after - * the user has reviewed the provider. - */ - activate?: boolean; -} - -``` -```typescript -export type AddBackupProviderResponse = - | AddBackupProviderOk - | AddBackupProviderPaymentRequired; - -``` -```typescript -interface AddBackupProviderOk { - status: "ok"; -} - -``` -```typescript -interface AddBackupProviderPaymentRequired { - status: "payment-required"; - talerUri?: string; -} - -``` - -### RemoveBackupProviderOp -```typescript -export type RemoveBackupProviderOp = { - op: WalletApiOperation.RemoveBackupProvider; - request: RemoveBackupProviderRequest; - response: EmptyObject; -}; -// RemoveBackupProvider = "removeBackupProvider" - -``` -```typescript -export interface RemoveBackupProviderRequest { - provider: string; -} - -``` - -### GetBackupInfoOp -```typescript -/** - * Get some useful stats about the backup state. - */ -export type GetBackupInfoOp = { - op: WalletApiOperation.GetBackupInfo; - request: EmptyObject; - response: BackupInfo; -}; -// GetBackupInfo = "getBackupInfo" - -``` -```typescript -export interface BackupInfo { - walletRootPub: string; - deviceId: string; - providers: ProviderInfo[]; -} - -``` -```typescript -/** - * Information about one provider. - * - * We don't store the account key here, - * as that's derived from the wallet root key. - */ -export interface ProviderInfo { - active: boolean; - syncProviderBaseUrl: string; - name: string; - terms?: BackupProviderTerms; - /** - * Last communication issue with the provider. - */ - lastError?: TalerErrorDetail; - lastSuccessfulBackupTimestamp?: TalerProtocolTimestamp; - lastAttemptedBackupTimestamp?: TalerProtocolTimestamp; - paymentProposalIds: string[]; - backupProblem?: BackupProblem; - paymentStatus: ProviderPaymentStatus; -} - -``` -```typescript -export interface BackupProviderTerms { - supportedProtocolVersion: string; - annualFee: AmountString; - storageLimitInMegabytes: number; -} - -``` -```typescript -export type BackupProblem = - | BackupUnreadableProblem - | BackupConflictingDeviceProblem; - -``` -```typescript -export interface BackupUnreadableProblem { - type: "backup-unreadable"; -} - -``` -```typescript -export interface BackupConflictingDeviceProblem { - type: "backup-conflicting-device"; - otherDeviceId: string; - myDeviceId: string; - backupTimestamp: AbsoluteTime; -} - -``` -```typescript -export type ProviderPaymentStatus = - | ProviderPaymentTermsChanged - | ProviderPaymentPaid - | ProviderPaymentInsufficientBalance - | ProviderPaymentUnpaid - | ProviderPaymentPending; - -``` -```typescript -export interface ProviderPaymentTermsChanged { - type: ProviderPaymentType.TermsChanged; - paidUntil: AbsoluteTime; - oldTerms: BackupProviderTerms; - newTerms: BackupProviderTerms; -} - -``` -```typescript -export interface ProviderPaymentPaid { - type: ProviderPaymentType.Paid; - paidUntil: AbsoluteTime; -} - -``` -```typescript -export interface ProviderPaymentInsufficientBalance { - type: ProviderPaymentType.InsufficientBalance; - amount: AmountString; -} - -``` -```typescript -export interface ProviderPaymentUnpaid { - type: ProviderPaymentType.Unpaid; -} - -``` -```typescript -export interface ProviderPaymentPending { - type: ProviderPaymentType.Pending; - talerUri?: string; -} - -``` - -### SetWalletDeviceIdOp -```typescript -/** - * Set the internal device ID of the wallet, used to - * identify whether a different/new wallet is accessing - * the backup of another wallet. - */ -export type SetWalletDeviceIdOp = { - op: WalletApiOperation.SetWalletDeviceId; - request: SetWalletDeviceIdRequest; - response: EmptyObject; -}; -// SetWalletDeviceId = "setWalletDeviceId" - -``` -```typescript -export interface SetWalletDeviceIdRequest { - /** - * New wallet device ID to set. - */ - walletDeviceId: string; -} - -``` - -### ExportBackupPlainOp -```typescript -/** - * Export a backup JSON, mostly useful for testing. - */ -export type ExportBackupPlainOp = { - op: WalletApiOperation.ExportBackupPlain; - request: EmptyObject; - response: WalletBackupContentV1; -}; -// ExportBackupPlain = "exportBackupPlain" - -``` - -### CheckPeerPushDebitOp -```typescript -/** - * Check if initiating a peer push payment is possible - * based on the funds in the wallet. - */ -export type CheckPeerPushDebitOp = { - op: WalletApiOperation.CheckPeerPushDebit; - request: CheckPeerPushDebitRequest; - response: CheckPeerPushDebitResponse; -}; -// CheckPeerPushDebit = "checkPeerPushDebit" - -``` -```typescript -export interface CheckPeerPushDebitRequest { - /** - * Preferred exchange to use for the p2p payment. - */ - exchangeBaseUrl?: string; - /** - * Instructed amount. - * - * FIXME: Allow specifying the instructed amount type. - */ - amount: AmountString; -} - -``` -```typescript -export interface CheckPeerPushDebitResponse { - amountRaw: AmountString; - amountEffective: AmountString; -} - -``` - -### InitiatePeerPushDebitOp -```typescript -/** - * Initiate an outgoing peer push payment. - */ -export type InitiatePeerPushDebitOp = { - op: WalletApiOperation.InitiatePeerPushDebit; - request: InitiatePeerPushPaymentRequest; - response: InitiatePeerPushPaymentResponse; -}; -// InitiatePeerPushDebit = "initiatePeerPushDebit" - -``` -```typescript -export interface InitiatePeerPushPaymentRequest { - exchangeBaseUrl?: string; - partialContractTerms: PeerContractTerms; -} - -``` -```typescript -export interface InitiatePeerPushPaymentResponse { - exchangeBaseUrl: string; - pursePub: string; - mergePriv: string; - contractPriv: string; - talerUri: string; - transactionId: string; -} - -``` - -### PreparePeerPushCreditOp -```typescript -/** - * Check an incoming peer push payment. - */ -export type PreparePeerPushCreditOp = { - op: WalletApiOperation.PreparePeerPushCredit; - request: PreparePeerPushCredit; - response: PreparePeerPushCreditResponse; -}; -// PreparePeerPushCredit = "preparePeerPushCredit" - -``` -```typescript -export interface PreparePeerPushCreditResponse { - contractTerms: PeerContractTerms; - /** - * @deprecated - */ - amount: AmountString; - amountRaw: AmountString; - amountEffective: AmountString; - peerPushPaymentIncomingId: string; -} - -``` - -### ConfirmPeerPushCreditOp -```typescript -/** - * Accept an incoming peer push payment. - */ -export type ConfirmPeerPushCreditOp = { - op: WalletApiOperation.ConfirmPeerPushCredit; - request: ConfirmPeerPushCreditRequest; - response: EmptyObject; -}; -// ConfirmPeerPushCredit = "confirmPeerPushCredit" - -``` -```typescript -export interface ConfirmPeerPushCreditRequest { - /** - * Transparent identifier of the incoming peer push payment. - */ - peerPushPaymentIncomingId: string; -} - -``` - -### CheckPeerPullCreditOp -```typescript -/** - * Check fees for an outgoing peer pull payment. - */ -export type CheckPeerPullCreditOp = { - op: WalletApiOperation.CheckPeerPullCredit; - request: CheckPeerPullCreditRequest; - response: CheckPeerPullCreditResponse; -}; -// CheckPeerPullCredit = "checkPeerPullCredit" - -``` -```typescript -export interface CheckPeerPullCreditRequest { - exchangeBaseUrl?: string; - amount: AmountString; -} - -``` -```typescript -export interface CheckPeerPullCreditResponse { - exchangeBaseUrl: string; - amountRaw: AmountString; - amountEffective: AmountString; -} - -``` - -### InitiatePeerPullCreditOp -```typescript -/** - * Initiate an outgoing peer pull payment. - */ -export type InitiatePeerPullCreditOp = { - op: WalletApiOperation.InitiatePeerPullCredit; - request: InitiatePeerPullCreditRequest; - response: InitiatePeerPullCreditResponse; -}; -// InitiatePeerPullCredit = "initiatePeerPullCredit" - -``` -```typescript -export interface InitiatePeerPullCreditRequest { - exchangeBaseUrl?: string; - partialContractTerms: PeerContractTerms; -} - -``` -```typescript -export interface InitiatePeerPullCreditResponse { - /** - * Taler URI for the other party to make the payment - * that was requested. - */ - talerUri: string; - transactionId: string; -} - -``` - -### PreparePeerPullDebitOp -```typescript -/** - * Prepare for an incoming peer pull payment. - */ -export type PreparePeerPullDebitOp = { - op: WalletApiOperation.PreparePeerPullDebit; - request: PreparePeerPullDebitRequest; - response: PreparePeerPullDebitResponse; -}; -// PreparePeerPullDebit = "preparePeerPullDebit" - -``` -```typescript -export interface PreparePeerPullDebitRequest { - talerUri: string; -} - -``` -```typescript -export interface PreparePeerPullDebitResponse { - contractTerms: PeerContractTerms; - /** - * @deprecated Redundant field with bad name, will be removed soon. - */ - amount: AmountString; - amountRaw: AmountString; - amountEffective: AmountString; - peerPullPaymentIncomingId: string; -} - -``` - -### ConfirmPeerPullDebitOp -```typescript -/** - * Accept an incoming peer pull payment (i.e. pay the other party). - */ -export type ConfirmPeerPullDebitOp = { - op: WalletApiOperation.ConfirmPeerPullDebit; - request: ConfirmPeerPullDebitRequest; - response: EmptyObject; -}; -// ConfirmPeerPullDebit = "confirmPeerPullDebit" - -``` -```typescript -export interface ConfirmPeerPullDebitRequest { - /** - * Transparent identifier of the incoming peer pull payment. - */ - peerPullPaymentIncomingId: string; -} - -``` - -### ValidateIbanOp -```typescript -export type ValidateIbanOp = { - op: WalletApiOperation.ValidateIban; - request: ValidateIbanRequest; - response: ValidateIbanResponse; -}; -// ValidateIban = "validateIban" - -``` -```typescript -export interface ValidateIbanRequest { - iban: string; -} - -``` -```typescript -export interface ValidateIbanResponse { - valid: boolean; -} - -``` - -### ExportDbOp -```typescript -/** - * Export the wallet database's contents to JSON. - */ -export type ExportDbOp = { - op: WalletApiOperation.ExportDb; - request: EmptyObject; - response: any; -}; -// ExportDb = "exportDb" - -``` - -### ImportDbOp -```typescript -export type ImportDbOp = { - op: WalletApiOperation.ImportDb; - request: any; - response: any; -}; -// ImportDb = "importDb" - -``` - -### ClearDbOp -```typescript -/** - * Dangerously clear the whole wallet database. - */ -export type ClearDbOp = { - op: WalletApiOperation.ClearDb; - request: EmptyObject; - response: EmptyObject; -}; -// ClearDb = "clearDb" - -``` - -### RecycleOp -```typescript -/** - * Export a backup, clear the database and re-import it. - */ -export type RecycleOp = { - op: WalletApiOperation.Recycle; - request: EmptyObject; - response: EmptyObject; -}; -// Recycle = "recycle" - -``` - -### ApplyDevExperimentOp -```typescript -/** - * Apply a developer experiment to the current wallet state. - * - * This allows UI developers / testers to play around without - * an elaborate test environment. - */ -export type ApplyDevExperimentOp = { - op: WalletApiOperation.ApplyDevExperiment; - request: ApplyDevExperimentRequest; - response: EmptyObject; -}; -// ApplyDevExperiment = "applyDevExperiment" - -``` -```typescript -export interface ApplyDevExperimentRequest { - devExperimentUri: string; -} - -``` - -### RunIntegrationTestOp -```typescript -/** - * Run a simple integration test on a test deployment - * of the exchange and merchant. - */ -export type RunIntegrationTestOp = { - op: WalletApiOperation.RunIntegrationTest; - request: IntegrationTestArgs; - response: EmptyObject; -}; -// RunIntegrationTest = "runIntegrationTest" - -``` - -### RunIntegrationTestV2Op -```typescript -/** - * Run a simple integration test on a test deployment - * of the exchange and merchant. - */ -export type RunIntegrationTestV2Op = { - op: WalletApiOperation.RunIntegrationTestV2; - request: IntegrationTestArgs; - response: EmptyObject; -}; -// RunIntegrationTestV2 = "runIntegrationTestV2" - -``` - -### TestCryptoOp -```typescript -/** - * Test crypto worker. - */ -export type TestCryptoOp = { - op: WalletApiOperation.TestCrypto; - request: EmptyObject; - response: any; -}; -// TestCrypto = "testCrypto" - -``` - -### WithdrawTestBalanceOp -```typescript -/** - * Make withdrawal on a test deployment of the exchange - * and merchant. - */ -export type WithdrawTestBalanceOp = { - op: WalletApiOperation.WithdrawTestBalance; - request: WithdrawTestBalanceRequest; - response: EmptyObject; -}; -// WithdrawTestBalance = "withdrawTestBalance" - -``` -```typescript -export interface WithdrawTestBalanceRequest { - amount: string; - /** - * Bank access API base URL. - */ - bankAccessApiBaseUrl: string; - exchangeBaseUrl: string; - forcedDenomSel?: ForcedDenomSel; -} - -``` - -### WithdrawTestkudosOp -```typescript -/** - * Make a withdrawal of testkudos on test.taler.net. - */ -export type WithdrawTestkudosOp = { - op: WalletApiOperation.WithdrawTestkudos; - request: EmptyObject; - response: EmptyObject; -}; -// WithdrawTestkudos = "withdrawTestkudos" - -``` - -### TestPayOp -```typescript -/** - * Make a test payment using a test deployment of - * the exchange and merchant. - */ -export type TestPayOp = { - op: WalletApiOperation.TestPay; - request: TestPayArgs; - response: TestPayResult; -}; -// TestPay = "testPay" - -``` -```typescript -export interface TestPayArgs { - merchantBaseUrl: string; - merchantAuthToken?: string; - amount: string; - summary: string; - forcedCoinSel?: ForcedCoinSel; -} - -``` -```typescript -export interface TestPayResult { - payCoinSelection: PayCoinSelection; -} - -``` -```typescript -/** - * Result of selecting coins, contains the exchange, and selected - * coins with their denomination. - */ -export interface PayCoinSelection { - /** - * Amount requested by the merchant. - */ - paymentAmount: AmountString; - /** - * Public keys of the coins that were selected. - */ - coinPubs: string[]; - /** - * Amount that each coin contributes. - */ - coinContributions: AmountString[]; - /** - * How much of the wire fees is the customer paying? - */ - customerWireFees: AmountString; - /** - * How much of the deposit fees is the customer paying? - */ - customerDepositFees: AmountString; -} - -``` - -### WithdrawFakebankOp -```typescript -/** - * Make a withdrawal from a fakebank, i.e. - * a bank where test users can be registered freely - * and testing APIs are available. - */ -export type WithdrawFakebankOp = { - op: WalletApiOperation.WithdrawFakebank; - request: WithdrawFakebankRequest; - response: EmptyObject; -}; -// WithdrawFakebank = "withdrawFakebank" - -``` -```typescript -export interface WithdrawFakebankRequest { - amount: AmountString; - exchange: string; - bank: string; -} - -``` - -### GetPendingTasksOp -```typescript -/** - * Get wallet-internal pending tasks. - */ -export type GetPendingTasksOp = { - op: WalletApiOperation.GetPendingOperations; - request: EmptyObject; - response: PendingTasksResponse; -}; -// GetPendingOperations = "getPendingOperations" - -``` -```typescript -/** - * Response returned from the pending operations API. - */ -export interface PendingOperationsResponse { - /** - * List of pending operations. - */ - pendingOperations: PendingTaskInfo[]; -} - -``` -```typescript -/** - * Information about a pending operation. - */ -export type PendingTaskInfo = PendingTaskInfoCommon & - ( - | PendingExchangeUpdateTask - | PendingExchangeCheckRefreshTask - | PendingPurchaseTask - | PendingRefreshTask - | PendingTipPickupTask - | PendingWithdrawTask - | PendingRecoupTask - | PendingDepositTask - | PendingBackupTask - | PendingPeerPushInitiationTask - | PendingPeerPullInitiationTask - | PendingPeerPullDebitTask - | PendingPeerPushCreditTask - ); - -``` -```typescript -/** - * Fields that are present in every pending operation. - */ -export interface PendingTaskInfoCommon { - /** - * Type of the pending operation. - */ - type: PendingTaskType; - /** - * Unique identifier for the pending task. - */ - id: string; - /** - * Set to true if the operation indicates that something is really in progress, - * as opposed to some regular scheduled operation that can be tried later. - */ - givesLifeness: boolean; - /** - * Operation is active and waiting for a longpoll result. - */ - isLongpolling: boolean; - /** - * Operation is waiting to be executed. - */ - isDue: boolean; - /** - * Timestamp when the pending operation should be executed next. - */ - timestampDue: AbsoluteTime; - /** - * Retry info. Currently used to stop the wallet after any operation - * exceeds a number of retries. - */ - retryInfo?: RetryInfo; -} - -``` -```typescript -export enum PendingTaskType { - ExchangeUpdate = "exchange-update", - ExchangeCheckRefresh = "exchange-check-refresh", - Purchase = "purchase", - Refresh = "refresh", - Recoup = "recoup", - TipPickup = "tip-pickup", - Withdraw = "withdraw", - Deposit = "deposit", - Backup = "backup", - // FIXME: Rename to peer-push-debit and peer-pull-debit - PeerPushInitiation = "peer-push-initiation", - PeerPullInitiation = "peer-pull-initiation", - PeerPushCredit = "peer-push-credit", - PeerPullDebit = "peer-pull-debit", -} - -``` -```typescript -export interface RetryInfo { - firstTry: AbsoluteTime; - nextRetry: AbsoluteTime; - retryCounter: number; -} - -``` -```typescript -export interface RetryPolicy { - readonly backoffDelta: Duration; - readonly backoffBase: number; - readonly maxTimeout: Duration; -} - -``` -```typescript -// Declare "static" methods in Error -interface ErrorConstructor { - /** Create .stack property on a target object */ - captureStackTrace(targetObject: object, constructorOpt?: Function): void; - /** - * Optional override for formatting stack traces - * - * @see https://v8.dev/docs/stack-trace-api#customizing-stack-traces - */ - prepareStackTrace?: - | ((err: Error, stackTraces: NodeJS.CallSite[]) => any) - | undefined; - stackTraceLimit: number; -} - -``` -```typescript -interface CallSite { - /** - * Value of "this" - */ - getThis(): unknown; - /** - * Type of "this" as a string. - * This is the name of the function stored in the constructor field of - * "this", if available. Otherwise the object's [[Class]] internal - * property. - */ - getTypeName(): string | null; - /** - * Current function - */ - getFunction(): Function | undefined; - /** - * Name of the current function, typically its name property. - * If a name property is not available an attempt will be made to try - * to infer a name from the function's context. - */ - getFunctionName(): string | null; - /** - * Name of the property [of "this" or one of its prototypes] that holds - * the current function - */ - getMethodName(): string | null; - /** - * Name of the script [if this function was defined in a script] - */ - getFileName(): string | null; - /** - * Current line number [if this function was defined in a script] - */ - getLineNumber(): number | null; - /** - * Current column number [if this function was defined in a script] - */ - getColumnNumber(): number | null; - /** - * A call site object representing the location where eval was called - * [if this function was created using a call to eval] - */ - getEvalOrigin(): string | undefined; - /** - * Is this a toplevel invocation, that is, is "this" the global object? - */ - isToplevel(): boolean; - /** - * Does this call take place in code defined by a call to eval? - */ - isEval(): boolean; - /** - * Is this call in native V8 code? - */ - isNative(): boolean; - /** - * Is this a constructor call? - */ - isConstructor(): boolean; -} - -``` -```typescript -/** - * The wallet is currently updating information about an exchange. - */ -export interface PendingExchangeUpdateTask { - type: PendingTaskType.ExchangeUpdate; - exchangeBaseUrl: string; - lastError: TalerErrorDetail | undefined; -} - -``` -```typescript -/** - * The wallet should check whether coins from this exchange - * need to be auto-refreshed. - */ -export interface PendingExchangeCheckRefreshTask { - type: PendingTaskType.ExchangeCheckRefresh; - exchangeBaseUrl: string; -} - -``` -```typescript -/** - * A purchase needs to be processed (i.e. for download / payment / refund). - */ -export interface PendingPurchaseTask { - type: PendingTaskType.Purchase; - proposalId: string; - retryInfo?: RetryInfo; - /** - * Status of the payment as string, used only for debugging. - */ - statusStr: string; - lastError: TalerErrorDetail | undefined; -} - -``` -```typescript -/** - * Status of an ongoing withdrawal operation. - */ -export interface PendingRefreshTask { - type: PendingTaskType.Refresh; - lastError?: TalerErrorDetail; - refreshGroupId: string; - finishedPerCoin: boolean[]; - retryInfo?: RetryInfo; -} - -``` -```typescript -/** - * The wallet is picking up a tip that the user has accepted. - */ -export interface PendingTipPickupTask { - type: PendingTaskType.TipPickup; - tipId: string; - merchantBaseUrl: string; - merchantTipId: string; -} - -``` -```typescript -/** - * Status of an ongoing withdrawal operation. - */ -export interface PendingWithdrawTask { - type: PendingTaskType.Withdraw; - lastError: TalerErrorDetail | undefined; - retryInfo?: RetryInfo; - withdrawalGroupId: string; -} - -``` -```typescript -export interface PendingRecoupTask { - type: PendingTaskType.Recoup; - recoupGroupId: string; - retryInfo?: RetryInfo; - lastError: TalerErrorDetail | undefined; -} - -``` -```typescript -/** - * Status of an ongoing deposit operation. - */ -export interface PendingDepositTask { - type: PendingTaskType.Deposit; - lastError: TalerErrorDetail | undefined; - retryInfo: RetryInfo | undefined; - depositGroupId: string; -} - -``` -```typescript -export interface PendingBackupTask { - type: PendingTaskType.Backup; - backupProviderBaseUrl: string; - lastError: TalerErrorDetail | undefined; -} - -``` -```typescript -/** - * The wallet wants to send a peer push payment. - */ -export interface PendingPeerPushInitiationTask { - type: PendingTaskType.PeerPushInitiation; - pursePub: string; -} - -``` -```typescript -/** - * The wallet wants to send a peer pull payment. - */ -export interface PendingPeerPullInitiationTask { - type: PendingTaskType.PeerPullInitiation; - pursePub: string; -} - -``` -```typescript -/** - * The wallet wants to send a peer pull payment. - */ -export interface PendingPeerPullDebitTask { - type: PendingTaskType.PeerPullDebit; - peerPullPaymentIncomingId: string; -} - -``` -```typescript -/** - */ -export interface PendingPeerPushCreditTask { - type: PendingTaskType.PeerPushCredit; - peerPushPaymentIncomingId: string; -} - -``` - -### DumpCoinsOp -```typescript -/** - * Dump all coins of the wallet in a simple JSON format. - */ -export type DumpCoinsOp = { - op: WalletApiOperation.DumpCoins; - request: EmptyObject; - response: CoinDumpJson; -}; -// DumpCoins = "dumpCoins" - -``` -```typescript -/** - * Easy to process format for the public data of coins - * managed by the wallet. - */ -export interface CoinDumpJson { - coins: Array<{ - /** - * The coin's denomination's public key. - */ - denom_pub: DenominationPubKey; - /** - * Hash of denom_pub. - */ - denom_pub_hash: string; - /** - * Value of the denomination (without any fees). - */ - denom_value: string; - /** - * Public key of the coin. - */ - coin_pub: string; - /** - * Base URL of the exchange for the coin. - */ - exchange_base_url: string; - /** - * Public key of the parent coin. - * Only present if this coin was obtained via refreshing. - */ - refresh_parent_coin_pub: string | undefined; - /** - * Public key of the reserve for this coin. - * Only present if this coin was obtained via refreshing. - */ - withdrawal_reserve_pub: string | undefined; - coin_status: CoinStatus; - spend_allocation: - | { - id: string; - amount: string; - } - | undefined; - /** - * Information about the age restriction - */ - ageCommitmentProof: AgeCommitmentProof | undefined; - }>; -} - -``` -```typescript -export type DenominationPubKey = RsaDenominationPubKey | CsDenominationPubKey; - -``` -```typescript -export interface RsaDenominationPubKey { - readonly cipher: DenomKeyType.Rsa; - readonly rsa_public_key: string; - readonly age_mask: number; -} - -``` -```typescript -export interface CsDenominationPubKey { - readonly cipher: DenomKeyType.ClauseSchnorr; - readonly age_mask: number; - readonly cs_public_key: string; -} - -``` -```typescript -/** - * Status of a coin. - */ -export declare enum CoinStatus { - /** - * Withdrawn and never shown to anybody. - */ - Fresh = "fresh", - /** - * Fresh, but currently marked as "suspended", thus won't be used - * for spending. Used for testing. - */ - FreshSuspended = "fresh-suspended", - /** - * A coin that has been spent and refreshed. - */ - Dormant = "dormant", -} - -``` -```typescript -export interface AgeCommitmentProof { - commitment: AgeCommitment; - proof: AgeProof; -} - -``` -```typescript -export interface AgeCommitment { - mask: number; - /** - * Public keys, one for each age group specified in the age mask. - */ - publicKeys: Edx25519PublicKeyEnc[]; -} - -``` -```typescript -export type Edx25519PublicKeyEnc = FlavorP<string, "Edx25519PublicKeyEnc", 32>; - -``` -```typescript -export type FlavorP<T, FlavorT extends string, S extends number> = T & { - _flavor?: `taler.${FlavorT}`; - _size?: S; -}; - -``` -```typescript -export interface AgeProof { - /** - * Private keys. Typically smaller than the number of public keys, - * because we drop private keys from age groups that are restricted. - */ - privateKeys: Edx25519PrivateKeyEnc[]; -} - -``` -```typescript -export type Edx25519PrivateKeyEnc = FlavorP< - string, - "Edx25519PrivateKeyEnc", - 64 ->; - -``` - -### SetCoinSuspendedOp -```typescript -/** - * Set a coin as (un-)suspended. - * Suspended coins won't be used for payments. - */ -export type SetCoinSuspendedOp = { - op: WalletApiOperation.SetCoinSuspended; - request: SetCoinSuspendedRequest; - response: EmptyObject; -}; -// SetCoinSuspended = "setCoinSuspended" - -``` -```typescript -export interface SetCoinSuspendedRequest { - coinPub: string; - suspended: boolean; -} - -``` - -### ForceRefreshOp -```typescript -/** - * Force a refresh on coins where it would not - * be necessary. - */ -export type ForceRefreshOp = { - op: WalletApiOperation.ForceRefresh; - request: ForceRefreshRequest; - response: EmptyObject; -}; -// ForceRefresh = "forceRefresh" - -``` -```typescript -export interface ForceRefreshRequest { - coinPubList: string[]; -} - -``` - -## Common Declarations -```typescript -export interface WalletCoreVersion { - hash: string | undefined; - version: string; - exchange: string; - merchant: string; - bank: string; - /** - * @deprecated will be removed - */ - devMode: boolean; -} -``` -```typescript -export type Transaction = - | TransactionWithdrawal - | TransactionPayment - | TransactionRefund - | TransactionTip - | TransactionRefresh - | TransactionDeposit - | TransactionPeerPullCredit - | TransactionPeerPullDebit - | TransactionPeerPushCredit - | TransactionPeerPushDebit; -``` -```typescript -export interface TransactionWithdrawal extends TransactionCommon { - type: TransactionType.Withdrawal; - /** - * Exchange of the withdrawal. - */ - exchangeBaseUrl: string; - /** - * Amount that got subtracted from the reserve balance. - */ - amountRaw: AmountString; - /** - * Amount that actually was (or will be) added to the wallet's balance. - */ - amountEffective: AmountString; - withdrawalDetails: WithdrawalDetails; -} -``` -```typescript -export interface TransactionCommon { - transactionId: TransactionIdStr; - type: TransactionType; - timestamp: TalerProtocolTimestamp; - /** - * Transaction state, as per DD37. - */ - txState: TransactionState; - /** - * @deprecated in favor of statusMajor and statusMinor - */ - extendedStatus: ExtendedStatus; - /** - * true if the transaction is still pending, false otherwise - * If a transaction is not longer pending, its timestamp will be updated, - * but its transactionId will remain unchanged - * - * @deprecated show extendedStatus - */ - pending: boolean; - /** - * True if the transaction encountered a problem that might be - * permanent. A frozen transaction won't be automatically retried. - * - * @deprecated show extendedStatus - */ - frozen: boolean; - /** - * Raw amount of the transaction (exclusive of fees or other extra costs). - */ - amountRaw: AmountString; - /** - * Amount added or removed from the wallet's balance (including all fees and other costs). - */ - amountEffective: AmountString; - error?: TalerErrorDetail; -} -``` -```typescript -export declare enum TransactionType { - Withdrawal = "withdrawal", - Payment = "payment", - Refund = "refund", - Refresh = "refresh", - Tip = "tip", - Deposit = "deposit", - PeerPushDebit = "peer-push-debit", - PeerPushCredit = "peer-push-credit", - PeerPullDebit = "peer-pull-debit", - PeerPullCredit = "peer-pull-credit", -} -``` -```typescript -export interface TalerProtocolTimestamp { - readonly t_s: number | "never"; -} -``` -```typescript -export interface TransactionState { - major: TransactionMajorState; - minor?: TransactionMinorState; -} -``` -```typescript -export declare enum TransactionMajorState { - None = "none", - Pending = "pending", - Done = "done", - Aborting = "aborting", - Aborted = "aborted", - Suspended = "suspended", - Failed = "failed", - Deleted = "deleted", - Unknown = "unknown", -} -``` -```typescript -export declare enum TransactionMinorState { - Unknown = "unknown", - Deposit = "deposit", - KycRequired = "kyc-required", - Track = "track", - Refresh = "refresh", -} -``` -```typescript -export declare enum ExtendedStatus { - Pending = "pending", - Done = "done", - Aborting = "aborting", - Aborted = "aborted", - Failed = "failed", - KycRequired = "kyc-required", -} -``` -```typescript -export interface TalerErrorDetail { - code: TalerErrorCode; - when?: AbsoluteTime; - hint?: string; - [x: string]: unknown; -} -``` -```typescript -export interface AbsoluteTime { - /** - * Timestamp in milliseconds. - */ - readonly t_ms: number | "never"; -} -``` -```typescript -export interface Duration { - /** - * Duration in milliseconds. - */ - readonly d_ms: number | "forever"; -} -``` -```typescript -export interface TalerProtocolDuration { - readonly d_us: number | "forever"; -} -``` -```typescript -export type WithdrawalDetails = - | WithdrawalDetailsForManualTransfer - | WithdrawalDetailsForTalerBankIntegrationApi; -``` -```typescript -interface WithdrawalDetailsForManualTransfer { - type: WithdrawalType.ManualTransfer; - /** - * Payto URIs that the exchange supports. - * - * Already contains the amount and message. - */ - exchangePaytoUris: string[]; - reservePub: string; - /** - * Is the reserve ready for withdrawal? - */ - reserveIsReady: boolean; -} -``` -```typescript -interface WithdrawalDetailsForTalerBankIntegrationApi { - type: WithdrawalType.TalerBankIntegrationApi; - /** - * Set to true if the bank has confirmed the withdrawal, false if not. - * An unconfirmed withdrawal usually requires user-input and should be highlighted in the UI. - * See also bankConfirmationUrl below. - */ - confirmed: boolean; - /** - * If the withdrawal is unconfirmed, this can include a URL for user - * initiated confirmation. - */ - bankConfirmationUrl?: string; - reservePub: string; - /** - * Is the reserve ready for withdrawal? - */ - reserveIsReady: boolean; -} -``` -```typescript -export interface TransactionPayment extends TransactionCommon { - type: TransactionType.Payment; - /** - * Additional information about the payment. - */ - info: OrderShortInfo; - /** - * Wallet-internal end-to-end identifier for the payment. - */ - proposalId: string; - /** - * How far did the wallet get with processing the payment? - * - * @deprecated use extendedStatus - */ - status: PaymentStatus; - /** - * Amount that must be paid for the contract - */ - amountRaw: AmountString; - /** - * Amount that was paid, including deposit, wire and refresh fees. - */ - amountEffective: AmountString; - /** - * Amount that has been refunded by the merchant - */ - totalRefundRaw: AmountString; - /** - * Amount will be added to the wallet's balance after fees and refreshing - */ - totalRefundEffective: AmountString; - /** - * Amount pending to be picked up - */ - refundPending: AmountString | undefined; - /** - * Reference to applied refunds - */ - refunds: RefundInfoShort[]; - /** - * Is the wallet currently checking for a refund? - */ - refundQueryActive: boolean; - /** - * Does this purchase has an pos validation - */ - posConfirmation: string | undefined; -} -``` -```typescript -export interface OrderShortInfo { - /** - * Order ID, uniquely identifies the order within a merchant instance - */ - orderId: string; - /** - * Hash of the contract terms. - */ - contractTermsHash: string; - /** - * More information about the merchant - */ - merchant: MerchantInfo; - /** - * Summary of the order, given by the merchant - */ - summary: string; - /** - * Map from IETF BCP 47 language tags to localized summaries - */ - summary_i18n?: InternationalizedString; - /** - * List of products that are part of the order - */ - products: Product[] | undefined; - /** - * Time indicating when the order should be delivered. - * May be overwritten by individual products. - */ - delivery_date?: TalerProtocolTimestamp; - /** - * Delivery location for (all!) products. - */ - delivery_location?: Location; - /** - * URL of the fulfillment, given by the merchant - */ - fulfillmentUrl?: string; - /** - * Plain text message that should be shown to the user - * when the payment is complete. - */ - fulfillmentMessage?: string; - /** - * Translations of fulfillmentMessage. - */ - fulfillmentMessage_i18n?: InternationalizedString; -} -``` -```typescript -export interface MerchantInfo { - name: string; - jurisdiction?: Location; - address?: Location; - logo?: string; - website?: string; - email?: string; -} -``` -```typescript -export interface Location { - country?: string; - country_subdivision?: string; - district?: string; - town?: string; - town_location?: string; - post_code?: string; - street?: string; - building_name?: string; - building_number?: string; - address_lines?: string[]; -} -``` -```typescript -export interface InternationalizedString { - [lang_tag: string]: string; -} -``` -```typescript -export interface Product { - product_id?: string; - description: string; - description_i18n?: { - [lang_tag: string]: string; - }; - quantity?: number; - unit?: string; - price?: AmountString; - image?: string; - taxes?: Tax[]; - delivery_date?: TalerProtocolTimestamp; -} -``` -```typescript -export interface Tax { - name: string; - tax: AmountString; -} -``` -```typescript -export declare enum PaymentStatus { - /** - * Explicitly aborted after timeout / failure - */ - Aborted = "aborted", - /** - * Payment failed, wallet will auto-retry. - * User should be given the option to retry now / abort. - */ - Failed = "failed", - /** - * Paid successfully - */ - Paid = "paid", - /** - * User accepted, payment is processing. - */ - Accepted = "accepted", -} -``` -```typescript -export interface RefundInfoShort { - transactionId: string; - timestamp: TalerProtocolTimestamp; - amountEffective: AmountString; - amountRaw: AmountString; -} -``` -```typescript -export interface TransactionRefund extends TransactionCommon { - type: TransactionType.Refund; - refundedTransactionId: string; - info: OrderShortInfo; - /** - * Amount pending to be picked up - */ - refundPending: AmountString | undefined; - amountRaw: AmountString; - amountEffective: AmountString; -} -``` -```typescript -export interface TransactionTip extends TransactionCommon { - type: TransactionType.Tip; - amountRaw: AmountString; - /** - * More information about the merchant - */ - amountEffective: AmountString; - merchantBaseUrl: string; -} -``` -```typescript -/** - * A transaction shown for refreshes. - * Only shown for (1) refreshes not associated with other transactions - * and (2) refreshes in an error state. - */ -export interface TransactionRefresh extends TransactionCommon { - type: TransactionType.Refresh; - refreshReason: RefreshReason; - /** - * Transaction ID that caused this refresh. - */ - originatingTransactionId?: string; - /** - * Always zero for refreshes - */ - amountRaw: AmountString; - /** - * Fees, i.e. the effective, negative effect of the refresh - * on the balance. - * - * Only applicable for stand-alone refreshes, and zero for - * other refreshes where the transaction itself accounts for the - * refresh fee. - */ - amountEffective: AmountString; - refreshInputAmount: AmountString; - refreshOutputAmount: AmountString; -} -``` -```typescript -/** - * Reasons for why a coin is being refreshed. - */ -export declare enum RefreshReason { - Manual = "manual", - PayMerchant = "pay-merchant", - PayDeposit = "pay-deposit", - PayPeerPush = "pay-peer-push", - PayPeerPull = "pay-peer-pull", - Refund = "refund", - AbortPay = "abort-pay", - AbortDeposit = "abort-deposit", - Recoup = "recoup", - BackupRestored = "backup-restored", - Scheduled = "scheduled", -} -``` -```typescript -/** - * Deposit transaction, which effectively sends - * money from this wallet somewhere else. - */ -export interface TransactionDeposit extends TransactionCommon { - type: TransactionType.Deposit; - depositGroupId: string; - /** - * Target for the deposit. - */ - targetPaytoUri: string; - /** - * Raw amount that is being deposited - */ - amountRaw: AmountString; - /** - * Effective amount that is being deposited - */ - amountEffective: AmountString; - wireTransferDeadline: TalerProtocolTimestamp; - wireTransferProgress: number; - /** - * Did all the deposit requests succeed? - */ - deposited: boolean; - trackingState: Array<{ - wireTransferId: string; - timestampExecuted: TalerProtocolTimestamp; - amountRaw: AmountString; - wireFee: AmountString; - }>; -} -``` -```typescript -/** - * Credit because we were paid for a P2P invoice we created. - */ -export interface TransactionPeerPullCredit extends TransactionCommon { - type: TransactionType.PeerPullCredit; - info: PeerInfoShort; - /** - * Exchange used. - */ - exchangeBaseUrl: string; - /** - * Amount that got subtracted from the reserve balance. - */ - amountRaw: AmountString; - /** - * Amount that actually was (or will be) added to the wallet's balance. - */ - amountEffective: AmountString; - /** - * URI to send to the other party. - */ - talerUri: string; -} -``` -```typescript -export interface PeerInfoShort { - expiration: TalerProtocolTimestamp | undefined; - summary: string | undefined; -} -``` -```typescript -/** - * Debit because we paid someone's invoice. - */ -export interface TransactionPeerPullDebit extends TransactionCommon { - type: TransactionType.PeerPullDebit; - info: PeerInfoShort; - /** - * Exchange used. - */ - exchangeBaseUrl: string; - amountRaw: AmountString; - amountEffective: AmountString; -} -``` -```typescript -/** - * We received money via a P2P payment. - */ -export interface TransactionPeerPushCredit extends TransactionCommon { - type: TransactionType.PeerPushCredit; - info: PeerInfoShort; - /** - * Exchange used. - */ - exchangeBaseUrl: string; - /** - * Amount that got subtracted from the reserve balance. - */ - amountRaw: AmountString; - /** - * Amount that actually was (or will be) added to the wallet's balance. - */ - amountEffective: AmountString; -} -``` -```typescript -/** - * We sent money via a P2P payment. - */ -export interface TransactionPeerPushDebit extends TransactionCommon { - type: TransactionType.PeerPushDebit; - info: PeerInfoShort; - /** - * Exchange used. - */ - exchangeBaseUrl: string; - /** - * Amount that got subtracted from the reserve balance. - */ - amountRaw: AmountString; - /** - * Amount that actually was (or will be) added to the wallet's balance. - */ - amountEffective: AmountString; - /** - * URI to accept the payment. - */ - talerUri: string; -} -``` -```typescript -export interface AbortTransactionRequest { - transactionId: string; - /** - * Move the payment immediately into an aborted state. - * The UI should warn the user that this might lead - * to money being lost. - * - * Defaults to false. - */ - forceImmediateAbort?: boolean; -} -``` -```typescript -export interface ExchangeListItem { - exchangeBaseUrl: string; - currency: string | undefined; - paytoUris: string[]; - tosStatus: ExchangeTosStatus; - exchangeStatus: ExchangeEntryStatus; - ageRestrictionOptions: number[]; - /** - * Permanently added to the wallet, as opposed to just - * temporarily queried. - */ - permanent: boolean; - /** - * Information about the last error that occurred when trying - * to update the exchange info. - */ - lastUpdateErrorInfo?: OperationErrorInfo; -} -``` -```typescript -export declare enum ExchangeTosStatus { - New = "new", - Accepted = "accepted", - Changed = "changed", - NotFound = "not-found", - Unknown = "unknown", -} -``` -```typescript -export declare enum ExchangeEntryStatus { - Unknown = "unknown", - Outdated = "outdated", - Ok = "ok", -} -``` -```typescript -export interface OperationErrorInfo { - error: TalerErrorDetail; -} -``` -```typescript -export interface ForcedDenomSel { - denoms: { - value: AmountString; - count: number; - }[]; -} -``` -```typescript -/** - * Result of a prepare pay operation. - */ -export type PreparePayResult = - | PreparePayResultInsufficientBalance - | PreparePayResultAlreadyConfirmed - | PreparePayResultPaymentPossible; -``` -```typescript -export interface PreparePayResultInsufficientBalance { - status: PreparePayResultType.InsufficientBalance; - proposalId: string; - contractTerms: MerchantContractTerms; - amountRaw: string; - noncePriv: string; - talerUri: string; - balanceDetails: PayMerchantInsufficientBalanceDetails; -} -``` -```typescript -/** - * Contract terms from a merchant. - * FIXME: Add type field! - */ -export interface MerchantContractTerms { - /** - * Hash of the merchant's wire details. - */ - h_wire: string; - /** - * Hash of the merchant's wire details. - */ - auto_refund?: TalerProtocolDuration; - /** - * Wire method the merchant wants to use. - */ - wire_method: string; - /** - * Human-readable short summary of the contract. - */ - summary: string; - summary_i18n?: InternationalizedString; - /** - * Nonce used to ensure freshness. - */ - nonce: string; - /** - * Total amount payable. - */ - amount: string; - /** - * Auditors accepted by the merchant. - */ - auditors: AuditorHandle[]; - /** - * Deadline to pay for the contract. - */ - pay_deadline: TalerProtocolTimestamp; - /** - * Maximum deposit fee covered by the merchant. - */ - max_fee: string; - /** - * Information about the merchant. - */ - merchant: MerchantInfo; - /** - * Public key of the merchant. - */ - merchant_pub: string; - /** - * Time indicating when the order should be delivered. - * May be overwritten by individual products. - */ - delivery_date?: TalerProtocolTimestamp; - /** - * Delivery location for (all!) products. - */ - delivery_location?: Location; - /** - * List of accepted exchanges. - */ - exchanges: ExchangeHandle[]; - /** - * Products that are sold in this contract. - */ - products?: Product[]; - /** - * Deadline for refunds. - */ - refund_deadline: TalerProtocolTimestamp; - /** - * Deadline for the wire transfer. - */ - wire_transfer_deadline: TalerProtocolTimestamp; - /** - * Time when the contract was generated by the merchant. - */ - timestamp: TalerProtocolTimestamp; - /** - * Order id to uniquely identify the purchase within - * one merchant instance. - */ - order_id: string; - /** - * Base URL of the merchant's backend. - */ - merchant_base_url: string; - /** - * Fulfillment URL to view the product or - * delivery status. - */ - fulfillment_url?: string; - /** - * URL meant to share the shopping cart. - */ - public_reorder_url?: string; - /** - * Plain text fulfillment message in the merchant's default language. - */ - fulfillment_message?: string; - /** - * Internationalized fulfillment messages. - */ - fulfillment_message_i18n?: InternationalizedString; - /** - * Share of the wire fee that must be settled with one payment. - */ - wire_fee_amortization?: number; - /** - * Maximum wire fee that the merchant agrees to pay for. - */ - max_wire_fee?: string; - minimum_age?: number; - /** - * Extra data, interpreted by the mechant only. - */ - extra?: any; -} -``` -```typescript -export interface AuditorHandle { - /** - * Official name of the auditor. - */ - name: string; - /** - * Master public signing key of the auditor. - */ - auditor_pub: string; - /** - * Base URL of the auditor. - */ - url: string; -} -``` -```typescript -/** - * Information about an exchange as stored inside a - * merchant's contract terms. - */ -export interface ExchangeHandle { - /** - * Master public signing key of the exchange. - */ - master_pub: string; - /** - * Base URL of the exchange. - */ - url: string; -} -``` -```typescript -/** - * Detailed reason for why the wallet's balance is insufficient. - */ -export interface PayMerchantInsufficientBalanceDetails { - /** - * Amount requested by the merchant. - */ - amountRequested: AmountString; - /** - * Balance of type "available" (see balance.ts for definition). - */ - balanceAvailable: AmountString; - /** - * Balance of type "material" (see balance.ts for definition). - */ - balanceMaterial: AmountString; - /** - * Balance of type "age-acceptable" (see balance.ts for definition). - */ - balanceAgeAcceptable: AmountString; - /** - * Balance of type "merchant-acceptable" (see balance.ts for definition). - */ - balanceMerchantAcceptable: AmountString; - /** - * Balance of type "merchant-depositable" (see balance.ts for definition). - */ - balanceMerchantDepositable: AmountString; - /** - * If the payment would succeed without fees - * (i.e. balanceMerchantDepositable >= amountRequested), - * this field contains an estimate of the amount that would additionally - * be required to cover the fees. - * - * It is not possible to give an exact value here, since it depends - * on the coin selection for the amount that would be additionally withdrawn. - */ - feeGapEstimate: AmountString; -} -``` -```typescript -export interface PreparePayResultAlreadyConfirmed { - status: PreparePayResultType.AlreadyConfirmed; - contractTerms: MerchantContractTerms; - paid: boolean; - amountRaw: string; - amountEffective: string; - contractTermsHash: string; - proposalId: string; - talerUri?: string; -} -``` -```typescript -/** - * Payment is possible. - */ -export interface PreparePayResultPaymentPossible { - status: PreparePayResultType.PaymentPossible; - proposalId: string; - contractTerms: MerchantContractTerms; - contractTermsHash: string; - amountRaw: string; - amountEffective: string; - noncePriv: string; - talerUri: string; -} -``` -```typescript -/** - * Forced coin selection for deposits/payments. - */ -export interface ForcedCoinSel { - coins: { - value: AmountString; - contribution: AmountString; - }[]; -} -``` -```typescript -export interface ApplyRefundResponse { - contractTermsHash: string; - transactionId: string; - proposalId: string; - amountEffectivePaid: AmountString; - amountRefundGranted: AmountString; - amountRefundGone: AmountString; - pendingAtExchange: boolean; - info: OrderShortInfo; -} -``` -```typescript -export interface AddExchangeRequest { - exchangeBaseUrl: string; - forceUpdate?: boolean; -} -``` -```typescript -export interface BackupRecovery { - walletRootPriv: string; - providers: { - name: string; - url: string; - }[]; -} -``` -```typescript -/** - * Contract terms between two wallets (as opposed to a merchant and wallet). - */ -export interface PeerContractTerms { - amount: AmountString; - summary: string; - purse_expiration: TalerProtocolTimestamp; -} -``` -```typescript -export interface IntegrationTestArgs { - exchangeBaseUrl: string; - bankAccessApiBaseUrl: string; - merchantBaseUrl: string; - merchantAuthToken?: string; - amountToWithdraw: string; - amountToSpend: string; -} -``` diff --git a/extract-tsdefs/myout.md b/extract-tsdefs/myout.md @@ -1,2517 +0,0 @@ -# Wallet API Documentation -```{note} -This file is auto-generated from [wallet-core](https://git.taler.net/wallet-core.git/tree/packages/taler-wallet-core/src/wallet-api-types.ts) -``` -## Overview -### Initialization -* [InitWalletOp](#initwalletop) -### Basic Wallet Information -* [GetBalancesOp](#getbalancesop) -### Managing Transactions -* [GetTransactionsOp](#gettransactionsop) -* [DeleteTransactionOp](#deletetransactionop) -* [RetryTransactionOp](#retrytransactionop) -### Withdrawals -* [GetWithdrawalDetailsForAmountOp](#getwithdrawaldetailsforamountop) -* [GetWithdrawalDetailsForUriOp](#getwithdrawaldetailsforuriop) -* [AcceptBankIntegratedWithdrawalOp](#acceptbankintegratedwithdrawalop) -* [AcceptManualWithdrawalOp](#acceptmanualwithdrawalop) -### Merchant Payments -* [PreparePayForUriOp](#preparepayforuriop) -* [ConfirmPayOp](#confirmpayop) -* [AbortPayWithRefundOp](#abortpaywithrefundop) -* [ApplyRefundOp](#applyrefundop) -### Tipping -* [PrepareTipOp](#preparetipop) -* [AcceptTipOp](#accepttipop) -### Exchange Management -* [ListExchangesOp](#listexchangesop) -* [AddExchangeOp](#addexchangeop) -* [SetExchangeTosAcceptedOp](#setexchangetosacceptedop) -* [GetExchangeTosOp](#getexchangetosop) -* [ListCurrenciesOp](#listcurrenciesop) -### Deposits -* [CreateDepositGroupOp](#createdepositgroupop) -* [TrackDepositGroupOp](#trackdepositgroupop) -### Backups -* [ExportBackupRecoveryOp](#exportbackuprecoveryop) -* [ImportBackupRecoveryOp](#importbackuprecoveryop) -* [RunBackupCycleOp](#runbackupcycleop) -* [AddBackupProviderOp](#addbackupproviderop) -* [GetBackupInfoOp](#getbackupinfoop) -* [SetWalletDeviceIdOp](#setwalletdeviceidop) -* [ExportBackupPlainOp](#exportbackupplainop) -### Peer Payments -* [InitiatePeerPushPaymentOp](#initiatepeerpushpaymentop) -* [CheckPeerPushPaymentOp](#checkpeerpushpaymentop) -* [AcceptPeerPushPaymentOp](#acceptpeerpushpaymentop) -* [InitiatePeerPullPaymentOp](#initiatepeerpullpaymentop) -* [CheckPeerPullPaymentOp](#checkpeerpullpaymentop) -* [AcceptPeerPullPaymentOp](#acceptpeerpullpaymentop) -### Database Management -* [ExportDbOp](#exportdbop) -* [ClearDbOp](#cleardbop) -* [RecycleOp](#recycleop) -### Testing and Debugging -* [RunIntegrationTestOp](#runintegrationtestop) -* [WithdrawTestBalanceOp](#withdrawtestbalanceop) -* [WithdrawTestkudosOp](#withdrawtestkudosop) -* [TestPayOp](#testpayop) -* [WithdrawFakebankOp](#withdrawfakebankop) -* [GetPendingTasksOp](#getpendingtasksop) -* [DumpCoinsOp](#dumpcoinsop) -* [SetCoinSuspendedOp](#setcoinsuspendedop) -* [ForceRefreshOp](#forcerefreshop) -## Operation Reference -(initwalletop)= -### InitWalletOp -```typescript -// group: Initialization -/** - * Initialize wallet-core. - * - * Must be the request before any other operations. - */ -export type InitWalletOp = { - op: WalletApiOperation.InitWallet; - request: {}; - response: {}; -}; - -``` -```typescript -// Enum value: -// WalletApiOperation.InitWallet = "initWallet" - -``` - -(getbalancesop)= -### GetBalancesOp -```typescript -// group: Basic Wallet Information -/** - * Get current wallet balance. - */ -export type GetBalancesOp = { - request: {}; - response: BalancesResponse; -}; - -``` -```typescript -export interface BalancesResponse { - balances: Balance[]; -} - -``` -```typescript -export interface Balance { - available: AmountString; - pendingIncoming: AmountString; - pendingOutgoing: AmountString; - hasPendingTransactions: boolean; - requiresUserInput: boolean; -} - -``` - -(gettransactionsop)= -### GetTransactionsOp -```typescript -// group: Managing Transactions -/** - * Get transactions. - */ -export type GetTransactionsOp = { - request: TransactionsRequest; - response: TransactionsResponse; -}; - -``` -```typescript -export interface TransactionsRequest { - /** - * return only transactions in the given currency - */ - currency?: string; - /** - * if present, results will be limited to transactions related to the given search string - */ - search?: string; -} - -``` -```typescript -export interface TransactionsResponse { - transactions: Transaction[]; -} - -``` -```typescript -export declare type Transaction = - | TransactionWithdrawal - | TransactionPayment - | TransactionRefund - | TransactionTip - | TransactionRefresh - | TransactionDeposit - | TransactionPeerPullCredit - | TransactionPeerPullDebit - | TransactionPeerPushCredit - | TransactionPeerPushDebit; - -``` -```typescript -export interface TransactionWithdrawal extends TransactionCommon { - type: TransactionType.Withdrawal; - /** - * Exchange of the withdrawal. - */ - exchangeBaseUrl: string; - /** - * Amount that got subtracted from the reserve balance. - */ - amountRaw: AmountString; - /** - * Amount that actually was (or will be) added to the wallet's balance. - */ - amountEffective: AmountString; - withdrawalDetails: WithdrawalDetails; -} - -``` -```typescript -// Enum value: -// TransactionType.Withdrawal = "withdrawal" - -``` -```typescript -export declare type WithdrawalDetails = - | WithdrawalDetailsForManualTransfer - | WithdrawalDetailsForTalerBankIntegrationApi; - -``` -```typescript -interface WithdrawalDetailsForManualTransfer { - type: WithdrawalType.ManualTransfer; - /** - * Payto URIs that the exchange supports. - * - * Already contains the amount and message. - */ - exchangePaytoUris: string[]; - reservePub: string; -} - -``` -```typescript -// Enum value: -// WithdrawalType.ManualTransfer = "manual-transfer" - -``` -```typescript -interface WithdrawalDetailsForTalerBankIntegrationApi { - type: WithdrawalType.TalerBankIntegrationApi; - /** - * Set to true if the bank has confirmed the withdrawal, false if not. - * An unconfirmed withdrawal usually requires user-input and should be highlighted in the UI. - * See also bankConfirmationUrl below. - */ - confirmed: boolean; - /** - * If the withdrawal is unconfirmed, this can include a URL for user - * initiated confirmation. - */ - bankConfirmationUrl?: string; - reservePub: string; -} - -``` -```typescript -// Enum value: -// WithdrawalType.TalerBankIntegrationApi = "taler-bank-integration-api" - -``` -```typescript -export interface TransactionPayment extends TransactionCommon { - type: TransactionType.Payment; - /** - * Additional information about the payment. - */ - info: OrderShortInfo; - /** - * Wallet-internal end-to-end identifier for the payment. - */ - proposalId: string; - /** - * How far did the wallet get with processing the payment? - */ - status: PaymentStatus; - /** - * Amount that must be paid for the contract - */ - amountRaw: AmountString; - /** - * Amount that was paid, including deposit, wire and refresh fees. - */ - amountEffective: AmountString; - /** - * Amount that has been refunded by the merchant - */ - totalRefundRaw: AmountString; - /** - * Amount will be added to the wallet's balance after fees and refreshing - */ - totalRefundEffective: AmountString; - /** - * Amount pending to be picked up - */ - refundPending: AmountString | undefined; - /** - * Reference to applied refunds - */ - refunds: RefundInfoShort[]; -} - -``` -```typescript -// Enum value: -// TransactionType.Payment = "payment" - -``` -```typescript -export declare enum PaymentStatus { - /** - * Explicitly aborted after timeout / failure - */ - Aborted = "aborted", - /** - * Payment failed, wallet will auto-retry. - * User should be given the option to retry now / abort. - */ - Failed = "failed", - /** - * Paid successfully - */ - Paid = "paid", - /** - * User accepted, payment is processing. - */ - Accepted = "accepted", -} - -``` -```typescript -export interface RefundInfoShort { - transactionId: string; - timestamp: TalerProtocolTimestamp; - amountEffective: AmountString; - amountRaw: AmountString; -} - -``` -```typescript -export interface TransactionRefund extends TransactionCommon { - type: TransactionType.Refund; - refundedTransactionId: string; - info: OrderShortInfo; - /** - * Amount pending to be picked up - */ - refundPending: AmountString | undefined; - amountRaw: AmountString; - amountEffective: AmountString; -} - -``` -```typescript -// Enum value: -// TransactionType.Refund = "refund" - -``` -```typescript -export interface TransactionTip extends TransactionCommon { - type: TransactionType.Tip; - amountRaw: AmountString; - /** - * More information about the merchant - */ - amountEffective: AmountString; - merchantBaseUrl: string; -} - -``` -```typescript -// Enum value: -// TransactionType.Tip = "tip" - -``` -```typescript -export interface TransactionRefresh extends TransactionCommon { - type: TransactionType.Refresh; - exchangeBaseUrl: string; - amountRaw: AmountString; - amountEffective: AmountString; -} - -``` -```typescript -/** - * Deposit transaction, which effectively sends - * money from this wallet somewhere else. - */ -export interface TransactionDeposit extends TransactionCommon { - type: TransactionType.Deposit; - depositGroupId: string; - /** - * Target for the deposit. - */ - targetPaytoUri: string; - /** - * Raw amount that is being deposited - */ - amountRaw: AmountString; - /** - * Effective amount that is being deposited - */ - amountEffective: AmountString; -} - -``` -```typescript -/** - * Credit because we were paid for a P2P invoice we created. - */ -export interface TransactionPeerPullCredit extends TransactionCommon { - type: TransactionType.PeerPullCredit; - info: PeerInfoShort; - /** - * Exchange used. - */ - exchangeBaseUrl: string; - /** - * Amount that got subtracted from the reserve balance. - */ - amountRaw: AmountString; - /** - * Amount that actually was (or will be) added to the wallet's balance. - */ - amountEffective: AmountString; - /** - * URI to send to the other party. - */ - talerUri: string; -} - -``` -```typescript -// Enum value: -// TransactionType.PeerPullCredit = "peer-pull-credit" - -``` -```typescript -export interface PeerInfoShort { - expiration: TalerProtocolTimestamp | undefined; - summary: string | undefined; -} - -``` -```typescript -/** - * Debit because we paid someone's invoice. - */ -export interface TransactionPeerPullDebit extends TransactionCommon { - type: TransactionType.PeerPullDebit; - info: PeerInfoShort; - /** - * Exchange used. - */ - exchangeBaseUrl: string; - amountRaw: AmountString; - amountEffective: AmountString; -} - -``` -```typescript -// Enum value: -// TransactionType.PeerPullDebit = "peer-pull-debit" - -``` -```typescript -/** - * We received money via a P2P payment. - */ -export interface TransactionPeerPushCredit extends TransactionCommon { - type: TransactionType.PeerPushCredit; - info: PeerInfoShort; - /** - * Exchange used. - */ - exchangeBaseUrl: string; - /** - * Amount that got subtracted from the reserve balance. - */ - amountRaw: AmountString; - /** - * Amount that actually was (or will be) added to the wallet's balance. - */ - amountEffective: AmountString; -} - -``` -```typescript -// Enum value: -// TransactionType.PeerPushCredit = "peer-push-credit" - -``` -```typescript -/** - * We sent money via a P2P payment. - */ -export interface TransactionPeerPushDebit extends TransactionCommon { - type: TransactionType.PeerPushDebit; - info: PeerInfoShort; - /** - * Exchange used. - */ - exchangeBaseUrl: string; - /** - * Amount that got subtracted from the reserve balance. - */ - amountRaw: AmountString; - /** - * Amount that actually was (or will be) added to the wallet's balance. - */ - amountEffective: AmountString; - /** - * URI to accept the payment. - */ - talerUri: string; -} - -``` -```typescript -// Enum value: -// TransactionType.PeerPushDebit = "peer-push-debit" - -``` - -(deletetransactionop)= -### DeleteTransactionOp -```typescript -/** - * Delete a transaction locally in the wallet. - */ -export type DeleteTransactionOp = { - request: DeleteTransactionRequest; - response: {}; -}; - -``` -```typescript -export interface DeleteTransactionRequest { - transactionId: string; -} - -``` - -(retrytransactionop)= -### RetryTransactionOp -```typescript -/** - * Immediately retry a transaction. - */ -export type RetryTransactionOp = { - request: RetryTransactionRequest; - response: {}; -}; - -``` -```typescript -export interface RetryTransactionRequest { - transactionId: string; -} - -``` - -(getwithdrawaldetailsforamountop)= -### GetWithdrawalDetailsForAmountOp -```typescript -// group: Withdrawals -/** - * Get details for withdrawing a particular amount (manual withdrawal). - */ -export type GetWithdrawalDetailsForAmountOp = { - request: GetWithdrawalDetailsForAmountRequest; - response: ManualWithdrawalDetails; -}; - -``` -```typescript -export interface GetWithdrawalDetailsForAmountRequest { - exchangeBaseUrl: string; - amount: string; - restrictAge?: number; -} - -``` -```typescript -export interface ManualWithdrawalDetails { - /** - * Did the user accept the current version of the exchange's - * terms of service? - */ - tosAccepted: boolean; - /** - * Amount that the user will transfer to the exchange. - */ - amountRaw: AmountString; - /** - * Amount that will be added to the user's wallet balance. - */ - amountEffective: AmountString; - /** - * Ways to pay the exchange. - */ - paytoUris: string[]; -} - -``` - -(getwithdrawaldetailsforuriop)= -### GetWithdrawalDetailsForUriOp -```typescript -/** - * Get details for withdrawing via a particular taler:// URI. - */ -export type GetWithdrawalDetailsForUriOp = { - request: GetWithdrawalDetailsForUriRequest; - response: WithdrawUriInfoResponse; -}; - -``` -```typescript -export interface GetWithdrawalDetailsForUriRequest { - talerWithdrawUri: string; - restrictAge?: number; -} - -``` -```typescript -export interface WithdrawUriInfoResponse { - amount: AmountString; - defaultExchangeBaseUrl?: string; - possibleExchanges: ExchangeListItem[]; -} - -``` - -(acceptbankintegratedwithdrawalop)= -### AcceptBankIntegratedWithdrawalOp -```typescript -/** - * Accept a bank-integrated withdrawal. - */ -export type AcceptBankIntegratedWithdrawalOp = { - request: AcceptBankIntegratedWithdrawalRequest; - response: AcceptWithdrawalResponse; -}; - -``` -```typescript -export interface AcceptBankIntegratedWithdrawalRequest { - talerWithdrawUri: string; - exchangeBaseUrl: string; - forcedDenomSel?: ForcedDenomSel; - restrictAge?: number; -} - -``` -```typescript -export interface AcceptWithdrawalResponse { - reservePub: string; - confirmTransferUrl?: string; - transactionId: string; -} - -``` - -(acceptmanualwithdrawalop)= -### AcceptManualWithdrawalOp -```typescript -/** - * Create a manual withdrawal. - */ -export type AcceptManualWithdrawalOp = { - request: AcceptManualWithdrawalRequest; - response: AcceptManualWithdrawalResult; -}; - -``` -```typescript -export interface AcceptManualWithdrawalRequest { - exchangeBaseUrl: string; - amount: string; - restrictAge?: number; -} - -``` -```typescript -export interface AcceptManualWithdrawalResult { - /** - * Payto URIs that can be used to fund the withdrawal. - */ - exchangePaytoUris: string[]; - /** - * Public key of the newly created reserve. - */ - reservePub: string; - transactionId: string; -} - -``` - -(preparepayforuriop)= -### PreparePayForUriOp -```typescript -// group: Merchant Payments -/** - * Prepare to make a payment - */ -export type PreparePayForUriOp = { - op: WalletApiOperation.PreparePayForUri; - request: PreparePayRequest; - response: PreparePayResult; -}; - -``` -```typescript -// Enum value: -// WalletApiOperation.PreparePayForUri = "preparePayForUri" - -``` -```typescript -export interface PreparePayRequest { - talerPayUri: string; -} - -``` -```typescript -/** - * Result of a prepare pay operation. - */ -export declare type PreparePayResult = - | PreparePayResultInsufficientBalance - | PreparePayResultAlreadyConfirmed - | PreparePayResultPaymentPossible; - -``` -```typescript -export interface PreparePayResultInsufficientBalance { - status: PreparePayResultType.InsufficientBalance; - proposalId: string; - contractTerms: ContractTerms; - amountRaw: string; - noncePriv: string; -} - -``` -```typescript -export interface PreparePayResultAlreadyConfirmed { - status: PreparePayResultType.AlreadyConfirmed; - contractTerms: ContractTerms; - paid: boolean; - amountRaw: string; - amountEffective: string; - contractTermsHash: string; - proposalId: string; -} - -``` -```typescript -// Enum value: -// PreparePayResultType.AlreadyConfirmed = "already-confirmed" - -``` -```typescript -/** - * Payment is possible. - */ -export interface PreparePayResultPaymentPossible { - status: PreparePayResultType.PaymentPossible; - proposalId: string; - contractTerms: ContractTerms; - contractTermsHash: string; - amountRaw: string; - amountEffective: string; - noncePriv: string; -} - -``` -```typescript -// Enum value: -// PreparePayResultType.PaymentPossible = "payment-possible" - -``` - -(confirmpayop)= -### ConfirmPayOp -```typescript -/** - * Confirm a payment that was previously prepared with - * {@link PreparePayForUriOp} - */ -export type ConfirmPayOp = { - op: WalletApiOperation.ConfirmPay; - request: ConfirmPayRequest; - response: ConfirmPayResult; -}; - -``` -```typescript -// Enum value: -// WalletApiOperation.ConfirmPay = "confirmPay" - -``` -```typescript -export interface ConfirmPayRequest { - proposalId: string; - sessionId?: string; - forcedCoinSel?: ForcedCoinSel; -} - -``` -```typescript -export declare type ConfirmPayResult = - | ConfirmPayResultDone - | ConfirmPayResultPending; - -``` -```typescript -/** - * Result for confirmPay - */ -export interface ConfirmPayResultDone { - type: ConfirmPayResultType.Done; - contractTerms: ContractTerms; - transactionId: string; -} - -``` -```typescript -// Enum value: -// ConfirmPayResultType.Done = "done" - -``` -```typescript -export interface ConfirmPayResultPending { - type: ConfirmPayResultType.Pending; - transactionId: string; - lastError: TalerErrorDetail | undefined; -} - -``` - -(abortpaywithrefundop)= -### AbortPayWithRefundOp -```typescript -/** - * Abort a pending payment with a refund. - */ -export type AbortPayWithRefundOp = { - request: AbortPayWithRefundRequest; - response: {}; -}; - -``` -```typescript -export interface AbortPayWithRefundRequest { - proposalId: string; -} - -``` - -(applyrefundop)= -### ApplyRefundOp -```typescript -/** - * Check for a refund based on a taler://refund URI. - */ -export type ApplyRefundOp = { - request: ApplyRefundRequest; - response: ApplyRefundResponse; -}; - -``` -```typescript -export interface ApplyRefundRequest { - talerRefundUri: string; -} - -``` -```typescript -export interface ApplyRefundResponse { - contractTermsHash: string; - transactionId: string; - proposalId: string; - amountEffectivePaid: AmountString; - amountRefundGranted: AmountString; - amountRefundGone: AmountString; - pendingAtExchange: boolean; - info: OrderShortInfo; -} - -``` - -(preparetipop)= -### PrepareTipOp -```typescript -// group: Tipping -/** - * Query and store information about a tip. - */ -export type PrepareTipOp = { - request: PrepareTipRequest; - response: PrepareTipResult; -}; - -``` -```typescript -export interface PrepareTipRequest { - talerTipUri: string; -} - -``` -```typescript -export interface PrepareTipResult { - /** - * Unique ID for the tip assigned by the wallet. - * Typically different from the merchant-generated tip ID. - */ - walletTipId: string; - /** - * Has the tip already been accepted? - */ - accepted: boolean; - /** - * Amount that the merchant gave. - */ - tipAmountRaw: AmountString; - /** - * Amount that arrived at the wallet. - * Might be lower than the raw amount due to fees. - */ - tipAmountEffective: AmountString; - /** - * Base URL of the merchant backend giving then tip. - */ - merchantBaseUrl: string; - /** - * Base URL of the exchange that is used to withdraw the tip. - * Determined by the merchant, the wallet/user has no choice here. - */ - exchangeBaseUrl: string; - /** - * Time when the tip will expire. After it expired, it can't be picked - * up anymore. - */ - expirationTimestamp: TalerProtocolTimestamp; -} - -``` - -(accepttipop)= -### AcceptTipOp -```typescript -/** - * Accept a tip. - */ -export type AcceptTipOp = { - request: AcceptTipRequest; - response: {}; -}; - -``` -```typescript -export interface AcceptTipRequest { - walletTipId: string; -} - -``` - -(listexchangesop)= -### ListExchangesOp -```typescript -// group: Exchange Management -/** - * List exchanges known to the wallet. - */ -export type ListExchangesOp = { - request: {}; - response: ExchangesListResponse; -}; - -``` -```typescript -export interface ExchangesListResponse { - exchanges: ExchangeListItem[]; -} - -``` - -(addexchangeop)= -### AddExchangeOp -```typescript -/** - * Add / force-update an exchange. - */ -export type AddExchangeOp = { - request: AddExchangeRequest; - response: {}; -}; - -``` -```typescript -export interface AddExchangeRequest { - exchangeBaseUrl: string; - forceUpdate?: boolean; -} - -``` - -(setexchangetosacceptedop)= -### SetExchangeTosAcceptedOp -```typescript -/** - * Accept a particular version of the exchange terms of service. - */ -export type SetExchangeTosAcceptedOp = { - request: AcceptExchangeTosRequest; - response: {}; -}; - -``` -```typescript -export interface AcceptExchangeTosRequest { - exchangeBaseUrl: string; - etag: string | undefined; -} - -``` - -(getexchangetosop)= -### GetExchangeTosOp -```typescript -/** - * Get the current terms of a service of an exchange. - */ -export type GetExchangeTosOp = { - request: GetExchangeTosRequest; - response: GetExchangeTosResult; -}; - -``` -```typescript -export interface GetExchangeTosRequest { - exchangeBaseUrl: string; - acceptedFormat?: string[]; -} - -``` -```typescript -export interface GetExchangeTosResult { - /** - * Markdown version of the current ToS. - */ - content: string; - /** - * Version tag of the current ToS. - */ - currentEtag: string; - /** - * Version tag of the last ToS that the user has accepted, - * if any. - */ - acceptedEtag: string | undefined; - /** - * Accepted content type - */ - contentType: string; -} - -``` - -(listcurrenciesop)= -### ListCurrenciesOp -```typescript -/** - * List currencies known to the wallet. - */ -export type ListCurrenciesOp = { - request: {}; - response: WalletCurrencyInfo; -}; - -``` -```typescript -export interface WalletCurrencyInfo { - trustedAuditors: { - currency: string; - auditorPub: string; - auditorBaseUrl: string; - }[]; - trustedExchanges: { - currency: string; - exchangeMasterPub: string; - exchangeBaseUrl: string; - }[]; -} - -``` - -(createdepositgroupop)= -### CreateDepositGroupOp -```typescript -// group: Deposits -/** - * Create a new deposit group. - * - * Deposit groups are used to deposit multiple coins to a bank - * account, usually the wallet user's own bank account. - */ -export type CreateDepositGroupOp = { - request: CreateDepositGroupRequest; - response: CreateDepositGroupResponse; -}; - -``` -```typescript -export interface CreateDepositGroupRequest { - depositPaytoUri: string; - amount: AmountString; -} - -``` -```typescript -export interface CreateDepositGroupResponse { - depositGroupId: string; - transactionId: string; -} - -``` - -(trackdepositgroupop)= -### TrackDepositGroupOp -```typescript -/** - * Track the status of a deposit group by querying the exchange. - */ -export type TrackDepositGroupOp = { - request: TrackDepositGroupRequest; - response: TrackDepositGroupResponse; -}; - -``` -```typescript -export interface TrackDepositGroupRequest { - depositGroupId: string; -} - -``` -```typescript -export interface TrackDepositGroupResponse { - responses: { - status: number; - body: any; - }[]; -} - -``` - -(exportbackuprecoveryop)= -### ExportBackupRecoveryOp -```typescript -// group: Backups -/** - * Export the recovery information for the wallet. - */ -export type ExportBackupRecoveryOp = { - request: {}; - response: BackupRecovery; -}; - -``` - -(importbackuprecoveryop)= -### ImportBackupRecoveryOp -```typescript -/** - * Import recovery information into the wallet. - */ -export type ImportBackupRecoveryOp = { - request: RecoveryLoadRequest; - response: {}; -}; - -``` -```typescript -/** - * Load recovery information into the wallet. - */ -export interface RecoveryLoadRequest { - recovery: BackupRecovery; - strategy?: RecoveryMergeStrategy; -} - -``` -```typescript -/** - * Strategy for loading recovery information. - */ -export declare enum RecoveryMergeStrategy { - /** - * Keep the local wallet root key, import and take over providers. - */ - Ours = "ours", - /** - * Migrate to the wallet root key from the recovery information. - */ - Theirs = "theirs", -} - -``` - -(runbackupcycleop)= -### RunBackupCycleOp -```typescript -/** - * Manually make and upload a backup. - */ -export type RunBackupCycleOp = { - request: {}; - response: {}; -}; - -``` - -(addbackupproviderop)= -### AddBackupProviderOp -```typescript -/** - * Add a new backup provider. - */ -export type AddBackupProviderOp = { - request: AddBackupProviderRequest; - response: {}; -}; - -``` -```typescript -export interface AddBackupProviderRequest { - backupProviderBaseUrl: string; - name: string; - /** - * Activate the provider. Should only be done after - * the user has reviewed the provider. - */ - activate?: boolean; -} - -``` - -(getbackupinfoop)= -### GetBackupInfoOp -```typescript -/** - * Get some useful stats about the backup state. - */ -export type GetBackupInfoOp = { - request: {}; - response: BackupInfo; -}; - -``` -```typescript -export interface BackupInfo { - walletRootPub: string; - deviceId: string; - providers: ProviderInfo[]; -} - -``` -```typescript -/** - * Information about one provider. - * - * We don't store the account key here, - * as that's derived from the wallet root key. - */ -export interface ProviderInfo { - active: boolean; - syncProviderBaseUrl: string; - name: string; - terms?: BackupProviderTerms; - /** - * Last communication issue with the provider. - */ - lastError?: TalerErrorDetail; - lastSuccessfulBackupTimestamp?: TalerProtocolTimestamp; - lastAttemptedBackupTimestamp?: TalerProtocolTimestamp; - paymentProposalIds: string[]; - backupProblem?: BackupProblem; - paymentStatus: ProviderPaymentStatus; -} - -``` -```typescript -export interface BackupProviderTerms { - supportedProtocolVersion: string; - annualFee: AmountString; - storageLimitInMegabytes: number; -} - -``` -```typescript -export type BackupProblem = - | BackupUnreadableProblem - | BackupConflictingDeviceProblem; - -``` -```typescript -export interface BackupUnreadableProblem { - type: "backup-unreadable"; -} - -``` -```typescript -export interface BackupConflictingDeviceProblem { - type: "backup-conflicting-device"; - otherDeviceId: string; - myDeviceId: string; - backupTimestamp: AbsoluteTime; -} - -``` -```typescript -export type ProviderPaymentStatus = - | ProviderPaymentTermsChanged - | ProviderPaymentPaid - | ProviderPaymentInsufficientBalance - | ProviderPaymentUnpaid - | ProviderPaymentPending; - -``` -```typescript -export interface ProviderPaymentTermsChanged { - type: ProviderPaymentType.TermsChanged; - paidUntil: AbsoluteTime; - oldTerms: BackupProviderTerms; - newTerms: BackupProviderTerms; -} - -``` -```typescript -// Enum value: -// ProviderPaymentType.TermsChanged = "terms-changed" - -``` -```typescript -export interface ProviderPaymentPaid { - type: ProviderPaymentType.Paid; - paidUntil: AbsoluteTime; -} - -``` -```typescript -// Enum value: -// ProviderPaymentType.Paid = "paid" - -``` -```typescript -export interface ProviderPaymentInsufficientBalance { - type: ProviderPaymentType.InsufficientBalance; -} - -``` -```typescript -export interface ProviderPaymentUnpaid { - type: ProviderPaymentType.Unpaid; -} - -``` -```typescript -// Enum value: -// ProviderPaymentType.Unpaid = "unpaid" - -``` -```typescript -export interface ProviderPaymentPending { - type: ProviderPaymentType.Pending; -} - -``` - -(setwalletdeviceidop)= -### SetWalletDeviceIdOp -```typescript -/** - * Set the internal device ID of the wallet, used to - * identify whether a different/new wallet is accessing - * the backup of another wallet. - */ -export type SetWalletDeviceIdOp = { - request: SetWalletDeviceIdRequest; - response: {}; -}; - -``` -```typescript -export interface SetWalletDeviceIdRequest { - /** - * New wallet device ID to set. - */ - walletDeviceId: string; -} - -``` - -(exportbackupplainop)= -### ExportBackupPlainOp -```typescript -/** - * Export a backup JSON, mostly useful for testing. - */ -export type ExportBackupPlainOp = { - request: {}; - response: WalletBackupContentV1; -}; - -``` - -(initiatepeerpushpaymentop)= -### InitiatePeerPushPaymentOp -```typescript -// group: Peer Payments -/** - * Initiate an outgoing peer push payment. - */ -export type InitiatePeerPushPaymentOp = { - request: InitiatePeerPushPaymentRequest; - response: InitiatePeerPushPaymentResponse; -}; - -``` -```typescript -export interface InitiatePeerPushPaymentRequest { - amount: AmountString; - partialContractTerms: any; -} - -``` -```typescript -export interface InitiatePeerPushPaymentResponse { - exchangeBaseUrl: string; - pursePub: string; - mergePriv: string; - contractPriv: string; - talerUri: string; - transactionId: string; -} - -``` - -(checkpeerpushpaymentop)= -### CheckPeerPushPaymentOp -```typescript -/** - * Check an incoming peer push payment. - */ -export type CheckPeerPushPaymentOp = { - request: CheckPeerPushPaymentRequest; - response: CheckPeerPushPaymentResponse; -}; - -``` -```typescript -export interface CheckPeerPushPaymentRequest { - talerUri: string; -} - -``` -```typescript -export interface CheckPeerPushPaymentResponse { - contractTerms: any; - amount: AmountString; - peerPushPaymentIncomingId: string; -} - -``` - -(acceptpeerpushpaymentop)= -### AcceptPeerPushPaymentOp -```typescript -/** - * Accept an incoming peer push payment. - */ -export type AcceptPeerPushPaymentOp = { - request: AcceptPeerPushPaymentRequest; - response: {}; -}; - -``` -```typescript -export interface AcceptPeerPushPaymentRequest { - /** - * Transparent identifier of the incoming peer push payment. - */ - peerPushPaymentIncomingId: string; -} - -``` - -(initiatepeerpullpaymentop)= -### InitiatePeerPullPaymentOp -```typescript -/** - * Initiate an outgoing peer pull payment. - */ -export type InitiatePeerPullPaymentOp = { - request: InitiatePeerPullPaymentRequest; - response: InitiatePeerPullPaymentResponse; -}; - -``` -```typescript -export interface InitiatePeerPullPaymentRequest { - /** - * FIXME: Make this optional? - */ - exchangeBaseUrl: string; - amount: AmountString; - partialContractTerms: any; -} - -``` -```typescript -export interface InitiatePeerPullPaymentResponse { - /** - * Taler URI for the other party to make the payment - * that was requested. - */ - talerUri: string; - transactionId: string; -} - -``` - -(checkpeerpullpaymentop)= -### CheckPeerPullPaymentOp -```typescript -/** - * Prepare for an incoming peer pull payment. - */ -export type CheckPeerPullPaymentOp = { - request: CheckPeerPullPaymentRequest; - response: CheckPeerPullPaymentResponse; -}; - -``` -```typescript -export interface CheckPeerPullPaymentRequest { - talerUri: string; -} - -``` -```typescript -export interface CheckPeerPullPaymentResponse { - contractTerms: any; - amount: AmountString; - peerPullPaymentIncomingId: string; -} - -``` - -(acceptpeerpullpaymentop)= -### AcceptPeerPullPaymentOp -```typescript -/** - * Accept an incoming peer pull payment. - */ -export type AcceptPeerPullPaymentOp = { - request: AcceptPeerPullPaymentRequest; - response: {}; -}; - -``` -```typescript -export interface AcceptPeerPullPaymentRequest { - /** - * Transparent identifier of the incoming peer pull payment. - */ - peerPullPaymentIncomingId: string; -} - -``` - -(exportdbop)= -### ExportDbOp -```typescript -// group: Database Management -/** - * Exoport the wallet database's contents to JSON. - */ -export type ExportDbOp = { - request: {}; - response: any; -}; - -``` - -(cleardbop)= -### ClearDbOp -```typescript -/** - * Dangerously clear the whole wallet database. - */ -export type ClearDbOp = { - request: {}; - response: {}; -}; - -``` - -(recycleop)= -### RecycleOp -```typescript -/** - * Export a backup, clear the database and re-import it. - */ -export type RecycleOp = { - request: {}; - response: {}; -}; - -``` - -(runintegrationtestop)= -### RunIntegrationTestOp -```typescript -// group: Testing and Debugging -/** - * Run a simple integration test on a test deployment - * of the exchange and merchant. - */ -export type RunIntegrationTestOp = { - request: IntegrationTestArgs; - response: {}; -}; - -``` -```typescript -export interface IntegrationTestArgs { - exchangeBaseUrl: string; - bankBaseUrl: string; - bankAccessApiBaseUrl?: string; - merchantBaseUrl: string; - merchantAuthToken?: string; - amountToWithdraw: string; - amountToSpend: string; -} - -``` - -(withdrawtestbalanceop)= -### WithdrawTestBalanceOp -```typescript -/** - * Make withdrawal on a test deployment of the exchange - * and merchant. - */ -export type WithdrawTestBalanceOp = { - request: WithdrawTestBalanceRequest; - response: {}; -}; - -``` -```typescript -export interface WithdrawTestBalanceRequest { - amount: string; - bankBaseUrl: string; - /** - * Bank access API base URL. Defaults to the bankBaseUrl. - */ - bankAccessApiBaseUrl?: string; - exchangeBaseUrl: string; - forcedDenomSel?: ForcedDenomSel; -} - -``` - -(withdrawtestkudosop)= -### WithdrawTestkudosOp -```typescript -/** - * Make a withdrawal of testkudos on test.taler.net. - */ -export type WithdrawTestkudosOp = { - op: WalletApiOperation.WithdrawTestkudos; - request: {}; - response: {}; -}; - -``` -```typescript -// Enum value: -// WalletApiOperation.WithdrawTestkudos = "withdrawTestkudos" - -``` - -(testpayop)= -### TestPayOp -```typescript -/** - * Make a test payment using a test deployment of - * the exchange and merchant. - */ -export type TestPayOp = { - request: TestPayArgs; - response: TestPayResult; -}; - -``` -```typescript -export interface TestPayArgs { - merchantBaseUrl: string; - merchantAuthToken?: string; - amount: string; - summary: string; - forcedCoinSel?: ForcedCoinSel; -} - -``` -```typescript -export interface TestPayResult { - payCoinSelection: PayCoinSelection; -} - -``` -```typescript -/** - * Result of selecting coins, contains the exchange, and selected - * coins with their denomination. - */ -export interface PayCoinSelection { - /** - * Amount requested by the merchant. - */ - paymentAmount: AmountJson; - /** - * Public keys of the coins that were selected. - */ - coinPubs: string[]; - /** - * Amount that each coin contributes. - */ - coinContributions: AmountJson[]; - /** - * How much of the wire fees is the customer paying? - */ - customerWireFees: AmountJson; - /** - * How much of the deposit fees is the customer paying? - */ - customerDepositFees: AmountJson; -} - -``` -```typescript -/** - * Non-negative financial amount. Fractional values are expressed as multiples - * of 1e-8. - */ -export interface AmountJson { - /** - * Value, must be an integer. - */ - readonly value: number; - /** - * Fraction, must be an integer. Represent 1/1e8 of a unit. - */ - readonly fraction: number; - /** - * Currency of the amount. - */ - readonly currency: string; -} - -``` - -(withdrawfakebankop)= -### WithdrawFakebankOp -```typescript -/** - * Make a withdrawal from a fakebank, i.e. - * a bank where test users can be registered freely - * and testing APIs are available. - */ -export type WithdrawFakebankOp = { - op: WalletApiOperation.WithdrawFakebank; - request: WithdrawFakebankRequest; - response: {}; -}; - -``` -```typescript -// Enum value: -// WalletApiOperation.WithdrawFakebank = "withdrawFakebank" - -``` -```typescript -export interface WithdrawFakebankRequest { - amount: AmountString; - exchange: string; - bank: string; -} - -``` - -(getpendingtasksop)= -### GetPendingTasksOp -```typescript -/** - * Get wallet-internal pending tasks. - */ -export type GetPendingTasksOp = { - request: {}; - response: PendingTasksResponse; -}; - -``` -```typescript -/** - * Response returned from the pending operations API. - */ -export interface PendingOperationsResponse { - /** - * List of pending operations. - */ - pendingOperations: PendingTaskInfo[]; -} - -``` -```typescript -/** - * Information about a pending operation. - */ -export type PendingTaskInfo = PendingTaskInfoCommon & - ( - | PendingExchangeUpdateTask - | PendingExchangeCheckRefreshTask - | PendingPayTask - | PendingProposalDownloadTask - | PendingRefreshTask - | PendingRefundQueryTask - | PendingTipPickupTask - | PendingWithdrawTask - | PendingRecoupTask - | PendingDepositTask - | PendingBackupTask - ); - -``` -```typescript -/** - * Fields that are present in every pending operation. - */ -export interface PendingTaskInfoCommon { - /** - * Type of the pending operation. - */ - type: PendingTaskType; - /** - * Unique identifier for the pending task. - */ - id: string; - /** - * Set to true if the operation indicates that something is really in progress, - * as opposed to some regular scheduled operation that can be tried later. - */ - givesLifeness: boolean; - /** - * Timestamp when the pending operation should be executed next. - */ - timestampDue: AbsoluteTime; - /** - * Retry info. Currently used to stop the wallet after any operation - * exceeds a number of retries. - */ - retryInfo?: RetryInfo; -} - -``` -```typescript -export enum PendingTaskType { - ExchangeUpdate = "exchange-update", - ExchangeCheckRefresh = "exchange-check-refresh", - Pay = "pay", - ProposalDownload = "proposal-download", - Refresh = "refresh", - Recoup = "recoup", - RefundQuery = "refund-query", - TipPickup = "tip-pickup", - Withdraw = "withdraw", - Deposit = "deposit", - Backup = "backup", -} - -``` -```typescript -export interface RetryInfo { - firstTry: AbsoluteTime; - nextRetry: AbsoluteTime; - retryCounter: number; -} - -``` -```typescript -export interface RetryPolicy { - readonly backoffDelta: Duration; - readonly backoffBase: number; - readonly maxTimeout: Duration; -} - -``` -```typescript -/** - * The wallet is currently updating information about an exchange. - */ -export interface PendingExchangeUpdateTask { - type: PendingTaskType.ExchangeUpdate; - exchangeBaseUrl: string; - lastError: TalerErrorDetail | undefined; -} - -``` -```typescript -// Enum value: -// PendingTaskType.ExchangeUpdate = "exchange-update" - -``` -```typescript -/** - * The wallet should check whether coins from this exchange - * need to be auto-refreshed. - */ -export interface PendingExchangeCheckRefreshTask { - type: PendingTaskType.ExchangeCheckRefresh; - exchangeBaseUrl: string; -} - -``` -```typescript -// Enum value: -// PendingTaskType.ExchangeCheckRefresh = "exchange-check-refresh" - -``` -```typescript -/** - * The wallet is signing coins and then sending them to - * the merchant. - */ -export interface PendingPayTask { - type: PendingTaskType.Pay; - proposalId: string; - isReplay: boolean; - retryInfo?: RetryInfo; - lastError: TalerErrorDetail | undefined; -} - -``` -```typescript -// Enum value: -// PendingTaskType.Pay = "pay" - -``` -```typescript -/** - * Status of downloading signed contract terms from a merchant. - */ -export interface PendingProposalDownloadTask { - type: PendingTaskType.ProposalDownload; - merchantBaseUrl: string; - proposalTimestamp: TalerProtocolTimestamp; - proposalId: string; - orderId: string; - lastError?: TalerErrorDetail; - retryInfo?: RetryInfo; -} - -``` -```typescript -// Enum value: -// PendingTaskType.ProposalDownload = "proposal-download" - -``` -```typescript -/** - * Status of an ongoing withdrawal operation. - */ -export interface PendingRefreshTask { - type: PendingTaskType.Refresh; - lastError?: TalerErrorDetail; - refreshGroupId: string; - finishedPerCoin: boolean[]; - retryInfo?: RetryInfo; -} - -``` -```typescript -/** - * The wallet is querying the merchant about whether any refund - * permissions are available for a purchase. - */ -export interface PendingRefundQueryTask { - type: PendingTaskType.RefundQuery; - proposalId: string; - retryInfo?: RetryInfo; - lastError: TalerErrorDetail | undefined; -} - -``` -```typescript -// Enum value: -// PendingTaskType.RefundQuery = "refund-query" - -``` -```typescript -/** - * The wallet is picking up a tip that the user has accepted. - */ -export interface PendingTipPickupTask { - type: PendingTaskType.TipPickup; - tipId: string; - merchantBaseUrl: string; - merchantTipId: string; -} - -``` -```typescript -// Enum value: -// PendingTaskType.TipPickup = "tip-pickup" - -``` -```typescript -/** - * Status of an ongoing withdrawal operation. - */ -export interface PendingWithdrawTask { - type: PendingTaskType.Withdraw; - lastError: TalerErrorDetail | undefined; - retryInfo?: RetryInfo; - withdrawalGroupId: string; -} - -``` -```typescript -// Enum value: -// PendingTaskType.Withdraw = "withdraw" - -``` -```typescript -export interface PendingRecoupTask { - type: PendingTaskType.Recoup; - recoupGroupId: string; - retryInfo?: RetryInfo; - lastError: TalerErrorDetail | undefined; -} - -``` -```typescript -// Enum value: -// PendingTaskType.Recoup = "recoup" - -``` -```typescript -/** - * Status of an ongoing deposit operation. - */ -export interface PendingDepositTask { - type: PendingTaskType.Deposit; - lastError: TalerErrorDetail | undefined; - retryInfo: RetryInfo | undefined; - depositGroupId: string; -} - -``` -```typescript -export interface PendingBackupTask { - type: PendingTaskType.Backup; - backupProviderBaseUrl: string; - lastError: TalerErrorDetail | undefined; -} - -``` -```typescript -// Enum value: -// PendingTaskType.Backup = "backup" - -``` - -(dumpcoinsop)= -### DumpCoinsOp -```typescript -/** - * Dump all coins of the wallet in a simple JSON format. - */ -export type DumpCoinsOp = { - request: {}; - response: CoinDumpJson; -}; - -``` -```typescript -/** - * Easy to process format for the public data of coins - * managed by the wallet. - */ -export interface CoinDumpJson { - coins: Array<{ - /** - * The coin's denomination's public key. - */ - denom_pub: DenominationPubKey; - /** - * Hash of denom_pub. - */ - denom_pub_hash: string; - /** - * Value of the denomination (without any fees). - */ - denom_value: string; - /** - * Public key of the coin. - */ - coin_pub: string; - /** - * Base URL of the exchange for the coin. - */ - exchange_base_url: string; - /** - * Remaining value on the coin, to the knowledge of - * the wallet. - */ - remaining_value: string; - /** - * Public key of the parent coin. - * Only present if this coin was obtained via refreshing. - */ - refresh_parent_coin_pub: string | undefined; - /** - * Public key of the reserve for this coin. - * Only present if this coin was obtained via refreshing. - */ - withdrawal_reserve_pub: string | undefined; - /** - * Is the coin suspended? - * Suspended coins are not considered for payments. - */ - coin_suspended: boolean; - /** - * Information about the age restriction - */ - ageCommitmentProof: AgeCommitmentProof | undefined; - }>; -} - -``` -```typescript -interface Array<T> extends RelativeIndexable<T> {} - -``` - -(setcoinsuspendedop)= -### SetCoinSuspendedOp -```typescript -/** - * Set a coin as (un-)suspended. - * Suspended coins won't be used for payments. - */ -export type SetCoinSuspendedOp = { - request: SetCoinSuspendedRequest; - response: {}; -}; - -``` -```typescript -export interface SetCoinSuspendedRequest { - coinPub: string; - suspended: boolean; -} - -``` - -(forcerefreshop)= -### ForceRefreshOp -```typescript -/** - * Force a refresh on coins where it would not - * be necessary. - */ -export type ForceRefreshOp = { - request: ForceRefreshRequest; - response: {}; -}; - -``` -```typescript -export interface ForceRefreshRequest { - coinPubList: string[]; -} - -``` - -## Common Declarations -```typescript -export interface OrderShortInfo { - /** - * Order ID, uniquely identifies the order within a merchant instance - */ - orderId: string; - /** - * Hash of the contract terms. - */ - contractTermsHash: string; - /** - * More information about the merchant - */ - merchant: MerchantInfo; - /** - * Summary of the order, given by the merchant - */ - summary: string; - /** - * Map from IETF BCP 47 language tags to localized summaries - */ - summary_i18n?: InternationalizedString; - /** - * List of products that are part of the order - */ - products: Product[] | undefined; - /** - * Time indicating when the order should be delivered. - * May be overwritten by individual products. - */ - delivery_date?: TalerProtocolTimestamp; - /** - * Delivery location for (all!) products. - */ - delivery_location?: Location; - /** - * URL of the fulfillment, given by the merchant - */ - fulfillmentUrl?: string; - /** - * Plain text message that should be shown to the user - * when the payment is complete. - */ - fulfillmentMessage?: string; - /** - * Translations of fulfillmentMessage. - */ - fulfillmentMessage_i18n?: InternationalizedString; -} -``` -```typescript -export interface MerchantInfo { - name: string; - jurisdiction?: Location; - address?: Location; - logo?: string; - website?: string; - email?: string; -} -``` -```typescript -export interface Location { - country?: string; - country_subdivision?: string; - district?: string; - town?: string; - town_location?: string; - post_code?: string; - street?: string; - building_name?: string; - building_number?: string; - address_lines?: string[]; -} -``` -```typescript -export interface InternationalizedString { - [lang_tag: string]: string; -} -``` -```typescript -export interface Product { - product_id?: string; - description: string; - description_i18n?: { - [lang_tag: string]: string; - }; - quantity?: number; - unit?: string; - price?: AmountString; - image?: string; - taxes?: Tax[]; - delivery_date?: TalerProtocolTimestamp; -} -``` -```typescript -export interface Tax { - name: string; - tax: AmountString; -} -``` -```typescript -export interface TalerProtocolTimestamp { - readonly t_s: number | "never"; -} -``` -```typescript -// Enum value: -// PendingTaskType.Refresh = "refresh" -``` -```typescript -// Enum value: -// PendingTaskType.Deposit = "deposit" -``` -```typescript -export interface ExchangeListItem { - exchangeBaseUrl: string; - currency: string; - paytoUris: string[]; - tos: ExchangeTos; -} -``` -```typescript -export interface ExchangeTos { - acceptedVersion?: string; - currentVersion?: string; - contentType?: string; - content?: string; -} -``` -```typescript -export interface ForcedDenomSel { - denoms: { - value: AmountString; - count: number; - }[]; -} -``` -```typescript -// Enum value: -// ProviderPaymentType.InsufficientBalance = "insufficient-balance" -``` -```typescript -/** - * Contract terms from a merchant. - */ -export interface ContractTerms { - /** - * Hash of the merchant's wire details. - */ - h_wire: string; - /** - * Hash of the merchant's wire details. - */ - auto_refund?: TalerProtocolDuration; - /** - * Wire method the merchant wants to use. - */ - wire_method: string; - /** - * Human-readable short summary of the contract. - */ - summary: string; - summary_i18n?: InternationalizedString; - /** - * Nonce used to ensure freshness. - */ - nonce: string; - /** - * Total amount payable. - */ - amount: string; - /** - * Auditors accepted by the merchant. - */ - auditors: AuditorHandle[]; - /** - * Deadline to pay for the contract. - */ - pay_deadline: TalerProtocolTimestamp; - /** - * Maximum deposit fee covered by the merchant. - */ - max_fee: string; - /** - * Information about the merchant. - */ - merchant: MerchantInfo; - /** - * Public key of the merchant. - */ - merchant_pub: string; - /** - * Time indicating when the order should be delivered. - * May be overwritten by individual products. - */ - delivery_date?: TalerProtocolTimestamp; - /** - * Delivery location for (all!) products. - */ - delivery_location?: Location; - /** - * List of accepted exchanges. - */ - exchanges: ExchangeHandle[]; - /** - * Products that are sold in this contract. - */ - products?: Product[]; - /** - * Deadline for refunds. - */ - refund_deadline: TalerProtocolTimestamp; - /** - * Deadline for the wire transfer. - */ - wire_transfer_deadline: TalerProtocolTimestamp; - /** - * Time when the contract was generated by the merchant. - */ - timestamp: TalerProtocolTimestamp; - /** - * Order id to uniquely identify the purchase within - * one merchant instance. - */ - order_id: string; - /** - * Base URL of the merchant's backend. - */ - merchant_base_url: string; - /** - * Fulfillment URL to view the product or - * delivery status. - */ - fulfillment_url?: string; - /** - * URL meant to share the shopping cart. - */ - public_reorder_url?: string; - /** - * Plain text fulfillment message in the merchant's default language. - */ - fulfillment_message?: string; - /** - * Internationalized fulfillment messages. - */ - fulfillment_message_i18n?: InternationalizedString; - /** - * Share of the wire fee that must be settled with one payment. - */ - wire_fee_amortization?: number; - /** - * Maximum wire fee that the merchant agrees to pay for. - */ - max_wire_fee?: string; - minimum_age?: number; - /** - * Extra data, interpreted by the mechant only. - */ - extra?: any; -} -``` -```typescript -export interface TalerProtocolDuration { - readonly d_us: number | "forever"; -} -``` -```typescript -export interface AuditorHandle { - /** - * Official name of the auditor. - */ - name: string; - /** - * Master public signing key of the auditor. - */ - auditor_pub: string; - /** - * Base URL of the auditor. - */ - url: string; -} -``` -```typescript -/** - * Information about an exchange as stored inside a - * merchant's contract terms. - */ -export interface ExchangeHandle { - /** - * Master public signing key of the exchange. - */ - master_pub: string; - /** - * Base URL of the exchange. - */ - url: string; -} -``` -```typescript -/** - * Forced coin selection for deposits/payments. - */ -export interface ForcedCoinSel { - coins: { - value: AmountString; - contribution: AmountString; - }[]; -} -``` -```typescript -// Enum value: -// ProviderPaymentType.Pending = "pending" -``` -```typescript -export interface TalerErrorDetail { - code: TalerErrorCode; - hint?: string; - [x: string]: unknown; -} -``` -```typescript -export interface BackupRecovery { - walletRootPriv: string; - providers: { - url: string; - }[]; -} -``` -```typescript -export interface AbsoluteTime { - /** - * Timestamp in milliseconds. - */ - readonly t_ms: number | "never"; -} -``` -```typescript -export interface Duration { - /** - * Duration in milliseconds. - */ - readonly d_ms: number | "forever"; -} -``` diff --git a/wallet/wallet-core.md b/wallet/wallet-core.md @@ -43,6 +43,7 @@ This file is auto-generated from the [taler-typescript-core](https://git.taler.n * [ListAssociatedRefreshesOp](#listassociatedrefreshesop) * [TestingGetSampleTransactionsOp](#testinggetsampletransactionsop) * [GetTransactionByIdOp](#gettransactionbyidop) +* [ResolveTransactionReferenceOp](#resolvetransactionreferenceop) * [DeleteTransactionOp](#deletetransactionop) * [RetryTransactionOp](#retrytransactionop) * [AbortTransactionOp](#aborttransactionop) @@ -57,10 +58,10 @@ This file is auto-generated from the [taler-typescript-core](https://git.taler.n * [AcceptBankIntegratedWithdrawalOp](#acceptbankintegratedwithdrawalop) * [AcceptManualWithdrawalOp](#acceptmanualwithdrawalop) ### Merchant Payments -* [PreparePayForUriOp](#preparepayforuriop) -* [PreparePayForTemplateOp](#preparepayfortemplateop) * [PreparePayForUriV2Op](#preparepayforuriv2op) * [PreparePayForTemplateV2Op](#preparepayfortemplatev2op) +* [PreparePayForPaivanaOp](#preparepayforpaivanaop) +* [GetPaivanaCookieOp](#getpaivanacookieop) * [GetChoicesForPaymentOp](#getchoicesforpaymentop) * [SharePaymentOp](#sharepaymentop) * [CheckPayForTemplateOp](#checkpayfortemplateop) @@ -92,6 +93,7 @@ This file is auto-generated from the [taler-typescript-core](https://git.taler.n * [GetBankAccountByIdOp](#getbankaccountbyidop) * [AddBankAccountsOp](#addbankaccountsop) * [ForgetBankAccountsOp](#forgetbankaccountsop) +* [ConfirmExchangeKeyChangeOp](#confirmexchangekeychangeop) * [SetExchangeTosAcceptedOp](#setexchangetosacceptedop) * [SetExchangeTosForgottenOp](#setexchangetosforgottenop) * [GetExchangeTosOp](#getexchangetosop) @@ -99,6 +101,7 @@ This file is auto-generated from the [taler-typescript-core](https://git.taler.n * [GetDepositWireTypesForCurrencyOp](#getdepositwiretypesforcurrencyop) * [GetExchangeDetailedInfoOp](#getexchangedetailedinfoop) * [GetDefaultExchangesOp](#getdefaultexchangesop) +* [ListWithdrawalExchangeCandidatesOp](#listwithdrawalexchangecandidatesop) * [GetExchangeEntryByUrlOp](#getexchangeentrybyurlop) * [GetExchangeResourcesOp](#getexchangeresourcesop) * [DeleteExchangeOp](#deleteexchangeop) @@ -109,10 +112,6 @@ This file is auto-generated from the [taler-typescript-core](https://git.taler.n ### Backups * [ExportDbToFileOp](#exportdbtofileop) * [ImportDbFromFileOp](#importdbfromfileop) -* [ListStoredBackupsOp](#liststoredbackupsop) -* [CreateStoredBackupsOp](#createstoredbackupsop) -* [RecoverStoredBackupsOp](#recoverstoredbackupsop) -* [DeleteStoredBackupOp](#deletestoredbackupop) ### Peer Payments * [CheckPeerPushDebitOp](#checkpeerpushdebitop) * [CheckPeerPushDebitV2Op](#checkpeerpushdebitv2op) @@ -202,11 +201,18 @@ export type ShutdownOp = { export type HintApplicationResumedOp = { op: WalletApiOperation.HintApplicationResumed; request: EmptyObject; - response: EmptyObject; + response: HintApplicationResumedResponse; }; // HintApplicationResumed = "hintApplicationResumed" ``` +```typescript +export interface HintApplicationResumedResponse { + dbWriteHealthy: boolean; + dbReadHealthy: boolean; +} + +``` ### SetWalletRunConfigOp ```typescript @@ -679,7 +685,7 @@ export type GetBalancesOp = { export interface BalancesResponse { /** Electronic cash balances, per currency scope. */ balances: WalletBalance[]; - /** Does the user have non-demo money? */ + /** Does the user have money from an exchange other than demo or test? */ haveProdBalance: boolean; donauSummary?: DonauSummaryItem[]; } @@ -834,6 +840,10 @@ export interface AmountJson { ### ConvertDepositAmountOp ```typescript +/** + * @deprecated Use {@link CheckDepositOp} for a concrete instructed amount, + * or {@link GetMaxDepositAmountOp} to query deposit limits. + */ export type ConvertDepositAmountOp = { op: WalletApiOperation.ConvertDepositAmount; request: ConvertAmountRequest; @@ -843,6 +853,10 @@ export type ConvertDepositAmountOp = { ``` ```typescript +/** + * @deprecated Use {@link CheckDepositRequest} for a concrete instructed + * amount, or {@link GetMaxDepositAmountRequest} to query deposit limits. + */ export interface ConvertAmountRequest { amount: AmountString; type: TransactionAmountMode; @@ -890,6 +904,9 @@ export interface GetMaxDepositAmountRequest { currency: string; /** * Target bank account to deposit into. + * + * When omitted, wire-method eligibility, account restrictions and wire + * fees cannot be reflected in the response. */ depositPaytoUri?: string; /** @@ -901,19 +918,71 @@ export interface GetMaxDepositAmountRequest { ``` ```typescript export interface GetMaxDepositAmountResponse { + /** Maximum that can be deposited immediately. */ + material: DepositMaximum; + /** Maximum including expected outputs of pending refresh operations. */ + available: DepositMaximum; + /** Eligibility and maximum amounts for every ready same-currency exchange. */ + exchangeDiagnostics: Record<string, DepositExchangeDiagnostics>; +} + +``` +```typescript +/** Maximum amounts and fees for one coherent deposit coin selection. */ +export interface DepositMaximum { + /** Gross target amount passed to CheckDeposit or CreateDepositGroup. */ + instructedAmount: AmountString; + /** + * Total balance effect on the wallet: instructed amount plus fees paid by + * the customer and the cost of refreshing any change. + */ effectiveAmount: AmountString; - rawAmount: AmountString; /** - * Account restrictions that affect the max deposit amount. + * Amount expected to reach the destination account: instructed amount + * minus fees covered by the counterparty. */ - depositRestrictions?: { - [exchangeBaseUrl: string]: { - [paytoUri: string]: AccountRestriction[]; - }; - }; + rawAmount: AmountString; + /** Total fees incurred by this deposit selection. */ + fees: DepositGroupFees; +} + +``` +```typescript +export interface DepositExchangeDiagnostics { + /** Maximum that can be deposited immediately. */ + material: DepositMaximum; + /** Maximum including expected outputs of pending refresh operations. */ + available: DepositMaximum; + /** Eligibility failures, in deterministic evaluation order. */ + reasons: DepositEligibilityReason[]; } ``` +```typescript +/** Reason why a ready, same-currency exchange cannot serve a deposit. */ +export type DepositEligibilityReason = + | { + type: DepositEligibilityReasonType.DirectDepositDisabled; + } + | { + type: DepositEligibilityReasonType.ScopeRestricted; + scopeInfo: ScopeInfo; + } + | { + type: DepositEligibilityReasonType.WireMethodUnsupported; + wireMethod: string; + } + | { + type: DepositEligibilityReasonType.WireFeeUnavailable; + wireMethod: string; + } + | { + type: DepositEligibilityReasonType.DepositAccountRestricted; + wireMethod: string; + accountRestrictions: Record<string, AccountRestriction[]>; + }; + +``` ### GetMaxPeerPushDebitAmountOp ```typescript @@ -1134,6 +1203,30 @@ export interface TransactionByIdRequest { ``` +### ResolveTransactionReferenceOp +```typescript +export type ResolveTransactionReferenceOp = { + op: WalletApiOperation.ResolveTransactionReference; + request: ResolveTransactionReferenceRequest; + response: ResolveTransactionReferenceResponse; +}; +// ResolveTransactionReference = "resolveTransactionReference" + +``` +```typescript +/** Resolve a wallet-local transaction identifier to its stable identifier. */ +export interface ResolveTransactionReferenceRequest { + transactionReference: string; +} + +``` +```typescript +export interface ResolveTransactionReferenceResponse { + transactionId: TransactionIdStr; +} + +``` + ### DeleteTransactionOp ```typescript /** @@ -1302,6 +1395,12 @@ export interface WithdrawalDetailsForAmount { */ scopeInfo: ScopeInfo; /** + * Set when the exchange changed its key set and the user has not confirmed + * the change. Accepting the withdrawal will be refused until they do, so + * this is the point at which to warn them. + */ + unconfirmedKeyChange?: ExchangeKeyChangeInfo; + /** * KYC soft limit. * * Withdrawals over that amount will require KYC. @@ -1492,34 +1591,6 @@ export interface AcceptManualWithdrawalResult { ``` -### PreparePayForUriOp -```typescript -/** - * Prepare to make a payment based on a taler://pay/ URI. - */ -export type PreparePayForUriOp = { - op: WalletApiOperation.PreparePayForUri; - request: PreparePayRequest; - response: PreparePayResult; -}; -// PreparePayForUri = "preparePayForUri" - -``` - -### PreparePayForTemplateOp -```typescript -/** - * Prepare to make a payment based on a taler://pay-template/ URI. - */ -export type PreparePayForTemplateOp = { - op: WalletApiOperation.PreparePayForTemplate; - request: PreparePayTemplateRequest; - response: PreparePayResult; -}; -// PreparePayForTemplate = "preparePayForTemplate" - -``` - ### PreparePayForUriV2Op ```typescript /** @@ -1533,6 +1604,12 @@ export type PreparePayForUriV2Op = { // PreparePayForUriV2 = "preparePayForUriV2" ``` +```typescript +export interface PreparePayRequest { + talerPayUri: string; +} + +``` ### PreparePayForTemplateV2Op ```typescript @@ -1547,6 +1624,73 @@ export type PreparePayForTemplateV2Op = { // PreparePayForTemplateV2 = "preparePayForTemplateV2" ``` +```typescript +export interface PreparePayTemplateRequest { + talerPayTemplateUri: string; + templateParams?: TemplateParams; + progressToken?: string; +} + +``` +```typescript +export type TemplateParams = { + amount?: AmountString; + summary?: string; +}; + +``` + +### PreparePayForPaivanaOp +```typescript +/** Prepare a payment for an HTTP(S) resource protected by Paivana. */ +export type PreparePayForPaivanaOp = { + op: WalletApiOperation.PreparePayForPaivana; + request: PreparePayForPaivanaRequest; + response: PreparePayForPaivanaResult; +}; +// PreparePayForPaivana = "preparePayForPaivana" + +``` +```typescript +export interface PreparePayForPaivanaRequest { + url: string; + progressToken?: string; +} + +``` +```typescript +export interface PreparePayForPaivanaResult { + transactionId: TransactionIdStr; + paivana: PaivanaRedemption; +} + +``` + +### GetPaivanaCookieOp +```typescript +/** Redeem a successfully paid Paivana transaction for an access cookie. */ +export type GetPaivanaCookieOp = { + op: WalletApiOperation.GetPaivanaCookie; + request: GetPaivanaCookieRequest; + response: GetPaivanaCookieResult; +}; +// GetPaivanaCookie = "getPaivanaCookie" + +``` +```typescript +export interface GetPaivanaCookieRequest { + transactionId: TransactionIdStr; + paivana: PaivanaRedemption; +} + +``` +```typescript +export interface GetPaivanaCookieResult { + /** Plain Cookie request-header value, without Set-Cookie attributes. */ + cookie: string; +} + +``` ### GetChoicesForPaymentOp ```typescript @@ -1908,7 +2052,7 @@ export interface TemplateContractDetailsDefaults { ```typescript /** * Confirm a payment that was previously prepared with - * {@link PreparePayForUriOp} + * {@link PreparePayForUriV2Op} */ export type ConfirmPayOp = { op: WalletApiOperation.ConfirmPay; @@ -2240,6 +2384,7 @@ export type CompleteExchangeBaseUrlOp = { ```typescript export interface CompleteBaseUrlRequest { url: string; + progressToken?: string; } ``` @@ -2262,6 +2407,13 @@ export type CompleteBaseUrlResult = status: "bad-syntax" | "bad-network" | "bad-exchange"; /** Error details in case status is not "ok" */ error: TalerErrorDetail; + /** + * Base URLs of exchanges known to the wallet whose host looks like what + * the user meant to type, most likely first. + * + * Absent when the wallet does not know anything similar. + */ + suggestions?: string[]; }; ``` @@ -2593,6 +2745,40 @@ export interface ForgetBankAccountRequest { ``` +### ConfirmExchangeKeyChangeOp +```typescript +/** + * Confirm that the exchange's changed key set is legitimate. + * + * The wallet has already adopted it; this releases the operations that send + * money to the exchange, which are withheld until the user has had a chance + * to notice that the key changed. + */ +export type ConfirmExchangeKeyChangeOp = { + op: WalletApiOperation.ConfirmExchangeKeyChange; + request: ConfirmExchangeKeyChangeRequest; + response: EmptyObject; + errors: + | TalerErrorCode.WALLET_EXCHANGE_NO_KEY_CHANGE_PENDING + | TalerErrorCode.WALLET_EXCHANGE_KEY_CHANGE_MISMATCH; +}; +// ConfirmExchangeKeyChange = "confirmExchangeKeyChange" + +``` +```typescript +export interface ConfirmExchangeKeyChangeRequest { + exchangeBaseUrl: string; + /** + * Master public key the exchange now uses. + * + * Required, so that a UI showing a stale key change cannot confirm a + * different one than the user was looking at. + */ + currentMasterPub: string; +} + +``` + ### SetExchangeTosAcceptedOp ```typescript /** @@ -2808,6 +2994,10 @@ export interface ExchangeAuditor { */ auditor_url: string; /** + * Human-readable name of the auditor. + */ + auditor_name: string; + /** * List of signatures for denominations by the auditor. */ denomination_keys: AuditorDenomSig[]; @@ -2907,18 +3097,19 @@ export interface FeeDescription { ### GetDefaultExchangesOp ```typescript -/** - * Get the current terms of a service of an exchange. - */ +/** @deprecated Use {@link ListWithdrawalExchangeCandidatesOp} instead. */ export type GetDefaultExchangesOp = { op: WalletApiOperation.GetDefaultExchanges; - request: EmptyObject; + request: GetDefaultExchangesRequest; response: GetDefaultExchangesResponse; }; // GetDefaultExchanges = "getDefaultExchanges" ``` ```typescript +/** + * @deprecated Use {@link ListWithdrawalExchangeCandidatesResponse} instead. + */ export interface GetDefaultExchangesResponse { defaultExchanges: { /** @@ -2940,6 +3131,47 @@ export interface GetDefaultExchangesResponse { ``` +### ListWithdrawalExchangeCandidatesOp +```typescript +export type ListWithdrawalExchangeCandidatesOp = { + op: WalletApiOperation.ListWithdrawalExchangeCandidates; + request: ListWithdrawalExchangeCandidatesRequest; + response: ListWithdrawalExchangeCandidatesResponse; +}; +// ListWithdrawalExchangeCandidates = "listWithdrawalExchangeCandidates" + +``` +```typescript +export interface ListWithdrawalExchangeCandidatesResponse { + candidates: WithdrawalExchangeCandidate[]; +} + +``` +```typescript +export interface WithdrawalExchangeCandidate { + /** A taler://withdraw-exchange URI for the exchange. */ + talerUri: string; + exchangeBaseUrl: string; + currency: string; + currencySpec: CurrencySpecification; + exchangeEntryStatus: ExchangeEntryStatus; + exchangeUpdateStatus: ExchangeUpdateStatus; + source: ExchangeEntrySource; + recommendationReasons: ExchangeRecommendationReason[]; + lastWithdrawal?: TalerPreciseTimestamp; +} + +``` +```typescript +export declare enum ExchangeRecommendationReason { + Preset = "preset", + UserAdded = "user-added", + PreviousWithdrawal = "previous-withdrawal", + PreviouslyUsed = "previously-used", +} + +``` + ### GetExchangeEntryByUrlOp ```typescript /** @@ -2989,14 +3221,14 @@ export interface GetExchangeResourcesResponse { ### DeleteExchangeOp ```typescript /** - * Get resources associated with an exchange. + * Delete an exchange and its associated resources. */ export type DeleteExchangeOp = { - op: WalletApiOperation.GetExchangeResources; + op: WalletApiOperation.DeleteExchange; request: DeleteExchangeRequest; response: EmptyObject; }; -// GetExchangeResources = "getExchangeResources" +// DeleteExchange = "deleteExchange" ``` ```typescript @@ -3053,7 +3285,7 @@ export type CreateDepositGroupOp = { export interface CreateDepositGroupRequest { depositPaytoUri: string; /** - * Amount to deposit (effective amount). + * Instructed amount used for deposit coin selection. */ amount: AmountString; /** @@ -3120,9 +3352,10 @@ export interface CheckDepositRequest { */ depositPaytoUri: string; /** - * Amount that should be deposited. + * Instructed amount used for deposit coin selection. * - * Raw amount, fees will be added on top. + * CheckDepositResponse reports the resulting wallet cost and destination + * amount, which can differ because of fees and refresh change. */ amount: AmountString; /** @@ -3147,14 +3380,6 @@ export interface CheckDepositResponse { } ``` -```typescript -export interface DepositGroupFees { - coin: AmountString; - wire: AmountString; - refresh: AmountString; -} - -``` ### ExportDbToFileOp ```typescript @@ -3229,76 +3454,6 @@ export interface ImportDbFromFileRequest { ``` -### ListStoredBackupsOp -```typescript -export type ListStoredBackupsOp = { - op: WalletApiOperation.ListStoredBackups; - request: EmptyObject; - response: StoredBackupList; -}; -// ListStoredBackups = "listStoredBackups" - -``` -```typescript -export interface StoredBackupList { - storedBackups: { - name: string; - }[]; -} - -``` - -### CreateStoredBackupsOp -```typescript -export type CreateStoredBackupsOp = { - op: WalletApiOperation.CreateStoredBackup; - request: EmptyObject; - response: CreateStoredBackupResponse; -}; -// CreateStoredBackup = "createStoredBackup" - -``` -```typescript -export interface CreateStoredBackupResponse { - name: string; -} - -``` - -### RecoverStoredBackupsOp -```typescript -export type RecoverStoredBackupsOp = { - op: WalletApiOperation.RecoverStoredBackup; - request: RecoverStoredBackupRequest; - response: EmptyObject; -}; -// RecoverStoredBackup = "recoverStoredBackup" - -``` -```typescript -export interface RecoverStoredBackupRequest { - name: string; -} - -``` - -### DeleteStoredBackupOp -```typescript -export type DeleteStoredBackupOp = { - op: WalletApiOperation.DeleteStoredBackup; - request: DeleteStoredBackupRequest; - response: EmptyObject; -}; -// DeleteStoredBackup = "deleteStoredBackup" - -``` -```typescript -export interface DeleteStoredBackupRequest { - name: string; -} - -``` - ### CheckPeerPushDebitOp ```typescript /** @@ -3363,6 +3518,8 @@ export interface InitiatePeerPushDebitRequest { * scope info. */ restrictScope?: ScopeInfo; + /** Quote returned by checkPeerPushDebitV2. */ + peerPushDebitQuote?: string; partialContractTerms: PartialPeerContractTerms; } @@ -3491,6 +3648,10 @@ export interface CheckPeerPullCreditResponse { amountRaw: AmountString; amountEffective: AmountString; /** + * Wallet-selected default expiration for the request. + */ + defaultExpiration: TalerProtocolDuration; + /** * Number of coins that will be used, * can be used by the UI to warn if excessively large. */ @@ -4511,7 +4672,7 @@ export interface TestingWaitBalanceRequest { export type TestingWaitTransactionStateOp = { op: WalletApiOperation.TestingWaitTransactionState; request: TestingWaitTransactionRequest; - response: EmptyObject; + response: TestingWaitTransactionStateResponse; }; // TestingWaitTransactionState = "testingWaitTransactionState" @@ -4536,28 +4697,82 @@ export interface TestingWaitTransactionRequest { * is reached with an error. */ requireError?: boolean; - txState: - | TransactionStatePattern - | TransactionStatePattern[] - | number - | "nonpending"; + txState: TestingWaitTxStateSpec; + /** + * States that end the wait even though they are not the + * state that was waited for. The response says which of the + * two sets matched. + * + * Without this, a transaction that ends up in a state it will + * never leave keeps the caller waiting until the timeout. + */ + bailStates?: TransactionStatePattern[]; + /** + * End the wait as soon as an error is recorded for the transaction. + * + * Beware that this includes transient errors of retried operations, + * which are cleared again once the operation succeeds. + */ + bailOnError?: boolean; } ``` ```typescript +/** + * State(s) to wait for. + * + * A plain pattern or a list of patterns (matching any of them), + * a wallet-internal numeric state ID, or one of the shorthands + * for a category of states. + */ +export type TestingWaitTxStateSpec = + | TransactionStatePattern + | TransactionStatePattern[] + | number + | "nonpending" + | "final"; + +``` +```typescript export interface TransactionStatePattern { major: TransactionMajorState | TransactionStateWildcard; minor?: TransactionMinorState | TransactionStateWildcard; + /** + * Required value of the "working" flag of the transaction state. + * A transaction state without the flag counts as false. + * + * If left undefined, the flag is not taken into account + * when matching, i.e. it behaves like a wildcard. + */ + working?: boolean | TransactionStateWildcard; } ``` - -### TestingWaitExchangeStateOp ```typescript -/** - * Wait until an exchange entry is in a particular state. - */ -export type TestingWaitExchangeStateOp = { +export interface TestingWaitTransactionStateResponse { + /** + * Which set of states ended the wait: the requested state + * or one of the bail states. + */ + matched: "target" | "bail"; + /** + * State that ended the wait. + */ + txState: TransactionState; + /** + * Wallet-internal state ID, only used for debugging and testing. + */ + stId: number; +} + +``` + +### TestingWaitExchangeStateOp +```typescript +/** + * Wait until an exchange entry is in a particular state. + */ +export type TestingWaitExchangeStateOp = { op: WalletApiOperation.TestingWaitExchangeState; request: TestingWaitExchangeStateRequest; response: EmptyObject; @@ -4850,12 +5065,33 @@ export interface WalletRunConfig { preventThrottling: boolean; skipDefaults: boolean; emitObservabilityEvents?: boolean; + /** + * Coin selection algorithm to use when spending. + * + * Defaults to the TALER_WALLET_COINSEL environment variable, and to + * "default" when that is unset. + */ + coinSelectionAlgorithm: CoinSelectionAlgorithm; }; /** * Configurations values that may be safe to show to the user */ features: { allowHttp: boolean; + /** + * Migrate the wallet database to wallet-core's native sqlite schema, + * replacing the IndexedDB emulation it has been stored in so far. + * + * Checked whenever the wallet is initialized, so a client that offers + * this as a setting only has to initialize the wallet again for it to + * take effect. Off by default: the native schema is still experimental. + * + * The migration happens once and is not undone by clearing the flag -- + * afterwards the database *is* a native one. It also only ever runs + * where the host stores the wallet in a sqlite file, which excludes the + * browser extension. + */ + migrateNativeDb: boolean; }; /** * Start processing tasks only when explicitly required, even after @@ -4873,8 +5109,22 @@ export interface WalletRunConfig { } ``` ```typescript +/** + * Coin selection algorithm the wallet uses when spending. + * + * "legacy-2024" is the algorithm the wallet shipped with in 2024: strictly + * largest-coin-first, without the exact-fit shortcut and the deposit-fee + * allowance correction that were added later. It is kept reachable because + * test suites outside this repository (in particular the exchange's auditor + * tests) pin the coin selections it produces. + */ +export type CoinSelectionAlgorithm = "default" | "legacy-2024"; +``` +```typescript export interface InitResponse { versionInfo: WalletCoreVersion; + /** Database backend used by the initialized wallet. */ + databaseBackend: WalletDatabaseBackend; } ``` ```typescript @@ -4906,6 +5156,9 @@ export interface WalletCoreVersion { } ``` ```typescript +export type WalletDatabaseBackend = "indexeddb" | "sqlite"; +``` +```typescript export type EmptyObject = Record<string, never>; ``` ```typescript @@ -5001,7 +5254,12 @@ export interface TalerPayUriResult { type: TalerUriAction.Pay; merchantBaseUrl: HostPortPath; orderId: string; - sessionId: string; + /** + * Session the payment is bound to. Undefined if the payment is not + * bound to any session, which the URI encodes as an empty last path + * component. + */ + sessionId?: string; claimToken?: string; /** * Nonce priv, only present in the @@ -5119,7 +5377,11 @@ export interface MailboxBaseUrl { } ``` ```typescript -export type ScopeInfo = ScopeInfoGlobal | ScopeInfoExchange | ScopeInfoAuditor; +export type ScopeInfo = + | ScopeInfoGlobal + | ScopeInfoExchange + | ScopeInfoAuditor + | ScopeInfoExchangeLegacyKeys; ``` ```typescript export type ScopeInfoGlobal = { @@ -5150,6 +5412,22 @@ export type ScopeInfoAuditor = { }; ``` ```typescript +export type ScopeInfoExchangeLegacyKeys = { + type: ScopeType.ExchangeLegacyKeys; + currency: string; + url: string; + /** The superseded key the funds were issued under. */ + masterPub: string; +}; +``` +```typescript +export interface DepositGroupFees { + coin: AmountString; + wire: AmountString; + refresh: AmountString; +} +``` +```typescript export type AccountRestriction = | RegexAccountRestriction | DenyAllAccountRestriction; @@ -5216,6 +5494,15 @@ export interface TransactionWithdrawal extends TransactionCommon { ```typescript export interface TransactionCommon { transactionId: TransactionIdStr; + /** + * Short identifier assigned by this wallet for local, human-facing use. + * + * It has the form `#${type}:${localIdent}`. It is intentionally not + * portable: importing or merging a wallet can assign different local + * identifiers. Clients must use transactionId when they need a stable ID. + * Undefined when the active wallet backend does not support local IDs. + */ + localTransactionId?: string; type: TransactionType; timestamp: TalerPreciseTimestamp; /** @@ -5352,9 +5639,15 @@ export declare enum TransactionMinorState { CreatePurse = "create-purse", DeletePurse = "delete-purse", Deposit = "deposit", + DepositAbortPartial = "deposit-abort-partial", + DepositAbortRecovered = "deposit-abort-recovered", + DepositAbortRecoveryFailed = "deposit-abort-recovery-failed", + DepositAbortRefundFailed = "deposit-abort-refund-failed", + DepositAbortTooLate = "deposit-abort-too-late", Exchange = "exchange", ExchangeWaitReserve = "exchange-wait-reserve", KycAuthRequired = "kyc-auth", + KycHardLimit = "kyc-hard-limit", KycInit = "kyc-init", KycRequired = "kyc", Merge = "merge", @@ -5409,6 +5702,32 @@ export interface Duration { } ``` ```typescript +export type DurationLike = TalerProtocolDuration | Duration; +``` +```typescript +export type TimestampLike = + | AbsoluteTime + | { + t_ms: number | "never"; + } + | TalerProtocolTimestamp + | TalerPreciseTimestamp + | Date + | number + | string + | Record<string, unknown>; +``` +```typescript +export interface FormatDateOptions { + dateFormat?: DateFormatPattern; + includeTime?: boolean; + includeSeconds?: boolean; +} +``` +```typescript +export type DateFormatPattern = "ymd" | "dmy" | "mdy"; +``` +```typescript export interface KycAuthTransferInfo { /** * Payto URI of the account that must make the transfer. @@ -5418,17 +5737,28 @@ export interface KycAuthTransferInfo { */ debitPaytoUri: string; /** - * Account public key that must be included in the subject. + * Account public key. + * + * Included in the transfer subject for some of the transfer options. */ accountPub: string; /** + * Options for making the KYC auth transfer, grouped by exchange credit + * account in the same format used for withdrawals. + */ + transferOptionsExt: WithdrawalExchangeAccountDetails[]; + /** * Options for making the KYC auth transfer payment * to the exchange. + * + * @deprecated Use transferOptionsExt instead. */ transferOptions: TransferOption[]; /** * Validity of the transferOptions or undefined * if transferOptions does not expire. + * + * @deprecated Use the per-account expiry in transferOptionsExt instead. */ transferExpiry: TalerProtocolTimestamp | undefined; /** @@ -5450,6 +5780,81 @@ export interface KycAuthTransferInfo { } ``` ```typescript +export interface WithdrawalExchangeAccountDetails { + /** + * Payto URI to of the exchange. + * + * Depending on whether the (manual!) withdrawal is accepted or just + * being checked, this already includes the subject with the + * reserve public key. + * + * Wallet UIs should never show instructions to send money to the exchange's payto + */ + paytoUri: string; + /** + * Status that indicates whether the account can be used + * by the user to send funds for a withdrawal. + * + * ok: account should be shown to the user + * error: account should not be shown to the user, UIs might render the error (in conversionError), + * especially in dev mode. + */ + status: "ok" | "error"; + /** + * Transfer amount. Might be in a different currency than the requested + * amount for withdrawal. + * + * Absent if this is a conversion account and the conversion failed. + */ + transferAmount?: AmountString; + /** + * Currency specification for the external currency. + * + * Only included if this account requires a currency conversion. + */ + currencySpecification?: CurrencySpecification; + /** + * Further restrictions for sending money to the + * exchange. + */ + creditRestrictions?: AccountRestriction[]; + /** + * Label given to the account or the account's bank by the exchange. + */ + bankLabel?: string; + priority?: number; + /** + * Error that happened when attempting to request the conversion rate. + */ + conversionError?: TalerErrorDetail; + /** + * Timestamp that indicates when the transfer options expire. + * + * If missing, options do not expire. + */ + transferExpiry?: TalerProtocolTimestamp; + /** + * Options for transfering funds to the exchange for the withdrawal. + */ + transferOptions: TransferOption[]; +} +``` +```typescript +/** + * DD51 https://docs.taler.net/design-documents/051-fractional-digits.html + */ +export interface CurrencySpecification { + name: string; + num_fractional_input_digits: Integer; + num_fractional_normal_digits: Integer; + num_fractional_trailing_zero_digits: Integer; + alt_unit_names: { + [log10: string]: string; + }; + common_amounts?: AmountString[]; +} +``` +```typescript export type TransferOption = | TransferOptionPayto | TransferOptionUri @@ -5527,81 +5932,6 @@ interface WithdrawalDetailsForManualTransfer { } ``` ```typescript -export interface WithdrawalExchangeAccountDetails { - /** - * Payto URI to of the exchange. - * - * Depending on whether the (manual!) withdrawal is accepted or just - * being checked, this already includes the subject with the - * reserve public key. - * - * Wallet UIs should never show instructions to send money to the exchange's payto - */ - paytoUri: string; - /** - * Status that indicates whether the account can be used - * by the user to send funds for a withdrawal. - * - * ok: account should be shown to the user - * error: account should not be shown to the user, UIs might render the error (in conversionError), - * especially in dev mode. - */ - status: "ok" | "error"; - /** - * Transfer amount. Might be in a different currency than the requested - * amount for withdrawal. - * - * Absent if this is a conversion account and the conversion failed. - */ - transferAmount?: AmountString; - /** - * Currency specification for the external currency. - * - * Only included if this account requires a currency conversion. - */ - currencySpecification?: CurrencySpecification; - /** - * Further restrictions for sending money to the - * exchange. - */ - creditRestrictions?: AccountRestriction[]; - /** - * Label given to the account or the account's bank by the exchange. - */ - bankLabel?: string; - priority?: number; - /** - * Error that happened when attempting to request the conversion rate. - */ - conversionError?: TalerErrorDetail; - /** - * Timestamp that indicates when the transfer options expire. - * - * If missing, options do not expire. - */ - transferExpiry?: TalerProtocolTimestamp; - /** - * Options for transfering funds to the exchange for the withdrawal. - */ - transferOptions: TransferOption[]; -} -``` -```typescript -/** - * DD51 https://docs.taler.net/design-documents/051-fractional-digits.html - */ -export interface CurrencySpecification { - name: string; - num_fractional_input_digits: Integer; - num_fractional_normal_digits: Integer; - num_fractional_trailing_zero_digits: Integer; - alt_unit_names: { - [log10: string]: string; - }; - common_amounts?: AmountString[]; -} -``` -```typescript interface WithdrawalDetailsForTalerBankIntegrationApi { type: WithdrawalType.TalerBankIntegrationApi; /** @@ -5810,8 +6140,11 @@ export interface ProductSold { [lang_tag: string]: string; }; quantity?: Integer; + unit_quantity?: DecimalQuantity; unit?: string; price?: AmountString; + prices?: AmountString[]; + prices_are_net?: boolean; image?: ImageDataUrl; taxes?: Tax[]; delivery_date?: Timestamp; @@ -6195,6 +6528,12 @@ export declare enum DenomLossEventType { DenomExpired = "denom-expired", DenomVanished = "denom-vanished", DenomUnoffered = "denom-unoffered", + /** + * The exchange revoked the denomination. A revoked denomination also stops + * being offered, so this must be checked before DenomUnoffered to say what + * actually happened. + */ + DenomRevoked = "denom-revoked", } ``` ```typescript @@ -6203,6 +6542,38 @@ export interface AbortTransactionRequest { } ``` ```typescript +/** + * Info about an exchange entry in the wallet. + */ +/** + * An exchange that changed its key set, pending the user's confirmation. + * + * The wallet has already adopted the new key set, so the entry works and the + * older coins stay spendable. What is withheld until this is confirmed is + * withdrawing: the bank details a withdrawal pays into are signed by the + * master key, so adopting a new one silently would let a URL that changed + * hands redirect the next transfer. + */ +export interface ExchangeKeyChangeInfo { + /** Master public key the exchange now uses, and the wallet now trusts. */ + currentMasterPub: string; + currentCurrency: string; + /** Master public key the wallet's older funds were issued under. */ + supersededMasterPub: string; + supersededCurrency: string; + /** + * Whether the new key set still advertises denominations the wallet holds + * coins of. + * + * False means the exchange does not offer to settle the older coins at all. + * True is the exchange's claim that it does, not proof of continuity: + * denomination public keys are public and anyone can re-publish them. + */ + sharesDenominations: boolean; + firstSeen: TalerPreciseTimestamp; +} +``` +```typescript export interface WithdrawUriInfoResponse { operationId: string; status: WithdrawalOperationStatusFlag; @@ -6232,12 +6603,15 @@ export type WithdrawalOperationStatusFlag = | "confirmed"; ``` ```typescript -/** - * Info about an exchange entry in the wallet. - */ export interface ExchangeListItem { exchangeBaseUrl: string; + source?: ExchangeEntrySource; masterPub: string | undefined; + /** + * Set when the exchange changed its key set and the user has not confirmed + * the change yet. Withdrawals are refused while this is present. + */ + unconfirmedKeyChange?: ExchangeKeyChangeInfo; currency: string; paytoUris: string[]; tosStatus: ExchangeTosStatus; @@ -6267,6 +6641,8 @@ export interface ExchangeListItem { */ bankComplianceLanguage?: string; lastUpdateTimestamp: TalerPreciseTimestamp | undefined; + /** Most recent successful withdrawal through this exchange. */ + lastWithdrawal?: TalerPreciseTimestamp; /** * Information about the last error that occurred when trying * to update the exchange info. @@ -6280,6 +6656,15 @@ export interface ExchangeListItem { } ``` ```typescript +/** How an exchange entry became known to the wallet. */ +export declare enum ExchangeEntrySource { + Builtin = "builtin", + User = "user", + Discovered = "discovered", + Unknown = "unknown", +} +``` +```typescript export declare enum ExchangeTosStatus { Pending = "pending", Proposed = "proposed", @@ -6332,42 +6717,53 @@ export interface ForcedDenomSel { } ``` ```typescript -export interface PreparePayRequest { - talerPayUri: string; +export interface PreparePayV2Result { + transactionId: TransactionIdStr; } ``` ```typescript -/** - * Result of a prepare pay operation. - */ -export type PreparePayResult = - | PreparePayResultInsufficientBalance - | PreparePayResultAlreadyConfirmed - | PreparePayResultPaymentPossible - | PreparePayResultChoiceSelection; +/** Information needed to redeem a paid Paivana order for an access cookie. */ +export interface PaivanaRedemption { + /** Canonical HTTP(S) URL of the protected resource. */ + url: string; + /** Crockford-base32 encoded 16-byte client nonce. */ + nonce: string; + /** End of the access period used to derive the Paivana session ID. */ + expiration: TalerProtocolTimestamp; +} ``` ```typescript -export interface PreparePayResultInsufficientBalance { - status: PreparePayResultType.InsufficientBalance; - transactionId: TransactionIdStr; - /** - * Scopes involved in this transaction. - * - * For the insufficient balance response, contains scopes - * of *possible* payment providers. - */ - scopes: ScopeInfo[]; - contractTerms: MerchantContractTermsV0; - amountRaw: AmountString; - talerUri: string; - balanceDetails: PaymentInsufficientBalanceDetails; +/** + * Forced coin selection for deposits/payments. + */ +export interface ForcedCoinSel { + coins: { + value: AmountString; + contribution: AmountString; + }[]; } ``` ```typescript /** * Detailed reason for why the wallet's balance is insufficient. + * + * Current wallet-core versions emit all structured fields. The legacy-only + * alternative lets clients continue decoding responses from older cores + * without allowing partially populated structured diagnostics. */ -export interface PaymentInsufficientBalanceDetails { +export type PaymentInsufficientBalanceDetails = + PaymentInsufficientBalanceCompatibilityDetails & + ( + | PaymentInsufficientBalanceStructuredDetails + | PaymentInsufficientBalanceLegacyOnly + ); +``` +```typescript +/** + * Request context and compatibility fields shared by old and current + * insufficient-balance responses. + */ +interface PaymentInsufficientBalanceCompatibilityDetails { /** * Amount requested by the merchant. */ @@ -6383,78 +6779,183 @@ export interface PaymentInsufficientBalanceDetails { * If this hint is not provided, the balance hints of * the individual exchanges should be shown, as the overall * reason might be a combination of the reasons for different exchanges. + * + * Compatibility-only and planned for removal after consumers migrate. + * + * @deprecated (2026-08-19) Use reasons. */ causeHint?: InsufficientBalanceHint; /** * Balance of type "available" (see balance.ts for definition). + * + * Compatibility-only and planned for removal after consumers migrate. + * + * @deprecated (2026-08-19) Use balance.available. */ balanceAvailable: AmountString; /** * Balance of type "material" (see balance.ts for definition). + * + * Compatibility-only and planned for removal after consumers migrate. + * + * @deprecated (2026-08-19) Use balance.material. */ balanceMaterial: AmountString; /** * Balance of type "age-acceptable" (see balance.ts for definition). + * + * Compatibility-only and planned for removal after consumers migrate. + * + * @deprecated (2026-08-19) Use reasons and exchanges. */ balanceAgeAcceptable: AmountString; /** * Balance of type "receiver-acceptable" (see balance.ts for definition). * - * @deprecated (2025-12-05) use balanceReceiver[...]Acceptable instead. + * Compatibility-only and planned for removal after consumers migrate. + * + * @deprecated (2025-12-05) Use reasons and exchanges. */ balanceReceiverAcceptable: AmountString; /** * Balance of type "receiver-exchange-url-acceptable" (see balance.ts for definition). + * + * Compatibility-only and planned for removal after consumers migrate. + * + * @deprecated (2026-08-19) Use reasons and exchanges. */ balanceReceiverExchangeUrlAcceptable: AmountString; /** * Balance of type "receiver-exchange-pub-acceptable" (see balance.ts for definition). + * + * Compatibility-only and planned for removal after consumers migrate. + * + * @deprecated (2026-08-19) Use reasons and exchanges. */ balanceReceiverExchangePubAcceptable: AmountString; /** * Balance of type "receiver-auditor-url-acceptable" (see balance.ts for definition). + * + * Compatibility-only and planned for removal after consumers migrate. + * + * @deprecated (2026-08-19) Use reasons and exchanges. */ balanceReceiverAuditorUrlAcceptable: AmountString; /** * Balance of type "merchant-depositable" (see balance.ts for definition). + * + * Compatibility-only and planned for removal after consumers migrate. + * + * @deprecated (2026-08-19) Use maximumPayableAmount and reasons. */ balanceReceiverDepositable: AmountString; + /** + * Compatibility-only and planned for removal after consumers migrate. + * + * @deprecated (2026-08-19) Use maximumPayableAmount and reasons. + */ balanceExchangeDepositable: AmountString; /** * Maximum effective amount that the wallet can spend, * when all fees are paid by the wallet. + * + * Compatibility-only and planned for removal after consumers migrate. + * + * @deprecated (2026-08-19) Use maximumPayableAmount. */ maxEffectiveSpendAmount: AmountString; + /** + * Compatibility-only and planned for removal after consumers migrate. + * + * @deprecated (2026-08-19) Use exchanges. + */ perExchange: { [url: string]: { + /** + * Compatibility-only and planned for removal after consumers migrate. + * + * @deprecated (2026-08-19) Use exchanges[url].balance.available. + */ balanceAvailable: AmountString; + /** + * Compatibility-only and planned for removal after consumers migrate. + * + * @deprecated (2026-08-19) Use exchanges[url].balance.material. + */ balanceMaterial: AmountString; + /** + * Compatibility-only and planned for removal after consumers migrate. + * + * @deprecated (2026-08-19) Use exchanges[url].maximumPayableAmount and reasons. + */ balanceExchangeDepositable: AmountString; + /** + * Compatibility-only and planned for removal after consumers migrate. + * + * @deprecated (2026-08-19) Use exchanges[url].reasons. + */ balanceAgeAcceptable: AmountString; /** - * @deprecated (2025-12-05) use balanceReceiver[...]Acceptable instead. + * Compatibility-only and planned for removal after consumers migrate. + * + * @deprecated (2025-12-05) Use exchanges[url].reasons. */ balanceReceiverAcceptable: AmountString; + /** + * Compatibility-only and planned for removal after consumers migrate. + * + * @deprecated (2026-08-19) Use exchanges[url].reasons. + */ balanceReceiverExchangeUrlAcceptable: AmountString; + /** + * Compatibility-only and planned for removal after consumers migrate. + * + * @deprecated (2026-08-19) Use exchanges[url].reasons. + */ balanceReceiverExchangePubAcceptable: AmountString; + /** + * Compatibility-only and planned for removal after consumers migrate. + * + * @deprecated (2026-08-19) Use exchanges[url].reasons. + */ balanceReceiverAuditorUrlAcceptable: AmountString; + /** + * Compatibility-only and planned for removal after consumers migrate. + * + * @deprecated (2026-08-19) Use exchanges[url].maximumPayableAmount and reasons. + */ balanceReceiverDepositable: AmountString; + /** + * Compatibility-only and planned for removal after consumers migrate. + * + * @deprecated (2026-08-19) Use exchanges[url].maximumPayableAmount. + */ maxEffectiveSpendAmount: AmountString; /** * The exchange master public key configured by the merchant * backend differs from the one of the coins stored in the wallet. + * + * Compatibility-only and planned for removal after consumers migrate. + * + * @deprecated (2026-08-19) Use the receiver-exchange-master-pub-mismatch reason. */ exchangeMasterPubMismatch: boolean; /** * Exchange doesn't have global fees configured for the relevant year, * p2p payments aren't possible. * - * @deprecated (2025-02-18) use causeHint instead + * Compatibility-only and planned for removal after consumers migrate. + * + * @deprecated (2025-02-18) Use the exchange-global-fees-unavailable reason. */ missingGlobalFees: boolean; /** * Hint that UIs should show to explain the insufficient * balance. + * + * Compatibility-only and planned for removal after consumers migrate. + * + * @deprecated (2026-08-19) Use exchanges[url].reasons. */ causeHint?: InsufficientBalanceHint | undefined; }; @@ -6503,87 +7004,114 @@ export declare enum InsufficientBalanceHint { } ``` ```typescript -export interface PreparePayResultAlreadyConfirmed { - status: PreparePayResultType.AlreadyConfirmed; - transactionId: TransactionIdStr; - contractTerms: MerchantContractTerms; - paid: boolean; - amountRaw: AmountString; - amountEffective?: AmountString | undefined; +/** Structured explanation emitted by current wallet-core versions. */ +export interface PaymentInsufficientBalanceStructuredDetails { + /** Balance in the requested sender scope before payment restrictions. */ + balance: CoinSelectionBalanceSnapshot; /** - * Scopes involved in this transaction. + * Maximum contribution attainable under the failed request's actual + * restrictions and fee policy. For peer payments this is the maximum at + * one exchange, since peer payments cannot combine exchanges. */ - scopes: ScopeInfo[]; - contractTermsHash: string; - talerUri: string; + maximumPayableAmount: AmountString; + /** Operation-wide reasons, in deterministic evaluation order. */ + reasons: CoinSelectionFailureReason[]; + /** Detailed analysis for every same-currency exchange known to the wallet. */ + exchanges: Record<string, CoinSelectionExchangeFailureDiagnostics>; } ``` ```typescript /** - * Payment is possible. + * Balance amounts before age, receiver, wire and fee restrictions. * - * This response is only returned for v0 contracts - * or when v1 are not enabled yet. - */ -export interface PreparePayResultPaymentPossible { - status: PreparePayResultType.PaymentPossible; - transactionId: TransactionIdStr; - contractTerms: MerchantContractTermsV0; - /** - * Scopes involved in this transaction. - */ - scopes: ScopeInfo[]; - amountRaw: AmountString; - amountEffective: AmountString; - /** - * FIXME: Unclear why this is needed. Remove? - */ - contractTermsHash: string; - /** - * FIXME: Unclear why this is needed! Remove? - */ - talerUri: string; -} -``` -```typescript -/** - * Unconfirmed contract v1 payment. - */ -export interface PreparePayResultChoiceSelection { - status: PreparePayResultType.ChoiceSelection; - transactionId: TransactionIdStr; - contractTerms: MerchantContractTerms; - contractTermsHash: string; - talerUri: string; -} -``` -```typescript -export interface PreparePayTemplateRequest { - talerPayTemplateUri: string; - templateParams?: TemplateParams; - progressToken?: string; + * The terminology follows balance.ts: pending withdrawals and peer credits + * are pending incoming balance and are not included here. Only effective + * outputs expected from unfinished refreshes bridge material to available. + */ +export interface CoinSelectionBalanceSnapshot { + /** Balance that the wallet believes it can spend immediately. */ + material: AmountString; + /** Expected effective output of unfinished refresh operations. */ + pendingRefresh: AmountString; + /** Material balance plus pending refresh output. */ + available: AmountString; } ``` ```typescript -export type TemplateParams = { - amount?: AmountString; - summary?: string; -}; +export type CoinSelectionFailureReason = + | { + type: CoinSelectionFailureReasonType.AvailableBalanceInsufficient; + amountAvailable: AmountString; + } + | { + type: CoinSelectionFailureReasonType.PendingRefresh; + amountPendingRefresh: AmountString; + } + | { + type: CoinSelectionFailureReasonType.MinimumAge; + requiredMinimumAge: number; + amountAgeAcceptable: AmountString; + } + | { + type: CoinSelectionFailureReasonType.ScopeRestricted; + scopeInfo: ScopeInfo; + } + | { + type: CoinSelectionFailureReasonType.ReceiverNotAccepted; + } + | { + type: CoinSelectionFailureReasonType.ReceiverExchangeMasterPubMismatch; + walletMasterPub: string; + receiverMasterPubs: string[]; + } + | { + type: CoinSelectionFailureReasonType.WireMethodUnsupported; + wireMethod: string; + } + | { + type: CoinSelectionFailureReasonType.WireFeeUnavailable; + wireMethod: string; + } + | { + type: CoinSelectionFailureReasonType.DepositAccountRestricted; + wireMethod: string; + accountRestrictions: Record<string, AccountRestriction[]>; + } + | { + type: CoinSelectionFailureReasonType.ExchangeGlobalFeesUnavailable; + } + | { + type: CoinSelectionFailureReasonType.FeesNotCovered; + maximumPayableAmount: AmountString; + } + | { + type: CoinSelectionFailureReasonType.BalanceFragmented; + combinedMaximumPayableAmount: AmountString; + } + | { + type: CoinSelectionFailureReasonType.SupersededExchangeMasterPub; + amountAffected: AmountString; + } + | { + type: CoinSelectionFailureReasonType.SelectionFailed; + }; ``` ```typescript -export interface PreparePayV2Result { - transactionId: TransactionIdStr; +export interface CoinSelectionExchangeFailureDiagnostics { + /** Balance held at this exchange before payment restrictions. */ + balance: CoinSelectionBalanceSnapshot; + /** Maximum contribution selectable from this exchange for this request. */ + maximumPayableAmount: AmountString; + /** Exchange-local reasons, in deterministic evaluation order. */ + reasons: CoinSelectionFailureReason[]; } ``` ```typescript -/** - * Forced coin selection for deposits/payments. - */ -export interface ForcedCoinSel { - coins: { - value: AmountString; - contribution: AmountString; - }[]; +interface PaymentInsufficientBalanceLegacyOnly { + balance?: undefined; + maximumPayableAmount?: undefined; + reasons?: undefined; + exchanges?: undefined; } ``` ```typescript @@ -6686,6 +7214,24 @@ export interface WireTypeDetails { } ``` ```typescript +/** + * @deprecated Use {@link ListWithdrawalExchangeCandidatesRequest} instead. + */ +export interface GetDefaultExchangesRequest { + /** + * Only return production exchanges from the builtin exchange list. + * Cannot be combined with `withBuiltin: false`. + */ + presetOnly?: boolean; + /** Include exchanges from the builtin list. Defaults to true. */ + withBuiltin?: boolean; + /** Include demo exchanges from the builtin list. Defaults to false. */ + withDemo?: boolean; + /** Include test exchanges from the builtin list. Defaults to false. */ + withTest?: boolean; +} +``` +```typescript export interface CheckPeerPushDebitRequest { /** * Preferred exchange to use for the p2p payment. @@ -6729,6 +7275,14 @@ export interface CheckPeerPushDebitOkResponse { * (or 1 week if the exchange does not specify it). */ defaultExpiration: TalerProtocolDuration; + /** + * Opaque description of the values reviewed by the caller. Passing this + * back to initiatePeerPushDebit makes wallet-core reject the operation when + * coin selection, fees or the selected exchange changed in the meantime. + * + * Optional for compatibility with older wallet-core implementations. + */ + peerPushDebitQuote?: string; } ``` ```typescript