taler-docs

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

myout.md (49633B)


      1 # Wallet API Documentation
      2 ```{note}
      3 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)
      4 ```
      5 ## Overview
      6 ###  Initialization
      7 * [InitWalletOp](#initwalletop)
      8 ###  Basic Wallet Information
      9 * [GetBalancesOp](#getbalancesop)
     10 ###  Managing Transactions
     11 * [GetTransactionsOp](#gettransactionsop)
     12 * [DeleteTransactionOp](#deletetransactionop)
     13 * [RetryTransactionOp](#retrytransactionop)
     14 ###  Withdrawals
     15 * [GetWithdrawalDetailsForAmountOp](#getwithdrawaldetailsforamountop)
     16 * [GetWithdrawalDetailsForUriOp](#getwithdrawaldetailsforuriop)
     17 * [AcceptBankIntegratedWithdrawalOp](#acceptbankintegratedwithdrawalop)
     18 * [AcceptManualWithdrawalOp](#acceptmanualwithdrawalop)
     19 ###  Merchant Payments
     20 * [PreparePayForUriOp](#preparepayforuriop)
     21 * [ConfirmPayOp](#confirmpayop)
     22 * [AbortPayWithRefundOp](#abortpaywithrefundop)
     23 * [ApplyRefundOp](#applyrefundop)
     24 ###  Tipping
     25 * [PrepareTipOp](#preparetipop)
     26 * [AcceptTipOp](#accepttipop)
     27 ###  Exchange Management
     28 * [ListExchangesOp](#listexchangesop)
     29 * [AddExchangeOp](#addexchangeop)
     30 * [SetExchangeTosAcceptedOp](#setexchangetosacceptedop)
     31 * [GetExchangeTosOp](#getexchangetosop)
     32 * [ListCurrenciesOp](#listcurrenciesop)
     33 ###  Deposits
     34 * [CreateDepositGroupOp](#createdepositgroupop)
     35 * [TrackDepositGroupOp](#trackdepositgroupop)
     36 ###  Backups
     37 * [ExportBackupRecoveryOp](#exportbackuprecoveryop)
     38 * [ImportBackupRecoveryOp](#importbackuprecoveryop)
     39 * [RunBackupCycleOp](#runbackupcycleop)
     40 * [AddBackupProviderOp](#addbackupproviderop)
     41 * [GetBackupInfoOp](#getbackupinfoop)
     42 * [SetWalletDeviceIdOp](#setwalletdeviceidop)
     43 * [ExportBackupPlainOp](#exportbackupplainop)
     44 ###  Peer Payments
     45 * [InitiatePeerPushPaymentOp](#initiatepeerpushpaymentop)
     46 * [CheckPeerPushPaymentOp](#checkpeerpushpaymentop)
     47 * [AcceptPeerPushPaymentOp](#acceptpeerpushpaymentop)
     48 * [InitiatePeerPullPaymentOp](#initiatepeerpullpaymentop)
     49 * [CheckPeerPullPaymentOp](#checkpeerpullpaymentop)
     50 * [AcceptPeerPullPaymentOp](#acceptpeerpullpaymentop)
     51 ###  Database Management
     52 * [ExportDbOp](#exportdbop)
     53 * [ClearDbOp](#cleardbop)
     54 * [RecycleOp](#recycleop)
     55 ###  Testing and Debugging
     56 * [RunIntegrationTestOp](#runintegrationtestop)
     57 * [WithdrawTestBalanceOp](#withdrawtestbalanceop)
     58 * [WithdrawTestkudosOp](#withdrawtestkudosop)
     59 * [TestPayOp](#testpayop)
     60 * [WithdrawFakebankOp](#withdrawfakebankop)
     61 * [GetPendingTasksOp](#getpendingtasksop)
     62 * [DumpCoinsOp](#dumpcoinsop)
     63 * [SetCoinSuspendedOp](#setcoinsuspendedop)
     64 * [ForceRefreshOp](#forcerefreshop)
     65 ## Operation Reference
     66 (initwalletop)=
     67 ### InitWalletOp
     68 ```typescript
     69 // group: Initialization
     70 /**
     71  * Initialize wallet-core.
     72  *
     73  * Must be the request before any other operations.
     74  */
     75 export type InitWalletOp = {
     76   op: WalletApiOperation.InitWallet;
     77   request: {};
     78   response: {};
     79 };
     80 
     81 ```
     82 ```typescript
     83 // Enum value:
     84 // WalletApiOperation.InitWallet = "initWallet"
     85 
     86 ```
     87 
     88 (getbalancesop)=
     89 ### GetBalancesOp
     90 ```typescript
     91 // group: Basic Wallet Information
     92 /**
     93  * Get current wallet balance.
     94  */
     95 export type GetBalancesOp = {
     96   request: {};
     97   response: BalancesResponse;
     98 };
     99 
    100 ```
    101 ```typescript
    102 export interface BalancesResponse {
    103   balances: Balance[];
    104 }
    105 
    106 ```
    107 ```typescript
    108 export interface Balance {
    109   available: AmountString;
    110   pendingIncoming: AmountString;
    111   pendingOutgoing: AmountString;
    112   hasPendingTransactions: boolean;
    113   requiresUserInput: boolean;
    114 }
    115 
    116 ```
    117 
    118 (gettransactionsop)=
    119 ### GetTransactionsOp
    120 ```typescript
    121 // group: Managing Transactions
    122 /**
    123  * Get transactions.
    124  */
    125 export type GetTransactionsOp = {
    126   request: TransactionsRequest;
    127   response: TransactionsResponse;
    128 };
    129 
    130 ```
    131 ```typescript
    132 export interface TransactionsRequest {
    133   /**
    134    * return only transactions in the given currency
    135    */
    136   currency?: string;
    137   /**
    138    * if present, results will be limited to transactions related to the given search string
    139    */
    140   search?: string;
    141 }
    142 
    143 ```
    144 ```typescript
    145 export interface TransactionsResponse {
    146   transactions: Transaction[];
    147 }
    148 
    149 ```
    150 ```typescript
    151 export declare type Transaction =
    152   | TransactionWithdrawal
    153   | TransactionPayment
    154   | TransactionRefund
    155   | TransactionTip
    156   | TransactionRefresh
    157   | TransactionDeposit
    158   | TransactionPeerPullCredit
    159   | TransactionPeerPullDebit
    160   | TransactionPeerPushCredit
    161   | TransactionPeerPushDebit;
    162 
    163 ```
    164 ```typescript
    165 export interface TransactionWithdrawal extends TransactionCommon {
    166   type: TransactionType.Withdrawal;
    167   /**
    168    * Exchange of the withdrawal.
    169    */
    170   exchangeBaseUrl: string;
    171   /**
    172    * Amount that got subtracted from the reserve balance.
    173    */
    174   amountRaw: AmountString;
    175   /**
    176    * Amount that actually was (or will be) added to the wallet's balance.
    177    */
    178   amountEffective: AmountString;
    179   withdrawalDetails: WithdrawalDetails;
    180 }
    181 
    182 ```
    183 ```typescript
    184 // Enum value:
    185 // TransactionType.Withdrawal = "withdrawal"
    186 
    187 ```
    188 ```typescript
    189 export declare type WithdrawalDetails =
    190   | WithdrawalDetailsForManualTransfer
    191   | WithdrawalDetailsForTalerBankIntegrationApi;
    192 
    193 ```
    194 ```typescript
    195 interface WithdrawalDetailsForManualTransfer {
    196   type: WithdrawalType.ManualTransfer;
    197   /**
    198    * Payto URIs that the exchange supports.
    199    *
    200    * Already contains the amount and message.
    201    */
    202   exchangePaytoUris: string[];
    203   reservePub: string;
    204 }
    205 
    206 ```
    207 ```typescript
    208 // Enum value:
    209 // WithdrawalType.ManualTransfer = "manual-transfer"
    210 
    211 ```
    212 ```typescript
    213 interface WithdrawalDetailsForTalerBankIntegrationApi {
    214   type: WithdrawalType.TalerBankIntegrationApi;
    215   /**
    216    * Set to true if the bank has confirmed the withdrawal, false if not.
    217    * An unconfirmed withdrawal usually requires user-input and should be highlighted in the UI.
    218    * See also bankConfirmationUrl below.
    219    */
    220   confirmed: boolean;
    221   /**
    222    * If the withdrawal is unconfirmed, this can include a URL for user
    223    * initiated confirmation.
    224    */
    225   bankConfirmationUrl?: string;
    226   reservePub: string;
    227 }
    228 
    229 ```
    230 ```typescript
    231 // Enum value:
    232 // WithdrawalType.TalerBankIntegrationApi = "taler-bank-integration-api"
    233 
    234 ```
    235 ```typescript
    236 export interface TransactionPayment extends TransactionCommon {
    237   type: TransactionType.Payment;
    238   /**
    239    * Additional information about the payment.
    240    */
    241   info: OrderShortInfo;
    242   /**
    243    * Wallet-internal end-to-end identifier for the payment.
    244    */
    245   proposalId: string;
    246   /**
    247    * How far did the wallet get with processing the payment?
    248    */
    249   status: PaymentStatus;
    250   /**
    251    * Amount that must be paid for the contract
    252    */
    253   amountRaw: AmountString;
    254   /**
    255    * Amount that was paid, including deposit, wire and refresh fees.
    256    */
    257   amountEffective: AmountString;
    258   /**
    259    * Amount that has been refunded by the merchant
    260    */
    261   totalRefundRaw: AmountString;
    262   /**
    263    * Amount will be added to the wallet's balance after fees and refreshing
    264    */
    265   totalRefundEffective: AmountString;
    266   /**
    267    * Amount pending to be picked up
    268    */
    269   refundPending: AmountString | undefined;
    270   /**
    271    * Reference to applied refunds
    272    */
    273   refunds: RefundInfoShort[];
    274 }
    275 
    276 ```
    277 ```typescript
    278 // Enum value:
    279 // TransactionType.Payment = "payment"
    280 
    281 ```
    282 ```typescript
    283 export declare enum PaymentStatus {
    284   /**
    285    * Explicitly aborted after timeout / failure
    286    */
    287   Aborted = "aborted",
    288   /**
    289    * Payment failed, wallet will auto-retry.
    290    * User should be given the option to retry now / abort.
    291    */
    292   Failed = "failed",
    293   /**
    294    * Paid successfully
    295    */
    296   Paid = "paid",
    297   /**
    298    * User accepted, payment is processing.
    299    */
    300   Accepted = "accepted",
    301 }
    302 
    303 ```
    304 ```typescript
    305 export interface RefundInfoShort {
    306   transactionId: string;
    307   timestamp: TalerProtocolTimestamp;
    308   amountEffective: AmountString;
    309   amountRaw: AmountString;
    310 }
    311 
    312 ```
    313 ```typescript
    314 export interface TransactionRefund extends TransactionCommon {
    315   type: TransactionType.Refund;
    316   refundedTransactionId: string;
    317   info: OrderShortInfo;
    318   /**
    319    * Amount pending to be picked up
    320    */
    321   refundPending: AmountString | undefined;
    322   amountRaw: AmountString;
    323   amountEffective: AmountString;
    324 }
    325 
    326 ```
    327 ```typescript
    328 // Enum value:
    329 // TransactionType.Refund = "refund"
    330 
    331 ```
    332 ```typescript
    333 export interface TransactionTip extends TransactionCommon {
    334   type: TransactionType.Tip;
    335   amountRaw: AmountString;
    336   /**
    337    * More information about the merchant
    338    */
    339   amountEffective: AmountString;
    340   merchantBaseUrl: string;
    341 }
    342 
    343 ```
    344 ```typescript
    345 // Enum value:
    346 // TransactionType.Tip = "tip"
    347 
    348 ```
    349 ```typescript
    350 export interface TransactionRefresh extends TransactionCommon {
    351   type: TransactionType.Refresh;
    352   exchangeBaseUrl: string;
    353   amountRaw: AmountString;
    354   amountEffective: AmountString;
    355 }
    356 
    357 ```
    358 ```typescript
    359 /**
    360  * Deposit transaction, which effectively sends
    361  * money from this wallet somewhere else.
    362  */
    363 export interface TransactionDeposit extends TransactionCommon {
    364   type: TransactionType.Deposit;
    365   depositGroupId: string;
    366   /**
    367    * Target for the deposit.
    368    */
    369   targetPaytoUri: string;
    370   /**
    371    * Raw amount that is being deposited
    372    */
    373   amountRaw: AmountString;
    374   /**
    375    * Effective amount that is being deposited
    376    */
    377   amountEffective: AmountString;
    378 }
    379 
    380 ```
    381 ```typescript
    382 /**
    383  * Credit because we were paid for a P2P invoice we created.
    384  */
    385 export interface TransactionPeerPullCredit extends TransactionCommon {
    386   type: TransactionType.PeerPullCredit;
    387   info: PeerInfoShort;
    388   /**
    389    * Exchange used.
    390    */
    391   exchangeBaseUrl: string;
    392   /**
    393    * Amount that got subtracted from the reserve balance.
    394    */
    395   amountRaw: AmountString;
    396   /**
    397    * Amount that actually was (or will be) added to the wallet's balance.
    398    */
    399   amountEffective: AmountString;
    400   /**
    401    * URI to send to the other party.
    402    */
    403   talerUri: string;
    404 }
    405 
    406 ```
    407 ```typescript
    408 // Enum value:
    409 // TransactionType.PeerPullCredit = "peer-pull-credit"
    410 
    411 ```
    412 ```typescript
    413 export interface PeerInfoShort {
    414   expiration: TalerProtocolTimestamp | undefined;
    415   summary: string | undefined;
    416 }
    417 
    418 ```
    419 ```typescript
    420 /**
    421  * Debit because we paid someone's invoice.
    422  */
    423 export interface TransactionPeerPullDebit extends TransactionCommon {
    424   type: TransactionType.PeerPullDebit;
    425   info: PeerInfoShort;
    426   /**
    427    * Exchange used.
    428    */
    429   exchangeBaseUrl: string;
    430   amountRaw: AmountString;
    431   amountEffective: AmountString;
    432 }
    433 
    434 ```
    435 ```typescript
    436 // Enum value:
    437 // TransactionType.PeerPullDebit = "peer-pull-debit"
    438 
    439 ```
    440 ```typescript
    441 /**
    442  * We received money via a P2P payment.
    443  */
    444 export interface TransactionPeerPushCredit extends TransactionCommon {
    445   type: TransactionType.PeerPushCredit;
    446   info: PeerInfoShort;
    447   /**
    448    * Exchange used.
    449    */
    450   exchangeBaseUrl: string;
    451   /**
    452    * Amount that got subtracted from the reserve balance.
    453    */
    454   amountRaw: AmountString;
    455   /**
    456    * Amount that actually was (or will be) added to the wallet's balance.
    457    */
    458   amountEffective: AmountString;
    459 }
    460 
    461 ```
    462 ```typescript
    463 // Enum value:
    464 // TransactionType.PeerPushCredit = "peer-push-credit"
    465 
    466 ```
    467 ```typescript
    468 /**
    469  * We sent money via a P2P payment.
    470  */
    471 export interface TransactionPeerPushDebit extends TransactionCommon {
    472   type: TransactionType.PeerPushDebit;
    473   info: PeerInfoShort;
    474   /**
    475    * Exchange used.
    476    */
    477   exchangeBaseUrl: string;
    478   /**
    479    * Amount that got subtracted from the reserve balance.
    480    */
    481   amountRaw: AmountString;
    482   /**
    483    * Amount that actually was (or will be) added to the wallet's balance.
    484    */
    485   amountEffective: AmountString;
    486   /**
    487    * URI to accept the payment.
    488    */
    489   talerUri: string;
    490 }
    491 
    492 ```
    493 ```typescript
    494 // Enum value:
    495 // TransactionType.PeerPushDebit = "peer-push-debit"
    496 
    497 ```
    498 
    499 (deletetransactionop)=
    500 ### DeleteTransactionOp
    501 ```typescript
    502 /**
    503  * Delete a transaction locally in the wallet.
    504  */
    505 export type DeleteTransactionOp = {
    506   request: DeleteTransactionRequest;
    507   response: {};
    508 };
    509 
    510 ```
    511 ```typescript
    512 export interface DeleteTransactionRequest {
    513   transactionId: string;
    514 }
    515 
    516 ```
    517 
    518 (retrytransactionop)=
    519 ### RetryTransactionOp
    520 ```typescript
    521 /**
    522  * Immediately retry a transaction.
    523  */
    524 export type RetryTransactionOp = {
    525   request: RetryTransactionRequest;
    526   response: {};
    527 };
    528 
    529 ```
    530 ```typescript
    531 export interface RetryTransactionRequest {
    532   transactionId: string;
    533 }
    534 
    535 ```
    536 
    537 (getwithdrawaldetailsforamountop)=
    538 ### GetWithdrawalDetailsForAmountOp
    539 ```typescript
    540 // group: Withdrawals
    541 /**
    542  * Get details for withdrawing a particular amount (manual withdrawal).
    543  */
    544 export type GetWithdrawalDetailsForAmountOp = {
    545   request: GetWithdrawalDetailsForAmountRequest;
    546   response: ManualWithdrawalDetails;
    547 };
    548 
    549 ```
    550 ```typescript
    551 export interface GetWithdrawalDetailsForAmountRequest {
    552   exchangeBaseUrl: string;
    553   amount: string;
    554   restrictAge?: number;
    555 }
    556 
    557 ```
    558 ```typescript
    559 export interface ManualWithdrawalDetails {
    560   /**
    561    * Did the user accept the current version of the exchange's
    562    * terms of service?
    563    */
    564   tosAccepted: boolean;
    565   /**
    566    * Amount that the user will transfer to the exchange.
    567    */
    568   amountRaw: AmountString;
    569   /**
    570    * Amount that will be added to the user's wallet balance.
    571    */
    572   amountEffective: AmountString;
    573   /**
    574    * Ways to pay the exchange.
    575    */
    576   paytoUris: string[];
    577 }
    578 
    579 ```
    580 
    581 (getwithdrawaldetailsforuriop)=
    582 ### GetWithdrawalDetailsForUriOp
    583 ```typescript
    584 /**
    585  * Get details for withdrawing via a particular taler:// URI.
    586  */
    587 export type GetWithdrawalDetailsForUriOp = {
    588   request: GetWithdrawalDetailsForUriRequest;
    589   response: WithdrawUriInfoResponse;
    590 };
    591 
    592 ```
    593 ```typescript
    594 export interface GetWithdrawalDetailsForUriRequest {
    595   talerWithdrawUri: string;
    596   restrictAge?: number;
    597 }
    598 
    599 ```
    600 ```typescript
    601 export interface WithdrawUriInfoResponse {
    602   amount: AmountString;
    603   defaultExchangeBaseUrl?: string;
    604   possibleExchanges: ExchangeListItem[];
    605 }
    606 
    607 ```
    608 
    609 (acceptbankintegratedwithdrawalop)=
    610 ### AcceptBankIntegratedWithdrawalOp
    611 ```typescript
    612 /**
    613  * Accept a bank-integrated withdrawal.
    614  */
    615 export type AcceptBankIntegratedWithdrawalOp = {
    616   request: AcceptBankIntegratedWithdrawalRequest;
    617   response: AcceptWithdrawalResponse;
    618 };
    619 
    620 ```
    621 ```typescript
    622 export interface AcceptBankIntegratedWithdrawalRequest {
    623   talerWithdrawUri: string;
    624   exchangeBaseUrl: string;
    625   forcedDenomSel?: ForcedDenomSel;
    626   restrictAge?: number;
    627 }
    628 
    629 ```
    630 ```typescript
    631 export interface AcceptWithdrawalResponse {
    632   reservePub: string;
    633   confirmTransferUrl?: string;
    634   transactionId: string;
    635 }
    636 
    637 ```
    638 
    639 (acceptmanualwithdrawalop)=
    640 ### AcceptManualWithdrawalOp
    641 ```typescript
    642 /**
    643  * Create a manual withdrawal.
    644  */
    645 export type AcceptManualWithdrawalOp = {
    646   request: AcceptManualWithdrawalRequest;
    647   response: AcceptManualWithdrawalResult;
    648 };
    649 
    650 ```
    651 ```typescript
    652 export interface AcceptManualWithdrawalRequest {
    653   exchangeBaseUrl: string;
    654   amount: string;
    655   restrictAge?: number;
    656 }
    657 
    658 ```
    659 ```typescript
    660 export interface AcceptManualWithdrawalResult {
    661   /**
    662    * Payto URIs that can be used to fund the withdrawal.
    663    */
    664   exchangePaytoUris: string[];
    665   /**
    666    * Public key of the newly created reserve.
    667    */
    668   reservePub: string;
    669   transactionId: string;
    670 }
    671 
    672 ```
    673 
    674 (preparepayforuriop)=
    675 ### PreparePayForUriOp
    676 ```typescript
    677 // group: Merchant Payments
    678 /**
    679  * Prepare to make a payment
    680  */
    681 export type PreparePayForUriOp = {
    682   op: WalletApiOperation.PreparePayForUri;
    683   request: PreparePayRequest;
    684   response: PreparePayResult;
    685 };
    686 
    687 ```
    688 ```typescript
    689 // Enum value:
    690 // WalletApiOperation.PreparePayForUri = "preparePayForUri"
    691 
    692 ```
    693 ```typescript
    694 export interface PreparePayRequest {
    695   talerPayUri: string;
    696 }
    697 
    698 ```
    699 ```typescript
    700 /**
    701  * Result of a prepare pay operation.
    702  */
    703 export declare type PreparePayResult =
    704   | PreparePayResultInsufficientBalance
    705   | PreparePayResultAlreadyConfirmed
    706   | PreparePayResultPaymentPossible;
    707 
    708 ```
    709 ```typescript
    710 export interface PreparePayResultInsufficientBalance {
    711   status: PreparePayResultType.InsufficientBalance;
    712   proposalId: string;
    713   contractTerms: ContractTerms;
    714   amountRaw: string;
    715   noncePriv: string;
    716 }
    717 
    718 ```
    719 ```typescript
    720 export interface PreparePayResultAlreadyConfirmed {
    721   status: PreparePayResultType.AlreadyConfirmed;
    722   contractTerms: ContractTerms;
    723   paid: boolean;
    724   amountRaw: string;
    725   amountEffective: string;
    726   contractTermsHash: string;
    727   proposalId: string;
    728 }
    729 
    730 ```
    731 ```typescript
    732 // Enum value:
    733 // PreparePayResultType.AlreadyConfirmed = "already-confirmed"
    734 
    735 ```
    736 ```typescript
    737 /**
    738  * Payment is possible.
    739  */
    740 export interface PreparePayResultPaymentPossible {
    741   status: PreparePayResultType.PaymentPossible;
    742   proposalId: string;
    743   contractTerms: ContractTerms;
    744   contractTermsHash: string;
    745   amountRaw: string;
    746   amountEffective: string;
    747   noncePriv: string;
    748 }
    749 
    750 ```
    751 ```typescript
    752 // Enum value:
    753 // PreparePayResultType.PaymentPossible = "payment-possible"
    754 
    755 ```
    756 
    757 (confirmpayop)=
    758 ### ConfirmPayOp
    759 ```typescript
    760 /**
    761  * Confirm a payment that was previously prepared with
    762  * {@link PreparePayForUriOp}
    763  */
    764 export type ConfirmPayOp = {
    765   op: WalletApiOperation.ConfirmPay;
    766   request: ConfirmPayRequest;
    767   response: ConfirmPayResult;
    768 };
    769 
    770 ```
    771 ```typescript
    772 // Enum value:
    773 // WalletApiOperation.ConfirmPay = "confirmPay"
    774 
    775 ```
    776 ```typescript
    777 export interface ConfirmPayRequest {
    778   proposalId: string;
    779   sessionId?: string;
    780   forcedCoinSel?: ForcedCoinSel;
    781 }
    782 
    783 ```
    784 ```typescript
    785 export declare type ConfirmPayResult =
    786   | ConfirmPayResultDone
    787   | ConfirmPayResultPending;
    788 
    789 ```
    790 ```typescript
    791 /**
    792  * Result for confirmPay
    793  */
    794 export interface ConfirmPayResultDone {
    795   type: ConfirmPayResultType.Done;
    796   contractTerms: ContractTerms;
    797   transactionId: string;
    798 }
    799 
    800 ```
    801 ```typescript
    802 // Enum value:
    803 // ConfirmPayResultType.Done = "done"
    804 
    805 ```
    806 ```typescript
    807 export interface ConfirmPayResultPending {
    808   type: ConfirmPayResultType.Pending;
    809   transactionId: string;
    810   lastError: TalerErrorDetail | undefined;
    811 }
    812 
    813 ```
    814 
    815 (abortpaywithrefundop)=
    816 ### AbortPayWithRefundOp
    817 ```typescript
    818 /**
    819  * Abort a pending payment with a refund.
    820  */
    821 export type AbortPayWithRefundOp = {
    822   request: AbortPayWithRefundRequest;
    823   response: {};
    824 };
    825 
    826 ```
    827 ```typescript
    828 export interface AbortPayWithRefundRequest {
    829   proposalId: string;
    830 }
    831 
    832 ```
    833 
    834 (applyrefundop)=
    835 ### ApplyRefundOp
    836 ```typescript
    837 /**
    838  * Check for a refund based on a taler://refund URI.
    839  */
    840 export type ApplyRefundOp = {
    841   request: ApplyRefundRequest;
    842   response: ApplyRefundResponse;
    843 };
    844 
    845 ```
    846 ```typescript
    847 export interface ApplyRefundRequest {
    848   talerRefundUri: string;
    849 }
    850 
    851 ```
    852 ```typescript
    853 export interface ApplyRefundResponse {
    854   contractTermsHash: string;
    855   transactionId: string;
    856   proposalId: string;
    857   amountEffectivePaid: AmountString;
    858   amountRefundGranted: AmountString;
    859   amountRefundGone: AmountString;
    860   pendingAtExchange: boolean;
    861   info: OrderShortInfo;
    862 }
    863 
    864 ```
    865 
    866 (preparetipop)=
    867 ### PrepareTipOp
    868 ```typescript
    869 // group: Tipping
    870 /**
    871  * Query and store information about a tip.
    872  */
    873 export type PrepareTipOp = {
    874   request: PrepareTipRequest;
    875   response: PrepareTipResult;
    876 };
    877 
    878 ```
    879 ```typescript
    880 export interface PrepareTipRequest {
    881   talerTipUri: string;
    882 }
    883 
    884 ```
    885 ```typescript
    886 export interface PrepareTipResult {
    887   /**
    888    * Unique ID for the tip assigned by the wallet.
    889    * Typically different from the merchant-generated tip ID.
    890    */
    891   walletTipId: string;
    892   /**
    893    * Has the tip already been accepted?
    894    */
    895   accepted: boolean;
    896   /**
    897    * Amount that the merchant gave.
    898    */
    899   tipAmountRaw: AmountString;
    900   /**
    901    * Amount that arrived at the wallet.
    902    * Might be lower than the raw amount due to fees.
    903    */
    904   tipAmountEffective: AmountString;
    905   /**
    906    * Base URL of the merchant backend giving then tip.
    907    */
    908   merchantBaseUrl: string;
    909   /**
    910    * Base URL of the exchange that is used to withdraw the tip.
    911    * Determined by the merchant, the wallet/user has no choice here.
    912    */
    913   exchangeBaseUrl: string;
    914   /**
    915    * Time when the tip will expire.  After it expired, it can't be picked
    916    * up anymore.
    917    */
    918   expirationTimestamp: TalerProtocolTimestamp;
    919 }
    920 
    921 ```
    922 
    923 (accepttipop)=
    924 ### AcceptTipOp
    925 ```typescript
    926 /**
    927  * Accept a tip.
    928  */
    929 export type AcceptTipOp = {
    930   request: AcceptTipRequest;
    931   response: {};
    932 };
    933 
    934 ```
    935 ```typescript
    936 export interface AcceptTipRequest {
    937   walletTipId: string;
    938 }
    939 
    940 ```
    941 
    942 (listexchangesop)=
    943 ### ListExchangesOp
    944 ```typescript
    945 // group: Exchange Management
    946 /**
    947  * List exchanges known to the wallet.
    948  */
    949 export type ListExchangesOp = {
    950   request: {};
    951   response: ExchangesListResponse;
    952 };
    953 
    954 ```
    955 ```typescript
    956 export interface ExchangesListResponse {
    957   exchanges: ExchangeListItem[];
    958 }
    959 
    960 ```
    961 
    962 (addexchangeop)=
    963 ### AddExchangeOp
    964 ```typescript
    965 /**
    966  * Add / force-update an exchange.
    967  */
    968 export type AddExchangeOp = {
    969   request: AddExchangeRequest;
    970   response: {};
    971 };
    972 
    973 ```
    974 ```typescript
    975 export interface AddExchangeRequest {
    976   exchangeBaseUrl: string;
    977   forceUpdate?: boolean;
    978 }
    979 
    980 ```
    981 
    982 (setexchangetosacceptedop)=
    983 ### SetExchangeTosAcceptedOp
    984 ```typescript
    985 /**
    986  * Accept a particular version of the exchange terms of service.
    987  */
    988 export type SetExchangeTosAcceptedOp = {
    989   request: AcceptExchangeTosRequest;
    990   response: {};
    991 };
    992 
    993 ```
    994 ```typescript
    995 export interface AcceptExchangeTosRequest {
    996   exchangeBaseUrl: string;
    997   etag: string | undefined;
    998 }
    999 
   1000 ```
   1001 
   1002 (getexchangetosop)=
   1003 ### GetExchangeTosOp
   1004 ```typescript
   1005 /**
   1006  * Get the current terms of a service of an exchange.
   1007  */
   1008 export type GetExchangeTosOp = {
   1009   request: GetExchangeTosRequest;
   1010   response: GetExchangeTosResult;
   1011 };
   1012 
   1013 ```
   1014 ```typescript
   1015 export interface GetExchangeTosRequest {
   1016   exchangeBaseUrl: string;
   1017   acceptedFormat?: string[];
   1018 }
   1019 
   1020 ```
   1021 ```typescript
   1022 export interface GetExchangeTosResult {
   1023   /**
   1024    * Markdown version of the current ToS.
   1025    */
   1026   content: string;
   1027   /**
   1028    * Version tag of the current ToS.
   1029    */
   1030   currentEtag: string;
   1031   /**
   1032    * Version tag of the last ToS that the user has accepted,
   1033    * if any.
   1034    */
   1035   acceptedEtag: string | undefined;
   1036   /**
   1037    * Accepted content type
   1038    */
   1039   contentType: string;
   1040 }
   1041 
   1042 ```
   1043 
   1044 (listcurrenciesop)=
   1045 ### ListCurrenciesOp
   1046 ```typescript
   1047 /**
   1048  * List currencies known to the wallet.
   1049  */
   1050 export type ListCurrenciesOp = {
   1051   request: {};
   1052   response: WalletCurrencyInfo;
   1053 };
   1054 
   1055 ```
   1056 ```typescript
   1057 export interface WalletCurrencyInfo {
   1058   trustedAuditors: {
   1059     currency: string;
   1060     auditorPub: string;
   1061     auditorBaseUrl: string;
   1062   }[];
   1063   trustedExchanges: {
   1064     currency: string;
   1065     exchangeMasterPub: string;
   1066     exchangeBaseUrl: string;
   1067   }[];
   1068 }
   1069 
   1070 ```
   1071 
   1072 (createdepositgroupop)=
   1073 ### CreateDepositGroupOp
   1074 ```typescript
   1075 // group: Deposits
   1076 /**
   1077  * Create a new deposit group.
   1078  *
   1079  * Deposit groups are used to deposit multiple coins to a bank
   1080  * account, usually the wallet user's own bank account.
   1081  */
   1082 export type CreateDepositGroupOp = {
   1083   request: CreateDepositGroupRequest;
   1084   response: CreateDepositGroupResponse;
   1085 };
   1086 
   1087 ```
   1088 ```typescript
   1089 export interface CreateDepositGroupRequest {
   1090   depositPaytoUri: string;
   1091   amount: AmountString;
   1092 }
   1093 
   1094 ```
   1095 ```typescript
   1096 export interface CreateDepositGroupResponse {
   1097   depositGroupId: string;
   1098   transactionId: string;
   1099 }
   1100 
   1101 ```
   1102 
   1103 (trackdepositgroupop)=
   1104 ### TrackDepositGroupOp
   1105 ```typescript
   1106 /**
   1107  * Track the status of a deposit group by querying the exchange.
   1108  */
   1109 export type TrackDepositGroupOp = {
   1110   request: TrackDepositGroupRequest;
   1111   response: TrackDepositGroupResponse;
   1112 };
   1113 
   1114 ```
   1115 ```typescript
   1116 export interface TrackDepositGroupRequest {
   1117   depositGroupId: string;
   1118 }
   1119 
   1120 ```
   1121 ```typescript
   1122 export interface TrackDepositGroupResponse {
   1123   responses: {
   1124     status: number;
   1125     body: any;
   1126   }[];
   1127 }
   1128 
   1129 ```
   1130 
   1131 (exportbackuprecoveryop)=
   1132 ### ExportBackupRecoveryOp
   1133 ```typescript
   1134 // group: Backups
   1135 /**
   1136  * Export the recovery information for the wallet.
   1137  */
   1138 export type ExportBackupRecoveryOp = {
   1139   request: {};
   1140   response: BackupRecovery;
   1141 };
   1142 
   1143 ```
   1144 
   1145 (importbackuprecoveryop)=
   1146 ### ImportBackupRecoveryOp
   1147 ```typescript
   1148 /**
   1149  * Import recovery information into the wallet.
   1150  */
   1151 export type ImportBackupRecoveryOp = {
   1152   request: RecoveryLoadRequest;
   1153   response: {};
   1154 };
   1155 
   1156 ```
   1157 ```typescript
   1158 /**
   1159  * Load recovery information into the wallet.
   1160  */
   1161 export interface RecoveryLoadRequest {
   1162   recovery: BackupRecovery;
   1163   strategy?: RecoveryMergeStrategy;
   1164 }
   1165 
   1166 ```
   1167 ```typescript
   1168 /**
   1169  * Strategy for loading recovery information.
   1170  */
   1171 export declare enum RecoveryMergeStrategy {
   1172   /**
   1173    * Keep the local wallet root key, import and take over providers.
   1174    */
   1175   Ours = "ours",
   1176   /**
   1177    * Migrate to the wallet root key from the recovery information.
   1178    */
   1179   Theirs = "theirs",
   1180 }
   1181 
   1182 ```
   1183 
   1184 (runbackupcycleop)=
   1185 ### RunBackupCycleOp
   1186 ```typescript
   1187 /**
   1188  * Manually make and upload a backup.
   1189  */
   1190 export type RunBackupCycleOp = {
   1191   request: {};
   1192   response: {};
   1193 };
   1194 
   1195 ```
   1196 
   1197 (addbackupproviderop)=
   1198 ### AddBackupProviderOp
   1199 ```typescript
   1200 /**
   1201  * Add a new backup provider.
   1202  */
   1203 export type AddBackupProviderOp = {
   1204   request: AddBackupProviderRequest;
   1205   response: {};
   1206 };
   1207 
   1208 ```
   1209 ```typescript
   1210 export interface AddBackupProviderRequest {
   1211   backupProviderBaseUrl: string;
   1212   name: string;
   1213   /**
   1214    * Activate the provider.  Should only be done after
   1215    * the user has reviewed the provider.
   1216    */
   1217   activate?: boolean;
   1218 }
   1219 
   1220 ```
   1221 
   1222 (getbackupinfoop)=
   1223 ### GetBackupInfoOp
   1224 ```typescript
   1225 /**
   1226  * Get some useful stats about the backup state.
   1227  */
   1228 export type GetBackupInfoOp = {
   1229   request: {};
   1230   response: BackupInfo;
   1231 };
   1232 
   1233 ```
   1234 ```typescript
   1235 export interface BackupInfo {
   1236   walletRootPub: string;
   1237   deviceId: string;
   1238   providers: ProviderInfo[];
   1239 }
   1240 
   1241 ```
   1242 ```typescript
   1243 /**
   1244  * Information about one provider.
   1245  *
   1246  * We don't store the account key here,
   1247  * as that's derived from the wallet root key.
   1248  */
   1249 export interface ProviderInfo {
   1250   active: boolean;
   1251   syncProviderBaseUrl: string;
   1252   name: string;
   1253   terms?: BackupProviderTerms;
   1254   /**
   1255    * Last communication issue with the provider.
   1256    */
   1257   lastError?: TalerErrorDetail;
   1258   lastSuccessfulBackupTimestamp?: TalerProtocolTimestamp;
   1259   lastAttemptedBackupTimestamp?: TalerProtocolTimestamp;
   1260   paymentProposalIds: string[];
   1261   backupProblem?: BackupProblem;
   1262   paymentStatus: ProviderPaymentStatus;
   1263 }
   1264 
   1265 ```
   1266 ```typescript
   1267 export interface BackupProviderTerms {
   1268   supportedProtocolVersion: string;
   1269   annualFee: AmountString;
   1270   storageLimitInMegabytes: number;
   1271 }
   1272 
   1273 ```
   1274 ```typescript
   1275 export type BackupProblem =
   1276   | BackupUnreadableProblem
   1277   | BackupConflictingDeviceProblem;
   1278 
   1279 ```
   1280 ```typescript
   1281 export interface BackupUnreadableProblem {
   1282   type: "backup-unreadable";
   1283 }
   1284 
   1285 ```
   1286 ```typescript
   1287 export interface BackupConflictingDeviceProblem {
   1288   type: "backup-conflicting-device";
   1289   otherDeviceId: string;
   1290   myDeviceId: string;
   1291   backupTimestamp: AbsoluteTime;
   1292 }
   1293 
   1294 ```
   1295 ```typescript
   1296 export type ProviderPaymentStatus =
   1297   | ProviderPaymentTermsChanged
   1298   | ProviderPaymentPaid
   1299   | ProviderPaymentInsufficientBalance
   1300   | ProviderPaymentUnpaid
   1301   | ProviderPaymentPending;
   1302 
   1303 ```
   1304 ```typescript
   1305 export interface ProviderPaymentTermsChanged {
   1306   type: ProviderPaymentType.TermsChanged;
   1307   paidUntil: AbsoluteTime;
   1308   oldTerms: BackupProviderTerms;
   1309   newTerms: BackupProviderTerms;
   1310 }
   1311 
   1312 ```
   1313 ```typescript
   1314 // Enum value:
   1315 // ProviderPaymentType.TermsChanged = "terms-changed"
   1316 
   1317 ```
   1318 ```typescript
   1319 export interface ProviderPaymentPaid {
   1320   type: ProviderPaymentType.Paid;
   1321   paidUntil: AbsoluteTime;
   1322 }
   1323 
   1324 ```
   1325 ```typescript
   1326 // Enum value:
   1327 // ProviderPaymentType.Paid = "paid"
   1328 
   1329 ```
   1330 ```typescript
   1331 export interface ProviderPaymentInsufficientBalance {
   1332   type: ProviderPaymentType.InsufficientBalance;
   1333 }
   1334 
   1335 ```
   1336 ```typescript
   1337 export interface ProviderPaymentUnpaid {
   1338   type: ProviderPaymentType.Unpaid;
   1339 }
   1340 
   1341 ```
   1342 ```typescript
   1343 // Enum value:
   1344 // ProviderPaymentType.Unpaid = "unpaid"
   1345 
   1346 ```
   1347 ```typescript
   1348 export interface ProviderPaymentPending {
   1349   type: ProviderPaymentType.Pending;
   1350 }
   1351 
   1352 ```
   1353 
   1354 (setwalletdeviceidop)=
   1355 ### SetWalletDeviceIdOp
   1356 ```typescript
   1357 /**
   1358  * Set the internal device ID of the wallet, used to
   1359  * identify whether a different/new wallet is accessing
   1360  * the backup of another wallet.
   1361  */
   1362 export type SetWalletDeviceIdOp = {
   1363   request: SetWalletDeviceIdRequest;
   1364   response: {};
   1365 };
   1366 
   1367 ```
   1368 ```typescript
   1369 export interface SetWalletDeviceIdRequest {
   1370   /**
   1371    * New wallet device ID to set.
   1372    */
   1373   walletDeviceId: string;
   1374 }
   1375 
   1376 ```
   1377 
   1378 (exportbackupplainop)=
   1379 ### ExportBackupPlainOp
   1380 ```typescript
   1381 /**
   1382  * Export a backup JSON, mostly useful for testing.
   1383  */
   1384 export type ExportBackupPlainOp = {
   1385   request: {};
   1386   response: WalletBackupContentV1;
   1387 };
   1388 
   1389 ```
   1390 
   1391 (initiatepeerpushpaymentop)=
   1392 ### InitiatePeerPushPaymentOp
   1393 ```typescript
   1394 // group: Peer Payments
   1395 /**
   1396  * Initiate an outgoing peer push payment.
   1397  */
   1398 export type InitiatePeerPushPaymentOp = {
   1399   request: InitiatePeerPushPaymentRequest;
   1400   response: InitiatePeerPushPaymentResponse;
   1401 };
   1402 
   1403 ```
   1404 ```typescript
   1405 export interface InitiatePeerPushPaymentRequest {
   1406   amount: AmountString;
   1407   partialContractTerms: any;
   1408 }
   1409 
   1410 ```
   1411 ```typescript
   1412 export interface InitiatePeerPushPaymentResponse {
   1413   exchangeBaseUrl: string;
   1414   pursePub: string;
   1415   mergePriv: string;
   1416   contractPriv: string;
   1417   talerUri: string;
   1418   transactionId: string;
   1419 }
   1420 
   1421 ```
   1422 
   1423 (checkpeerpushpaymentop)=
   1424 ### CheckPeerPushPaymentOp
   1425 ```typescript
   1426 /**
   1427  * Check an incoming peer push payment.
   1428  */
   1429 export type CheckPeerPushPaymentOp = {
   1430   request: CheckPeerPushPaymentRequest;
   1431   response: CheckPeerPushPaymentResponse;
   1432 };
   1433 
   1434 ```
   1435 ```typescript
   1436 export interface CheckPeerPushPaymentRequest {
   1437   talerUri: string;
   1438 }
   1439 
   1440 ```
   1441 ```typescript
   1442 export interface CheckPeerPushPaymentResponse {
   1443   contractTerms: any;
   1444   amount: AmountString;
   1445   peerPushPaymentIncomingId: string;
   1446 }
   1447 
   1448 ```
   1449 
   1450 (acceptpeerpushpaymentop)=
   1451 ### AcceptPeerPushPaymentOp
   1452 ```typescript
   1453 /**
   1454  * Accept an incoming peer push payment.
   1455  */
   1456 export type AcceptPeerPushPaymentOp = {
   1457   request: AcceptPeerPushPaymentRequest;
   1458   response: {};
   1459 };
   1460 
   1461 ```
   1462 ```typescript
   1463 export interface AcceptPeerPushPaymentRequest {
   1464   /**
   1465    * Transparent identifier of the incoming peer push payment.
   1466    */
   1467   peerPushPaymentIncomingId: string;
   1468 }
   1469 
   1470 ```
   1471 
   1472 (initiatepeerpullpaymentop)=
   1473 ### InitiatePeerPullPaymentOp
   1474 ```typescript
   1475 /**
   1476  * Initiate an outgoing peer pull payment.
   1477  */
   1478 export type InitiatePeerPullPaymentOp = {
   1479   request: InitiatePeerPullPaymentRequest;
   1480   response: InitiatePeerPullPaymentResponse;
   1481 };
   1482 
   1483 ```
   1484 ```typescript
   1485 export interface InitiatePeerPullPaymentRequest {
   1486   /**
   1487    * FIXME: Make this optional?
   1488    */
   1489   exchangeBaseUrl: string;
   1490   amount: AmountString;
   1491   partialContractTerms: any;
   1492 }
   1493 
   1494 ```
   1495 ```typescript
   1496 export interface InitiatePeerPullPaymentResponse {
   1497   /**
   1498    * Taler URI for the other party to make the payment
   1499    * that was requested.
   1500    */
   1501   talerUri: string;
   1502   transactionId: string;
   1503 }
   1504 
   1505 ```
   1506 
   1507 (checkpeerpullpaymentop)=
   1508 ### CheckPeerPullPaymentOp
   1509 ```typescript
   1510 /**
   1511  * Prepare for an incoming peer pull payment.
   1512  */
   1513 export type CheckPeerPullPaymentOp = {
   1514   request: CheckPeerPullPaymentRequest;
   1515   response: CheckPeerPullPaymentResponse;
   1516 };
   1517 
   1518 ```
   1519 ```typescript
   1520 export interface CheckPeerPullPaymentRequest {
   1521   talerUri: string;
   1522 }
   1523 
   1524 ```
   1525 ```typescript
   1526 export interface CheckPeerPullPaymentResponse {
   1527   contractTerms: any;
   1528   amount: AmountString;
   1529   peerPullPaymentIncomingId: string;
   1530 }
   1531 
   1532 ```
   1533 
   1534 (acceptpeerpullpaymentop)=
   1535 ### AcceptPeerPullPaymentOp
   1536 ```typescript
   1537 /**
   1538  * Accept an incoming peer pull payment.
   1539  */
   1540 export type AcceptPeerPullPaymentOp = {
   1541   request: AcceptPeerPullPaymentRequest;
   1542   response: {};
   1543 };
   1544 
   1545 ```
   1546 ```typescript
   1547 export interface AcceptPeerPullPaymentRequest {
   1548   /**
   1549    * Transparent identifier of the incoming peer pull payment.
   1550    */
   1551   peerPullPaymentIncomingId: string;
   1552 }
   1553 
   1554 ```
   1555 
   1556 (exportdbop)=
   1557 ### ExportDbOp
   1558 ```typescript
   1559 // group: Database Management
   1560 /**
   1561  * Exoport the wallet database's contents to JSON.
   1562  */
   1563 export type ExportDbOp = {
   1564   request: {};
   1565   response: any;
   1566 };
   1567 
   1568 ```
   1569 
   1570 (cleardbop)=
   1571 ### ClearDbOp
   1572 ```typescript
   1573 /**
   1574  * Dangerously clear the whole wallet database.
   1575  */
   1576 export type ClearDbOp = {
   1577   request: {};
   1578   response: {};
   1579 };
   1580 
   1581 ```
   1582 
   1583 (recycleop)=
   1584 ### RecycleOp
   1585 ```typescript
   1586 /**
   1587  * Export a backup, clear the database and re-import it.
   1588  */
   1589 export type RecycleOp = {
   1590   request: {};
   1591   response: {};
   1592 };
   1593 
   1594 ```
   1595 
   1596 (runintegrationtestop)=
   1597 ### RunIntegrationTestOp
   1598 ```typescript
   1599 // group: Testing and Debugging
   1600 /**
   1601  * Run a simple integration test on a test deployment
   1602  * of the exchange and merchant.
   1603  */
   1604 export type RunIntegrationTestOp = {
   1605   request: IntegrationTestArgs;
   1606   response: {};
   1607 };
   1608 
   1609 ```
   1610 ```typescript
   1611 export interface IntegrationTestArgs {
   1612   exchangeBaseUrl: string;
   1613   bankBaseUrl: string;
   1614   bankAccessApiBaseUrl?: string;
   1615   merchantBaseUrl: string;
   1616   merchantAuthToken?: string;
   1617   amountToWithdraw: string;
   1618   amountToSpend: string;
   1619 }
   1620 
   1621 ```
   1622 
   1623 (withdrawtestbalanceop)=
   1624 ### WithdrawTestBalanceOp
   1625 ```typescript
   1626 /**
   1627  * Make withdrawal on a test deployment of the exchange
   1628  * and merchant.
   1629  */
   1630 export type WithdrawTestBalanceOp = {
   1631   request: WithdrawTestBalanceRequest;
   1632   response: {};
   1633 };
   1634 
   1635 ```
   1636 ```typescript
   1637 export interface WithdrawTestBalanceRequest {
   1638   amount: string;
   1639   bankBaseUrl: string;
   1640   /**
   1641    * Bank access API base URL.  Defaults to the bankBaseUrl.
   1642    */
   1643   bankAccessApiBaseUrl?: string;
   1644   exchangeBaseUrl: string;
   1645   forcedDenomSel?: ForcedDenomSel;
   1646 }
   1647 
   1648 ```
   1649 
   1650 (withdrawtestkudosop)=
   1651 ### WithdrawTestkudosOp
   1652 ```typescript
   1653 /**
   1654  * Make a withdrawal of testkudos on test.taler.net.
   1655  */
   1656 export type WithdrawTestkudosOp = {
   1657   op: WalletApiOperation.WithdrawTestkudos;
   1658   request: {};
   1659   response: {};
   1660 };
   1661 
   1662 ```
   1663 ```typescript
   1664 // Enum value:
   1665 // WalletApiOperation.WithdrawTestkudos = "withdrawTestkudos"
   1666 
   1667 ```
   1668 
   1669 (testpayop)=
   1670 ### TestPayOp
   1671 ```typescript
   1672 /**
   1673  * Make a test payment using a test deployment of
   1674  * the exchange and merchant.
   1675  */
   1676 export type TestPayOp = {
   1677   request: TestPayArgs;
   1678   response: TestPayResult;
   1679 };
   1680 
   1681 ```
   1682 ```typescript
   1683 export interface TestPayArgs {
   1684   merchantBaseUrl: string;
   1685   merchantAuthToken?: string;
   1686   amount: string;
   1687   summary: string;
   1688   forcedCoinSel?: ForcedCoinSel;
   1689 }
   1690 
   1691 ```
   1692 ```typescript
   1693 export interface TestPayResult {
   1694   payCoinSelection: PayCoinSelection;
   1695 }
   1696 
   1697 ```
   1698 ```typescript
   1699 /**
   1700  * Result of selecting coins, contains the exchange, and selected
   1701  * coins with their denomination.
   1702  */
   1703 export interface PayCoinSelection {
   1704   /**
   1705    * Amount requested by the merchant.
   1706    */
   1707   paymentAmount: AmountJson;
   1708   /**
   1709    * Public keys of the coins that were selected.
   1710    */
   1711   coinPubs: string[];
   1712   /**
   1713    * Amount that each coin contributes.
   1714    */
   1715   coinContributions: AmountJson[];
   1716   /**
   1717    * How much of the wire fees is the customer paying?
   1718    */
   1719   customerWireFees: AmountJson;
   1720   /**
   1721    * How much of the deposit fees is the customer paying?
   1722    */
   1723   customerDepositFees: AmountJson;
   1724 }
   1725 
   1726 ```
   1727 ```typescript
   1728 /**
   1729  * Non-negative financial amount.  Fractional values are expressed as multiples
   1730  * of 1e-8.
   1731  */
   1732 export interface AmountJson {
   1733   /**
   1734    * Value, must be an integer.
   1735    */
   1736   readonly value: number;
   1737   /**
   1738    * Fraction, must be an integer.  Represent 1/1e8 of a unit.
   1739    */
   1740   readonly fraction: number;
   1741   /**
   1742    * Currency of the amount.
   1743    */
   1744   readonly currency: string;
   1745 }
   1746 
   1747 ```
   1748 
   1749 (withdrawfakebankop)=
   1750 ### WithdrawFakebankOp
   1751 ```typescript
   1752 /**
   1753  * Make a withdrawal from a fakebank, i.e.
   1754  * a bank where test users can be registered freely
   1755  * and testing APIs are available.
   1756  */
   1757 export type WithdrawFakebankOp = {
   1758   op: WalletApiOperation.WithdrawFakebank;
   1759   request: WithdrawFakebankRequest;
   1760   response: {};
   1761 };
   1762 
   1763 ```
   1764 ```typescript
   1765 // Enum value:
   1766 // WalletApiOperation.WithdrawFakebank = "withdrawFakebank"
   1767 
   1768 ```
   1769 ```typescript
   1770 export interface WithdrawFakebankRequest {
   1771   amount: AmountString;
   1772   exchange: string;
   1773   bank: string;
   1774 }
   1775 
   1776 ```
   1777 
   1778 (getpendingtasksop)=
   1779 ### GetPendingTasksOp
   1780 ```typescript
   1781 /**
   1782  * Get wallet-internal pending tasks.
   1783  */
   1784 export type GetPendingTasksOp = {
   1785   request: {};
   1786   response: PendingTasksResponse;
   1787 };
   1788 
   1789 ```
   1790 ```typescript
   1791 /**
   1792  * Response returned from the pending operations API.
   1793  */
   1794 export interface PendingOperationsResponse {
   1795   /**
   1796    * List of pending operations.
   1797    */
   1798   pendingOperations: PendingTaskInfo[];
   1799 }
   1800 
   1801 ```
   1802 ```typescript
   1803 /**
   1804  * Information about a pending operation.
   1805  */
   1806 export type PendingTaskInfo = PendingTaskInfoCommon &
   1807   (
   1808     | PendingExchangeUpdateTask
   1809     | PendingExchangeCheckRefreshTask
   1810     | PendingPayTask
   1811     | PendingProposalDownloadTask
   1812     | PendingRefreshTask
   1813     | PendingRefundQueryTask
   1814     | PendingTipPickupTask
   1815     | PendingWithdrawTask
   1816     | PendingRecoupTask
   1817     | PendingDepositTask
   1818     | PendingBackupTask
   1819   );
   1820 
   1821 ```
   1822 ```typescript
   1823 /**
   1824  * Fields that are present in every pending operation.
   1825  */
   1826 export interface PendingTaskInfoCommon {
   1827   /**
   1828    * Type of the pending operation.
   1829    */
   1830   type: PendingTaskType;
   1831   /**
   1832    * Unique identifier for the pending task.
   1833    */
   1834   id: string;
   1835   /**
   1836    * Set to true if the operation indicates that something is really in progress,
   1837    * as opposed to some regular scheduled operation that can be tried later.
   1838    */
   1839   givesLifeness: boolean;
   1840   /**
   1841    * Timestamp when the pending operation should be executed next.
   1842    */
   1843   timestampDue: AbsoluteTime;
   1844   /**
   1845    * Retry info.  Currently used to stop the wallet after any operation
   1846    * exceeds a number of retries.
   1847    */
   1848   retryInfo?: RetryInfo;
   1849 }
   1850 
   1851 ```
   1852 ```typescript
   1853 export enum PendingTaskType {
   1854   ExchangeUpdate = "exchange-update",
   1855   ExchangeCheckRefresh = "exchange-check-refresh",
   1856   Pay = "pay",
   1857   ProposalDownload = "proposal-download",
   1858   Refresh = "refresh",
   1859   Recoup = "recoup",
   1860   RefundQuery = "refund-query",
   1861   TipPickup = "tip-pickup",
   1862   Withdraw = "withdraw",
   1863   Deposit = "deposit",
   1864   Backup = "backup",
   1865 }
   1866 
   1867 ```
   1868 ```typescript
   1869 export interface RetryInfo {
   1870   firstTry: AbsoluteTime;
   1871   nextRetry: AbsoluteTime;
   1872   retryCounter: number;
   1873 }
   1874 
   1875 ```
   1876 ```typescript
   1877 export interface RetryPolicy {
   1878   readonly backoffDelta: Duration;
   1879   readonly backoffBase: number;
   1880   readonly maxTimeout: Duration;
   1881 }
   1882 
   1883 ```
   1884 ```typescript
   1885 /**
   1886  * The wallet is currently updating information about an exchange.
   1887  */
   1888 export interface PendingExchangeUpdateTask {
   1889   type: PendingTaskType.ExchangeUpdate;
   1890   exchangeBaseUrl: string;
   1891   lastError: TalerErrorDetail | undefined;
   1892 }
   1893 
   1894 ```
   1895 ```typescript
   1896 // Enum value:
   1897 // PendingTaskType.ExchangeUpdate = "exchange-update"
   1898 
   1899 ```
   1900 ```typescript
   1901 /**
   1902  * The wallet should check whether coins from this exchange
   1903  * need to be auto-refreshed.
   1904  */
   1905 export interface PendingExchangeCheckRefreshTask {
   1906   type: PendingTaskType.ExchangeCheckRefresh;
   1907   exchangeBaseUrl: string;
   1908 }
   1909 
   1910 ```
   1911 ```typescript
   1912 // Enum value:
   1913 // PendingTaskType.ExchangeCheckRefresh = "exchange-check-refresh"
   1914 
   1915 ```
   1916 ```typescript
   1917 /**
   1918  * The wallet is signing coins and then sending them to
   1919  * the merchant.
   1920  */
   1921 export interface PendingPayTask {
   1922   type: PendingTaskType.Pay;
   1923   proposalId: string;
   1924   isReplay: boolean;
   1925   retryInfo?: RetryInfo;
   1926   lastError: TalerErrorDetail | undefined;
   1927 }
   1928 
   1929 ```
   1930 ```typescript
   1931 // Enum value:
   1932 // PendingTaskType.Pay = "pay"
   1933 
   1934 ```
   1935 ```typescript
   1936 /**
   1937  * Status of downloading signed contract terms from a merchant.
   1938  */
   1939 export interface PendingProposalDownloadTask {
   1940   type: PendingTaskType.ProposalDownload;
   1941   merchantBaseUrl: string;
   1942   proposalTimestamp: TalerProtocolTimestamp;
   1943   proposalId: string;
   1944   orderId: string;
   1945   lastError?: TalerErrorDetail;
   1946   retryInfo?: RetryInfo;
   1947 }
   1948 
   1949 ```
   1950 ```typescript
   1951 // Enum value:
   1952 // PendingTaskType.ProposalDownload = "proposal-download"
   1953 
   1954 ```
   1955 ```typescript
   1956 /**
   1957  * Status of an ongoing withdrawal operation.
   1958  */
   1959 export interface PendingRefreshTask {
   1960   type: PendingTaskType.Refresh;
   1961   lastError?: TalerErrorDetail;
   1962   refreshGroupId: string;
   1963   finishedPerCoin: boolean[];
   1964   retryInfo?: RetryInfo;
   1965 }
   1966 
   1967 ```
   1968 ```typescript
   1969 /**
   1970  * The wallet is querying the merchant about whether any refund
   1971  * permissions are available for a purchase.
   1972  */
   1973 export interface PendingRefundQueryTask {
   1974   type: PendingTaskType.RefundQuery;
   1975   proposalId: string;
   1976   retryInfo?: RetryInfo;
   1977   lastError: TalerErrorDetail | undefined;
   1978 }
   1979 
   1980 ```
   1981 ```typescript
   1982 // Enum value:
   1983 // PendingTaskType.RefundQuery = "refund-query"
   1984 
   1985 ```
   1986 ```typescript
   1987 /**
   1988  * The wallet is picking up a tip that the user has accepted.
   1989  */
   1990 export interface PendingTipPickupTask {
   1991   type: PendingTaskType.TipPickup;
   1992   tipId: string;
   1993   merchantBaseUrl: string;
   1994   merchantTipId: string;
   1995 }
   1996 
   1997 ```
   1998 ```typescript
   1999 // Enum value:
   2000 // PendingTaskType.TipPickup = "tip-pickup"
   2001 
   2002 ```
   2003 ```typescript
   2004 /**
   2005  * Status of an ongoing withdrawal operation.
   2006  */
   2007 export interface PendingWithdrawTask {
   2008   type: PendingTaskType.Withdraw;
   2009   lastError: TalerErrorDetail | undefined;
   2010   retryInfo?: RetryInfo;
   2011   withdrawalGroupId: string;
   2012 }
   2013 
   2014 ```
   2015 ```typescript
   2016 // Enum value:
   2017 // PendingTaskType.Withdraw = "withdraw"
   2018 
   2019 ```
   2020 ```typescript
   2021 export interface PendingRecoupTask {
   2022   type: PendingTaskType.Recoup;
   2023   recoupGroupId: string;
   2024   retryInfo?: RetryInfo;
   2025   lastError: TalerErrorDetail | undefined;
   2026 }
   2027 
   2028 ```
   2029 ```typescript
   2030 // Enum value:
   2031 // PendingTaskType.Recoup = "recoup"
   2032 
   2033 ```
   2034 ```typescript
   2035 /**
   2036  * Status of an ongoing deposit operation.
   2037  */
   2038 export interface PendingDepositTask {
   2039   type: PendingTaskType.Deposit;
   2040   lastError: TalerErrorDetail | undefined;
   2041   retryInfo: RetryInfo | undefined;
   2042   depositGroupId: string;
   2043 }
   2044 
   2045 ```
   2046 ```typescript
   2047 export interface PendingBackupTask {
   2048   type: PendingTaskType.Backup;
   2049   backupProviderBaseUrl: string;
   2050   lastError: TalerErrorDetail | undefined;
   2051 }
   2052 
   2053 ```
   2054 ```typescript
   2055 // Enum value:
   2056 // PendingTaskType.Backup = "backup"
   2057 
   2058 ```
   2059 
   2060 (dumpcoinsop)=
   2061 ### DumpCoinsOp
   2062 ```typescript
   2063 /**
   2064  * Dump all coins of the wallet in a simple JSON format.
   2065  */
   2066 export type DumpCoinsOp = {
   2067   request: {};
   2068   response: CoinDumpJson;
   2069 };
   2070 
   2071 ```
   2072 ```typescript
   2073 /**
   2074  * Easy to process format for the public data of coins
   2075  * managed by the wallet.
   2076  */
   2077 export interface CoinDumpJson {
   2078   coins: Array<{
   2079     /**
   2080      * The coin's denomination's public key.
   2081      */
   2082     denom_pub: DenominationPubKey;
   2083     /**
   2084      * Hash of denom_pub.
   2085      */
   2086     denom_pub_hash: string;
   2087     /**
   2088      * Value of the denomination (without any fees).
   2089      */
   2090     denom_value: string;
   2091     /**
   2092      * Public key of the coin.
   2093      */
   2094     coin_pub: string;
   2095     /**
   2096      * Base URL of the exchange for the coin.
   2097      */
   2098     exchange_base_url: string;
   2099     /**
   2100      * Remaining value on the coin, to the knowledge of
   2101      * the wallet.
   2102      */
   2103     remaining_value: string;
   2104     /**
   2105      * Public key of the parent coin.
   2106      * Only present if this coin was obtained via refreshing.
   2107      */
   2108     refresh_parent_coin_pub: string | undefined;
   2109     /**
   2110      * Public key of the reserve for this coin.
   2111      * Only present if this coin was obtained via refreshing.
   2112      */
   2113     withdrawal_reserve_pub: string | undefined;
   2114     /**
   2115      * Is the coin suspended?
   2116      * Suspended coins are not considered for payments.
   2117      */
   2118     coin_suspended: boolean;
   2119     /**
   2120      * Information about the age restriction
   2121      */
   2122     ageCommitmentProof: AgeCommitmentProof | undefined;
   2123   }>;
   2124 }
   2125 
   2126 ```
   2127 ```typescript
   2128 interface Array<T> extends RelativeIndexable<T> {}
   2129 
   2130 ```
   2131 
   2132 (setcoinsuspendedop)=
   2133 ### SetCoinSuspendedOp
   2134 ```typescript
   2135 /**
   2136  * Set a coin as (un-)suspended.
   2137  * Suspended coins won't be used for payments.
   2138  */
   2139 export type SetCoinSuspendedOp = {
   2140   request: SetCoinSuspendedRequest;
   2141   response: {};
   2142 };
   2143 
   2144 ```
   2145 ```typescript
   2146 export interface SetCoinSuspendedRequest {
   2147   coinPub: string;
   2148   suspended: boolean;
   2149 }
   2150 
   2151 ```
   2152 
   2153 (forcerefreshop)=
   2154 ### ForceRefreshOp
   2155 ```typescript
   2156 /**
   2157  * Force a refresh on coins where it would not
   2158  * be necessary.
   2159  */
   2160 export type ForceRefreshOp = {
   2161   request: ForceRefreshRequest;
   2162   response: {};
   2163 };
   2164 
   2165 ```
   2166 ```typescript
   2167 export interface ForceRefreshRequest {
   2168   coinPubList: string[];
   2169 }
   2170 
   2171 ```
   2172 
   2173 ## Common Declarations
   2174 ```typescript
   2175 export interface OrderShortInfo {
   2176   /**
   2177    * Order ID, uniquely identifies the order within a merchant instance
   2178    */
   2179   orderId: string;
   2180   /**
   2181    * Hash of the contract terms.
   2182    */
   2183   contractTermsHash: string;
   2184   /**
   2185    * More information about the merchant
   2186    */
   2187   merchant: MerchantInfo;
   2188   /**
   2189    * Summary of the order, given by the merchant
   2190    */
   2191   summary: string;
   2192   /**
   2193    * Map from IETF BCP 47 language tags to localized summaries
   2194    */
   2195   summary_i18n?: InternationalizedString;
   2196   /**
   2197    * List of products that are part of the order
   2198    */
   2199   products: Product[] | undefined;
   2200   /**
   2201    * Time indicating when the order should be delivered.
   2202    * May be overwritten by individual products.
   2203    */
   2204   delivery_date?: TalerProtocolTimestamp;
   2205   /**
   2206    * Delivery location for (all!) products.
   2207    */
   2208   delivery_location?: Location;
   2209   /**
   2210    * URL of the fulfillment, given by the merchant
   2211    */
   2212   fulfillmentUrl?: string;
   2213   /**
   2214    * Plain text message that should be shown to the user
   2215    * when the payment is complete.
   2216    */
   2217   fulfillmentMessage?: string;
   2218   /**
   2219    * Translations of fulfillmentMessage.
   2220    */
   2221   fulfillmentMessage_i18n?: InternationalizedString;
   2222 }
   2223 ```
   2224 ```typescript
   2225 export interface MerchantInfo {
   2226   name: string;
   2227   jurisdiction?: Location;
   2228   address?: Location;
   2229   logo?: string;
   2230   website?: string;
   2231   email?: string;
   2232 }
   2233 ```
   2234 ```typescript
   2235 export interface Location {
   2236   country?: string;
   2237   country_subdivision?: string;
   2238   district?: string;
   2239   town?: string;
   2240   town_location?: string;
   2241   post_code?: string;
   2242   street?: string;
   2243   building_name?: string;
   2244   building_number?: string;
   2245   address_lines?: string[];
   2246 }
   2247 ```
   2248 ```typescript
   2249 export interface InternationalizedString {
   2250   [lang_tag: string]: string;
   2251 }
   2252 ```
   2253 ```typescript
   2254 export interface Product {
   2255   product_id?: string;
   2256   description: string;
   2257   description_i18n?: {
   2258     [lang_tag: string]: string;
   2259   };
   2260   quantity?: number;
   2261   unit?: string;
   2262   price?: AmountString;
   2263   image?: string;
   2264   taxes?: Tax[];
   2265   delivery_date?: TalerProtocolTimestamp;
   2266 }
   2267 ```
   2268 ```typescript
   2269 export interface Tax {
   2270   name: string;
   2271   tax: AmountString;
   2272 }
   2273 ```
   2274 ```typescript
   2275 export interface TalerProtocolTimestamp {
   2276   readonly t_s: number | "never";
   2277 }
   2278 ```
   2279 ```typescript
   2280 // Enum value:
   2281 // PendingTaskType.Refresh = "refresh"
   2282 ```
   2283 ```typescript
   2284 // Enum value:
   2285 // PendingTaskType.Deposit = "deposit"
   2286 ```
   2287 ```typescript
   2288 export interface ExchangeListItem {
   2289   exchangeBaseUrl: string;
   2290   currency: string;
   2291   paytoUris: string[];
   2292   tos: ExchangeTos;
   2293 }
   2294 ```
   2295 ```typescript
   2296 export interface ExchangeTos {
   2297   acceptedVersion?: string;
   2298   currentVersion?: string;
   2299   contentType?: string;
   2300   content?: string;
   2301 }
   2302 ```
   2303 ```typescript
   2304 export interface ForcedDenomSel {
   2305   denoms: {
   2306     value: AmountString;
   2307     count: number;
   2308   }[];
   2309 }
   2310 ```
   2311 ```typescript
   2312 // Enum value:
   2313 // ProviderPaymentType.InsufficientBalance = "insufficient-balance"
   2314 ```
   2315 ```typescript
   2316 /**
   2317  * Contract terms from a merchant.
   2318  */
   2319 export interface ContractTerms {
   2320   /**
   2321    * Hash of the merchant's wire details.
   2322    */
   2323   h_wire: string;
   2324   /**
   2325    * Hash of the merchant's wire details.
   2326    */
   2327   auto_refund?: TalerProtocolDuration;
   2328   /**
   2329    * Wire method the merchant wants to use.
   2330    */
   2331   wire_method: string;
   2332   /**
   2333    * Human-readable short summary of the contract.
   2334    */
   2335   summary: string;
   2336   summary_i18n?: InternationalizedString;
   2337   /**
   2338    * Nonce used to ensure freshness.
   2339    */
   2340   nonce: string;
   2341   /**
   2342    * Total amount payable.
   2343    */
   2344   amount: string;
   2345   /**
   2346    * Auditors accepted by the merchant.
   2347    */
   2348   auditors: AuditorHandle[];
   2349   /**
   2350    * Deadline to pay for the contract.
   2351    */
   2352   pay_deadline: TalerProtocolTimestamp;
   2353   /**
   2354    * Maximum deposit fee covered by the merchant.
   2355    */
   2356   max_fee: string;
   2357   /**
   2358    * Information about the merchant.
   2359    */
   2360   merchant: MerchantInfo;
   2361   /**
   2362    * Public key of the merchant.
   2363    */
   2364   merchant_pub: string;
   2365   /**
   2366    * Time indicating when the order should be delivered.
   2367    * May be overwritten by individual products.
   2368    */
   2369   delivery_date?: TalerProtocolTimestamp;
   2370   /**
   2371    * Delivery location for (all!) products.
   2372    */
   2373   delivery_location?: Location;
   2374   /**
   2375    * List of accepted exchanges.
   2376    */
   2377   exchanges: ExchangeHandle[];
   2378   /**
   2379    * Products that are sold in this contract.
   2380    */
   2381   products?: Product[];
   2382   /**
   2383    * Deadline for refunds.
   2384    */
   2385   refund_deadline: TalerProtocolTimestamp;
   2386   /**
   2387    * Deadline for the wire transfer.
   2388    */
   2389   wire_transfer_deadline: TalerProtocolTimestamp;
   2390   /**
   2391    * Time when the contract was generated by the merchant.
   2392    */
   2393   timestamp: TalerProtocolTimestamp;
   2394   /**
   2395    * Order id to uniquely identify the purchase within
   2396    * one merchant instance.
   2397    */
   2398   order_id: string;
   2399   /**
   2400    * Base URL of the merchant's backend.
   2401    */
   2402   merchant_base_url: string;
   2403   /**
   2404    * Fulfillment URL to view the product or
   2405    * delivery status.
   2406    */
   2407   fulfillment_url?: string;
   2408   /**
   2409    * URL meant to share the shopping cart.
   2410    */
   2411   public_reorder_url?: string;
   2412   /**
   2413    * Plain text fulfillment message in the merchant's default language.
   2414    */
   2415   fulfillment_message?: string;
   2416   /**
   2417    * Internationalized fulfillment messages.
   2418    */
   2419   fulfillment_message_i18n?: InternationalizedString;
   2420   /**
   2421    * Share of the wire fee that must be settled with one payment.
   2422    */
   2423   wire_fee_amortization?: number;
   2424   /**
   2425    * Maximum wire fee that the merchant agrees to pay for.
   2426    */
   2427   max_wire_fee?: string;
   2428   minimum_age?: number;
   2429   /**
   2430    * Extra data, interpreted by the mechant only.
   2431    */
   2432   extra?: any;
   2433 }
   2434 ```
   2435 ```typescript
   2436 export interface TalerProtocolDuration {
   2437   readonly d_us: number | "forever";
   2438 }
   2439 ```
   2440 ```typescript
   2441 export interface AuditorHandle {
   2442   /**
   2443    * Official name of the auditor.
   2444    */
   2445   name: string;
   2446   /**
   2447    * Master public signing key of the auditor.
   2448    */
   2449   auditor_pub: string;
   2450   /**
   2451    * Base URL of the auditor.
   2452    */
   2453   url: string;
   2454 }
   2455 ```
   2456 ```typescript
   2457 /**
   2458  * Information about an exchange as stored inside a
   2459  * merchant's contract terms.
   2460  */
   2461 export interface ExchangeHandle {
   2462   /**
   2463    * Master public signing key of the exchange.
   2464    */
   2465   master_pub: string;
   2466   /**
   2467    * Base URL of the exchange.
   2468    */
   2469   url: string;
   2470 }
   2471 ```
   2472 ```typescript
   2473 /**
   2474  * Forced coin selection for deposits/payments.
   2475  */
   2476 export interface ForcedCoinSel {
   2477   coins: {
   2478     value: AmountString;
   2479     contribution: AmountString;
   2480   }[];
   2481 }
   2482 ```
   2483 ```typescript
   2484 // Enum value:
   2485 // ProviderPaymentType.Pending = "pending"
   2486 ```
   2487 ```typescript
   2488 export interface TalerErrorDetail {
   2489   code: TalerErrorCode;
   2490   hint?: string;
   2491   [x: string]: unknown;
   2492 }
   2493 ```
   2494 ```typescript
   2495 export interface BackupRecovery {
   2496   walletRootPriv: string;
   2497   providers: {
   2498     url: string;
   2499   }[];
   2500 }
   2501 ```
   2502 ```typescript
   2503 export interface AbsoluteTime {
   2504   /**
   2505    * Timestamp in milliseconds.
   2506    */
   2507   readonly t_ms: number | "never";
   2508 }
   2509 ```
   2510 ```typescript
   2511 export interface Duration {
   2512   /**
   2513    * Duration in milliseconds.
   2514    */
   2515   readonly d_ms: number | "forever";
   2516 }
   2517 ```