taler-docs

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

foo (76482B)


      1 # Wallet-Core API Documentation
      2 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).
      3 ## Overview
      4 ### Unknown Group
      5 * [InitWalletOp](#initwalletop)
      6 * [GetVersionOp](#getversionop)
      7 ###  Basic Wallet Information
      8 * [GetBalancesOp](#getbalancesop)
      9 * [GetBalancesDetailOp](#getbalancesdetailop)
     10 ###  Managing Transactions
     11 * [GetTransactionsOp](#gettransactionsop)
     12 * [GetTransactionByIdOp](#gettransactionbyidop)
     13 * [RetryPendingNowOp](#retrypendingnowop)
     14 * [DeleteTransactionOp](#deletetransactionop)
     15 * [RetryTransactionOp](#retrytransactionop)
     16 * [AbortTransactionOp](#aborttransactionop)
     17 * [SuspendTransactionOp](#suspendtransactionop)
     18 * [ResumeTransactionOp](#resumetransactionop)
     19 ###  Withdrawals
     20 * [GetWithdrawalDetailsForAmountOp](#getwithdrawaldetailsforamountop)
     21 * [GetWithdrawalDetailsForUriOp](#getwithdrawaldetailsforuriop)
     22 * [AcceptBankIntegratedWithdrawalOp](#acceptbankintegratedwithdrawalop)
     23 * [AcceptManualWithdrawalOp](#acceptmanualwithdrawalop)
     24 ###  Merchant Payments
     25 * [PreparePayForUriOp](#preparepayforuriop)
     26 * [PreparePayForTemplateOp](#preparepayfortemplateop)
     27 * [GetContractTermsDetailsOp](#getcontracttermsdetailsop)
     28 * [ConfirmPayOp](#confirmpayop)
     29 * [ApplyRefundOp](#applyrefundop)
     30 * [ApplyRefundFromPurchaseIdOp](#applyrefundfrompurchaseidop)
     31 * [PrepareRefundOp](#preparerefundop)
     32 ###  Tipping
     33 * [PrepareTipOp](#preparetipop)
     34 * [AcceptTipOp](#accepttipop)
     35 ###  Exchange Management
     36 * [ListExchangesOp](#listexchangesop)
     37 * [AddExchangeOp](#addexchangeop)
     38 * [ListKnownBankAccountsOp](#listknownbankaccountsop)
     39 * [AddKnownBankAccountsOp](#addknownbankaccountsop)
     40 * [ForgetKnownBankAccountsOp](#forgetknownbankaccountsop)
     41 * [SetExchangeTosAcceptedOp](#setexchangetosacceptedop)
     42 * [GetExchangeTosOp](#getexchangetosop)
     43 * [GetExchangeDetailedInfoOp](#getexchangedetailedinfoop)
     44 * [ListCurrenciesOp](#listcurrenciesop)
     45 ###  Deposits
     46 * [GenerateDepositGroupTxIdOp](#generatedepositgrouptxidop)
     47 * [CreateDepositGroupOp](#createdepositgroupop)
     48 * [PrepareDepositOp](#preparedepositop)
     49 ###  Backups
     50 * [ExportBackupRecoveryOp](#exportbackuprecoveryop)
     51 * [ImportBackupRecoveryOp](#importbackuprecoveryop)
     52 * [RunBackupCycleOp](#runbackupcycleop)
     53 * [ExportBackupOp](#exportbackupop)
     54 * [AddBackupProviderOp](#addbackupproviderop)
     55 * [RemoveBackupProviderOp](#removebackupproviderop)
     56 * [GetBackupInfoOp](#getbackupinfoop)
     57 * [SetWalletDeviceIdOp](#setwalletdeviceidop)
     58 * [ExportBackupPlainOp](#exportbackupplainop)
     59 ###  Peer Payments
     60 * [CheckPeerPushDebitOp](#checkpeerpushdebitop)
     61 * [InitiatePeerPushDebitOp](#initiatepeerpushdebitop)
     62 * [PreparePeerPushCreditOp](#preparepeerpushcreditop)
     63 * [ConfirmPeerPushCreditOp](#confirmpeerpushcreditop)
     64 * [CheckPeerPullCreditOp](#checkpeerpullcreditop)
     65 * [InitiatePeerPullCreditOp](#initiatepeerpullcreditop)
     66 * [PreparePeerPullDebitOp](#preparepeerpulldebitop)
     67 * [ConfirmPeerPullDebitOp](#confirmpeerpulldebitop)
     68 ###  Data Validation
     69 * [ValidateIbanOp](#validateibanop)
     70 ###  Database Management
     71 * [ExportDbOp](#exportdbop)
     72 * [ImportDbOp](#importdbop)
     73 * [ClearDbOp](#cleardbop)
     74 * [RecycleOp](#recycleop)
     75 ###  Testing and Debugging
     76 * [ApplyDevExperimentOp](#applydevexperimentop)
     77 * [RunIntegrationTestOp](#runintegrationtestop)
     78 * [RunIntegrationTestV2Op](#runintegrationtestv2op)
     79 * [TestCryptoOp](#testcryptoop)
     80 * [WithdrawTestBalanceOp](#withdrawtestbalanceop)
     81 * [WithdrawTestkudosOp](#withdrawtestkudosop)
     82 * [TestPayOp](#testpayop)
     83 * [WithdrawFakebankOp](#withdrawfakebankop)
     84 * [GetPendingTasksOp](#getpendingtasksop)
     85 * [DumpCoinsOp](#dumpcoinsop)
     86 * [SetCoinSuspendedOp](#setcoinsuspendedop)
     87 * [ForceRefreshOp](#forcerefreshop)
     88 ## Operation Reference
     89 ### InitWalletOp
     90 ```typescript
     91 /**
     92  * Initialize wallet-core.
     93  *
     94  * Must be the request before any other operations.
     95  */
     96 export type InitWalletOp = {
     97   op: WalletApiOperation.InitWallet;
     98   request: InitRequest;
     99   response: InitResponse;
    100 };
    101 // InitWallet = "initWallet"
    102 
    103 ```
    104 ```typescript
    105 export interface InitRequest {
    106   skipDefaults?: boolean;
    107 }
    108 
    109 ```
    110 ```typescript
    111 export interface InitResponse {
    112   versionInfo: WalletCoreVersion;
    113 }
    114 
    115 ```
    116 
    117 ### GetVersionOp
    118 ```typescript
    119 export type GetVersionOp = {
    120   op: WalletApiOperation.GetVersion;
    121   request: EmptyObject;
    122   response: WalletCoreVersion;
    123 };
    124 // GetVersion = "getVersion"
    125 
    126 ```
    127 
    128 ### GetBalancesOp
    129 ```typescript
    130 /**
    131  * Get current wallet balance.
    132  */
    133 export type GetBalancesOp = {
    134   op: WalletApiOperation.GetBalances;
    135   request: EmptyObject;
    136   response: BalancesResponse;
    137 };
    138 // GetBalances = "getBalances"
    139 
    140 ```
    141 ```typescript
    142 export interface BalancesResponse {
    143   balances: Balance[];
    144 }
    145 
    146 ```
    147 ```typescript
    148 export interface Balance {
    149   scopeInfo: ScopeInfo;
    150   available: AmountString;
    151   pendingIncoming: AmountString;
    152   pendingOutgoing: AmountString;
    153   hasPendingTransactions: boolean;
    154   requiresUserInput: boolean;
    155 }
    156 
    157 ```
    158 ```typescript
    159 export type ScopeInfo =
    160   | {
    161       type: ScopeType.Global;
    162       currency: string;
    163     }
    164   | {
    165       type: ScopeType.Exchange;
    166       currency: string;
    167       url: string;
    168     }
    169   | {
    170       type: ScopeType.Auditor;
    171       currency: string;
    172       url: string;
    173     };
    174 
    175 ```
    176 
    177 ### GetBalancesDetailOp
    178 ```typescript
    179 export type GetBalancesDetailOp = {
    180   op: WalletApiOperation.GetBalanceDetail;
    181   request: GetBalanceDetailRequest;
    182   response: MerchantPaymentBalanceDetails;
    183 };
    184 // GetBalanceDetail = "getBalanceDetail"
    185 
    186 ```
    187 ```typescript
    188 export interface GetBalanceDetailRequest {
    189   currency: string;
    190 }
    191 
    192 ```
    193 ```typescript
    194 export interface MerchantPaymentBalanceDetails {
    195   /**
    196    * Balance of type "available" (see balance.ts for definition).
    197    */
    198   balanceAvailable: AmountJson;
    199   /**
    200    * Balance of type "material" (see balance.ts for definition).
    201    */
    202   balanceMaterial: AmountJson;
    203   /**
    204    * Balance of type "age-acceptable" (see balance.ts for definition).
    205    */
    206   balanceAgeAcceptable: AmountJson;
    207   /**
    208    * Balance of type "merchant-acceptable" (see balance.ts for definition).
    209    */
    210   balanceMerchantAcceptable: AmountJson;
    211   /**
    212    * Balance of type "merchant-depositable" (see balance.ts for definition).
    213    */
    214   balanceMerchantDepositable: AmountJson;
    215 }
    216 
    217 ```
    218 ```typescript
    219 /**
    220  * Non-negative financial amount.  Fractional values are expressed as multiples
    221  * of 1e-8.
    222  */
    223 export interface AmountJson {
    224   /**
    225    * Value, must be an integer.
    226    */
    227   readonly value: number;
    228   /**
    229    * Fraction, must be an integer.  Represent 1/1e8 of a unit.
    230    */
    231   readonly fraction: number;
    232   /**
    233    * Currency of the amount.
    234    */
    235   readonly currency: string;
    236 }
    237 
    238 ```
    239 
    240 ### GetTransactionsOp
    241 ```typescript
    242 /**
    243  * Get transactions.
    244  */
    245 export type GetTransactionsOp = {
    246   op: WalletApiOperation.GetTransactions;
    247   request: TransactionsRequest;
    248   response: TransactionsResponse;
    249 };
    250 // GetTransactions = "getTransactions"
    251 
    252 ```
    253 ```typescript
    254 export interface TransactionsRequest {
    255   /**
    256    * return only transactions in the given currency
    257    */
    258   currency?: string;
    259   /**
    260    * if present, results will be limited to transactions related to the given search string
    261    */
    262   search?: string;
    263   /**
    264    * If true, include all refreshes in the transactions list.
    265    */
    266   includeRefreshes?: boolean;
    267 }
    268 
    269 ```
    270 ```typescript
    271 export interface TransactionsResponse {
    272   transactions: Transaction[];
    273 }
    274 
    275 ```
    276 
    277 ### GetTransactionByIdOp
    278 ```typescript
    279 export type GetTransactionByIdOp = {
    280   op: WalletApiOperation.GetTransactionById;
    281   request: TransactionByIdRequest;
    282   response: Transaction;
    283 };
    284 // GetTransactionById = "getTransactionById"
    285 
    286 ```
    287 ```typescript
    288 export interface TransactionByIdRequest {
    289   transactionId: string;
    290 }
    291 
    292 ```
    293 
    294 ### RetryPendingNowOp
    295 ```typescript
    296 export type RetryPendingNowOp = {
    297   op: WalletApiOperation.RetryPendingNow;
    298   request: EmptyObject;
    299   response: EmptyObject;
    300 };
    301 // RetryPendingNow = "retryPendingNow"
    302 
    303 ```
    304 
    305 ### DeleteTransactionOp
    306 ```typescript
    307 /**
    308  * Delete a transaction locally in the wallet.
    309  */
    310 export type DeleteTransactionOp = {
    311   op: WalletApiOperation.DeleteTransaction;
    312   request: DeleteTransactionRequest;
    313   response: EmptyObject;
    314 };
    315 // DeleteTransaction = "deleteTransaction"
    316 
    317 ```
    318 ```typescript
    319 export interface DeleteTransactionRequest {
    320   transactionId: string;
    321 }
    322 
    323 ```
    324 
    325 ### RetryTransactionOp
    326 ```typescript
    327 /**
    328  * Immediately retry a transaction.
    329  */
    330 export type RetryTransactionOp = {
    331   op: WalletApiOperation.RetryTransaction;
    332   request: RetryTransactionRequest;
    333   response: EmptyObject;
    334 };
    335 // RetryTransaction = "retryTransaction"
    336 
    337 ```
    338 ```typescript
    339 export interface RetryTransactionRequest {
    340   transactionId: string;
    341 }
    342 
    343 ```
    344 
    345 ### AbortTransactionOp
    346 ```typescript
    347 /**
    348  * Abort a transaction
    349  *
    350  * For payment transactions, it puts the payment into an "aborting" state.
    351  */
    352 export type AbortTransactionOp = {
    353   op: WalletApiOperation.AbortTransaction;
    354   request: AbortTransactionRequest;
    355   response: EmptyObject;
    356 };
    357 // AbortTransaction = "abortTransaction"
    358 
    359 ```
    360 
    361 ### SuspendTransactionOp
    362 ```typescript
    363 /**
    364  * Suspend a transaction
    365  */
    366 export type SuspendTransactionOp = {
    367   op: WalletApiOperation.SuspendTransaction;
    368   request: AbortTransactionRequest;
    369   response: EmptyObject;
    370 };
    371 // SuspendTransaction = "suspendTransaction"
    372 
    373 ```
    374 
    375 ### ResumeTransactionOp
    376 ```typescript
    377 /**
    378  * Resume a transaction
    379  */
    380 export type ResumeTransactionOp = {
    381   op: WalletApiOperation.ResumeTransaction;
    382   request: AbortTransactionRequest;
    383   response: EmptyObject;
    384 };
    385 // ResumeTransaction = "resumeTransaction"
    386 
    387 ```
    388 
    389 ### GetWithdrawalDetailsForAmountOp
    390 ```typescript
    391 /**
    392  * Get details for withdrawing a particular amount (manual withdrawal).
    393  */
    394 export type GetWithdrawalDetailsForAmountOp = {
    395   op: WalletApiOperation.GetWithdrawalDetailsForAmount;
    396   request: GetWithdrawalDetailsForAmountRequest;
    397   response: ManualWithdrawalDetails;
    398 };
    399 // GetWithdrawalDetailsForAmount = "getWithdrawalDetailsForAmount"
    400 
    401 ```
    402 ```typescript
    403 export interface GetWithdrawalDetailsForAmountRequest {
    404   exchangeBaseUrl: string;
    405   amount: string;
    406   restrictAge?: number;
    407 }
    408 
    409 ```
    410 ```typescript
    411 export interface ManualWithdrawalDetails {
    412   /**
    413    * Did the user accept the current version of the exchange's
    414    * terms of service?
    415    */
    416   tosAccepted: boolean;
    417   /**
    418    * Amount that the user will transfer to the exchange.
    419    */
    420   amountRaw: AmountString;
    421   /**
    422    * Amount that will be added to the user's wallet balance.
    423    */
    424   amountEffective: AmountString;
    425   /**
    426    * Ways to pay the exchange.
    427    */
    428   paytoUris: string[];
    429   /**
    430    * If the exchange supports age-restricted coins it will return
    431    * the array of ages.
    432    */
    433   ageRestrictionOptions?: number[];
    434 }
    435 
    436 ```
    437 
    438 ### GetWithdrawalDetailsForUriOp
    439 ```typescript
    440 /**
    441  * Get details for withdrawing via a particular taler:// URI.
    442  */
    443 export type GetWithdrawalDetailsForUriOp = {
    444   op: WalletApiOperation.GetWithdrawalDetailsForUri;
    445   request: GetWithdrawalDetailsForUriRequest;
    446   response: WithdrawUriInfoResponse;
    447 };
    448 // GetWithdrawalDetailsForUri = "getWithdrawalDetailsForUri"
    449 
    450 ```
    451 ```typescript
    452 export interface GetWithdrawalDetailsForUriRequest {
    453   talerWithdrawUri: string;
    454   restrictAge?: number;
    455 }
    456 
    457 ```
    458 ```typescript
    459 export interface WithdrawUriInfoResponse {
    460   amount: AmountString;
    461   defaultExchangeBaseUrl?: string;
    462   possibleExchanges: ExchangeListItem[];
    463 }
    464 
    465 ```
    466 
    467 ### AcceptBankIntegratedWithdrawalOp
    468 ```typescript
    469 /**
    470  * Accept a bank-integrated withdrawal.
    471  */
    472 export type AcceptBankIntegratedWithdrawalOp = {
    473   op: WalletApiOperation.AcceptBankIntegratedWithdrawal;
    474   request: AcceptBankIntegratedWithdrawalRequest;
    475   response: AcceptWithdrawalResponse;
    476 };
    477 // AcceptBankIntegratedWithdrawal = "acceptBankIntegratedWithdrawal"
    478 
    479 ```
    480 ```typescript
    481 export interface AcceptBankIntegratedWithdrawalRequest {
    482   talerWithdrawUri: string;
    483   exchangeBaseUrl: string;
    484   forcedDenomSel?: ForcedDenomSel;
    485   restrictAge?: number;
    486 }
    487 
    488 ```
    489 ```typescript
    490 export interface AcceptWithdrawalResponse {
    491   reservePub: string;
    492   confirmTransferUrl?: string;
    493   transactionId: string;
    494 }
    495 
    496 ```
    497 
    498 ### AcceptManualWithdrawalOp
    499 ```typescript
    500 /**
    501  * Create a manual withdrawal.
    502  */
    503 export type AcceptManualWithdrawalOp = {
    504   op: WalletApiOperation.AcceptManualWithdrawal;
    505   request: AcceptManualWithdrawalRequest;
    506   response: AcceptManualWithdrawalResult;
    507 };
    508 // AcceptManualWithdrawal = "acceptManualWithdrawal"
    509 
    510 ```
    511 ```typescript
    512 export interface AcceptManualWithdrawalRequest {
    513   exchangeBaseUrl: string;
    514   amount: string;
    515   restrictAge?: number;
    516 }
    517 
    518 ```
    519 ```typescript
    520 export interface AcceptManualWithdrawalResult {
    521   /**
    522    * Payto URIs that can be used to fund the withdrawal.
    523    */
    524   exchangePaytoUris: string[];
    525   /**
    526    * Public key of the newly created reserve.
    527    */
    528   reservePub: string;
    529   transactionId: string;
    530 }
    531 
    532 ```
    533 
    534 ### PreparePayForUriOp
    535 ```typescript
    536 /**
    537  * Prepare to make a payment based on a taler://pay/ URI.
    538  */
    539 export type PreparePayForUriOp = {
    540   op: WalletApiOperation.PreparePayForUri;
    541   request: PreparePayRequest;
    542   response: PreparePayResult;
    543 };
    544 // PreparePayForUri = "preparePayForUri"
    545 
    546 ```
    547 ```typescript
    548 export interface PreparePayRequest {
    549   talerPayUri: string;
    550 }
    551 
    552 ```
    553 
    554 ### PreparePayForTemplateOp
    555 ```typescript
    556 /**
    557  * Prepare to make a payment based on a taler://pay-template/ URI.
    558  */
    559 export type PreparePayForTemplateOp = {
    560   op: WalletApiOperation.PreparePayForTemplate;
    561   request: PreparePayTemplateRequest;
    562   response: PreparePayResult;
    563 };
    564 // PreparePayForTemplate = "preparePayForTemplate"
    565 
    566 ```
    567 ```typescript
    568 export interface PreparePayTemplateRequest {
    569   talerPayTemplateUri: string;
    570   templateParams: Record<string, string>;
    571 }
    572 
    573 ```
    574 
    575 ### GetContractTermsDetailsOp
    576 ```typescript
    577 export type GetContractTermsDetailsOp = {
    578   op: WalletApiOperation.GetContractTermsDetails;
    579   request: GetContractTermsDetailsRequest;
    580   response: WalletContractData;
    581 };
    582 // GetContractTermsDetails = "getContractTermsDetails"
    583 
    584 ```
    585 ```typescript
    586 export interface GetContractTermsDetailsRequest {
    587   proposalId: string;
    588 }
    589 
    590 ```
    591 ```typescript
    592 /**
    593  * Data extracted from the contract terms that is relevant for payment
    594  * processing in the wallet.
    595  */
    596 export interface WalletContractData {
    597   products?: Product[];
    598   summaryI18n:
    599     | {
    600         [lang_tag: string]: string;
    601       }
    602     | undefined;
    603   /**
    604    * Fulfillment URL, or the empty string if the order has no fulfillment URL.
    605    *
    606    * Stored as a non-nullable string as we use this field for IndexedDB indexing.
    607    */
    608   fulfillmentUrl: string;
    609   contractTermsHash: string;
    610   fulfillmentMessage?: string;
    611   fulfillmentMessageI18n?: InternationalizedString;
    612   merchantSig: string;
    613   merchantPub: string;
    614   merchant: MerchantInfo;
    615   amount: AmountString;
    616   orderId: string;
    617   merchantBaseUrl: string;
    618   summary: string;
    619   autoRefund: TalerProtocolDuration | undefined;
    620   maxWireFee: AmountString;
    621   wireFeeAmortization: number;
    622   payDeadline: TalerProtocolTimestamp;
    623   refundDeadline: TalerProtocolTimestamp;
    624   allowedAuditors: AllowedAuditorInfo[];
    625   allowedExchanges: AllowedExchangeInfo[];
    626   timestamp: TalerProtocolTimestamp;
    627   wireMethod: string;
    628   wireInfoHash: string;
    629   maxDepositFee: AmountString;
    630   minimumAge?: number;
    631   deliveryDate: TalerProtocolTimestamp | undefined;
    632   deliveryLocation: Location | undefined;
    633 }
    634 
    635 ```
    636 ```typescript
    637 export interface AllowedAuditorInfo {
    638   auditorBaseUrl: string;
    639   auditorPub: string;
    640 }
    641 
    642 ```
    643 ```typescript
    644 export interface AllowedExchangeInfo {
    645   exchangeBaseUrl: string;
    646   exchangePub: string;
    647 }
    648 
    649 ```
    650 
    651 ### ConfirmPayOp
    652 ```typescript
    653 /**
    654  * Confirm a payment that was previously prepared with
    655  * {@link PreparePayForUriOp}
    656  */
    657 export type ConfirmPayOp = {
    658   op: WalletApiOperation.ConfirmPay;
    659   request: ConfirmPayRequest;
    660   response: ConfirmPayResult;
    661 };
    662 // ConfirmPay = "confirmPay"
    663 
    664 ```
    665 ```typescript
    666 export interface ConfirmPayRequest {
    667   proposalId: string;
    668   sessionId?: string;
    669   forcedCoinSel?: ForcedCoinSel;
    670 }
    671 
    672 ```
    673 ```typescript
    674 export type ConfirmPayResult = ConfirmPayResultDone | ConfirmPayResultPending;
    675 
    676 ```
    677 ```typescript
    678 /**
    679  * Result for confirmPay
    680  */
    681 export interface ConfirmPayResultDone {
    682   type: ConfirmPayResultType.Done;
    683   contractTerms: MerchantContractTerms;
    684   transactionId: string;
    685 }
    686 
    687 ```
    688 ```typescript
    689 export interface ConfirmPayResultPending {
    690   type: ConfirmPayResultType.Pending;
    691   transactionId: string;
    692   lastError: TalerErrorDetail | undefined;
    693 }
    694 
    695 ```
    696 
    697 ### ApplyRefundOp
    698 ```typescript
    699 /**
    700  * Check for a refund based on a taler://refund URI.
    701  */
    702 export type ApplyRefundOp = {
    703   op: WalletApiOperation.ApplyRefund;
    704   request: ApplyRefundRequest;
    705   response: ApplyRefundResponse;
    706 };
    707 // ApplyRefund = "applyRefund"
    708 
    709 ```
    710 ```typescript
    711 export interface ApplyRefundRequest {
    712   talerRefundUri: string;
    713 }
    714 
    715 ```
    716 
    717 ### ApplyRefundFromPurchaseIdOp
    718 ```typescript
    719 export type ApplyRefundFromPurchaseIdOp = {
    720   op: WalletApiOperation.ApplyRefundFromPurchaseId;
    721   request: ApplyRefundFromPurchaseIdRequest;
    722   response: ApplyRefundResponse;
    723 };
    724 // ApplyRefundFromPurchaseId = "applyRefundFromPurchaseId"
    725 
    726 ```
    727 ```typescript
    728 export interface ApplyRefundFromPurchaseIdRequest {
    729   purchaseId: string;
    730 }
    731 
    732 ```
    733 
    734 ### PrepareRefundOp
    735 ```typescript
    736 export type PrepareRefundOp = {
    737   op: WalletApiOperation.PrepareRefund;
    738   request: PrepareRefundRequest;
    739   response: PrepareRefundResult;
    740 };
    741 // PrepareRefund = "prepareRefund"
    742 
    743 ```
    744 ```typescript
    745 export interface PrepareRefundRequest {
    746   talerRefundUri: string;
    747 }
    748 
    749 ```
    750 ```typescript
    751 export interface PrepareRefundResult {
    752   proposalId: string;
    753   effectivePaid: AmountString;
    754   gone: AmountString;
    755   granted: AmountString;
    756   pending: boolean;
    757   awaiting: AmountString;
    758   info: OrderShortInfo;
    759 }
    760 
    761 ```
    762 
    763 ### PrepareTipOp
    764 ```typescript
    765 /**
    766  * Query and store information about a tip.
    767  */
    768 export type PrepareTipOp = {
    769   op: WalletApiOperation.PrepareTip;
    770   request: PrepareTipRequest;
    771   response: PrepareTipResult;
    772 };
    773 // PrepareTip = "prepareTip"
    774 
    775 ```
    776 ```typescript
    777 export interface PrepareTipRequest {
    778   talerTipUri: string;
    779 }
    780 
    781 ```
    782 ```typescript
    783 export interface PrepareTipResult {
    784   /**
    785    * Unique ID for the tip assigned by the wallet.
    786    * Typically different from the merchant-generated tip ID.
    787    */
    788   walletTipId: string;
    789   /**
    790    * Has the tip already been accepted?
    791    */
    792   accepted: boolean;
    793   /**
    794    * Amount that the merchant gave.
    795    */
    796   tipAmountRaw: AmountString;
    797   /**
    798    * Amount that arrived at the wallet.
    799    * Might be lower than the raw amount due to fees.
    800    */
    801   tipAmountEffective: AmountString;
    802   /**
    803    * Base URL of the merchant backend giving then tip.
    804    */
    805   merchantBaseUrl: string;
    806   /**
    807    * Base URL of the exchange that is used to withdraw the tip.
    808    * Determined by the merchant, the wallet/user has no choice here.
    809    */
    810   exchangeBaseUrl: string;
    811   /**
    812    * Time when the tip will expire.  After it expired, it can't be picked
    813    * up anymore.
    814    */
    815   expirationTimestamp: TalerProtocolTimestamp;
    816 }
    817 
    818 ```
    819 
    820 ### AcceptTipOp
    821 ```typescript
    822 /**
    823  * Accept a tip.
    824  */
    825 export type AcceptTipOp = {
    826   op: WalletApiOperation.AcceptTip;
    827   request: AcceptTipRequest;
    828   response: AcceptTipResponse;
    829 };
    830 // AcceptTip = "acceptTip"
    831 
    832 ```
    833 ```typescript
    834 export interface AcceptTipRequest {
    835   walletTipId: string;
    836 }
    837 
    838 ```
    839 ```typescript
    840 export interface AcceptTipResponse {
    841   transactionId: string;
    842   next_url?: string;
    843 }
    844 
    845 ```
    846 
    847 ### ListExchangesOp
    848 ```typescript
    849 /**
    850  * List exchanges known to the wallet.
    851  */
    852 export type ListExchangesOp = {
    853   op: WalletApiOperation.ListExchanges;
    854   request: EmptyObject;
    855   response: ExchangesListResponse;
    856 };
    857 // ListExchanges = "listExchanges"
    858 
    859 ```
    860 ```typescript
    861 export interface ExchangesListResponse {
    862   exchanges: ExchangeListItem[];
    863 }
    864 
    865 ```
    866 
    867 ### AddExchangeOp
    868 ```typescript
    869 /**
    870  * Add / force-update an exchange.
    871  */
    872 export type AddExchangeOp = {
    873   op: WalletApiOperation.AddExchange;
    874   request: AddExchangeRequest;
    875   response: EmptyObject;
    876 };
    877 // AddExchange = "addExchange"
    878 
    879 ```
    880 
    881 ### ListKnownBankAccountsOp
    882 ```typescript
    883 export type ListKnownBankAccountsOp = {
    884   op: WalletApiOperation.ListKnownBankAccounts;
    885   request: ListKnownBankAccountsRequest;
    886   response: KnownBankAccounts;
    887 };
    888 // ListKnownBankAccounts = "listKnownBankAccounts"
    889 
    890 ```
    891 ```typescript
    892 export interface ListKnownBankAccountsRequest {
    893   currency?: string;
    894 }
    895 
    896 ```
    897 ```typescript
    898 export interface KnownBankAccounts {
    899   accounts: KnownBankAccountsInfo[];
    900 }
    901 
    902 ```
    903 ```typescript
    904 export interface KnownBankAccountsInfo {
    905   uri: PaytoUri;
    906   kyc_completed: boolean;
    907   currency: string;
    908   alias: string;
    909 }
    910 
    911 ```
    912 ```typescript
    913 export type PaytoUri =
    914   | PaytoUriUnknown
    915   | PaytoUriIBAN
    916   | PaytoUriTalerBank
    917   | PaytoUriBitcoin;
    918 
    919 ```
    920 ```typescript
    921 export interface PaytoUriUnknown extends PaytoUriGeneric {
    922   isKnown: false;
    923 }
    924 
    925 ```
    926 ```typescript
    927 export interface PaytoUriGeneric {
    928   targetType: string;
    929   targetPath: string;
    930   params: {
    931     [name: string]: string;
    932   };
    933 }
    934 
    935 ```
    936 ```typescript
    937 export interface PaytoUriIBAN extends PaytoUriGeneric {
    938   isKnown: true;
    939   targetType: "iban";
    940   iban: string;
    941   bic?: string;
    942 }
    943 
    944 ```
    945 ```typescript
    946 export interface PaytoUriTalerBank extends PaytoUriGeneric {
    947   isKnown: true;
    948   targetType: "x-taler-bank";
    949   host: string;
    950   account: string;
    951 }
    952 
    953 ```
    954 ```typescript
    955 export interface PaytoUriBitcoin extends PaytoUriGeneric {
    956   isKnown: true;
    957   targetType: "bitcoin";
    958   segwitAddrs: Array<string>;
    959 }
    960 
    961 ```
    962 
    963 ### AddKnownBankAccountsOp
    964 ```typescript
    965 export type AddKnownBankAccountsOp = {
    966   op: WalletApiOperation.AddKnownBankAccounts;
    967   request: AddKnownBankAccountsRequest;
    968   response: EmptyObject;
    969 };
    970 // AddKnownBankAccounts = "addKnownBankAccounts"
    971 
    972 ```
    973 ```typescript
    974 export interface AddKnownBankAccountsRequest {
    975   payto: string;
    976   alias: string;
    977   currency: string;
    978 }
    979 
    980 ```
    981 
    982 ### ForgetKnownBankAccountsOp
    983 ```typescript
    984 export type ForgetKnownBankAccountsOp = {
    985   op: WalletApiOperation.ForgetKnownBankAccounts;
    986   request: ForgetKnownBankAccountsRequest;
    987   response: EmptyObject;
    988 };
    989 // ForgetKnownBankAccounts = "forgetKnownBankAccounts"
    990 
    991 ```
    992 ```typescript
    993 export interface ForgetKnownBankAccountsRequest {
    994   payto: string;
    995 }
    996 
    997 ```
    998 
    999 ### SetExchangeTosAcceptedOp
   1000 ```typescript
   1001 /**
   1002  * Accept a particular version of the exchange terms of service.
   1003  */
   1004 export type SetExchangeTosAcceptedOp = {
   1005   op: WalletApiOperation.SetExchangeTosAccepted;
   1006   request: AcceptExchangeTosRequest;
   1007   response: EmptyObject;
   1008 };
   1009 // SetExchangeTosAccepted = "setExchangeTosAccepted"
   1010 
   1011 ```
   1012 ```typescript
   1013 export interface AcceptExchangeTosRequest {
   1014   exchangeBaseUrl: string;
   1015   etag: string | undefined;
   1016 }
   1017 
   1018 ```
   1019 
   1020 ### GetExchangeTosOp
   1021 ```typescript
   1022 /**
   1023  * Get the current terms of a service of an exchange.
   1024  */
   1025 export type GetExchangeTosOp = {
   1026   op: WalletApiOperation.GetExchangeTos;
   1027   request: GetExchangeTosRequest;
   1028   response: GetExchangeTosResult;
   1029 };
   1030 // GetExchangeTos = "getExchangeTos"
   1031 
   1032 ```
   1033 ```typescript
   1034 export interface GetExchangeTosRequest {
   1035   exchangeBaseUrl: string;
   1036   acceptedFormat?: string[];
   1037 }
   1038 
   1039 ```
   1040 ```typescript
   1041 export interface GetExchangeTosResult {
   1042   /**
   1043    * Markdown version of the current ToS.
   1044    */
   1045   content: string;
   1046   /**
   1047    * Version tag of the current ToS.
   1048    */
   1049   currentEtag: string;
   1050   /**
   1051    * Version tag of the last ToS that the user has accepted,
   1052    * if any.
   1053    */
   1054   acceptedEtag: string | undefined;
   1055   /**
   1056    * Accepted content type
   1057    */
   1058   contentType: string;
   1059   tosStatus: ExchangeTosStatus;
   1060 }
   1061 
   1062 ```
   1063 
   1064 ### GetExchangeDetailedInfoOp
   1065 ```typescript
   1066 /**
   1067  * Get the current terms of a service of an exchange.
   1068  */
   1069 export type GetExchangeDetailedInfoOp = {
   1070   op: WalletApiOperation.GetExchangeDetailedInfo;
   1071   request: AddExchangeRequest;
   1072   response: ExchangeDetailedResponse;
   1073 };
   1074 // GetExchangeDetailedInfo = "getExchangeDetailedInfo"
   1075 
   1076 ```
   1077 ```typescript
   1078 export interface ExchangeDetailedResponse {
   1079   exchange: ExchangeFullDetails;
   1080 }
   1081 
   1082 ```
   1083 ```typescript
   1084 export interface ExchangeFullDetails {
   1085   exchangeBaseUrl: string;
   1086   currency: string;
   1087   paytoUris: string[];
   1088   tos: ExchangeTosStatusDetails;
   1089   auditors: ExchangeAuditor[];
   1090   wireInfo: WireInfo;
   1091   denomFees: DenomOperationMap<FeeDescription[]>;
   1092   transferFees: Record<string, FeeDescription[]>;
   1093   globalFees: FeeDescription[];
   1094 }
   1095 
   1096 ```
   1097 ```typescript
   1098 export interface ExchangeTosStatusDetails {
   1099   acceptedVersion?: string;
   1100   currentVersion?: string;
   1101   contentType?: string;
   1102   content?: string;
   1103 }
   1104 
   1105 ```
   1106 ```typescript
   1107 export interface WireInfo {
   1108   feesForType: WireFeeMap;
   1109   accounts: ExchangeAccount[];
   1110 }
   1111 
   1112 ```
   1113 ```typescript
   1114 /**
   1115  * Information about one of the exchange's bank accounts.
   1116  */
   1117 export interface ExchangeAccount {
   1118   payto_uri: string;
   1119   master_sig: string;
   1120 }
   1121 
   1122 ```
   1123 ```typescript
   1124 export interface FeeDescription {
   1125   group: string;
   1126   from: AbsoluteTime;
   1127   until: AbsoluteTime;
   1128   fee?: AmountString;
   1129 }
   1130 
   1131 ```
   1132 
   1133 ### ListCurrenciesOp
   1134 ```typescript
   1135 /**
   1136  * List currencies known to the wallet.
   1137  */
   1138 export type ListCurrenciesOp = {
   1139   op: WalletApiOperation.ListCurrencies;
   1140   request: EmptyObject;
   1141   response: WalletCurrencyInfo;
   1142 };
   1143 // ListCurrencies = "listCurrencies"
   1144 
   1145 ```
   1146 ```typescript
   1147 export interface WalletCurrencyInfo {
   1148   trustedAuditors: {
   1149     currency: string;
   1150     auditorPub: string;
   1151     auditorBaseUrl: string;
   1152   }[];
   1153   trustedExchanges: {
   1154     currency: string;
   1155     exchangeMasterPub: string;
   1156     exchangeBaseUrl: string;
   1157   }[];
   1158 }
   1159 
   1160 ```
   1161 
   1162 ### GenerateDepositGroupTxIdOp
   1163 ```typescript
   1164 /**
   1165  * Generate a fresh transaction ID for a deposit group.
   1166  *
   1167  * The resulting transaction ID can be specified when creating
   1168  * a deposit group, so that the client can already start waiting for notifications
   1169  * on that specific deposit group before the GreateDepositGroup request returns.
   1170  */
   1171 export type GenerateDepositGroupTxIdOp = {
   1172   op: WalletApiOperation.GenerateDepositGroupTxId;
   1173   request: EmptyObject;
   1174   response: TxIdResponse;
   1175 };
   1176 // GenerateDepositGroupTxId = "generateDepositGroupTxId"
   1177 
   1178 ```
   1179 ```typescript
   1180 export interface TxIdResponse {
   1181   transactionId: string;
   1182 }
   1183 
   1184 ```
   1185 
   1186 ### CreateDepositGroupOp
   1187 ```typescript
   1188 /**
   1189  * Create a new deposit group.
   1190  *
   1191  * Deposit groups are used to deposit multiple coins to a bank
   1192  * account, usually the wallet user's own bank account.
   1193  */
   1194 export type CreateDepositGroupOp = {
   1195   op: WalletApiOperation.CreateDepositGroup;
   1196   request: CreateDepositGroupRequest;
   1197   response: CreateDepositGroupResponse;
   1198 };
   1199 // CreateDepositGroup = "createDepositGroup"
   1200 
   1201 ```
   1202 ```typescript
   1203 export interface CreateDepositGroupRequest {
   1204   /**
   1205    * Pre-allocated transaction ID.
   1206    * Allows clients to easily handle notifications
   1207    * that occur while the operation has been created but
   1208    * before the creation request has returned.
   1209    */
   1210   transactionId?: string;
   1211   depositPaytoUri: string;
   1212   amount: AmountString;
   1213 }
   1214 
   1215 ```
   1216 ```typescript
   1217 export interface CreateDepositGroupResponse {
   1218   depositGroupId: string;
   1219   transactionId: string;
   1220 }
   1221 
   1222 ```
   1223 
   1224 ### PrepareDepositOp
   1225 ```typescript
   1226 export type PrepareDepositOp = {
   1227   op: WalletApiOperation.PrepareDeposit;
   1228   request: PrepareDepositRequest;
   1229   response: PrepareDepositResponse;
   1230 };
   1231 // PrepareDeposit = "prepareDeposit"
   1232 
   1233 ```
   1234 ```typescript
   1235 export interface PrepareDepositRequest {
   1236   depositPaytoUri: string;
   1237   amount: AmountString;
   1238 }
   1239 
   1240 ```
   1241 ```typescript
   1242 export interface PrepareDepositResponse {
   1243   totalDepositCost: AmountString;
   1244   effectiveDepositAmount: AmountString;
   1245   fees: DepositGroupFees;
   1246 }
   1247 
   1248 ```
   1249 ```typescript
   1250 export interface DepositGroupFees {
   1251   coin: AmountString;
   1252   wire: AmountString;
   1253   refresh: AmountString;
   1254 }
   1255 
   1256 ```
   1257 
   1258 ### ExportBackupRecoveryOp
   1259 ```typescript
   1260 /**
   1261  * Export the recovery information for the wallet.
   1262  */
   1263 export type ExportBackupRecoveryOp = {
   1264   op: WalletApiOperation.ExportBackupRecovery;
   1265   request: EmptyObject;
   1266   response: BackupRecovery;
   1267 };
   1268 // ExportBackupRecovery = "exportBackupRecovery"
   1269 
   1270 ```
   1271 
   1272 ### ImportBackupRecoveryOp
   1273 ```typescript
   1274 /**
   1275  * Import recovery information into the wallet.
   1276  */
   1277 export type ImportBackupRecoveryOp = {
   1278   op: WalletApiOperation.ImportBackupRecovery;
   1279   request: RecoveryLoadRequest;
   1280   response: EmptyObject;
   1281 };
   1282 // ImportBackupRecovery = "importBackupRecovery"
   1283 
   1284 ```
   1285 ```typescript
   1286 /**
   1287  * Load recovery information into the wallet.
   1288  */
   1289 export interface RecoveryLoadRequest {
   1290   recovery: BackupRecovery;
   1291   strategy?: RecoveryMergeStrategy;
   1292 }
   1293 
   1294 ```
   1295 ```typescript
   1296 /**
   1297  * Strategy for loading recovery information.
   1298  */
   1299 export declare enum RecoveryMergeStrategy {
   1300   /**
   1301    * Keep the local wallet root key, import and take over providers.
   1302    */
   1303   Ours = "ours",
   1304   /**
   1305    * Migrate to the wallet root key from the recovery information.
   1306    */
   1307   Theirs = "theirs",
   1308 }
   1309 
   1310 ```
   1311 
   1312 ### RunBackupCycleOp
   1313 ```typescript
   1314 /**
   1315  * Manually make and upload a backup.
   1316  */
   1317 export type RunBackupCycleOp = {
   1318   op: WalletApiOperation.RunBackupCycle;
   1319   request: RunBackupCycleRequest;
   1320   response: EmptyObject;
   1321 };
   1322 // RunBackupCycle = "runBackupCycle"
   1323 
   1324 ```
   1325 ```typescript
   1326 export interface RunBackupCycleRequest {
   1327   /**
   1328    * List of providers to backup or empty for all known providers.
   1329    */
   1330   providers?: Array<string>;
   1331 }
   1332 
   1333 ```
   1334 
   1335 ### ExportBackupOp
   1336 ```typescript
   1337 export type ExportBackupOp = {
   1338   op: WalletApiOperation.ExportBackup;
   1339   request: EmptyObject;
   1340   response: EmptyObject;
   1341 };
   1342 // ExportBackup = "exportBackup"
   1343 
   1344 ```
   1345 
   1346 ### AddBackupProviderOp
   1347 ```typescript
   1348 /**
   1349  * Add a new backup provider.
   1350  */
   1351 export type AddBackupProviderOp = {
   1352   op: WalletApiOperation.AddBackupProvider;
   1353   request: AddBackupProviderRequest;
   1354   response: AddBackupProviderResponse;
   1355 };
   1356 // AddBackupProvider = "addBackupProvider"
   1357 
   1358 ```
   1359 ```typescript
   1360 export interface AddBackupProviderRequest {
   1361   backupProviderBaseUrl: string;
   1362   name: string;
   1363   /**
   1364    * Activate the provider.  Should only be done after
   1365    * the user has reviewed the provider.
   1366    */
   1367   activate?: boolean;
   1368 }
   1369 
   1370 ```
   1371 ```typescript
   1372 export type AddBackupProviderResponse =
   1373   | AddBackupProviderOk
   1374   | AddBackupProviderPaymentRequired;
   1375 
   1376 ```
   1377 ```typescript
   1378 interface AddBackupProviderOk {
   1379   status: "ok";
   1380 }
   1381 
   1382 ```
   1383 ```typescript
   1384 interface AddBackupProviderPaymentRequired {
   1385   status: "payment-required";
   1386   talerUri?: string;
   1387 }
   1388 
   1389 ```
   1390 
   1391 ### RemoveBackupProviderOp
   1392 ```typescript
   1393 export type RemoveBackupProviderOp = {
   1394   op: WalletApiOperation.RemoveBackupProvider;
   1395   request: RemoveBackupProviderRequest;
   1396   response: EmptyObject;
   1397 };
   1398 // RemoveBackupProvider = "removeBackupProvider"
   1399 
   1400 ```
   1401 ```typescript
   1402 export interface RemoveBackupProviderRequest {
   1403   provider: string;
   1404 }
   1405 
   1406 ```
   1407 
   1408 ### GetBackupInfoOp
   1409 ```typescript
   1410 /**
   1411  * Get some useful stats about the backup state.
   1412  */
   1413 export type GetBackupInfoOp = {
   1414   op: WalletApiOperation.GetBackupInfo;
   1415   request: EmptyObject;
   1416   response: BackupInfo;
   1417 };
   1418 // GetBackupInfo = "getBackupInfo"
   1419 
   1420 ```
   1421 ```typescript
   1422 export interface BackupInfo {
   1423   walletRootPub: string;
   1424   deviceId: string;
   1425   providers: ProviderInfo[];
   1426 }
   1427 
   1428 ```
   1429 ```typescript
   1430 /**
   1431  * Information about one provider.
   1432  *
   1433  * We don't store the account key here,
   1434  * as that's derived from the wallet root key.
   1435  */
   1436 export interface ProviderInfo {
   1437   active: boolean;
   1438   syncProviderBaseUrl: string;
   1439   name: string;
   1440   terms?: BackupProviderTerms;
   1441   /**
   1442    * Last communication issue with the provider.
   1443    */
   1444   lastError?: TalerErrorDetail;
   1445   lastSuccessfulBackupTimestamp?: TalerProtocolTimestamp;
   1446   lastAttemptedBackupTimestamp?: TalerProtocolTimestamp;
   1447   paymentProposalIds: string[];
   1448   backupProblem?: BackupProblem;
   1449   paymentStatus: ProviderPaymentStatus;
   1450 }
   1451 
   1452 ```
   1453 ```typescript
   1454 export interface BackupProviderTerms {
   1455   supportedProtocolVersion: string;
   1456   annualFee: AmountString;
   1457   storageLimitInMegabytes: number;
   1458 }
   1459 
   1460 ```
   1461 ```typescript
   1462 export type BackupProblem =
   1463   | BackupUnreadableProblem
   1464   | BackupConflictingDeviceProblem;
   1465 
   1466 ```
   1467 ```typescript
   1468 export interface BackupUnreadableProblem {
   1469   type: "backup-unreadable";
   1470 }
   1471 
   1472 ```
   1473 ```typescript
   1474 export interface BackupConflictingDeviceProblem {
   1475   type: "backup-conflicting-device";
   1476   otherDeviceId: string;
   1477   myDeviceId: string;
   1478   backupTimestamp: AbsoluteTime;
   1479 }
   1480 
   1481 ```
   1482 ```typescript
   1483 export type ProviderPaymentStatus =
   1484   | ProviderPaymentTermsChanged
   1485   | ProviderPaymentPaid
   1486   | ProviderPaymentInsufficientBalance
   1487   | ProviderPaymentUnpaid
   1488   | ProviderPaymentPending;
   1489 
   1490 ```
   1491 ```typescript
   1492 export interface ProviderPaymentTermsChanged {
   1493   type: ProviderPaymentType.TermsChanged;
   1494   paidUntil: AbsoluteTime;
   1495   oldTerms: BackupProviderTerms;
   1496   newTerms: BackupProviderTerms;
   1497 }
   1498 
   1499 ```
   1500 ```typescript
   1501 export interface ProviderPaymentPaid {
   1502   type: ProviderPaymentType.Paid;
   1503   paidUntil: AbsoluteTime;
   1504 }
   1505 
   1506 ```
   1507 ```typescript
   1508 export interface ProviderPaymentInsufficientBalance {
   1509   type: ProviderPaymentType.InsufficientBalance;
   1510   amount: AmountString;
   1511 }
   1512 
   1513 ```
   1514 ```typescript
   1515 export interface ProviderPaymentUnpaid {
   1516   type: ProviderPaymentType.Unpaid;
   1517 }
   1518 
   1519 ```
   1520 ```typescript
   1521 export interface ProviderPaymentPending {
   1522   type: ProviderPaymentType.Pending;
   1523   talerUri?: string;
   1524 }
   1525 
   1526 ```
   1527 
   1528 ### SetWalletDeviceIdOp
   1529 ```typescript
   1530 /**
   1531  * Set the internal device ID of the wallet, used to
   1532  * identify whether a different/new wallet is accessing
   1533  * the backup of another wallet.
   1534  */
   1535 export type SetWalletDeviceIdOp = {
   1536   op: WalletApiOperation.SetWalletDeviceId;
   1537   request: SetWalletDeviceIdRequest;
   1538   response: EmptyObject;
   1539 };
   1540 // SetWalletDeviceId = "setWalletDeviceId"
   1541 
   1542 ```
   1543 ```typescript
   1544 export interface SetWalletDeviceIdRequest {
   1545   /**
   1546    * New wallet device ID to set.
   1547    */
   1548   walletDeviceId: string;
   1549 }
   1550 
   1551 ```
   1552 
   1553 ### ExportBackupPlainOp
   1554 ```typescript
   1555 /**
   1556  * Export a backup JSON, mostly useful for testing.
   1557  */
   1558 export type ExportBackupPlainOp = {
   1559   op: WalletApiOperation.ExportBackupPlain;
   1560   request: EmptyObject;
   1561   response: WalletBackupContentV1;
   1562 };
   1563 // ExportBackupPlain = "exportBackupPlain"
   1564 
   1565 ```
   1566 
   1567 ### CheckPeerPushDebitOp
   1568 ```typescript
   1569 /**
   1570  * Check if initiating a peer push payment is possible
   1571  * based on the funds in the wallet.
   1572  */
   1573 export type CheckPeerPushDebitOp = {
   1574   op: WalletApiOperation.CheckPeerPushDebit;
   1575   request: CheckPeerPushDebitRequest;
   1576   response: CheckPeerPushDebitResponse;
   1577 };
   1578 // CheckPeerPushDebit = "checkPeerPushDebit"
   1579 
   1580 ```
   1581 ```typescript
   1582 export interface CheckPeerPushDebitRequest {
   1583   /**
   1584    * Preferred exchange to use for the p2p payment.
   1585    */
   1586   exchangeBaseUrl?: string;
   1587   /**
   1588    * Instructed amount.
   1589    *
   1590    * FIXME: Allow specifying the instructed amount type.
   1591    */
   1592   amount: AmountString;
   1593 }
   1594 
   1595 ```
   1596 ```typescript
   1597 export interface CheckPeerPushDebitResponse {
   1598   amountRaw: AmountString;
   1599   amountEffective: AmountString;
   1600 }
   1601 
   1602 ```
   1603 
   1604 ### InitiatePeerPushDebitOp
   1605 ```typescript
   1606 /**
   1607  * Initiate an outgoing peer push payment.
   1608  */
   1609 export type InitiatePeerPushDebitOp = {
   1610   op: WalletApiOperation.InitiatePeerPushDebit;
   1611   request: InitiatePeerPushPaymentRequest;
   1612   response: InitiatePeerPushPaymentResponse;
   1613 };
   1614 // InitiatePeerPushDebit = "initiatePeerPushDebit"
   1615 
   1616 ```
   1617 ```typescript
   1618 export interface InitiatePeerPushPaymentRequest {
   1619   exchangeBaseUrl?: string;
   1620   partialContractTerms: PeerContractTerms;
   1621 }
   1622 
   1623 ```
   1624 ```typescript
   1625 export interface InitiatePeerPushPaymentResponse {
   1626   exchangeBaseUrl: string;
   1627   pursePub: string;
   1628   mergePriv: string;
   1629   contractPriv: string;
   1630   talerUri: string;
   1631   transactionId: string;
   1632 }
   1633 
   1634 ```
   1635 
   1636 ### PreparePeerPushCreditOp
   1637 ```typescript
   1638 /**
   1639  * Check an incoming peer push payment.
   1640  */
   1641 export type PreparePeerPushCreditOp = {
   1642   op: WalletApiOperation.PreparePeerPushCredit;
   1643   request: PreparePeerPushCredit;
   1644   response: PreparePeerPushCreditResponse;
   1645 };
   1646 // PreparePeerPushCredit = "preparePeerPushCredit"
   1647 
   1648 ```
   1649 ```typescript
   1650 export interface PreparePeerPushCreditResponse {
   1651   contractTerms: PeerContractTerms;
   1652   /**
   1653    * @deprecated
   1654    */
   1655   amount: AmountString;
   1656   amountRaw: AmountString;
   1657   amountEffective: AmountString;
   1658   peerPushPaymentIncomingId: string;
   1659 }
   1660 
   1661 ```
   1662 
   1663 ### ConfirmPeerPushCreditOp
   1664 ```typescript
   1665 /**
   1666  * Accept an incoming peer push payment.
   1667  */
   1668 export type ConfirmPeerPushCreditOp = {
   1669   op: WalletApiOperation.ConfirmPeerPushCredit;
   1670   request: ConfirmPeerPushCreditRequest;
   1671   response: EmptyObject;
   1672 };
   1673 // ConfirmPeerPushCredit = "confirmPeerPushCredit"
   1674 
   1675 ```
   1676 ```typescript
   1677 export interface ConfirmPeerPushCreditRequest {
   1678   /**
   1679    * Transparent identifier of the incoming peer push payment.
   1680    */
   1681   peerPushPaymentIncomingId: string;
   1682 }
   1683 
   1684 ```
   1685 
   1686 ### CheckPeerPullCreditOp
   1687 ```typescript
   1688 /**
   1689  * Check fees for an outgoing peer pull payment.
   1690  */
   1691 export type CheckPeerPullCreditOp = {
   1692   op: WalletApiOperation.CheckPeerPullCredit;
   1693   request: CheckPeerPullCreditRequest;
   1694   response: CheckPeerPullCreditResponse;
   1695 };
   1696 // CheckPeerPullCredit = "checkPeerPullCredit"
   1697 
   1698 ```
   1699 ```typescript
   1700 export interface CheckPeerPullCreditRequest {
   1701   exchangeBaseUrl?: string;
   1702   amount: AmountString;
   1703 }
   1704 
   1705 ```
   1706 ```typescript
   1707 export interface CheckPeerPullCreditResponse {
   1708   exchangeBaseUrl: string;
   1709   amountRaw: AmountString;
   1710   amountEffective: AmountString;
   1711 }
   1712 
   1713 ```
   1714 
   1715 ### InitiatePeerPullCreditOp
   1716 ```typescript
   1717 /**
   1718  * Initiate an outgoing peer pull payment.
   1719  */
   1720 export type InitiatePeerPullCreditOp = {
   1721   op: WalletApiOperation.InitiatePeerPullCredit;
   1722   request: InitiatePeerPullCreditRequest;
   1723   response: InitiatePeerPullCreditResponse;
   1724 };
   1725 // InitiatePeerPullCredit = "initiatePeerPullCredit"
   1726 
   1727 ```
   1728 ```typescript
   1729 export interface InitiatePeerPullCreditRequest {
   1730   exchangeBaseUrl?: string;
   1731   partialContractTerms: PeerContractTerms;
   1732 }
   1733 
   1734 ```
   1735 ```typescript
   1736 export interface InitiatePeerPullCreditResponse {
   1737   /**
   1738    * Taler URI for the other party to make the payment
   1739    * that was requested.
   1740    */
   1741   talerUri: string;
   1742   transactionId: string;
   1743 }
   1744 
   1745 ```
   1746 
   1747 ### PreparePeerPullDebitOp
   1748 ```typescript
   1749 /**
   1750  * Prepare for an incoming peer pull payment.
   1751  */
   1752 export type PreparePeerPullDebitOp = {
   1753   op: WalletApiOperation.PreparePeerPullDebit;
   1754   request: PreparePeerPullDebitRequest;
   1755   response: PreparePeerPullDebitResponse;
   1756 };
   1757 // PreparePeerPullDebit = "preparePeerPullDebit"
   1758 
   1759 ```
   1760 ```typescript
   1761 export interface PreparePeerPullDebitRequest {
   1762   talerUri: string;
   1763 }
   1764 
   1765 ```
   1766 ```typescript
   1767 export interface PreparePeerPullDebitResponse {
   1768   contractTerms: PeerContractTerms;
   1769   /**
   1770    * @deprecated Redundant field with bad name, will be removed soon.
   1771    */
   1772   amount: AmountString;
   1773   amountRaw: AmountString;
   1774   amountEffective: AmountString;
   1775   peerPullPaymentIncomingId: string;
   1776 }
   1777 
   1778 ```
   1779 
   1780 ### ConfirmPeerPullDebitOp
   1781 ```typescript
   1782 /**
   1783  * Accept an incoming peer pull payment (i.e. pay the other party).
   1784  */
   1785 export type ConfirmPeerPullDebitOp = {
   1786   op: WalletApiOperation.ConfirmPeerPullDebit;
   1787   request: ConfirmPeerPullDebitRequest;
   1788   response: EmptyObject;
   1789 };
   1790 // ConfirmPeerPullDebit = "confirmPeerPullDebit"
   1791 
   1792 ```
   1793 ```typescript
   1794 export interface ConfirmPeerPullDebitRequest {
   1795   /**
   1796    * Transparent identifier of the incoming peer pull payment.
   1797    */
   1798   peerPullPaymentIncomingId: string;
   1799 }
   1800 
   1801 ```
   1802 
   1803 ### ValidateIbanOp
   1804 ```typescript
   1805 export type ValidateIbanOp = {
   1806   op: WalletApiOperation.ValidateIban;
   1807   request: ValidateIbanRequest;
   1808   response: ValidateIbanResponse;
   1809 };
   1810 // ValidateIban = "validateIban"
   1811 
   1812 ```
   1813 ```typescript
   1814 export interface ValidateIbanRequest {
   1815   iban: string;
   1816 }
   1817 
   1818 ```
   1819 ```typescript
   1820 export interface ValidateIbanResponse {
   1821   valid: boolean;
   1822 }
   1823 
   1824 ```
   1825 
   1826 ### ExportDbOp
   1827 ```typescript
   1828 /**
   1829  * Export the wallet database's contents to JSON.
   1830  */
   1831 export type ExportDbOp = {
   1832   op: WalletApiOperation.ExportDb;
   1833   request: EmptyObject;
   1834   response: any;
   1835 };
   1836 // ExportDb = "exportDb"
   1837 
   1838 ```
   1839 
   1840 ### ImportDbOp
   1841 ```typescript
   1842 export type ImportDbOp = {
   1843   op: WalletApiOperation.ImportDb;
   1844   request: any;
   1845   response: any;
   1846 };
   1847 // ImportDb = "importDb"
   1848 
   1849 ```
   1850 
   1851 ### ClearDbOp
   1852 ```typescript
   1853 /**
   1854  * Dangerously clear the whole wallet database.
   1855  */
   1856 export type ClearDbOp = {
   1857   op: WalletApiOperation.ClearDb;
   1858   request: EmptyObject;
   1859   response: EmptyObject;
   1860 };
   1861 // ClearDb = "clearDb"
   1862 
   1863 ```
   1864 
   1865 ### RecycleOp
   1866 ```typescript
   1867 /**
   1868  * Export a backup, clear the database and re-import it.
   1869  */
   1870 export type RecycleOp = {
   1871   op: WalletApiOperation.Recycle;
   1872   request: EmptyObject;
   1873   response: EmptyObject;
   1874 };
   1875 // Recycle = "recycle"
   1876 
   1877 ```
   1878 
   1879 ### ApplyDevExperimentOp
   1880 ```typescript
   1881 /**
   1882  * Apply a developer experiment to the current wallet state.
   1883  *
   1884  * This allows UI developers / testers to play around without
   1885  * an elaborate test environment.
   1886  */
   1887 export type ApplyDevExperimentOp = {
   1888   op: WalletApiOperation.ApplyDevExperiment;
   1889   request: ApplyDevExperimentRequest;
   1890   response: EmptyObject;
   1891 };
   1892 // ApplyDevExperiment = "applyDevExperiment"
   1893 
   1894 ```
   1895 ```typescript
   1896 export interface ApplyDevExperimentRequest {
   1897   devExperimentUri: string;
   1898 }
   1899 
   1900 ```
   1901 
   1902 ### RunIntegrationTestOp
   1903 ```typescript
   1904 /**
   1905  * Run a simple integration test on a test deployment
   1906  * of the exchange and merchant.
   1907  */
   1908 export type RunIntegrationTestOp = {
   1909   op: WalletApiOperation.RunIntegrationTest;
   1910   request: IntegrationTestArgs;
   1911   response: EmptyObject;
   1912 };
   1913 // RunIntegrationTest = "runIntegrationTest"
   1914 
   1915 ```
   1916 
   1917 ### RunIntegrationTestV2Op
   1918 ```typescript
   1919 /**
   1920  * Run a simple integration test on a test deployment
   1921  * of the exchange and merchant.
   1922  */
   1923 export type RunIntegrationTestV2Op = {
   1924   op: WalletApiOperation.RunIntegrationTestV2;
   1925   request: IntegrationTestArgs;
   1926   response: EmptyObject;
   1927 };
   1928 // RunIntegrationTestV2 = "runIntegrationTestV2"
   1929 
   1930 ```
   1931 
   1932 ### TestCryptoOp
   1933 ```typescript
   1934 /**
   1935  * Test crypto worker.
   1936  */
   1937 export type TestCryptoOp = {
   1938   op: WalletApiOperation.TestCrypto;
   1939   request: EmptyObject;
   1940   response: any;
   1941 };
   1942 // TestCrypto = "testCrypto"
   1943 
   1944 ```
   1945 
   1946 ### WithdrawTestBalanceOp
   1947 ```typescript
   1948 /**
   1949  * Make withdrawal on a test deployment of the exchange
   1950  * and merchant.
   1951  */
   1952 export type WithdrawTestBalanceOp = {
   1953   op: WalletApiOperation.WithdrawTestBalance;
   1954   request: WithdrawTestBalanceRequest;
   1955   response: EmptyObject;
   1956 };
   1957 // WithdrawTestBalance = "withdrawTestBalance"
   1958 
   1959 ```
   1960 ```typescript
   1961 export interface WithdrawTestBalanceRequest {
   1962   amount: string;
   1963   /**
   1964    * Bank access API base URL.
   1965    */
   1966   bankAccessApiBaseUrl: string;
   1967   exchangeBaseUrl: string;
   1968   forcedDenomSel?: ForcedDenomSel;
   1969 }
   1970 
   1971 ```
   1972 
   1973 ### WithdrawTestkudosOp
   1974 ```typescript
   1975 /**
   1976  * Make a withdrawal of testkudos on test.taler.net.
   1977  */
   1978 export type WithdrawTestkudosOp = {
   1979   op: WalletApiOperation.WithdrawTestkudos;
   1980   request: EmptyObject;
   1981   response: EmptyObject;
   1982 };
   1983 // WithdrawTestkudos = "withdrawTestkudos"
   1984 
   1985 ```
   1986 
   1987 ### TestPayOp
   1988 ```typescript
   1989 /**
   1990  * Make a test payment using a test deployment of
   1991  * the exchange and merchant.
   1992  */
   1993 export type TestPayOp = {
   1994   op: WalletApiOperation.TestPay;
   1995   request: TestPayArgs;
   1996   response: TestPayResult;
   1997 };
   1998 // TestPay = "testPay"
   1999 
   2000 ```
   2001 ```typescript
   2002 export interface TestPayArgs {
   2003   merchantBaseUrl: string;
   2004   merchantAuthToken?: string;
   2005   amount: string;
   2006   summary: string;
   2007   forcedCoinSel?: ForcedCoinSel;
   2008 }
   2009 
   2010 ```
   2011 ```typescript
   2012 export interface TestPayResult {
   2013   payCoinSelection: PayCoinSelection;
   2014 }
   2015 
   2016 ```
   2017 ```typescript
   2018 /**
   2019  * Result of selecting coins, contains the exchange, and selected
   2020  * coins with their denomination.
   2021  */
   2022 export interface PayCoinSelection {
   2023   /**
   2024    * Amount requested by the merchant.
   2025    */
   2026   paymentAmount: AmountString;
   2027   /**
   2028    * Public keys of the coins that were selected.
   2029    */
   2030   coinPubs: string[];
   2031   /**
   2032    * Amount that each coin contributes.
   2033    */
   2034   coinContributions: AmountString[];
   2035   /**
   2036    * How much of the wire fees is the customer paying?
   2037    */
   2038   customerWireFees: AmountString;
   2039   /**
   2040    * How much of the deposit fees is the customer paying?
   2041    */
   2042   customerDepositFees: AmountString;
   2043 }
   2044 
   2045 ```
   2046 
   2047 ### WithdrawFakebankOp
   2048 ```typescript
   2049 /**
   2050  * Make a withdrawal from a fakebank, i.e.
   2051  * a bank where test users can be registered freely
   2052  * and testing APIs are available.
   2053  */
   2054 export type WithdrawFakebankOp = {
   2055   op: WalletApiOperation.WithdrawFakebank;
   2056   request: WithdrawFakebankRequest;
   2057   response: EmptyObject;
   2058 };
   2059 // WithdrawFakebank = "withdrawFakebank"
   2060 
   2061 ```
   2062 ```typescript
   2063 export interface WithdrawFakebankRequest {
   2064   amount: AmountString;
   2065   exchange: string;
   2066   bank: string;
   2067 }
   2068 
   2069 ```
   2070 
   2071 ### GetPendingTasksOp
   2072 ```typescript
   2073 /**
   2074  * Get wallet-internal pending tasks.
   2075  */
   2076 export type GetPendingTasksOp = {
   2077   op: WalletApiOperation.GetPendingOperations;
   2078   request: EmptyObject;
   2079   response: PendingTasksResponse;
   2080 };
   2081 // GetPendingOperations = "getPendingOperations"
   2082 
   2083 ```
   2084 ```typescript
   2085 /**
   2086  * Response returned from the pending operations API.
   2087  */
   2088 export interface PendingOperationsResponse {
   2089   /**
   2090    * List of pending operations.
   2091    */
   2092   pendingOperations: PendingTaskInfo[];
   2093 }
   2094 
   2095 ```
   2096 ```typescript
   2097 /**
   2098  * Information about a pending operation.
   2099  */
   2100 export type PendingTaskInfo = PendingTaskInfoCommon &
   2101   (
   2102     | PendingExchangeUpdateTask
   2103     | PendingExchangeCheckRefreshTask
   2104     | PendingPurchaseTask
   2105     | PendingRefreshTask
   2106     | PendingTipPickupTask
   2107     | PendingWithdrawTask
   2108     | PendingRecoupTask
   2109     | PendingDepositTask
   2110     | PendingBackupTask
   2111     | PendingPeerPushInitiationTask
   2112     | PendingPeerPullInitiationTask
   2113     | PendingPeerPullDebitTask
   2114     | PendingPeerPushCreditTask
   2115   );
   2116 
   2117 ```
   2118 ```typescript
   2119 /**
   2120  * Fields that are present in every pending operation.
   2121  */
   2122 export interface PendingTaskInfoCommon {
   2123   /**
   2124    * Type of the pending operation.
   2125    */
   2126   type: PendingTaskType;
   2127   /**
   2128    * Unique identifier for the pending task.
   2129    */
   2130   id: string;
   2131   /**
   2132    * Set to true if the operation indicates that something is really in progress,
   2133    * as opposed to some regular scheduled operation that can be tried later.
   2134    */
   2135   givesLifeness: boolean;
   2136   /**
   2137    * Operation is active and waiting for a longpoll result.
   2138    */
   2139   isLongpolling: boolean;
   2140   /**
   2141    * Operation is waiting to be executed.
   2142    */
   2143   isDue: boolean;
   2144   /**
   2145    * Timestamp when the pending operation should be executed next.
   2146    */
   2147   timestampDue: AbsoluteTime;
   2148   /**
   2149    * Retry info.  Currently used to stop the wallet after any operation
   2150    * exceeds a number of retries.
   2151    */
   2152   retryInfo?: RetryInfo;
   2153 }
   2154 
   2155 ```
   2156 ```typescript
   2157 export enum PendingTaskType {
   2158   ExchangeUpdate = "exchange-update",
   2159   ExchangeCheckRefresh = "exchange-check-refresh",
   2160   Purchase = "purchase",
   2161   Refresh = "refresh",
   2162   Recoup = "recoup",
   2163   TipPickup = "tip-pickup",
   2164   Withdraw = "withdraw",
   2165   Deposit = "deposit",
   2166   Backup = "backup",
   2167   // FIXME: Rename to peer-push-debit and peer-pull-debit
   2168   PeerPushInitiation = "peer-push-initiation",
   2169   PeerPullInitiation = "peer-pull-initiation",
   2170   PeerPushCredit = "peer-push-credit",
   2171   PeerPullDebit = "peer-pull-debit",
   2172 }
   2173 
   2174 ```
   2175 ```typescript
   2176 export interface RetryInfo {
   2177   firstTry: AbsoluteTime;
   2178   nextRetry: AbsoluteTime;
   2179   retryCounter: number;
   2180 }
   2181 
   2182 ```
   2183 ```typescript
   2184 export interface RetryPolicy {
   2185   readonly backoffDelta: Duration;
   2186   readonly backoffBase: number;
   2187   readonly maxTimeout: Duration;
   2188 }
   2189 
   2190 ```
   2191 ```typescript
   2192 // Declare "static" methods in Error
   2193 interface ErrorConstructor {
   2194   /** Create .stack property on a target object */
   2195   captureStackTrace(targetObject: object, constructorOpt?: Function): void;
   2196   /**
   2197    * Optional override for formatting stack traces
   2198    *
   2199    * @see https://v8.dev/docs/stack-trace-api#customizing-stack-traces
   2200    */
   2201   prepareStackTrace?:
   2202     | ((err: Error, stackTraces: NodeJS.CallSite[]) => any)
   2203     | undefined;
   2204   stackTraceLimit: number;
   2205 }
   2206 
   2207 ```
   2208 ```typescript
   2209 interface CallSite {
   2210   /**
   2211    * Value of "this"
   2212    */
   2213   getThis(): unknown;
   2214   /**
   2215    * Type of "this" as a string.
   2216    * This is the name of the function stored in the constructor field of
   2217    * "this", if available.  Otherwise the object's [[Class]] internal
   2218    * property.
   2219    */
   2220   getTypeName(): string | null;
   2221   /**
   2222    * Current function
   2223    */
   2224   getFunction(): Function | undefined;
   2225   /**
   2226    * Name of the current function, typically its name property.
   2227    * If a name property is not available an attempt will be made to try
   2228    * to infer a name from the function's context.
   2229    */
   2230   getFunctionName(): string | null;
   2231   /**
   2232    * Name of the property [of "this" or one of its prototypes] that holds
   2233    * the current function
   2234    */
   2235   getMethodName(): string | null;
   2236   /**
   2237    * Name of the script [if this function was defined in a script]
   2238    */
   2239   getFileName(): string | null;
   2240   /**
   2241    * Current line number [if this function was defined in a script]
   2242    */
   2243   getLineNumber(): number | null;
   2244   /**
   2245    * Current column number [if this function was defined in a script]
   2246    */
   2247   getColumnNumber(): number | null;
   2248   /**
   2249    * A call site object representing the location where eval was called
   2250    * [if this function was created using a call to eval]
   2251    */
   2252   getEvalOrigin(): string | undefined;
   2253   /**
   2254    * Is this a toplevel invocation, that is, is "this" the global object?
   2255    */
   2256   isToplevel(): boolean;
   2257   /**
   2258    * Does this call take place in code defined by a call to eval?
   2259    */
   2260   isEval(): boolean;
   2261   /**
   2262    * Is this call in native V8 code?
   2263    */
   2264   isNative(): boolean;
   2265   /**
   2266    * Is this a constructor call?
   2267    */
   2268   isConstructor(): boolean;
   2269 }
   2270 
   2271 ```
   2272 ```typescript
   2273 /**
   2274  * The wallet is currently updating information about an exchange.
   2275  */
   2276 export interface PendingExchangeUpdateTask {
   2277   type: PendingTaskType.ExchangeUpdate;
   2278   exchangeBaseUrl: string;
   2279   lastError: TalerErrorDetail | undefined;
   2280 }
   2281 
   2282 ```
   2283 ```typescript
   2284 /**
   2285  * The wallet should check whether coins from this exchange
   2286  * need to be auto-refreshed.
   2287  */
   2288 export interface PendingExchangeCheckRefreshTask {
   2289   type: PendingTaskType.ExchangeCheckRefresh;
   2290   exchangeBaseUrl: string;
   2291 }
   2292 
   2293 ```
   2294 ```typescript
   2295 /**
   2296  * A purchase needs to be processed (i.e. for download / payment / refund).
   2297  */
   2298 export interface PendingPurchaseTask {
   2299   type: PendingTaskType.Purchase;
   2300   proposalId: string;
   2301   retryInfo?: RetryInfo;
   2302   /**
   2303    * Status of the payment as string, used only for debugging.
   2304    */
   2305   statusStr: string;
   2306   lastError: TalerErrorDetail | undefined;
   2307 }
   2308 
   2309 ```
   2310 ```typescript
   2311 /**
   2312  * Status of an ongoing withdrawal operation.
   2313  */
   2314 export interface PendingRefreshTask {
   2315   type: PendingTaskType.Refresh;
   2316   lastError?: TalerErrorDetail;
   2317   refreshGroupId: string;
   2318   finishedPerCoin: boolean[];
   2319   retryInfo?: RetryInfo;
   2320 }
   2321 
   2322 ```
   2323 ```typescript
   2324 /**
   2325  * The wallet is picking up a tip that the user has accepted.
   2326  */
   2327 export interface PendingTipPickupTask {
   2328   type: PendingTaskType.TipPickup;
   2329   tipId: string;
   2330   merchantBaseUrl: string;
   2331   merchantTipId: string;
   2332 }
   2333 
   2334 ```
   2335 ```typescript
   2336 /**
   2337  * Status of an ongoing withdrawal operation.
   2338  */
   2339 export interface PendingWithdrawTask {
   2340   type: PendingTaskType.Withdraw;
   2341   lastError: TalerErrorDetail | undefined;
   2342   retryInfo?: RetryInfo;
   2343   withdrawalGroupId: string;
   2344 }
   2345 
   2346 ```
   2347 ```typescript
   2348 export interface PendingRecoupTask {
   2349   type: PendingTaskType.Recoup;
   2350   recoupGroupId: string;
   2351   retryInfo?: RetryInfo;
   2352   lastError: TalerErrorDetail | undefined;
   2353 }
   2354 
   2355 ```
   2356 ```typescript
   2357 /**
   2358  * Status of an ongoing deposit operation.
   2359  */
   2360 export interface PendingDepositTask {
   2361   type: PendingTaskType.Deposit;
   2362   lastError: TalerErrorDetail | undefined;
   2363   retryInfo: RetryInfo | undefined;
   2364   depositGroupId: string;
   2365 }
   2366 
   2367 ```
   2368 ```typescript
   2369 export interface PendingBackupTask {
   2370   type: PendingTaskType.Backup;
   2371   backupProviderBaseUrl: string;
   2372   lastError: TalerErrorDetail | undefined;
   2373 }
   2374 
   2375 ```
   2376 ```typescript
   2377 /**
   2378  * The wallet wants to send a peer push payment.
   2379  */
   2380 export interface PendingPeerPushInitiationTask {
   2381   type: PendingTaskType.PeerPushInitiation;
   2382   pursePub: string;
   2383 }
   2384 
   2385 ```
   2386 ```typescript
   2387 /**
   2388  * The wallet wants to send a peer pull payment.
   2389  */
   2390 export interface PendingPeerPullInitiationTask {
   2391   type: PendingTaskType.PeerPullInitiation;
   2392   pursePub: string;
   2393 }
   2394 
   2395 ```
   2396 ```typescript
   2397 /**
   2398  * The wallet wants to send a peer pull payment.
   2399  */
   2400 export interface PendingPeerPullDebitTask {
   2401   type: PendingTaskType.PeerPullDebit;
   2402   peerPullPaymentIncomingId: string;
   2403 }
   2404 
   2405 ```
   2406 ```typescript
   2407 /**
   2408  */
   2409 export interface PendingPeerPushCreditTask {
   2410   type: PendingTaskType.PeerPushCredit;
   2411   peerPushPaymentIncomingId: string;
   2412 }
   2413 
   2414 ```
   2415 
   2416 ### DumpCoinsOp
   2417 ```typescript
   2418 /**
   2419  * Dump all coins of the wallet in a simple JSON format.
   2420  */
   2421 export type DumpCoinsOp = {
   2422   op: WalletApiOperation.DumpCoins;
   2423   request: EmptyObject;
   2424   response: CoinDumpJson;
   2425 };
   2426 // DumpCoins = "dumpCoins"
   2427 
   2428 ```
   2429 ```typescript
   2430 /**
   2431  * Easy to process format for the public data of coins
   2432  * managed by the wallet.
   2433  */
   2434 export interface CoinDumpJson {
   2435   coins: Array<{
   2436     /**
   2437      * The coin's denomination's public key.
   2438      */
   2439     denom_pub: DenominationPubKey;
   2440     /**
   2441      * Hash of denom_pub.
   2442      */
   2443     denom_pub_hash: string;
   2444     /**
   2445      * Value of the denomination (without any fees).
   2446      */
   2447     denom_value: string;
   2448     /**
   2449      * Public key of the coin.
   2450      */
   2451     coin_pub: string;
   2452     /**
   2453      * Base URL of the exchange for the coin.
   2454      */
   2455     exchange_base_url: string;
   2456     /**
   2457      * Public key of the parent coin.
   2458      * Only present if this coin was obtained via refreshing.
   2459      */
   2460     refresh_parent_coin_pub: string | undefined;
   2461     /**
   2462      * Public key of the reserve for this coin.
   2463      * Only present if this coin was obtained via refreshing.
   2464      */
   2465     withdrawal_reserve_pub: string | undefined;
   2466     coin_status: CoinStatus;
   2467     spend_allocation:
   2468       | {
   2469           id: string;
   2470           amount: string;
   2471         }
   2472       | undefined;
   2473     /**
   2474      * Information about the age restriction
   2475      */
   2476     ageCommitmentProof: AgeCommitmentProof | undefined;
   2477   }>;
   2478 }
   2479 
   2480 ```
   2481 ```typescript
   2482 export type DenominationPubKey = RsaDenominationPubKey | CsDenominationPubKey;
   2483 
   2484 ```
   2485 ```typescript
   2486 export interface RsaDenominationPubKey {
   2487   readonly cipher: DenomKeyType.Rsa;
   2488   readonly rsa_public_key: string;
   2489   readonly age_mask: number;
   2490 }
   2491 
   2492 ```
   2493 ```typescript
   2494 export interface CsDenominationPubKey {
   2495   readonly cipher: DenomKeyType.ClauseSchnorr;
   2496   readonly age_mask: number;
   2497   readonly cs_public_key: string;
   2498 }
   2499 
   2500 ```
   2501 ```typescript
   2502 /**
   2503  * Status of a coin.
   2504  */
   2505 export declare enum CoinStatus {
   2506   /**
   2507    * Withdrawn and never shown to anybody.
   2508    */
   2509   Fresh = "fresh",
   2510   /**
   2511    * Fresh, but currently marked as "suspended", thus won't be used
   2512    * for spending.  Used for testing.
   2513    */
   2514   FreshSuspended = "fresh-suspended",
   2515   /**
   2516    * A coin that has been spent and refreshed.
   2517    */
   2518   Dormant = "dormant",
   2519 }
   2520 
   2521 ```
   2522 ```typescript
   2523 export interface AgeCommitmentProof {
   2524   commitment: AgeCommitment;
   2525   proof: AgeProof;
   2526 }
   2527 
   2528 ```
   2529 ```typescript
   2530 export interface AgeCommitment {
   2531   mask: number;
   2532   /**
   2533    * Public keys, one for each age group specified in the age mask.
   2534    */
   2535   publicKeys: Edx25519PublicKeyEnc[];
   2536 }
   2537 
   2538 ```
   2539 ```typescript
   2540 export type Edx25519PublicKeyEnc = FlavorP<string, "Edx25519PublicKeyEnc", 32>;
   2541 
   2542 ```
   2543 ```typescript
   2544 export type FlavorP<T, FlavorT extends string, S extends number> = T & {
   2545   _flavor?: `taler.${FlavorT}`;
   2546   _size?: S;
   2547 };
   2548 
   2549 ```
   2550 ```typescript
   2551 export interface AgeProof {
   2552   /**
   2553    * Private keys.  Typically smaller than the number of public keys,
   2554    * because we drop private keys from age groups that are restricted.
   2555    */
   2556   privateKeys: Edx25519PrivateKeyEnc[];
   2557 }
   2558 
   2559 ```
   2560 ```typescript
   2561 export type Edx25519PrivateKeyEnc = FlavorP<
   2562   string,
   2563   "Edx25519PrivateKeyEnc",
   2564   64
   2565 >;
   2566 
   2567 ```
   2568 
   2569 ### SetCoinSuspendedOp
   2570 ```typescript
   2571 /**
   2572  * Set a coin as (un-)suspended.
   2573  * Suspended coins won't be used for payments.
   2574  */
   2575 export type SetCoinSuspendedOp = {
   2576   op: WalletApiOperation.SetCoinSuspended;
   2577   request: SetCoinSuspendedRequest;
   2578   response: EmptyObject;
   2579 };
   2580 // SetCoinSuspended = "setCoinSuspended"
   2581 
   2582 ```
   2583 ```typescript
   2584 export interface SetCoinSuspendedRequest {
   2585   coinPub: string;
   2586   suspended: boolean;
   2587 }
   2588 
   2589 ```
   2590 
   2591 ### ForceRefreshOp
   2592 ```typescript
   2593 /**
   2594  * Force a refresh on coins where it would not
   2595  * be necessary.
   2596  */
   2597 export type ForceRefreshOp = {
   2598   op: WalletApiOperation.ForceRefresh;
   2599   request: ForceRefreshRequest;
   2600   response: EmptyObject;
   2601 };
   2602 // ForceRefresh = "forceRefresh"
   2603 
   2604 ```
   2605 ```typescript
   2606 export interface ForceRefreshRequest {
   2607   coinPubList: string[];
   2608 }
   2609 
   2610 ```
   2611 
   2612 ## Common Declarations
   2613 ```typescript
   2614 export interface WalletCoreVersion {
   2615   hash: string | undefined;
   2616   version: string;
   2617   exchange: string;
   2618   merchant: string;
   2619   bank: string;
   2620   /**
   2621    * @deprecated will be removed
   2622    */
   2623   devMode: boolean;
   2624 }
   2625 ```
   2626 ```typescript
   2627 export type Transaction =
   2628   | TransactionWithdrawal
   2629   | TransactionPayment
   2630   | TransactionRefund
   2631   | TransactionTip
   2632   | TransactionRefresh
   2633   | TransactionDeposit
   2634   | TransactionPeerPullCredit
   2635   | TransactionPeerPullDebit
   2636   | TransactionPeerPushCredit
   2637   | TransactionPeerPushDebit;
   2638 ```
   2639 ```typescript
   2640 export interface TransactionWithdrawal extends TransactionCommon {
   2641   type: TransactionType.Withdrawal;
   2642   /**
   2643    * Exchange of the withdrawal.
   2644    */
   2645   exchangeBaseUrl: string;
   2646   /**
   2647    * Amount that got subtracted from the reserve balance.
   2648    */
   2649   amountRaw: AmountString;
   2650   /**
   2651    * Amount that actually was (or will be) added to the wallet's balance.
   2652    */
   2653   amountEffective: AmountString;
   2654   withdrawalDetails: WithdrawalDetails;
   2655 }
   2656 ```
   2657 ```typescript
   2658 export interface TransactionCommon {
   2659   transactionId: TransactionIdStr;
   2660   type: TransactionType;
   2661   timestamp: TalerProtocolTimestamp;
   2662   /**
   2663    * Transaction state, as per DD37.
   2664    */
   2665   txState: TransactionState;
   2666   /**
   2667    * @deprecated in favor of statusMajor and statusMinor
   2668    */
   2669   extendedStatus: ExtendedStatus;
   2670   /**
   2671    * true if the transaction is still pending, false otherwise
   2672    * If a transaction is not longer pending, its timestamp will be updated,
   2673    * but its transactionId will remain unchanged
   2674    *
   2675    * @deprecated show extendedStatus
   2676    */
   2677   pending: boolean;
   2678   /**
   2679    * True if the transaction encountered a problem that might be
   2680    * permanent.  A frozen transaction won't be automatically retried.
   2681    *
   2682    * @deprecated show extendedStatus
   2683    */
   2684   frozen: boolean;
   2685   /**
   2686    * Raw amount of the transaction (exclusive of fees or other extra costs).
   2687    */
   2688   amountRaw: AmountString;
   2689   /**
   2690    * Amount added or removed from the wallet's balance (including all fees and other costs).
   2691    */
   2692   amountEffective: AmountString;
   2693   error?: TalerErrorDetail;
   2694 }
   2695 ```
   2696 ```typescript
   2697 export declare enum TransactionType {
   2698   Withdrawal = "withdrawal",
   2699   Payment = "payment",
   2700   Refund = "refund",
   2701   Refresh = "refresh",
   2702   Tip = "tip",
   2703   Deposit = "deposit",
   2704   PeerPushDebit = "peer-push-debit",
   2705   PeerPushCredit = "peer-push-credit",
   2706   PeerPullDebit = "peer-pull-debit",
   2707   PeerPullCredit = "peer-pull-credit",
   2708 }
   2709 ```
   2710 ```typescript
   2711 export interface TalerProtocolTimestamp {
   2712   readonly t_s: number | "never";
   2713 }
   2714 ```
   2715 ```typescript
   2716 export interface TransactionState {
   2717   major: TransactionMajorState;
   2718   minor?: TransactionMinorState;
   2719 }
   2720 ```
   2721 ```typescript
   2722 export declare enum TransactionMajorState {
   2723   None = "none",
   2724   Pending = "pending",
   2725   Done = "done",
   2726   Aborting = "aborting",
   2727   Aborted = "aborted",
   2728   Suspended = "suspended",
   2729   Failed = "failed",
   2730   Deleted = "deleted",
   2731   Unknown = "unknown",
   2732 }
   2733 ```
   2734 ```typescript
   2735 export declare enum TransactionMinorState {
   2736   Unknown = "unknown",
   2737   Deposit = "deposit",
   2738   KycRequired = "kyc-required",
   2739   Track = "track",
   2740   Refresh = "refresh",
   2741 }
   2742 ```
   2743 ```typescript
   2744 export declare enum ExtendedStatus {
   2745   Pending = "pending",
   2746   Done = "done",
   2747   Aborting = "aborting",
   2748   Aborted = "aborted",
   2749   Failed = "failed",
   2750   KycRequired = "kyc-required",
   2751 }
   2752 ```
   2753 ```typescript
   2754 export interface TalerErrorDetail {
   2755   code: TalerErrorCode;
   2756   when?: AbsoluteTime;
   2757   hint?: string;
   2758   [x: string]: unknown;
   2759 }
   2760 ```
   2761 ```typescript
   2762 export interface AbsoluteTime {
   2763   /**
   2764    * Timestamp in milliseconds.
   2765    */
   2766   readonly t_ms: number | "never";
   2767 }
   2768 ```
   2769 ```typescript
   2770 export interface Duration {
   2771   /**
   2772    * Duration in milliseconds.
   2773    */
   2774   readonly d_ms: number | "forever";
   2775 }
   2776 ```
   2777 ```typescript
   2778 export interface TalerProtocolDuration {
   2779   readonly d_us: number | "forever";
   2780 }
   2781 ```
   2782 ```typescript
   2783 export type WithdrawalDetails =
   2784   | WithdrawalDetailsForManualTransfer
   2785   | WithdrawalDetailsForTalerBankIntegrationApi;
   2786 ```
   2787 ```typescript
   2788 interface WithdrawalDetailsForManualTransfer {
   2789   type: WithdrawalType.ManualTransfer;
   2790   /**
   2791    * Payto URIs that the exchange supports.
   2792    *
   2793    * Already contains the amount and message.
   2794    */
   2795   exchangePaytoUris: string[];
   2796   reservePub: string;
   2797   /**
   2798    * Is the reserve ready for withdrawal?
   2799    */
   2800   reserveIsReady: boolean;
   2801 }
   2802 ```
   2803 ```typescript
   2804 interface WithdrawalDetailsForTalerBankIntegrationApi {
   2805   type: WithdrawalType.TalerBankIntegrationApi;
   2806   /**
   2807    * Set to true if the bank has confirmed the withdrawal, false if not.
   2808    * An unconfirmed withdrawal usually requires user-input and should be highlighted in the UI.
   2809    * See also bankConfirmationUrl below.
   2810    */
   2811   confirmed: boolean;
   2812   /**
   2813    * If the withdrawal is unconfirmed, this can include a URL for user
   2814    * initiated confirmation.
   2815    */
   2816   bankConfirmationUrl?: string;
   2817   reservePub: string;
   2818   /**
   2819    * Is the reserve ready for withdrawal?
   2820    */
   2821   reserveIsReady: boolean;
   2822 }
   2823 ```
   2824 ```typescript
   2825 export interface TransactionPayment extends TransactionCommon {
   2826   type: TransactionType.Payment;
   2827   /**
   2828    * Additional information about the payment.
   2829    */
   2830   info: OrderShortInfo;
   2831   /**
   2832    * Wallet-internal end-to-end identifier for the payment.
   2833    */
   2834   proposalId: string;
   2835   /**
   2836    * How far did the wallet get with processing the payment?
   2837    *
   2838    * @deprecated use extendedStatus
   2839    */
   2840   status: PaymentStatus;
   2841   /**
   2842    * Amount that must be paid for the contract
   2843    */
   2844   amountRaw: AmountString;
   2845   /**
   2846    * Amount that was paid, including deposit, wire and refresh fees.
   2847    */
   2848   amountEffective: AmountString;
   2849   /**
   2850    * Amount that has been refunded by the merchant
   2851    */
   2852   totalRefundRaw: AmountString;
   2853   /**
   2854    * Amount will be added to the wallet's balance after fees and refreshing
   2855    */
   2856   totalRefundEffective: AmountString;
   2857   /**
   2858    * Amount pending to be picked up
   2859    */
   2860   refundPending: AmountString | undefined;
   2861   /**
   2862    * Reference to applied refunds
   2863    */
   2864   refunds: RefundInfoShort[];
   2865   /**
   2866    * Is the wallet currently checking for a refund?
   2867    */
   2868   refundQueryActive: boolean;
   2869   /**
   2870    * Does this purchase has an pos validation
   2871    */
   2872   posConfirmation: string | undefined;
   2873 }
   2874 ```
   2875 ```typescript
   2876 export interface OrderShortInfo {
   2877   /**
   2878    * Order ID, uniquely identifies the order within a merchant instance
   2879    */
   2880   orderId: string;
   2881   /**
   2882    * Hash of the contract terms.
   2883    */
   2884   contractTermsHash: string;
   2885   /**
   2886    * More information about the merchant
   2887    */
   2888   merchant: MerchantInfo;
   2889   /**
   2890    * Summary of the order, given by the merchant
   2891    */
   2892   summary: string;
   2893   /**
   2894    * Map from IETF BCP 47 language tags to localized summaries
   2895    */
   2896   summary_i18n?: InternationalizedString;
   2897   /**
   2898    * List of products that are part of the order
   2899    */
   2900   products: Product[] | undefined;
   2901   /**
   2902    * Time indicating when the order should be delivered.
   2903    * May be overwritten by individual products.
   2904    */
   2905   delivery_date?: TalerProtocolTimestamp;
   2906   /**
   2907    * Delivery location for (all!) products.
   2908    */
   2909   delivery_location?: Location;
   2910   /**
   2911    * URL of the fulfillment, given by the merchant
   2912    */
   2913   fulfillmentUrl?: string;
   2914   /**
   2915    * Plain text message that should be shown to the user
   2916    * when the payment is complete.
   2917    */
   2918   fulfillmentMessage?: string;
   2919   /**
   2920    * Translations of fulfillmentMessage.
   2921    */
   2922   fulfillmentMessage_i18n?: InternationalizedString;
   2923 }
   2924 ```
   2925 ```typescript
   2926 export interface MerchantInfo {
   2927   name: string;
   2928   jurisdiction?: Location;
   2929   address?: Location;
   2930   logo?: string;
   2931   website?: string;
   2932   email?: string;
   2933 }
   2934 ```
   2935 ```typescript
   2936 export interface Location {
   2937   country?: string;
   2938   country_subdivision?: string;
   2939   district?: string;
   2940   town?: string;
   2941   town_location?: string;
   2942   post_code?: string;
   2943   street?: string;
   2944   building_name?: string;
   2945   building_number?: string;
   2946   address_lines?: string[];
   2947 }
   2948 ```
   2949 ```typescript
   2950 export interface InternationalizedString {
   2951   [lang_tag: string]: string;
   2952 }
   2953 ```
   2954 ```typescript
   2955 export interface Product {
   2956   product_id?: string;
   2957   description: string;
   2958   description_i18n?: {
   2959     [lang_tag: string]: string;
   2960   };
   2961   quantity?: number;
   2962   unit?: string;
   2963   price?: AmountString;
   2964   image?: string;
   2965   taxes?: Tax[];
   2966   delivery_date?: TalerProtocolTimestamp;
   2967 }
   2968 ```
   2969 ```typescript
   2970 export interface Tax {
   2971   name: string;
   2972   tax: AmountString;
   2973 }
   2974 ```
   2975 ```typescript
   2976 export declare enum PaymentStatus {
   2977   /**
   2978    * Explicitly aborted after timeout / failure
   2979    */
   2980   Aborted = "aborted",
   2981   /**
   2982    * Payment failed, wallet will auto-retry.
   2983    * User should be given the option to retry now / abort.
   2984    */
   2985   Failed = "failed",
   2986   /**
   2987    * Paid successfully
   2988    */
   2989   Paid = "paid",
   2990   /**
   2991    * User accepted, payment is processing.
   2992    */
   2993   Accepted = "accepted",
   2994 }
   2995 ```
   2996 ```typescript
   2997 export interface RefundInfoShort {
   2998   transactionId: string;
   2999   timestamp: TalerProtocolTimestamp;
   3000   amountEffective: AmountString;
   3001   amountRaw: AmountString;
   3002 }
   3003 ```
   3004 ```typescript
   3005 export interface TransactionRefund extends TransactionCommon {
   3006   type: TransactionType.Refund;
   3007   refundedTransactionId: string;
   3008   info: OrderShortInfo;
   3009   /**
   3010    * Amount pending to be picked up
   3011    */
   3012   refundPending: AmountString | undefined;
   3013   amountRaw: AmountString;
   3014   amountEffective: AmountString;
   3015 }
   3016 ```
   3017 ```typescript
   3018 export interface TransactionTip extends TransactionCommon {
   3019   type: TransactionType.Tip;
   3020   amountRaw: AmountString;
   3021   /**
   3022    * More information about the merchant
   3023    */
   3024   amountEffective: AmountString;
   3025   merchantBaseUrl: string;
   3026 }
   3027 ```
   3028 ```typescript
   3029 /**
   3030  * A transaction shown for refreshes.
   3031  * Only shown for (1) refreshes not associated with other transactions
   3032  * and (2) refreshes in an error state.
   3033  */
   3034 export interface TransactionRefresh extends TransactionCommon {
   3035   type: TransactionType.Refresh;
   3036   refreshReason: RefreshReason;
   3037   /**
   3038    * Transaction ID that caused this refresh.
   3039    */
   3040   originatingTransactionId?: string;
   3041   /**
   3042    * Always zero for refreshes
   3043    */
   3044   amountRaw: AmountString;
   3045   /**
   3046    * Fees, i.e. the effective, negative effect of the refresh
   3047    * on the balance.
   3048    *
   3049    * Only applicable for stand-alone refreshes, and zero for
   3050    * other refreshes where the transaction itself accounts for the
   3051    * refresh fee.
   3052    */
   3053   amountEffective: AmountString;
   3054   refreshInputAmount: AmountString;
   3055   refreshOutputAmount: AmountString;
   3056 }
   3057 ```
   3058 ```typescript
   3059 /**
   3060  * Reasons for why a coin is being refreshed.
   3061  */
   3062 export declare enum RefreshReason {
   3063   Manual = "manual",
   3064   PayMerchant = "pay-merchant",
   3065   PayDeposit = "pay-deposit",
   3066   PayPeerPush = "pay-peer-push",
   3067   PayPeerPull = "pay-peer-pull",
   3068   Refund = "refund",
   3069   AbortPay = "abort-pay",
   3070   AbortDeposit = "abort-deposit",
   3071   Recoup = "recoup",
   3072   BackupRestored = "backup-restored",
   3073   Scheduled = "scheduled",
   3074 }
   3075 ```
   3076 ```typescript
   3077 /**
   3078  * Deposit transaction, which effectively sends
   3079  * money from this wallet somewhere else.
   3080  */
   3081 export interface TransactionDeposit extends TransactionCommon {
   3082   type: TransactionType.Deposit;
   3083   depositGroupId: string;
   3084   /**
   3085    * Target for the deposit.
   3086    */
   3087   targetPaytoUri: string;
   3088   /**
   3089    * Raw amount that is being deposited
   3090    */
   3091   amountRaw: AmountString;
   3092   /**
   3093    * Effective amount that is being deposited
   3094    */
   3095   amountEffective: AmountString;
   3096   wireTransferDeadline: TalerProtocolTimestamp;
   3097   wireTransferProgress: number;
   3098   /**
   3099    * Did all the deposit requests succeed?
   3100    */
   3101   deposited: boolean;
   3102   trackingState: Array<{
   3103     wireTransferId: string;
   3104     timestampExecuted: TalerProtocolTimestamp;
   3105     amountRaw: AmountString;
   3106     wireFee: AmountString;
   3107   }>;
   3108 }
   3109 ```
   3110 ```typescript
   3111 /**
   3112  * Credit because we were paid for a P2P invoice we created.
   3113  */
   3114 export interface TransactionPeerPullCredit extends TransactionCommon {
   3115   type: TransactionType.PeerPullCredit;
   3116   info: PeerInfoShort;
   3117   /**
   3118    * Exchange used.
   3119    */
   3120   exchangeBaseUrl: string;
   3121   /**
   3122    * Amount that got subtracted from the reserve balance.
   3123    */
   3124   amountRaw: AmountString;
   3125   /**
   3126    * Amount that actually was (or will be) added to the wallet's balance.
   3127    */
   3128   amountEffective: AmountString;
   3129   /**
   3130    * URI to send to the other party.
   3131    */
   3132   talerUri: string;
   3133 }
   3134 ```
   3135 ```typescript
   3136 export interface PeerInfoShort {
   3137   expiration: TalerProtocolTimestamp | undefined;
   3138   summary: string | undefined;
   3139 }
   3140 ```
   3141 ```typescript
   3142 /**
   3143  * Debit because we paid someone's invoice.
   3144  */
   3145 export interface TransactionPeerPullDebit extends TransactionCommon {
   3146   type: TransactionType.PeerPullDebit;
   3147   info: PeerInfoShort;
   3148   /**
   3149    * Exchange used.
   3150    */
   3151   exchangeBaseUrl: string;
   3152   amountRaw: AmountString;
   3153   amountEffective: AmountString;
   3154 }
   3155 ```
   3156 ```typescript
   3157 /**
   3158  * We received money via a P2P payment.
   3159  */
   3160 export interface TransactionPeerPushCredit extends TransactionCommon {
   3161   type: TransactionType.PeerPushCredit;
   3162   info: PeerInfoShort;
   3163   /**
   3164    * Exchange used.
   3165    */
   3166   exchangeBaseUrl: string;
   3167   /**
   3168    * Amount that got subtracted from the reserve balance.
   3169    */
   3170   amountRaw: AmountString;
   3171   /**
   3172    * Amount that actually was (or will be) added to the wallet's balance.
   3173    */
   3174   amountEffective: AmountString;
   3175 }
   3176 ```
   3177 ```typescript
   3178 /**
   3179  * We sent money via a P2P payment.
   3180  */
   3181 export interface TransactionPeerPushDebit extends TransactionCommon {
   3182   type: TransactionType.PeerPushDebit;
   3183   info: PeerInfoShort;
   3184   /**
   3185    * Exchange used.
   3186    */
   3187   exchangeBaseUrl: string;
   3188   /**
   3189    * Amount that got subtracted from the reserve balance.
   3190    */
   3191   amountRaw: AmountString;
   3192   /**
   3193    * Amount that actually was (or will be) added to the wallet's balance.
   3194    */
   3195   amountEffective: AmountString;
   3196   /**
   3197    * URI to accept the payment.
   3198    */
   3199   talerUri: string;
   3200 }
   3201 ```
   3202 ```typescript
   3203 export interface AbortTransactionRequest {
   3204   transactionId: string;
   3205   /**
   3206    * Move the payment immediately into an aborted state.
   3207    * The UI should warn the user that this might lead
   3208    * to money being lost.
   3209    *
   3210    * Defaults to false.
   3211    */
   3212   forceImmediateAbort?: boolean;
   3213 }
   3214 ```
   3215 ```typescript
   3216 export interface ExchangeListItem {
   3217   exchangeBaseUrl: string;
   3218   currency: string | undefined;
   3219   paytoUris: string[];
   3220   tosStatus: ExchangeTosStatus;
   3221   exchangeStatus: ExchangeEntryStatus;
   3222   ageRestrictionOptions: number[];
   3223   /**
   3224    * Permanently added to the wallet, as opposed to just
   3225    * temporarily queried.
   3226    */
   3227   permanent: boolean;
   3228   /**
   3229    * Information about the last error that occurred when trying
   3230    * to update the exchange info.
   3231    */
   3232   lastUpdateErrorInfo?: OperationErrorInfo;
   3233 }
   3234 ```
   3235 ```typescript
   3236 export declare enum ExchangeTosStatus {
   3237   New = "new",
   3238   Accepted = "accepted",
   3239   Changed = "changed",
   3240   NotFound = "not-found",
   3241   Unknown = "unknown",
   3242 }
   3243 ```
   3244 ```typescript
   3245 export declare enum ExchangeEntryStatus {
   3246   Unknown = "unknown",
   3247   Outdated = "outdated",
   3248   Ok = "ok",
   3249 }
   3250 ```
   3251 ```typescript
   3252 export interface OperationErrorInfo {
   3253   error: TalerErrorDetail;
   3254 }
   3255 ```
   3256 ```typescript
   3257 export interface ForcedDenomSel {
   3258   denoms: {
   3259     value: AmountString;
   3260     count: number;
   3261   }[];
   3262 }
   3263 ```
   3264 ```typescript
   3265 /**
   3266  * Result of a prepare pay operation.
   3267  */
   3268 export type PreparePayResult =
   3269   | PreparePayResultInsufficientBalance
   3270   | PreparePayResultAlreadyConfirmed
   3271   | PreparePayResultPaymentPossible;
   3272 ```
   3273 ```typescript
   3274 export interface PreparePayResultInsufficientBalance {
   3275   status: PreparePayResultType.InsufficientBalance;
   3276   proposalId: string;
   3277   contractTerms: MerchantContractTerms;
   3278   amountRaw: string;
   3279   noncePriv: string;
   3280   talerUri: string;
   3281   balanceDetails: PayMerchantInsufficientBalanceDetails;
   3282 }
   3283 ```
   3284 ```typescript
   3285 /**
   3286  * Contract terms from a merchant.
   3287  * FIXME: Add type field!
   3288  */
   3289 export interface MerchantContractTerms {
   3290   /**
   3291    * Hash of the merchant's wire details.
   3292    */
   3293   h_wire: string;
   3294   /**
   3295    * Hash of the merchant's wire details.
   3296    */
   3297   auto_refund?: TalerProtocolDuration;
   3298   /**
   3299    * Wire method the merchant wants to use.
   3300    */
   3301   wire_method: string;
   3302   /**
   3303    * Human-readable short summary of the contract.
   3304    */
   3305   summary: string;
   3306   summary_i18n?: InternationalizedString;
   3307   /**
   3308    * Nonce used to ensure freshness.
   3309    */
   3310   nonce: string;
   3311   /**
   3312    * Total amount payable.
   3313    */
   3314   amount: string;
   3315   /**
   3316    * Auditors accepted by the merchant.
   3317    */
   3318   auditors: AuditorHandle[];
   3319   /**
   3320    * Deadline to pay for the contract.
   3321    */
   3322   pay_deadline: TalerProtocolTimestamp;
   3323   /**
   3324    * Maximum deposit fee covered by the merchant.
   3325    */
   3326   max_fee: string;
   3327   /**
   3328    * Information about the merchant.
   3329    */
   3330   merchant: MerchantInfo;
   3331   /**
   3332    * Public key of the merchant.
   3333    */
   3334   merchant_pub: string;
   3335   /**
   3336    * Time indicating when the order should be delivered.
   3337    * May be overwritten by individual products.
   3338    */
   3339   delivery_date?: TalerProtocolTimestamp;
   3340   /**
   3341    * Delivery location for (all!) products.
   3342    */
   3343   delivery_location?: Location;
   3344   /**
   3345    * List of accepted exchanges.
   3346    */
   3347   exchanges: ExchangeHandle[];
   3348   /**
   3349    * Products that are sold in this contract.
   3350    */
   3351   products?: Product[];
   3352   /**
   3353    * Deadline for refunds.
   3354    */
   3355   refund_deadline: TalerProtocolTimestamp;
   3356   /**
   3357    * Deadline for the wire transfer.
   3358    */
   3359   wire_transfer_deadline: TalerProtocolTimestamp;
   3360   /**
   3361    * Time when the contract was generated by the merchant.
   3362    */
   3363   timestamp: TalerProtocolTimestamp;
   3364   /**
   3365    * Order id to uniquely identify the purchase within
   3366    * one merchant instance.
   3367    */
   3368   order_id: string;
   3369   /**
   3370    * Base URL of the merchant's backend.
   3371    */
   3372   merchant_base_url: string;
   3373   /**
   3374    * Fulfillment URL to view the product or
   3375    * delivery status.
   3376    */
   3377   fulfillment_url?: string;
   3378   /**
   3379    * URL meant to share the shopping cart.
   3380    */
   3381   public_reorder_url?: string;
   3382   /**
   3383    * Plain text fulfillment message in the merchant's default language.
   3384    */
   3385   fulfillment_message?: string;
   3386   /**
   3387    * Internationalized fulfillment messages.
   3388    */
   3389   fulfillment_message_i18n?: InternationalizedString;
   3390   /**
   3391    * Share of the wire fee that must be settled with one payment.
   3392    */
   3393   wire_fee_amortization?: number;
   3394   /**
   3395    * Maximum wire fee that the merchant agrees to pay for.
   3396    */
   3397   max_wire_fee?: string;
   3398   minimum_age?: number;
   3399   /**
   3400    * Extra data, interpreted by the mechant only.
   3401    */
   3402   extra?: any;
   3403 }
   3404 ```
   3405 ```typescript
   3406 export interface AuditorHandle {
   3407   /**
   3408    * Official name of the auditor.
   3409    */
   3410   name: string;
   3411   /**
   3412    * Master public signing key of the auditor.
   3413    */
   3414   auditor_pub: string;
   3415   /**
   3416    * Base URL of the auditor.
   3417    */
   3418   url: string;
   3419 }
   3420 ```
   3421 ```typescript
   3422 /**
   3423  * Information about an exchange as stored inside a
   3424  * merchant's contract terms.
   3425  */
   3426 export interface ExchangeHandle {
   3427   /**
   3428    * Master public signing key of the exchange.
   3429    */
   3430   master_pub: string;
   3431   /**
   3432    * Base URL of the exchange.
   3433    */
   3434   url: string;
   3435 }
   3436 ```
   3437 ```typescript
   3438 /**
   3439  * Detailed reason for why the wallet's balance is insufficient.
   3440  */
   3441 export interface PayMerchantInsufficientBalanceDetails {
   3442   /**
   3443    * Amount requested by the merchant.
   3444    */
   3445   amountRequested: AmountString;
   3446   /**
   3447    * Balance of type "available" (see balance.ts for definition).
   3448    */
   3449   balanceAvailable: AmountString;
   3450   /**
   3451    * Balance of type "material" (see balance.ts for definition).
   3452    */
   3453   balanceMaterial: AmountString;
   3454   /**
   3455    * Balance of type "age-acceptable" (see balance.ts for definition).
   3456    */
   3457   balanceAgeAcceptable: AmountString;
   3458   /**
   3459    * Balance of type "merchant-acceptable" (see balance.ts for definition).
   3460    */
   3461   balanceMerchantAcceptable: AmountString;
   3462   /**
   3463    * Balance of type "merchant-depositable" (see balance.ts for definition).
   3464    */
   3465   balanceMerchantDepositable: AmountString;
   3466   /**
   3467    * If the payment would succeed without fees
   3468    * (i.e. balanceMerchantDepositable >= amountRequested),
   3469    * this field contains an estimate of the amount that would additionally
   3470    * be required to cover the fees.
   3471    *
   3472    * It is not possible to give an exact value here, since it depends
   3473    * on the coin selection for the amount that would be additionally withdrawn.
   3474    */
   3475   feeGapEstimate: AmountString;
   3476 }
   3477 ```
   3478 ```typescript
   3479 export interface PreparePayResultAlreadyConfirmed {
   3480   status: PreparePayResultType.AlreadyConfirmed;
   3481   contractTerms: MerchantContractTerms;
   3482   paid: boolean;
   3483   amountRaw: string;
   3484   amountEffective: string;
   3485   contractTermsHash: string;
   3486   proposalId: string;
   3487   talerUri?: string;
   3488 }
   3489 ```
   3490 ```typescript
   3491 /**
   3492  * Payment is possible.
   3493  */
   3494 export interface PreparePayResultPaymentPossible {
   3495   status: PreparePayResultType.PaymentPossible;
   3496   proposalId: string;
   3497   contractTerms: MerchantContractTerms;
   3498   contractTermsHash: string;
   3499   amountRaw: string;
   3500   amountEffective: string;
   3501   noncePriv: string;
   3502   talerUri: string;
   3503 }
   3504 ```
   3505 ```typescript
   3506 /**
   3507  * Forced coin selection for deposits/payments.
   3508  */
   3509 export interface ForcedCoinSel {
   3510   coins: {
   3511     value: AmountString;
   3512     contribution: AmountString;
   3513   }[];
   3514 }
   3515 ```
   3516 ```typescript
   3517 export interface ApplyRefundResponse {
   3518   contractTermsHash: string;
   3519   transactionId: string;
   3520   proposalId: string;
   3521   amountEffectivePaid: AmountString;
   3522   amountRefundGranted: AmountString;
   3523   amountRefundGone: AmountString;
   3524   pendingAtExchange: boolean;
   3525   info: OrderShortInfo;
   3526 }
   3527 ```
   3528 ```typescript
   3529 export interface AddExchangeRequest {
   3530   exchangeBaseUrl: string;
   3531   forceUpdate?: boolean;
   3532 }
   3533 ```
   3534 ```typescript
   3535 export interface BackupRecovery {
   3536   walletRootPriv: string;
   3537   providers: {
   3538     name: string;
   3539     url: string;
   3540   }[];
   3541 }
   3542 ```
   3543 ```typescript
   3544 /**
   3545  * Contract terms between two wallets (as opposed to a merchant and wallet).
   3546  */
   3547 export interface PeerContractTerms {
   3548   amount: AmountString;
   3549   summary: string;
   3550   purse_expiration: TalerProtocolTimestamp;
   3551 }
   3552 ```
   3553 ```typescript
   3554 export interface IntegrationTestArgs {
   3555   exchangeBaseUrl: string;
   3556   bankAccessApiBaseUrl: string;
   3557   merchantBaseUrl: string;
   3558   merchantAuthToken?: string;
   3559   amountToWithdraw: string;
   3560   amountToSpend: string;
   3561 }
   3562 ```