wallet-core.md (151847B)
1 # Wallet-Core API Documentation 2 This file is auto-generated from the [taler-typescript-core](https://git.taler.net/taler-typescript-core.git/tree/packages/taler-wallet-core/src/wallet-api-types.ts) repository. 3 ## Overview 4 ### Initialization 5 * [InitWalletOp](#initwalletop) 6 * [ShutdownOp](#shutdownop) 7 * [HintApplicationResumedOp](#hintapplicationresumedop) 8 * [SetWalletRunConfigOp](#setwalletrunconfigop) 9 * [GetVersionOp](#getversionop) 10 * [HintNetworkAvailabilityOp](#hintnetworkavailabilityop) 11 ### Donau 12 * [SetDonauOp](#setdonauop) 13 * [GetDonauOp](#getdonauop) 14 * [GetDonauStatementsOp](#getdonaustatementsop) 15 ### Contacts 16 * [AddContactOp](#addcontactop) 17 * [DeleteContactOp](#deletecontactop) 18 * [GetContactsOp](#getcontactsop) 19 ### Mailbox 20 * [RefreshMailboxOp](#refreshmailboxop) 21 * [InitializeMailboxOp](#initializemailboxop) 22 * [GetMailboxOp](#getmailboxop) 23 * [GetMailboxMessagesOp](#getmailboxmessagesop) 24 * [DeleteMailboxMessageOp](#deletemailboxmessageop) 25 * [AddMailboxMessageOp](#addmailboxmessageop) 26 * [SendTalerUriMailboxMessageOp](#sendtalerurimailboxmessageop) 27 ### Basic Wallet Information 28 * [GetBalancesOp](#getbalancesop) 29 * [GetBalancesDetailOp](#getbalancesdetailop) 30 * [ConvertDepositAmountOp](#convertdepositamountop) 31 * [GetMaxDepositAmountOp](#getmaxdepositamountop) 32 * [GetMaxPeerPushDebitAmountOp](#getmaxpeerpushdebitamountop) 33 ### Managing Transactions 34 * [GetTransactionsOp](#gettransactionsop) 35 * [GetTransactionsV2Op](#gettransactionsv2op) 36 * [ListAssociatedRefreshesOp](#listassociatedrefreshesop) 37 * [TestingGetSampleTransactionsOp](#testinggetsampletransactionsop) 38 * [GetTransactionByIdOp](#gettransactionbyidop) 39 * [RetryPendingNowOp](#retrypendingnowop) 40 * [DeleteTransactionOp](#deletetransactionop) 41 * [RetryTransactionOp](#retrytransactionop) 42 * [AbortTransactionOp](#aborttransactionop) 43 * [FailTransactionOp](#failtransactionop) 44 * [SuspendTransactionOp](#suspendtransactionop) 45 * [ResumeTransactionOp](#resumetransactionop) 46 ### Withdrawals 47 * [GetWithdrawalDetailsForAmountOp](#getwithdrawaldetailsforamountop) 48 * [GetWithdrawalDetailsForUriOp](#getwithdrawaldetailsforuriop) 49 * [PrepareBankIntegratedWithdrawalOp](#preparebankintegratedwithdrawalop) 50 * [ConfirmWithdrawalOp](#confirmwithdrawalop) 51 * [AcceptBankIntegratedWithdrawalOp](#acceptbankintegratedwithdrawalop) 52 * [AcceptManualWithdrawalOp](#acceptmanualwithdrawalop) 53 ### Merchant Payments 54 * [PreparePayForUriOp](#preparepayforuriop) 55 * [PreparePayForTemplateOp](#preparepayfortemplateop) 56 * [PreparePayForUriV2Op](#preparepayforuriv2op) 57 * [PreparePayForTemplateV2Op](#preparepayfortemplatev2op) 58 * [GetChoicesForPaymentOp](#getchoicesforpaymentop) 59 * [SharePaymentOp](#sharepaymentop) 60 * [CheckPayForTemplateOp](#checkpayfortemplateop) 61 * [ConfirmPayOp](#confirmpayop) 62 * [StartRefundQueryForUriOp](#startrefundqueryforuriop) 63 * [StartRefundQueryOp](#startrefundqueryop) 64 ### Token family management 65 * [ListDiscountsOp](#listdiscountsop) 66 * [DeleteDiscountOp](#deletediscountop) 67 * [ListSubscriptionsOp](#listsubscriptionsop) 68 * [DeleteSubscriptionOp](#deletesubscriptionop) 69 ### Global Currency management 70 * [ListGlobalCurrencyAuditorsOp](#listglobalcurrencyauditorsop) 71 * [ListGlobalCurrencyExchangesOp](#listglobalcurrencyexchangesop) 72 * [AddGlobalCurrencyExchangeOp](#addglobalcurrencyexchangeop) 73 * [AddGlobalCurrencyAuditorOp](#addglobalcurrencyauditorop) 74 * [RemoveGlobalCurrencyExchangeOp](#removeglobalcurrencyexchangeop) 75 * [RemoveGlobalCurrencyAuditorOp](#removeglobalcurrencyauditorop) 76 ### Exchange Management 77 * [CompleteExchangeBaseUrlOp](#completeexchangebaseurlop) 78 * [ListExchangesOp](#listexchangesop) 79 * [StartExchangeWalletKycOp](#startexchangewalletkycop) 80 * [TestingWaitExchangeWalletKycOp](#testingwaitexchangewalletkycop) 81 * [TestingPlanMigrateExchangeBaseUrlOp](#testingplanmigrateexchangebaseurlop) 82 * [PrepareWithdrawExchangeOp](#preparewithdrawexchangeop) 83 * [AddExchangeOp](#addexchangeop) 84 * [UpdateExchangeEntryOp](#updateexchangeentryop) 85 * [ListBankAccountsOp](#listbankaccountsop) 86 * [GetBankAccountByIdOp](#getbankaccountbyidop) 87 * [AddBankAccountsOp](#addbankaccountsop) 88 * [ForgetBankAccountsOp](#forgetbankaccountsop) 89 * [SetExchangeTosAcceptedOp](#setexchangetosacceptedop) 90 * [SetExchangeTosForgottenOp](#setexchangetosforgottenop) 91 * [GetExchangeTosOp](#getexchangetosop) 92 * [GetDepositWireTypesOp](#getdepositwiretypesop) 93 * [GetDepositWireTypesForCurrencyOp](#getdepositwiretypesforcurrencyop) 94 * [GetExchangeDetailedInfoOp](#getexchangedetailedinfoop) 95 * [GetDefaultExchangesOp](#getdefaultexchangesop) 96 * [GetExchangeEntryByUrlOp](#getexchangeentrybyurlop) 97 * [GetExchangeResourcesOp](#getexchangeresourcesop) 98 * [DeleteExchangeOp](#deleteexchangeop) 99 * [GetCurrencySpecificationOp](#getcurrencyspecificationop) 100 ### Deposits 101 * [CreateDepositGroupOp](#createdepositgroupop) 102 * [CheckDepositOp](#checkdepositop) 103 ### Backups 104 * [ExportDbToFileOp](#exportdbtofileop) 105 * [ImportDbFromFileOp](#importdbfromfileop) 106 * [ListStoredBackupsOp](#liststoredbackupsop) 107 * [CreateStoredBackupsOp](#createstoredbackupsop) 108 * [RecoverStoredBackupsOp](#recoverstoredbackupsop) 109 * [DeleteStoredBackupOp](#deletestoredbackupop) 110 ### Peer Payments 111 * [CheckPeerPushDebitOp](#checkpeerpushdebitop) 112 * [CheckPeerPushDebitV2Op](#checkpeerpushdebitv2op) 113 * [InitiatePeerPushDebitOp](#initiatepeerpushdebitop) 114 * [PreparePeerPushCreditOp](#preparepeerpushcreditop) 115 * [ConfirmPeerPushCreditOp](#confirmpeerpushcreditop) 116 * [CheckPeerPullCreditOp](#checkpeerpullcreditop) 117 * [InitiatePeerPullCreditOp](#initiatepeerpullcreditop) 118 * [PreparePeerPullDebitOp](#preparepeerpulldebitop) 119 * [ConfirmPeerPullDebitOp](#confirmpeerpulldebitop) 120 ### Data Validation and Conversion 121 * [ValidateIbanOp](#validateibanop) 122 * [CanonicalizeBaseUrlOp](#canonicalizebaseurlop) 123 * [GetQrCodesForPaytoOp](#getqrcodesforpaytoop) 124 * [ConvertIbanAccountFieldToPaytoOp](#convertibanaccountfieldtopaytoop) 125 * [ConvertIbanPaytoToAccountFieldOp](#convertibanpaytotoaccountfieldop) 126 * [GetBankingChoicesForPaytoOp](#getbankingchoicesforpaytoop) 127 ### Database Management 128 * [ExportDbOp](#exportdbop) 129 * [ImportDbOp](#importdbop) 130 * [ClearDbOp](#cleardbop) 131 * [RecycleOp](#recycleop) 132 ### Testing and Debugging 133 * [ApplyDevExperimentOp](#applydevexperimentop) 134 * [RunIntegrationTestOp](#runintegrationtestop) 135 * [RunIntegrationTestV2Op](#runintegrationtestv2op) 136 * [TestCryptoOp](#testcryptoop) 137 * [WithdrawTestBalanceOp](#withdrawtestbalanceop) 138 * [WithdrawTestkudosOp](#withdrawtestkudosop) 139 * [TestPayOp](#testpayop) 140 * [GetActiveTasksOp](#getactivetasksop) 141 * [GetPerformanceStatsOp](#getperformancestatsop) 142 * [DumpCoinsOp](#dumpcoinsop) 143 * [TestingSetTimetravelOp](#testingsettimetravelop) 144 * [TestingWaitTransactionsFinalOp](#testingwaittransactionsfinalop) 145 * [TestingWaitTasksDoneOp](#testingwaittasksdoneop) 146 * [TestingWaitRefreshesFinalOp](#testingwaitrefreshesfinalop) 147 * [TestingWaitTransactionStateOp](#testingwaittransactionstateop) 148 * [TestingWaitExchangeStateOp](#testingwaitexchangestateop) 149 * [TestingWaitExchangeReadyOp](#testingwaitexchangereadyop) 150 * [TestingPingOp](#testingpingop) 151 * [TestingGetReserveHistoryOp](#testinggetreservehistoryop) 152 * [TestingResetAllRetriesOp](#testingresetallretriesop) 153 * [TestingGetDenomStatsOp](#testinggetdenomstatsop) 154 * [TestingRunFixupOp](#testingrunfixupop) 155 * [TestingGetDiagnosticsOp](#testinggetdiagnosticsop) 156 * [TestingGetFlightRecordsOp](#testinggetflightrecordsop) 157 * [TestingCorruptWithdrawalCoinSelOp](#testingcorruptwithdrawalcoinselop) 158 * [SetCoinSuspendedOp](#setcoinsuspendedop) 159 * [ForceRefreshOp](#forcerefreshop) 160 ## Operation Reference 161 ### InitWalletOp 162 ```typescript 163 /** 164 * Initialize wallet-core. 165 * 166 * Must be the first request made to wallet-core. 167 */ 168 export type InitWalletOp = { 169 op: WalletApiOperation.InitWallet; 170 request: InitRequest; 171 response: InitResponse; 172 }; 173 // InitWallet = "initWallet" 174 175 ``` 176 177 ### ShutdownOp 178 ```typescript 179 export type ShutdownOp = { 180 op: WalletApiOperation.Shutdown; 181 request: EmptyObject; 182 response: EmptyObject; 183 }; 184 // Shutdown = "shutdown" 185 186 ``` 187 188 ### HintApplicationResumedOp 189 ```typescript 190 /** 191 * Give wallet-core a kick and restart all pending tasks. 192 * Useful when the host application gets suspended and resumed, 193 * and active network requests might have stalled. 194 */ 195 export type HintApplicationResumedOp = { 196 op: WalletApiOperation.HintApplicationResumed; 197 request: EmptyObject; 198 response: EmptyObject; 199 }; 200 // HintApplicationResumed = "hintApplicationResumed" 201 202 ``` 203 204 ### SetWalletRunConfigOp 205 ```typescript 206 /** 207 * Change the configuration of wallet-core. 208 * 209 * Currently an alias for the initWallet request. 210 */ 211 export type SetWalletRunConfigOp = { 212 op: WalletApiOperation.SetWalletRunConfig; 213 request: InitRequest; 214 response: InitResponse; 215 }; 216 // SetWalletRunConfig = "setWalletRunConfig" 217 218 ``` 219 220 ### GetVersionOp 221 ```typescript 222 export type GetVersionOp = { 223 op: WalletApiOperation.GetVersion; 224 request: EmptyObject; 225 response: WalletCoreVersion; 226 }; 227 // GetVersion = "getVersion" 228 229 ``` 230 231 ### HintNetworkAvailabilityOp 232 ```typescript 233 export type HintNetworkAvailabilityOp = { 234 op: WalletApiOperation.HintNetworkAvailability; 235 request: HintNetworkAvailabilityRequest; 236 response: EmptyObject; 237 }; 238 // HintNetworkAvailability = "hintNetworkAvailability" 239 240 ``` 241 ```typescript 242 export interface HintNetworkAvailabilityRequest { 243 isNetworkAvailable: boolean; 244 } 245 246 ``` 247 248 ### SetDonauOp 249 ```typescript 250 /** 251 * Set the donation authority for this wallet. 252 */ 253 export type SetDonauOp = { 254 op: WalletApiOperation.SetDonau; 255 request: SetDonauRequest; 256 response: EmptyObject; 257 }; 258 // SetDonau = "setDonau" 259 260 ``` 261 ```typescript 262 export interface SetDonauRequest { 263 donauBaseUrl: string; 264 taxPayerId: string; 265 } 266 267 ``` 268 269 ### GetDonauOp 270 ```typescript 271 /** 272 * Get the currently configured donation authority for this 273 * wallet. 274 */ 275 export type GetDonauOp = { 276 op: WalletApiOperation.GetDonau; 277 request: EmptyObject; 278 response: GetDonauResponse; 279 }; 280 // GetDonau = "getDonau" 281 282 ``` 283 ```typescript 284 export interface GetDonauResponse { 285 currentDonauInfo: 286 | { 287 donauBaseUrl: string; 288 taxPayerId: string; 289 } 290 | undefined; 291 } 292 293 ``` 294 295 ### GetDonauStatementsOp 296 ```typescript 297 /** 298 * Get a list of donation statements 299 * for this wallet. 300 * Both donation statements for the currently configured 301 * donation authority as well as past configurations (if they exist) 302 * are returned. 303 */ 304 export type GetDonauStatementsOp = { 305 op: WalletApiOperation.GetDonauStatements; 306 request: GetDonauStatementsRequest; 307 response: GetDonauStatementsResponse; 308 }; 309 // GetDonauStatements = "getDonauStatements" 310 311 ``` 312 ```typescript 313 export interface GetDonauStatementsRequest { 314 donauBaseUrl?: string; 315 } 316 317 ``` 318 ```typescript 319 export interface GetDonauStatementsResponse { 320 statements: DonauStatementItem[]; 321 } 322 323 ``` 324 ```typescript 325 export interface DonauStatementItem { 326 total: AmountString; 327 year: number; 328 legalDomain: string; 329 uri: string; 330 donationStatementSig: EddsaSignatureString; 331 donauPub: EddsaPublicKeyString; 332 } 333 334 ``` 335 336 ### AddContactOp 337 ```typescript 338 /** 339 * add contact. 340 */ 341 export type AddContactOp = { 342 op: WalletApiOperation.AddContact; 343 request: AddContactRequest; 344 response: EmptyObject; 345 }; 346 // AddContact = "addContact" 347 348 ``` 349 ```typescript 350 export interface AddContactRequest { 351 contact: ContactEntry; 352 } 353 354 ``` 355 356 ### DeleteContactOp 357 ```typescript 358 /** 359 * delete contact. 360 */ 361 export type DeleteContactOp = { 362 op: WalletApiOperation.DeleteContact; 363 request: DeleteContactRequest; 364 response: EmptyObject; 365 }; 366 // DeleteContact = "deleteContact" 367 368 ``` 369 ```typescript 370 export interface DeleteContactRequest { 371 contact: ContactEntry; 372 } 373 374 ``` 375 376 ### GetContactsOp 377 ```typescript 378 /** 379 * Get contacts. 380 */ 381 export type GetContactsOp = { 382 op: WalletApiOperation.GetContacts; 383 request: EmptyObject; 384 response: ContactListResponse; 385 }; 386 // GetContacts = "getContacts" 387 388 ``` 389 ```typescript 390 export interface ContactListResponse { 391 contacts: ContactEntry[]; 392 } 393 394 ``` 395 396 ### RefreshMailboxOp 397 ```typescript 398 /** 399 * Refresh mailbox Op. 400 */ 401 export type RefreshMailboxOp = { 402 op: WalletApiOperation.RefreshMailbox; 403 request: MailboxConfiguration; 404 response: MailboxMessageRecord[]; 405 }; 406 // RefreshMailbox = "refreshMailbox" 407 408 ``` 409 410 ### InitializeMailboxOp 411 ```typescript 412 /** 413 * Initialize messages mailbox Op. 414 */ 415 export type InitializeMailboxOp = { 416 op: WalletApiOperation.InitializeMailbox; 417 request: string; 418 response: MailboxConfiguration; 419 }; 420 // InitializeMailbox = "initializeMailbox" 421 422 ``` 423 424 ### GetMailboxOp 425 ```typescript 426 /** 427 * Get messages mailbox Op. 428 */ 429 export type GetMailboxOp = { 430 op: WalletApiOperation.GetMailbox; 431 request: string; 432 response: MailboxConfiguration | undefined; 433 }; 434 // GetMailbox = "getMailbox" 435 436 ``` 437 438 ### GetMailboxMessagesOp 439 ```typescript 440 /** 441 * Get Messages Op. 442 */ 443 export type GetMailboxMessagesOp = { 444 op: WalletApiOperation.GetMailboxMessages; 445 request: EmptyObject; 446 response: MailboxMessagesResponse; 447 }; 448 // GetMailboxMessages = "getMailboxMessage" 449 450 ``` 451 ```typescript 452 export interface MailboxMessagesResponse { 453 messages: MailboxMessageRecord[]; 454 } 455 456 ``` 457 458 ### DeleteMailboxMessageOp 459 ```typescript 460 /** 461 * delete message. 462 */ 463 export type DeleteMailboxMessageOp = { 464 op: WalletApiOperation.DeleteMailboxMessage; 465 request: DeleteMailboxMessageRequest; 466 response: EmptyObject; 467 }; 468 // DeleteMailboxMessage = "deleteMailboxMessage" 469 470 ``` 471 ```typescript 472 export interface DeleteMailboxMessageRequest { 473 message: MailboxMessageRecord; 474 } 475 476 ``` 477 478 ### AddMailboxMessageOp 479 ```typescript 480 /** 481 * add message. 482 */ 483 export type AddMailboxMessageOp = { 484 op: WalletApiOperation.AddMailboxMessage; 485 request: AddMailboxMessageRequest; 486 response: EmptyObject; 487 }; 488 // AddMailboxMessage = "addMailboxMessage" 489 490 ``` 491 ```typescript 492 export interface AddMailboxMessageRequest { 493 message: MailboxMessageRecord; 494 } 495 496 ``` 497 498 ### SendTalerUriMailboxMessageOp 499 ```typescript 500 /** 501 * send message. 502 */ 503 export type SendTalerUriMailboxMessageOp = { 504 op: WalletApiOperation.SendTalerUriMailboxMessage; 505 request: SendTalerUriMailboxMessageRequest; 506 response: EmptyObject; 507 }; 508 // SendTalerUriMailboxMessage = "sendTalerUriMailboxMessage" 509 510 ``` 511 ```typescript 512 export interface SendTalerUriMailboxMessageRequest { 513 contact: ContactEntry; 514 talerUri: string; 515 } 516 517 ``` 518 519 ### GetBalancesOp 520 ```typescript 521 /** 522 * Get current wallet balance. 523 */ 524 export type GetBalancesOp = { 525 op: WalletApiOperation.GetBalances; 526 request: EmptyObject; 527 response: BalancesResponse; 528 }; 529 // GetBalances = "getBalances" 530 531 ``` 532 ```typescript 533 /** 534 * Response to a getBalances request. 535 */ 536 export interface BalancesResponse { 537 /** Electronic cash balances, per currency scope. */ 538 balances: WalletBalance[]; 539 /** Does the user have non-demo money? */ 540 haveProdBalance: boolean; 541 donauSummary?: DonauSummaryItem[]; 542 } 543 544 ``` 545 ```typescript 546 export interface WalletBalance { 547 scopeInfo: ScopeInfo; 548 available: AmountString; 549 pendingIncoming: AmountString; 550 pendingOutgoing: AmountString; 551 flags: BalanceFlag[]; 552 /** 553 * Available URLs for pages that list 554 * where money in this scope can be spent. 555 */ 556 shoppingUrls?: string[]; 557 /** 558 * Are p2p payments disabled for this scope? 559 */ 560 disablePeerPayments?: boolean; 561 /** 562 * Are wallet deposits enabled for this scope? 563 */ 564 disableDirectDeposits?: boolean; 565 } 566 567 ``` 568 ```typescript 569 export declare enum BalanceFlag { 570 IncomingKyc = "incoming-kyc", 571 IncomingAml = "incoming-aml", 572 IncomingConfirmation = "incoming-confirmation", 573 OutgoingKyc = "outgoing-kyc", 574 } 575 576 ``` 577 ```typescript 578 export interface DonauSummaryItem { 579 /** Base URL of the donau service. */ 580 donauBaseUrl: string; 581 /** Legal domain of the donau service (if available). */ 582 legalDomain?: string; 583 /** Year of the donation(s). */ 584 year: number; 585 /** 586 * Sum of donation receipts we received from merchants in the 587 * applicable year. 588 */ 589 amountReceiptsAvailable: AmountString; 590 /** 591 * Sum of donation receipts that were already submitted 592 * to the donau in the applicable year. 593 */ 594 amountReceiptsSubmitted: AmountString; 595 /** 596 * Amount of the latest available statement. Missing if no statement 597 * was requested yet. 598 */ 599 amountStatement?: AmountString; 600 } 601 602 ``` 603 604 ### GetBalancesDetailOp 605 ```typescript 606 export type GetBalancesDetailOp = { 607 op: WalletApiOperation.GetBalanceDetail; 608 request: GetBalanceDetailRequest; 609 response: PaymentBalanceDetails; 610 }; 611 // GetBalanceDetail = "getBalanceDetail" 612 613 ``` 614 ```typescript 615 export interface GetBalanceDetailRequest { 616 currency: string; 617 } 618 619 ``` 620 ```typescript 621 export interface PaymentBalanceDetails { 622 /** 623 * Balance of type "available" (see balance.ts for definition). 624 */ 625 balanceAvailable: AmountJson; 626 /** 627 * Balance of type "material" (see balance.ts for definition). 628 */ 629 balanceMaterial: AmountJson; 630 /** 631 * Balance of type "age-acceptable" (see balance.ts for definition). 632 */ 633 balanceAgeAcceptable: AmountJson; 634 /** 635 * Balance of type "receiver-acceptable" (see balance.ts for definition). 636 * 637 * @deprecated (2025-12-05) use balanceReceiver[...]Acceptable instead. 638 */ 639 balanceReceiverAcceptable: AmountJson; 640 /** 641 * Balance of type "receiver-exchange-url-acceptable" (see balance.ts for definition). 642 */ 643 balanceReceiverExchangeUrlAcceptable: AmountJson; 644 /** 645 * Balance of type "receiver-exchange-pub-acceptable" (see balance.ts for definition). 646 */ 647 balanceReceiverExchangePubAcceptable: AmountJson; 648 /** 649 * Balance of type "receiver-auditor-url-acceptable" (see balance.ts for definition). 650 */ 651 balanceReceiverAuditorUrlAcceptable: AmountJson; 652 /** 653 * Balance of type "receiver-depositable" (see balance.ts for definition). 654 */ 655 balanceReceiverDepositable: AmountJson; 656 /** 657 * Balance that's depositable with the exchange. 658 * This balance is reduced by the exchange's debit restrictions 659 * and wire fee configuration. 660 */ 661 balanceExchangeDepositable: AmountJson; 662 /** 663 * Estimated maximum amount that the wallet could pay for, under the assumption 664 * that the merchant pays absolutely no fees. 665 */ 666 maxMerchantEffectiveDepositAmount: AmountJson; 667 } 668 669 ``` 670 ```typescript 671 /** 672 * Non-negative financial amount. Fractional values are expressed as multiples 673 * of 1e-8. 674 */ 675 export interface AmountJson { 676 /** 677 * Value, must be an integer. 678 */ 679 readonly value: number; 680 /** 681 * Fraction, must be an integer. Represent 1/1e8 of a unit. 682 */ 683 readonly fraction: number; 684 /** 685 * Currency of the amount. 686 */ 687 readonly currency: string; 688 } 689 690 ``` 691 692 ### ConvertDepositAmountOp 693 ```typescript 694 export type ConvertDepositAmountOp = { 695 op: WalletApiOperation.ConvertDepositAmount; 696 request: ConvertAmountRequest; 697 response: AmountResponse; 698 }; 699 // ConvertDepositAmount = "convertDepositAmount" 700 701 ``` 702 ```typescript 703 export interface ConvertAmountRequest { 704 amount: AmountString; 705 type: TransactionAmountMode; 706 depositPaytoUri: PaytoString; 707 } 708 709 ``` 710 ```typescript 711 /** 712 * How the amount should be interpreted in a transaction 713 * Effective = how the balance is change 714 * Raw = effective amount without fee 715 * 716 * Depending on the transaction, raw can be higher than effective 717 */ 718 export declare enum TransactionAmountMode { 719 Effective = "effective", 720 Raw = "raw", 721 } 722 723 ``` 724 ```typescript 725 export interface AmountResponse { 726 effectiveAmount: AmountString; 727 rawAmount: AmountString; 728 } 729 730 ``` 731 732 ### GetMaxDepositAmountOp 733 ```typescript 734 export type GetMaxDepositAmountOp = { 735 op: WalletApiOperation.GetMaxDepositAmount; 736 request: GetMaxDepositAmountRequest; 737 response: GetMaxDepositAmountResponse; 738 }; 739 // GetMaxDepositAmount = "getMaxDepositAmount" 740 741 ``` 742 ```typescript 743 export interface GetMaxDepositAmountRequest { 744 /** 745 * Currency to deposit. 746 */ 747 currency: string; 748 /** 749 * Target bank account to deposit into. 750 */ 751 depositPaytoUri?: string; 752 /** 753 * Restrict the deposit to a certain scope. 754 */ 755 restrictScope?: ScopeInfo; 756 } 757 758 ``` 759 ```typescript 760 export interface GetMaxDepositAmountResponse { 761 effectiveAmount: AmountString; 762 rawAmount: AmountString; 763 /** 764 * Account restrictions that affect the max deposit amount. 765 */ 766 depositRestrictions?: { 767 [exchangeBaseUrl: string]: { 768 [paytoUri: string]: AccountRestriction[]; 769 }; 770 }; 771 } 772 773 ``` 774 775 ### GetMaxPeerPushDebitAmountOp 776 ```typescript 777 export type GetMaxPeerPushDebitAmountOp = { 778 op: WalletApiOperation.GetMaxPeerPushDebitAmount; 779 request: GetMaxPeerPushDebitAmountRequest; 780 response: GetMaxPeerPushDebitAmountResponse; 781 }; 782 // GetMaxPeerPushDebitAmount = "getMaxPeerPushDebitAmount" 783 784 ``` 785 ```typescript 786 export interface GetMaxPeerPushDebitAmountRequest { 787 currency: string; 788 /** 789 * Preferred exchange to use for the p2p payment. 790 */ 791 exchangeBaseUrl?: string; 792 restrictScope?: ScopeInfo; 793 } 794 795 ``` 796 ```typescript 797 export interface GetMaxPeerPushDebitAmountResponse { 798 effectiveAmount: AmountString; 799 rawAmount: AmountString; 800 exchangeBaseUrl?: string; 801 } 802 803 ``` 804 805 ### GetTransactionsOp 806 ```typescript 807 /** 808 * Get transactions. 809 */ 810 export type GetTransactionsOp = { 811 op: WalletApiOperation.GetTransactions; 812 request: TransactionsRequest; 813 response: TransactionsResponse; 814 }; 815 // GetTransactions = "getTransactions" 816 817 ``` 818 ```typescript 819 export interface TransactionsRequest { 820 /** 821 * return only transactions in the given currency 822 * 823 * it will be removed in next release 824 * 825 * @deprecated use scopeInfo 826 */ 827 currency?: string; 828 /** 829 * return only transactions in the given scopeInfo 830 */ 831 scopeInfo?: ScopeInfo; 832 /** 833 * if present, results will be limited to transactions related to the given search string 834 */ 835 search?: string; 836 /** 837 * Sort order of the transaction items. 838 * By default, items are sorted ascending by their 839 * main timestamp. 840 * 841 * ascending: ascending by timestamp, but pending transactions first 842 * descending: ascending by timestamp, but pending transactions first 843 * stable-ascending: ascending by timestamp, with pending transactions amidst other transactions 844 * (stable in the sense of: pending transactions don't jump around) 845 */ 846 sort?: "ascending" | "descending" | "stable-ascending"; 847 /** 848 * If true, include all refreshes in the transactions list. 849 */ 850 includeRefreshes?: boolean; 851 filterByState?: TransactionStateFilter; 852 } 853 854 ``` 855 856 ### GetTransactionsV2Op 857 ```typescript 858 export type GetTransactionsV2Op = { 859 op: WalletApiOperation.GetTransactionsV2; 860 request: GetTransactionsV2Request; 861 response: TransactionsResponse; 862 }; 863 // GetTransactionsV2 = "getTransactionsV2" 864 865 ``` 866 ```typescript 867 export interface GetTransactionsV2Request { 868 /** 869 * Return only transactions in the given currency. 870 */ 871 currency?: string; 872 /** 873 * Return only transactions in the given scopeInfo 874 */ 875 scopeInfo?: ScopeInfo; 876 /** 877 * If true, include all refreshes in the transactions list. 878 */ 879 includeRefreshes?: boolean; 880 /** 881 * If true, include transactions that would usually be filtered out. 882 * Implies includeRefreshes. 883 */ 884 includeAll?: boolean; 885 /** 886 * Only return transactions before/after this offset. 887 */ 888 offsetTransactionId?: TransactionIdStr; 889 /** 890 * Only return transactions before/after the transaction with this 891 * timestamp. 892 * 893 * Used as a fallback if the offsetTransactionId was deleted. 894 */ 895 offsetTimestamp?: TalerPreciseTimestamp; 896 /** 897 * Number of transactions to return. 898 * 899 * When the limit is positive, results are returned 900 * in ascending order of their timestamp. If no offset is specified, 901 * the result list begins with the first transaction. 902 * If an offset is specified, transactions after the offset are returned. 903 * 904 * When the limit is negative, results are returned 905 * in descending order of their timestamp. If no offset is specified, 906 * the result list begins with with the last transaction. 907 * If an offset is specified, transactions before the offset are returned. 908 */ 909 limit?: number; 910 /** 911 * Filter transactions by their state / state category. 912 * 913 * If not specified, all transactions are returned. 914 * 915 * final: Transactions in any final state 916 * nonfinal: Transactions in any state but the final states 917 * nonfinal-dialog: nonfinal transactions that require confirmation / some 918 * choice by the user 919 * nonfinal-approved: nonfinal transactions that need no further user approval 920 * done: Transactions in the "done" major state 921 */ 922 filterByState?: 923 | "final" 924 | "nonfinal" 925 | "done" 926 | "nonfinal-approved" 927 | "nonfinal-dialog"; 928 } 929 930 ``` 931 932 ### ListAssociatedRefreshesOp 933 ```typescript 934 /** 935 * List refresh transactions associated with another transaction. 936 */ 937 export type ListAssociatedRefreshesOp = { 938 op: WalletApiOperation.ListAssociatedRefreshes; 939 request: ListAssociatedRefreshesRequest; 940 response: ListAssociatedRefreshesResponse; 941 }; 942 // ListAssociatedRefreshes = "listAssociatedRefreshes" 943 944 ``` 945 ```typescript 946 export interface ListAssociatedRefreshesRequest { 947 transactionId: string; 948 } 949 950 ``` 951 ```typescript 952 export interface ListAssociatedRefreshesResponse { 953 transactionIds: string[]; 954 } 955 956 ``` 957 958 ### TestingGetSampleTransactionsOp 959 ```typescript 960 /** 961 * Get sample transactions. 962 */ 963 export type TestingGetSampleTransactionsOp = { 964 op: WalletApiOperation.TestingGetSampleTransactions; 965 request: EmptyObject; 966 response: TransactionsResponse; 967 }; 968 // TestingGetSampleTransactions = "testingGetSampleTransactions" 969 970 ``` 971 972 ### GetTransactionByIdOp 973 ```typescript 974 export type GetTransactionByIdOp = { 975 op: WalletApiOperation.GetTransactionById; 976 request: TransactionByIdRequest; 977 response: Transaction; 978 }; 979 // GetTransactionById = "getTransactionById" 980 981 ``` 982 ```typescript 983 export interface TransactionByIdRequest { 984 transactionId: string; 985 /** 986 * If set to true, report the full contract terms in the response 987 * if the transaction has them. 988 */ 989 includeContractTerms?: boolean; 990 } 991 992 ``` 993 994 ### RetryPendingNowOp 995 ```typescript 996 export type RetryPendingNowOp = { 997 op: WalletApiOperation.RetryPendingNow; 998 request: EmptyObject; 999 response: EmptyObject; 1000 }; 1001 // RetryPendingNow = "retryPendingNow" 1002 1003 ``` 1004 1005 ### DeleteTransactionOp 1006 ```typescript 1007 /** 1008 * Delete a transaction locally in the wallet. 1009 */ 1010 export type DeleteTransactionOp = { 1011 op: WalletApiOperation.DeleteTransaction; 1012 request: DeleteTransactionRequest; 1013 response: EmptyObject; 1014 }; 1015 // DeleteTransaction = "deleteTransaction" 1016 1017 ``` 1018 ```typescript 1019 export interface DeleteTransactionRequest { 1020 transactionId: TransactionIdStr; 1021 } 1022 1023 ``` 1024 1025 ### RetryTransactionOp 1026 ```typescript 1027 /** 1028 * Immediately retry a transaction. 1029 */ 1030 export type RetryTransactionOp = { 1031 op: WalletApiOperation.RetryTransaction; 1032 request: RetryTransactionRequest; 1033 response: EmptyObject; 1034 }; 1035 // RetryTransaction = "retryTransaction" 1036 1037 ``` 1038 ```typescript 1039 export interface RetryTransactionRequest { 1040 transactionId: TransactionIdStr; 1041 } 1042 1043 ``` 1044 1045 ### AbortTransactionOp 1046 ```typescript 1047 /** 1048 * Abort a transaction 1049 * 1050 * For payment transactions, it puts the payment into an "aborting" state. 1051 */ 1052 export type AbortTransactionOp = { 1053 op: WalletApiOperation.AbortTransaction; 1054 request: AbortTransactionRequest; 1055 response: EmptyObject; 1056 }; 1057 // AbortTransaction = "abortTransaction" 1058 1059 ``` 1060 1061 ### FailTransactionOp 1062 ```typescript 1063 /** 1064 * Cancel aborting a transaction 1065 * 1066 * For payment transactions, it puts the payment into an "aborting" state. 1067 */ 1068 export type FailTransactionOp = { 1069 op: WalletApiOperation.FailTransaction; 1070 request: FailTransactionRequest; 1071 response: EmptyObject; 1072 }; 1073 // FailTransaction = "failTransaction" 1074 1075 ``` 1076 ```typescript 1077 export interface FailTransactionRequest { 1078 transactionId: TransactionIdStr; 1079 } 1080 1081 ``` 1082 1083 ### SuspendTransactionOp 1084 ```typescript 1085 /** 1086 * Suspend a transaction 1087 */ 1088 export type SuspendTransactionOp = { 1089 op: WalletApiOperation.SuspendTransaction; 1090 request: AbortTransactionRequest; 1091 response: EmptyObject; 1092 }; 1093 // SuspendTransaction = "suspendTransaction" 1094 1095 ``` 1096 1097 ### ResumeTransactionOp 1098 ```typescript 1099 /** 1100 * Resume a transaction 1101 */ 1102 export type ResumeTransactionOp = { 1103 op: WalletApiOperation.ResumeTransaction; 1104 request: AbortTransactionRequest; 1105 response: EmptyObject; 1106 }; 1107 // ResumeTransaction = "resumeTransaction" 1108 1109 ``` 1110 1111 ### GetWithdrawalDetailsForAmountOp 1112 ```typescript 1113 /** 1114 * Get details for withdrawing a particular amount (manual withdrawal). 1115 */ 1116 export type GetWithdrawalDetailsForAmountOp = { 1117 op: WalletApiOperation.GetWithdrawalDetailsForAmount; 1118 request: GetWithdrawalDetailsForAmountRequest; 1119 response: WithdrawalDetailsForAmount; 1120 }; 1121 // GetWithdrawalDetailsForAmount = "getWithdrawalDetailsForAmount" 1122 1123 ``` 1124 ```typescript 1125 export interface GetWithdrawalDetailsForAmountRequest { 1126 exchangeBaseUrl?: string; 1127 /** 1128 * Specify currency scope for the withdrawal. 1129 * 1130 * May only be used when exchangeBaseUrl is not specified. 1131 */ 1132 restrictScope?: ScopeInfo; 1133 amount: AmountString; 1134 restrictAge?: number; 1135 /** 1136 * ID provided by the client to cancel the request. 1137 * 1138 * If the same request is made again with the same clientCancellationId, 1139 * all previous requests are cancelled. 1140 * 1141 * The cancelled request will receive an error response with 1142 * an error code that indicates the cancellation. 1143 * 1144 * The cancellation is best-effort, responses might still arrive. 1145 */ 1146 clientCancellationId?: string; 1147 } 1148 1149 ``` 1150 ```typescript 1151 export interface WithdrawalDetailsForAmount { 1152 /** 1153 * Exchange base URL for the withdrawal. 1154 */ 1155 exchangeBaseUrl: string; 1156 /** 1157 * Amount that the user will transfer to the exchange. 1158 */ 1159 amountRaw: AmountString; 1160 /** 1161 * Amount that will be added to the user's wallet balance. 1162 */ 1163 amountEffective: AmountString; 1164 /** 1165 * Number of coins that would be used for withdrawal. 1166 * 1167 * The UIs should warn if this number is too high (roughly at >100). 1168 */ 1169 numCoins: number; 1170 /** 1171 * Ways to pay the exchange, including accounts that require currency conversion. 1172 */ 1173 withdrawalAccountsList: WithdrawalExchangeAccountDetails[]; 1174 /** 1175 * If the exchange supports age-restricted coins it will return 1176 * the array of ages. 1177 */ 1178 ageRestrictionOptions?: number[]; 1179 /** 1180 * Scope info of the currency withdrawn. 1181 */ 1182 scopeInfo: ScopeInfo; 1183 /** 1184 * KYC soft limit. 1185 * 1186 * Withdrawals over that amount will require KYC. 1187 */ 1188 kycSoftLimit?: AmountString; 1189 /** 1190 * KYC soft limits. 1191 * 1192 * Withdrawals over that amount will be denied. 1193 */ 1194 kycHardLimit?: AmountString; 1195 /** 1196 * Ways to pay the exchange. 1197 * 1198 * @deprecated in favor of withdrawalAccountsList 1199 */ 1200 paytoUris: string[]; 1201 /** 1202 * Did the user accept the current version of the exchange's 1203 * terms of service? 1204 * 1205 * @deprecated the client should query the exchange entry instead 1206 */ 1207 tosAccepted: boolean; 1208 } 1209 1210 ``` 1211 1212 ### GetWithdrawalDetailsForUriOp 1213 ```typescript 1214 /** 1215 * Get details for withdrawing via a particular taler:// URI. 1216 * 1217 * @deprecated Use {@link PrepareBankIntegratedWithdrawalOp} instead 1218 */ 1219 export type GetWithdrawalDetailsForUriOp = { 1220 op: WalletApiOperation.GetWithdrawalDetailsForUri; 1221 request: GetWithdrawalDetailsForUriRequest; 1222 response: WithdrawUriInfoResponse; 1223 }; 1224 // GetWithdrawalDetailsForUri = "getWithdrawalDetailsForUri" 1225 1226 ``` 1227 ```typescript 1228 export interface GetWithdrawalDetailsForUriRequest { 1229 talerWithdrawUri: string; 1230 /** 1231 * @deprecated not used 1232 */ 1233 restrictAge?: number; 1234 } 1235 1236 ``` 1237 1238 ### PrepareBankIntegratedWithdrawalOp 1239 ```typescript 1240 /** 1241 * Prepare a bank-integrated withdrawal operation. 1242 */ 1243 export type PrepareBankIntegratedWithdrawalOp = { 1244 op: WalletApiOperation.PrepareBankIntegratedWithdrawal; 1245 request: PrepareBankIntegratedWithdrawalRequest; 1246 response: PrepareBankIntegratedWithdrawalResponse; 1247 }; 1248 // PrepareBankIntegratedWithdrawal = "prepareBankIntegratedWithdrawal" 1249 1250 ``` 1251 ```typescript 1252 export interface PrepareBankIntegratedWithdrawalRequest { 1253 talerWithdrawUri: string; 1254 } 1255 1256 ``` 1257 ```typescript 1258 export interface PrepareBankIntegratedWithdrawalResponse { 1259 transactionId: TransactionIdStr; 1260 info: WithdrawUriInfoResponse; 1261 } 1262 1263 ``` 1264 1265 ### ConfirmWithdrawalOp 1266 ```typescript 1267 /** 1268 * Confirm a withdrawal transaction. 1269 */ 1270 export type ConfirmWithdrawalOp = { 1271 op: WalletApiOperation.ConfirmWithdrawal; 1272 request: ConfirmWithdrawalRequest; 1273 response: AcceptWithdrawalResponse; 1274 }; 1275 // ConfirmWithdrawal = "confirmWithdrawal" 1276 1277 ``` 1278 ```typescript 1279 export interface ConfirmWithdrawalRequest { 1280 transactionId: string; 1281 exchangeBaseUrl: string; 1282 amount: AmountString | undefined; 1283 forcedDenomSel?: ForcedDenomSel; 1284 restrictAge?: number; 1285 } 1286 1287 ``` 1288 1289 ### AcceptBankIntegratedWithdrawalOp 1290 ```typescript 1291 /** 1292 * Accept a bank-integrated withdrawal. 1293 * 1294 * @deprecated in favor of prepare/confirm withdrawal. 1295 */ 1296 export type AcceptBankIntegratedWithdrawalOp = { 1297 op: WalletApiOperation.AcceptBankIntegratedWithdrawal; 1298 request: AcceptBankIntegratedWithdrawalRequest; 1299 response: AcceptWithdrawalResponse; 1300 }; 1301 // AcceptBankIntegratedWithdrawal = "acceptBankIntegratedWithdrawal" 1302 1303 ``` 1304 ```typescript 1305 export interface AcceptBankIntegratedWithdrawalRequest { 1306 talerWithdrawUri: string; 1307 exchangeBaseUrl: string; 1308 forcedDenomSel?: ForcedDenomSel; 1309 /** 1310 * Amount to withdraw. 1311 * If the bank's withdrawal operation uses a fixed amount, 1312 * this field must either be left undefined or its value must match 1313 * the amount from the withdrawal operation. 1314 */ 1315 amount?: AmountString; 1316 restrictAge?: number; 1317 } 1318 1319 ``` 1320 1321 ### AcceptManualWithdrawalOp 1322 ```typescript 1323 /** 1324 * Create a manual withdrawal. 1325 */ 1326 export type AcceptManualWithdrawalOp = { 1327 op: WalletApiOperation.AcceptManualWithdrawal; 1328 request: AcceptManualWithdrawalRequest; 1329 response: AcceptManualWithdrawalResult; 1330 }; 1331 // AcceptManualWithdrawal = "acceptManualWithdrawal" 1332 1333 ``` 1334 ```typescript 1335 export interface AcceptManualWithdrawalRequest { 1336 exchangeBaseUrl: string; 1337 amount: AmountString; 1338 restrictAge?: number; 1339 /** 1340 * Instead of generating a fresh, random reserve key pair, 1341 * use the provided reserve private key. 1342 * 1343 * Use with caution. Usage of this field may be restricted 1344 * to developer mode. 1345 */ 1346 forceReservePriv?: EddsaPrivateKeyString; 1347 } 1348 1349 ``` 1350 ```typescript 1351 export interface AcceptManualWithdrawalResult { 1352 /** 1353 * Transaction ID of the newly created withdrawal transaction. 1354 */ 1355 transactionId: TransactionIdStr; 1356 /** 1357 * Public key of the newly created reserve. 1358 */ 1359 reservePub: string; 1360 /** 1361 * Bank accounts of the exchange that can be used 1362 * to fund the withdrawal. 1363 */ 1364 withdrawalAccountsList: WithdrawalExchangeAccountDetails[]; 1365 } 1366 1367 ``` 1368 1369 ### PreparePayForUriOp 1370 ```typescript 1371 /** 1372 * Prepare to make a payment based on a taler://pay/ URI. 1373 */ 1374 export type PreparePayForUriOp = { 1375 op: WalletApiOperation.PreparePayForUri; 1376 request: PreparePayRequest; 1377 response: PreparePayResult; 1378 }; 1379 // PreparePayForUri = "preparePayForUri" 1380 1381 ``` 1382 1383 ### PreparePayForTemplateOp 1384 ```typescript 1385 /** 1386 * Prepare to make a payment based on a taler://pay-template/ URI. 1387 */ 1388 export type PreparePayForTemplateOp = { 1389 op: WalletApiOperation.PreparePayForTemplate; 1390 request: PreparePayTemplateRequest; 1391 response: PreparePayResult; 1392 }; 1393 // PreparePayForTemplate = "preparePayForTemplate" 1394 1395 ``` 1396 1397 ### PreparePayForUriV2Op 1398 ```typescript 1399 /** 1400 * Prepare to make a payment based on a taler://pay/ URI. 1401 */ 1402 export type PreparePayForUriV2Op = { 1403 op: WalletApiOperation.PreparePayForUriV2; 1404 request: PreparePayRequest; 1405 response: PreparePayV2Result; 1406 }; 1407 // PreparePayForUriV2 = "preparePayForUriV2" 1408 1409 ``` 1410 1411 ### PreparePayForTemplateV2Op 1412 ```typescript 1413 /** 1414 * Prepare to make a payment based on a taler://pay-template/ URI. 1415 */ 1416 export type PreparePayForTemplateV2Op = { 1417 op: WalletApiOperation.PreparePayForTemplateV2; 1418 request: PreparePayTemplateRequest; 1419 response: PreparePayV2Result; 1420 }; 1421 // PreparePayForTemplateV2 = "preparePayForTemplateV2" 1422 1423 ``` 1424 1425 ### GetChoicesForPaymentOp 1426 ```typescript 1427 /** 1428 * Get a list of contract v1 choices for a given payment tx 1429 * in dialog(confirm) state, as well as additional information 1430 * on whether they can be used to pay the order or not, depending 1431 * on the funds available on the wallet, or whether a specific 1432 * choice should be paid automatically without user confirmation, 1433 * based on user configuration or the type of payment requested. 1434 * 1435 * This request will fail if contract choices are not yet 1436 * available, in which case the `choicesAvailable' field of the tx 1437 * will be undefined or set to false. 1438 */ 1439 export type GetChoicesForPaymentOp = { 1440 op: WalletApiOperation.GetChoicesForPayment; 1441 request: GetChoicesForPaymentRequest; 1442 response: GetChoicesForPaymentResult; 1443 }; 1444 // GetChoicesForPayment = "getChoicesForPayment" 1445 1446 ``` 1447 ```typescript 1448 export interface GetChoicesForPaymentRequest { 1449 transactionId: string; 1450 forcedCoinSel?: ForcedCoinSel; 1451 } 1452 1453 ``` 1454 ```typescript 1455 export type GetChoicesForPaymentResult = { 1456 /** 1457 * Details for all choices in the contract. 1458 * 1459 * The index in this array corresponds to the choice 1460 * index in the original contract v1. For contract v0 1461 * orders, it will only contain a single choice with no 1462 * inputs/outputs. 1463 */ 1464 choices: ChoiceSelectionDetail[]; 1465 /** 1466 * Index of the choice in @e choices array to present 1467 * to the user as default. 1468 * 1469 * Won´t be set if no default selection is configured 1470 * or no choice is payable, otherwise, it will always 1471 * be 0 for v0 orders. 1472 */ 1473 defaultChoiceIndex?: number; 1474 /** 1475 * Whether the choice referenced by @e automaticExecutableIndex 1476 * should be confirmed automatically without 1477 * user interaction. 1478 * 1479 * If true, the wallet should call `confirmPay' 1480 * immediately afterwards, if false, the user 1481 * should be first prompted to select and 1482 * confirm a choice. Undefined when no choices 1483 * are payable. 1484 */ 1485 automaticExecution?: boolean; 1486 /** 1487 * Index of the choice that would be set to automatically 1488 * execute if the choice was payable. When @e automaticExecution 1489 * is set to true, the payment should be confirmed with this 1490 * choice index without user interaction. 1491 */ 1492 automaticExecutableIndex?: number; 1493 /** 1494 * Data extracted from the contract terms that 1495 * is relevant for payment processing in the wallet. 1496 */ 1497 contractTerms: MerchantContractTerms; 1498 }; 1499 1500 ``` 1501 ```typescript 1502 export type ChoiceSelectionDetail = 1503 | ChoiceSelectionDetailPaymentPossible 1504 | ChoiceSelectionDetailInsufficientBalance; 1505 1506 ``` 1507 ```typescript 1508 export interface ChoiceSelectionDetailPaymentPossible { 1509 status: ChoiceSelectionDetailType.PaymentPossible; 1510 amountRaw: AmountString; 1511 amountEffective: AmountString; 1512 scopeInfo: ScopeInfo | undefined; 1513 tokenDetails?: PaymentTokenAvailabilityDetails; 1514 } 1515 1516 ``` 1517 ```typescript 1518 export interface PaymentTokenAvailabilityDetails { 1519 /** 1520 * Number of tokens requested by the merchant. 1521 */ 1522 tokensRequested: number; 1523 /** 1524 * Number of tokens available to use. 1525 */ 1526 tokensAvailable: number; 1527 /** 1528 * Number of tokens for which the merchant is unexpected. 1529 * 1530 * Can be used to pay (i.e. with forced selection), 1531 * but a warning should be displayed to the user. 1532 */ 1533 tokensUnexpected: number; 1534 /** 1535 * Number of tokens for which the merchant is untrusted. 1536 * 1537 * Cannot be used to pay, so an error should be displayed. 1538 */ 1539 tokensUntrusted: number; 1540 perTokenFamily: { 1541 [slug: string]: { 1542 causeHint?: TokenAvailabilityHint; 1543 requested: number; 1544 available: number; 1545 unexpected: number; 1546 untrusted: number; 1547 }; 1548 }; 1549 } 1550 1551 ``` 1552 ```typescript 1553 export declare enum TokenAvailabilityHint { 1554 WalletTokensAvailableInsufficient = "wallet-tokens-available-insufficient", 1555 MerchantUnexpected = "merchant-unexpected", 1556 MerchantUntrusted = "merchant-untrusted", 1557 } 1558 1559 ``` 1560 ```typescript 1561 export interface ChoiceSelectionDetailInsufficientBalance { 1562 status: ChoiceSelectionDetailType.InsufficientBalance; 1563 amountRaw: AmountString; 1564 balanceDetails?: PaymentInsufficientBalanceDetails; 1565 tokenDetails?: PaymentTokenAvailabilityDetails; 1566 } 1567 1568 ``` 1569 1570 ### SharePaymentOp 1571 ```typescript 1572 export type SharePaymentOp = { 1573 op: WalletApiOperation.SharePayment; 1574 request: SharePaymentRequest; 1575 response: SharePaymentResult; 1576 }; 1577 // SharePayment = "sharePayment" 1578 1579 ``` 1580 ```typescript 1581 export interface SharePaymentRequest { 1582 merchantBaseUrl: string; 1583 orderId: string; 1584 } 1585 1586 ``` 1587 ```typescript 1588 export interface SharePaymentResult { 1589 privatePayUri: string; 1590 } 1591 1592 ``` 1593 1594 ### CheckPayForTemplateOp 1595 ```typescript 1596 export type CheckPayForTemplateOp = { 1597 op: WalletApiOperation.CheckPayForTemplate; 1598 request: CheckPayTemplateRequest; 1599 response: CheckPayTemplateReponse; 1600 }; 1601 // CheckPayForTemplate = "checkPayForTemplate" 1602 1603 ``` 1604 ```typescript 1605 export interface CheckPayTemplateRequest { 1606 talerPayTemplateUri: string; 1607 } 1608 1609 ``` 1610 ```typescript 1611 export type CheckPayTemplateReponse = { 1612 templateDetails: WalletTemplateDetailsResponse; 1613 supportedCurrencies: string[]; 1614 }; 1615 1616 ``` 1617 ```typescript 1618 export interface WalletTemplateDetailsResponse { 1619 template_contract: TemplateContractDetails; 1620 editable_defaults?: TemplateContractDetailsDefaults; 1621 required_currency?: string; 1622 } 1623 1624 ``` 1625 ```typescript 1626 export type TemplateContractDetails = 1627 | TemplateContractFixedOrder 1628 | TemplateContractInventoryCart 1629 | TemplateContractPaivana; 1630 1631 ``` 1632 ```typescript 1633 export interface TemplateContractFixedOrder extends TemplateContractCommon { 1634 template_type: TemplateType.FIXED_ORDER; 1635 amount?: AmountString; 1636 } 1637 1638 ``` 1639 ```typescript 1640 export interface TemplateContractCommon { 1641 template_type: TemplateType; 1642 summary?: string; 1643 currency?: string; 1644 pay_duration?: RelativeTime; 1645 max_pickup_duration?: RelativeTime; 1646 minimum_age?: Integer; 1647 request_tip?: boolean; 1648 } 1649 1650 ``` 1651 ```typescript 1652 export declare enum TemplateType { 1653 FIXED_ORDER = "fixed-order", 1654 INVENTORY_CART = "inventory-cart", 1655 PAIVANA = "paivana", 1656 } 1657 1658 ``` 1659 ```typescript 1660 export interface TemplateContractInventoryCart extends TemplateContractCommon { 1661 template_type: TemplateType.INVENTORY_CART; 1662 selected_all?: boolean; 1663 selected_categories?: Integer[]; 1664 selected_products?: string[]; 1665 choose_one?: boolean; 1666 inventory_payload?: InventoryPayload; 1667 } 1668 1669 ``` 1670 ```typescript 1671 export interface InventoryPayload { 1672 products: InventoryPayloadProduct[]; 1673 categories: InventoryPayloadCategory[]; 1674 units: InventoryPayloadUnit[]; 1675 } 1676 1677 ``` 1678 ```typescript 1679 export interface InventoryPayloadProduct { 1680 product_id: string; 1681 product_name: string; 1682 description: string; 1683 description_i18n?: { 1684 [lang_tag: string]: string; 1685 }; 1686 unit: string; 1687 unit_prices: AmountString[]; 1688 unit_allow_fraction: boolean; 1689 unit_precision_level: Integer; 1690 remaining_stock: DecimalQuantity; 1691 categories: Integer[]; 1692 taxes?: Tax[]; 1693 image_hash?: string; 1694 } 1695 1696 ``` 1697 ```typescript 1698 export interface InventoryPayloadCategory { 1699 category_id: Integer; 1700 category_name: string; 1701 category_name_i18n?: { 1702 [lang_tag: string]: string; 1703 }; 1704 } 1705 1706 ``` 1707 ```typescript 1708 export interface InventoryPayloadUnit { 1709 unit: string; 1710 unit_name_long: string; 1711 unit_name_long_i18n?: { 1712 [lang_tag: string]: string; 1713 }; 1714 unit_name_short: string; 1715 unit_name_short_i18n?: { 1716 [lang_tag: string]: string; 1717 }; 1718 unit_allow_fraction: boolean; 1719 unit_precision_level: Integer; 1720 } 1721 1722 ``` 1723 ```typescript 1724 export interface TemplateContractPaivana extends TemplateContractCommon { 1725 template_type: TemplateType.PAIVANA; 1726 website_regex?: string; 1727 choices: OrderChoice[]; 1728 } 1729 1730 ``` 1731 ```typescript 1732 export interface OrderChoice { 1733 amount: AmountString; 1734 description?: string; 1735 description_i18n?: InternationalizedString; 1736 inputs?: OrderInput[]; 1737 outputs?: OrderOutput[]; 1738 max_fee?: AmountString; 1739 } 1740 1741 ``` 1742 ```typescript 1743 export interface OrderInputToken { 1744 type: OrderInputType.Token; 1745 token_family_slug: string; 1746 count?: Integer; 1747 } 1748 1749 ``` 1750 ```typescript 1751 export type OrderOutput = OrderOutputToken | OrderOutputTaxReceipt; 1752 1753 ``` 1754 ```typescript 1755 export interface OrderOutputToken { 1756 type: OrderOutputType.Token; 1757 token_family_slug: string; 1758 count?: Integer; 1759 valid_at?: TalerPreciseTimestamp; 1760 } 1761 1762 ``` 1763 ```typescript 1764 export interface OrderOutputTaxReceipt { 1765 type: OrderOutputType.TaxReceipt; 1766 amount?: AmountString; 1767 donau_urls: string[]; 1768 } 1769 1770 ``` 1771 ```typescript 1772 /** 1773 * Key-value pairs matching a subset of the 1774 * fields from template_contract that are 1775 * user-editable defaults for this template. 1776 * Since protocol **v13**. 1777 */ 1778 export interface TemplateContractDetailsDefaults { 1779 summary?: string; 1780 currency?: string; 1781 /** 1782 * Amount *or* a plain currency string. 1783 */ 1784 amount?: string; 1785 } 1786 1787 ``` 1788 1789 ### ConfirmPayOp 1790 ```typescript 1791 /** 1792 * Confirm a payment that was previously prepared with 1793 * {@link PreparePayForUriOp} 1794 */ 1795 export type ConfirmPayOp = { 1796 op: WalletApiOperation.ConfirmPay; 1797 request: ConfirmPayRequest; 1798 response: ConfirmPayResult; 1799 }; 1800 // ConfirmPay = "confirmPay" 1801 1802 ``` 1803 ```typescript 1804 export interface ConfirmPayRequest { 1805 transactionId: TransactionIdStr; 1806 useDonau?: boolean; 1807 sessionId?: string; 1808 forcedCoinSel?: ForcedCoinSel; 1809 /** 1810 * Whether token selection should be forced 1811 * e.g. use tokens with non-matching `expected_domains' 1812 * 1813 * Only applies to v1 orders. 1814 */ 1815 forcedTokenSel?: boolean; 1816 /** 1817 * Only applies to v1 orders. 1818 */ 1819 choiceIndex?: number; 1820 } 1821 1822 ``` 1823 ```typescript 1824 export type ConfirmPayResult = ConfirmPayResultDone | ConfirmPayResultPending; 1825 1826 ``` 1827 ```typescript 1828 /** 1829 * Result for confirmPay 1830 */ 1831 export interface ConfirmPayResultDone { 1832 type: ConfirmPayResultType.Done; 1833 contractTerms: MerchantContractTermsV0; 1834 transactionId: TransactionIdStr; 1835 } 1836 1837 ``` 1838 ```typescript 1839 export interface ConfirmPayResultPending { 1840 type: ConfirmPayResultType.Pending; 1841 transactionId: TransactionIdStr; 1842 lastError: TalerErrorDetail | undefined; 1843 } 1844 1845 ``` 1846 1847 ### StartRefundQueryForUriOp 1848 ```typescript 1849 /** 1850 * Check for a refund based on a taler://refund URI. 1851 */ 1852 export type StartRefundQueryForUriOp = { 1853 op: WalletApiOperation.StartRefundQueryForUri; 1854 request: PrepareRefundRequest; 1855 response: StartRefundQueryForUriResponse; 1856 }; 1857 // StartRefundQueryForUri = "startRefundQueryForUri" 1858 1859 ``` 1860 ```typescript 1861 export interface PrepareRefundRequest { 1862 talerRefundUri: string; 1863 } 1864 1865 ``` 1866 ```typescript 1867 export interface StartRefundQueryForUriResponse { 1868 /** 1869 * Transaction id of the *payment* where the refund query was started. 1870 */ 1871 transactionId: TransactionIdStr; 1872 } 1873 1874 ``` 1875 1876 ### StartRefundQueryOp 1877 ```typescript 1878 export type StartRefundQueryOp = { 1879 op: WalletApiOperation.StartRefundQuery; 1880 request: StartRefundQueryRequest; 1881 response: EmptyObject; 1882 }; 1883 // StartRefundQuery = "startRefundQuery" 1884 1885 ``` 1886 ```typescript 1887 export interface StartRefundQueryRequest { 1888 transactionId: TransactionIdStr; 1889 } 1890 1891 ``` 1892 1893 ### ListDiscountsOp 1894 ```typescript 1895 /** 1896 * List discount tokens stored in the wallet. Listed tokens 1897 * will be grouped based on token family details. 1898 */ 1899 export type ListDiscountsOp = { 1900 op: WalletApiOperation.ListDiscounts; 1901 request: ListDiscountsRequest; 1902 response: ListDiscountsResponse; 1903 }; 1904 // ListDiscounts = "listDiscounts" 1905 1906 ``` 1907 ```typescript 1908 export interface ListDiscountsResponse { 1909 discounts: DiscountListDetail[]; 1910 } 1911 1912 ``` 1913 1914 ### DeleteDiscountOp 1915 ```typescript 1916 export type DeleteDiscountOp = { 1917 op: WalletApiOperation.DeleteDiscount; 1918 request: DeleteDiscountRequest; 1919 response: EmptyObject; 1920 }; 1921 // DeleteDiscount = "deleteDiscount" 1922 1923 ``` 1924 ```typescript 1925 export interface DeleteDiscountRequest { 1926 /** 1927 * Hash of token family info. 1928 */ 1929 tokenFamilyHash: string; 1930 } 1931 1932 ``` 1933 1934 ### ListSubscriptionsOp 1935 ```typescript 1936 /** 1937 * List subscription tokens stored in the wallet. Listed tokens 1938 * will be grouped based on token family details. 1939 */ 1940 export type ListSubscriptionsOp = { 1941 op: WalletApiOperation.ListSubscriptions; 1942 request: ListSubscriptionsRequest; 1943 response: ListSubscriptionsResponse; 1944 }; 1945 // ListSubscriptions = "listSubscriptions" 1946 1947 ``` 1948 ```typescript 1949 export interface ListSubscriptionsResponse { 1950 subscriptions: SubscriptionListDetail[]; 1951 } 1952 1953 ``` 1954 ```typescript 1955 export type SubscriptionListDetail = Omit< 1956 DiscountListDetail, 1957 "tokensAvailable" 1958 >; 1959 1960 ``` 1961 1962 ### DeleteSubscriptionOp 1963 ```typescript 1964 export type DeleteSubscriptionOp = { 1965 op: WalletApiOperation.DeleteSubscription; 1966 request: DeleteSubscriptionRequest; 1967 response: EmptyObject; 1968 }; 1969 // DeleteSubscription = "deleteSubscription" 1970 1971 ``` 1972 ```typescript 1973 export interface DeleteSubscriptionRequest { 1974 /** 1975 * Hash of token family info. 1976 */ 1977 tokenFamilyHash: string; 1978 } 1979 1980 ``` 1981 1982 ### ListGlobalCurrencyAuditorsOp 1983 ```typescript 1984 export type ListGlobalCurrencyAuditorsOp = { 1985 op: WalletApiOperation.ListGlobalCurrencyAuditors; 1986 request: EmptyObject; 1987 response: ListGlobalCurrencyAuditorsResponse; 1988 }; 1989 // ListGlobalCurrencyAuditors = "listGlobalCurrencyAuditors" 1990 1991 ``` 1992 ```typescript 1993 export interface ListGlobalCurrencyAuditorsResponse { 1994 auditors: { 1995 currency: string; 1996 auditorBaseUrl: string; 1997 auditorPub: string; 1998 }[]; 1999 } 2000 2001 ``` 2002 2003 ### ListGlobalCurrencyExchangesOp 2004 ```typescript 2005 export type ListGlobalCurrencyExchangesOp = { 2006 op: WalletApiOperation.ListGlobalCurrencyExchanges; 2007 request: EmptyObject; 2008 response: ListGlobalCurrencyExchangesResponse; 2009 }; 2010 // ListGlobalCurrencyExchanges = "listGlobalCurrencyExchanges" 2011 2012 ``` 2013 ```typescript 2014 export interface ListGlobalCurrencyExchangesResponse { 2015 exchanges: { 2016 currency: string; 2017 exchangeBaseUrl: string; 2018 exchangeMasterPub: string; 2019 }[]; 2020 } 2021 2022 ``` 2023 2024 ### AddGlobalCurrencyExchangeOp 2025 ```typescript 2026 export type AddGlobalCurrencyExchangeOp = { 2027 op: WalletApiOperation.AddGlobalCurrencyExchange; 2028 request: AddGlobalCurrencyExchangeRequest; 2029 response: EmptyObject; 2030 }; 2031 // AddGlobalCurrencyExchange = "addGlobalCurrencyExchange" 2032 2033 ``` 2034 ```typescript 2035 export interface AddGlobalCurrencyExchangeRequest { 2036 currency: string; 2037 exchangeBaseUrl: string; 2038 exchangeMasterPub: string; 2039 } 2040 2041 ``` 2042 2043 ### AddGlobalCurrencyAuditorOp 2044 ```typescript 2045 export type AddGlobalCurrencyAuditorOp = { 2046 op: WalletApiOperation.AddGlobalCurrencyAuditor; 2047 request: AddGlobalCurrencyAuditorRequest; 2048 response: EmptyObject; 2049 }; 2050 // AddGlobalCurrencyAuditor = "addGlobalCurrencyAuditor" 2051 2052 ``` 2053 ```typescript 2054 export interface AddGlobalCurrencyAuditorRequest { 2055 currency: string; 2056 auditorBaseUrl: string; 2057 auditorPub: string; 2058 } 2059 2060 ``` 2061 2062 ### RemoveGlobalCurrencyExchangeOp 2063 ```typescript 2064 export type RemoveGlobalCurrencyExchangeOp = { 2065 op: WalletApiOperation.RemoveGlobalCurrencyExchange; 2066 request: RemoveGlobalCurrencyExchangeRequest; 2067 response: EmptyObject; 2068 }; 2069 // RemoveGlobalCurrencyExchange = "removeGlobalCurrencyExchange" 2070 2071 ``` 2072 ```typescript 2073 export interface RemoveGlobalCurrencyExchangeRequest { 2074 currency: string; 2075 exchangeBaseUrl: string; 2076 exchangeMasterPub: string; 2077 } 2078 2079 ``` 2080 2081 ### RemoveGlobalCurrencyAuditorOp 2082 ```typescript 2083 export type RemoveGlobalCurrencyAuditorOp = { 2084 op: WalletApiOperation.RemoveGlobalCurrencyAuditor; 2085 request: RemoveGlobalCurrencyAuditorRequest; 2086 response: EmptyObject; 2087 }; 2088 // RemoveGlobalCurrencyAuditor = "removeGlobalCurrencyAuditor" 2089 2090 ``` 2091 ```typescript 2092 export interface RemoveGlobalCurrencyAuditorRequest { 2093 currency: string; 2094 auditorBaseUrl: string; 2095 auditorPub: string; 2096 } 2097 2098 ``` 2099 2100 ### CompleteExchangeBaseUrlOp 2101 ```typescript 2102 /** 2103 * Force a refresh on coins where it would not 2104 * be necessary. 2105 */ 2106 export type CompleteExchangeBaseUrlOp = { 2107 op: WalletApiOperation.CompleteExchangeBaseUrl; 2108 request: CompleteBaseUrlRequest; 2109 response: CompleteBaseUrlResult; 2110 }; 2111 // CompleteExchangeBaseUrl = "completeExchangeBaseUrl" 2112 2113 ``` 2114 ```typescript 2115 export interface CompleteBaseUrlRequest { 2116 url: string; 2117 } 2118 2119 ``` 2120 ```typescript 2121 export type CompleteBaseUrlResult = 2122 | { 2123 /** 2124 * ok: completion is a proper exchange 2125 */ 2126 status: "ok"; 2127 /** Completed exchange base URL, if completion was possible */ 2128 completion: string; 2129 } 2130 | { 2131 /** 2132 * bad-syntax: url is so badly malformed, it can't be completed 2133 * bad-network: syntax okay, but exchange can't be reached 2134 * bad-exchange: syntax and network okay, but not talking to an exchange 2135 */ 2136 status: "bad-syntax" | "bad-network" | "bad-exchange"; 2137 /** Error details in case status is not "ok" */ 2138 error: TalerErrorDetail; 2139 }; 2140 2141 ``` 2142 2143 ### ListExchangesOp 2144 ```typescript 2145 /** 2146 * List exchanges known to the wallet. 2147 */ 2148 export type ListExchangesOp = { 2149 op: WalletApiOperation.ListExchanges; 2150 request: ListExchangesRequest; 2151 response: ExchangesListResponse; 2152 }; 2153 // ListExchanges = "listExchanges" 2154 2155 ``` 2156 ```typescript 2157 export interface ListExchangesRequest { 2158 /** 2159 * Filter results to only include exchanges in the given scope. 2160 */ 2161 filterByScope?: ScopeInfo; 2162 /** 2163 * Filter results to only include exchanges 2164 * with the given status. 2165 */ 2166 filterByExchangeEntryStatus?: ExchangeEntryStatus; 2167 /** 2168 * Filter results to only include exchanges with the 2169 * given type. 2170 */ 2171 filterByType?: ExchangeType; 2172 } 2173 2174 ``` 2175 ```typescript 2176 export type ExchangeType = "demo" | "prod"; 2177 2178 ``` 2179 ```typescript 2180 export interface ExchangesListResponse { 2181 exchanges: ExchangeListItem[]; 2182 } 2183 2184 ``` 2185 2186 ### StartExchangeWalletKycOp 2187 ```typescript 2188 export type StartExchangeWalletKycOp = { 2189 op: WalletApiOperation.StartExchangeWalletKyc; 2190 request: StartExchangeWalletKycRequest; 2191 response: EmptyObject; 2192 }; 2193 // StartExchangeWalletKyc = "startExchangeWalletKyc" 2194 2195 ``` 2196 ```typescript 2197 export interface StartExchangeWalletKycRequest { 2198 exchangeBaseUrl: string; 2199 amount: AmountString; 2200 } 2201 2202 ``` 2203 2204 ### TestingWaitExchangeWalletKycOp 2205 ```typescript 2206 export type TestingWaitExchangeWalletKycOp = { 2207 op: WalletApiOperation.TestingWaitExchangeWalletKyc; 2208 request: TestingWaitWalletKycRequest; 2209 response: EmptyObject; 2210 }; 2211 // TestingWaitExchangeWalletKyc = "testingWaitWalletKyc" 2212 2213 ``` 2214 ```typescript 2215 export interface TestingWaitWalletKycRequest { 2216 exchangeBaseUrl: string; 2217 amount: AmountString; 2218 /** 2219 * Do we wait for the KYC to be passed (true), 2220 * or do we already return if legitimization is 2221 * required (false). 2222 */ 2223 passed: boolean; 2224 } 2225 2226 ``` 2227 2228 ### TestingPlanMigrateExchangeBaseUrlOp 2229 ```typescript 2230 /** 2231 * Enable migration from an old exchange base URL to a new 2232 * exchange base URL. 2233 * 2234 * The actual migration is only applied once the exchange 2235 * returns the new base URL. 2236 */ 2237 export type TestingPlanMigrateExchangeBaseUrlOp = { 2238 op: WalletApiOperation.TestingPlanMigrateExchangeBaseUrl; 2239 request: TestingPlanMigrateExchangeBaseUrlRequest; 2240 response: EmptyObject; 2241 }; 2242 // TestingPlanMigrateExchangeBaseUrl = "testingPlanMigrateExchangeBaseUrl" 2243 2244 ``` 2245 ```typescript 2246 export interface TestingPlanMigrateExchangeBaseUrlRequest { 2247 oldExchangeBaseUrl: string; 2248 newExchangeBaseUrl: string; 2249 } 2250 2251 ``` 2252 2253 ### PrepareWithdrawExchangeOp 2254 ```typescript 2255 /** 2256 * Prepare for withdrawing via a taler://withdraw-exchange URI. 2257 */ 2258 export type PrepareWithdrawExchangeOp = { 2259 op: WalletApiOperation.PrepareWithdrawExchange; 2260 request: PrepareWithdrawExchangeRequest; 2261 response: PrepareWithdrawExchangeResponse; 2262 }; 2263 // PrepareWithdrawExchange = "prepareWithdrawExchange" 2264 2265 ``` 2266 ```typescript 2267 export interface PrepareWithdrawExchangeRequest { 2268 /** 2269 * A taler://withdraw-exchange URI. 2270 */ 2271 talerUri: string; 2272 } 2273 2274 ``` 2275 ```typescript 2276 export interface PrepareWithdrawExchangeResponse { 2277 /** 2278 * Base URL of the exchange that already existed 2279 * or was ephemerally added as an exchange entry to 2280 * the wallet. 2281 */ 2282 exchangeBaseUrl: string; 2283 /** 2284 * Amount from the taler://withdraw-exchange URI. 2285 * Only present if specified in the URI. 2286 */ 2287 amount?: AmountString; 2288 } 2289 2290 ``` 2291 2292 ### AddExchangeOp 2293 ```typescript 2294 /** 2295 * Add / force-update an exchange. 2296 */ 2297 export type AddExchangeOp = { 2298 op: WalletApiOperation.AddExchange; 2299 request: AddExchangeRequest; 2300 response: AddExchangeResponse; 2301 }; 2302 // AddExchange = "addExchange" 2303 2304 ``` 2305 ```typescript 2306 export interface AddExchangeRequest { 2307 /** 2308 * Either an http(s) exchange base URL or 2309 * a taler://add-exchange/ URI. 2310 */ 2311 uri?: string; 2312 /** 2313 * Only ephemerally add the exchange. 2314 */ 2315 ephemeral?: boolean; 2316 /** 2317 * Allow passing incomplete URLs. The wallet will try to complete 2318 * the URL and throw an error if completion is not possible. 2319 */ 2320 allowCompletion?: boolean; 2321 /** 2322 * @deprecated use a separate API call to start a forced exchange update instead 2323 */ 2324 forceUpdate?: boolean; 2325 /** 2326 * @deprecated Use {@link uri} instead 2327 */ 2328 exchangeBaseUrl?: string; 2329 } 2330 2331 ``` 2332 ```typescript 2333 export interface AddExchangeResponse { 2334 /** 2335 * Base URL of the exchange that was added to the wallet. 2336 */ 2337 exchangeBaseUrl: string; 2338 } 2339 2340 ``` 2341 2342 ### UpdateExchangeEntryOp 2343 ```typescript 2344 /** 2345 * Update an exchange entry. 2346 * 2347 * Only starts updating the exchange entry. 2348 * After this request finishes, it is not guaranteed that 2349 * the exchange entry has been updated. 2350 * 2351 * Use notifications and the listExchanges request 2352 * to check the status. 2353 */ 2354 export type UpdateExchangeEntryOp = { 2355 op: WalletApiOperation.UpdateExchangeEntry; 2356 request: UpdateExchangeEntryRequest; 2357 response: EmptyObject; 2358 }; 2359 // UpdateExchangeEntry = "updateExchangeEntry" 2360 2361 ``` 2362 ```typescript 2363 export interface UpdateExchangeEntryRequest { 2364 exchangeBaseUrl: string; 2365 force?: boolean; 2366 } 2367 2368 ``` 2369 2370 ### ListBankAccountsOp 2371 ```typescript 2372 export type ListBankAccountsOp = { 2373 op: WalletApiOperation.ListBankAccounts; 2374 request: ListBankAccountsRequest; 2375 response: ListBankAccountsResponse; 2376 }; 2377 // ListBankAccounts = "listBankAccounts" 2378 2379 ``` 2380 ```typescript 2381 export interface ListBankAccountsRequest { 2382 currency?: string; 2383 } 2384 2385 ``` 2386 ```typescript 2387 export interface ListBankAccountsResponse { 2388 accounts: WalletBankAccountInfo[]; 2389 } 2390 2391 ``` 2392 2393 ### GetBankAccountByIdOp 2394 ```typescript 2395 export type GetBankAccountByIdOp = { 2396 op: WalletApiOperation.GetBankAccountById; 2397 request: GetBankAccountByIdRequest; 2398 response: GetBankAccountByIdResponse; 2399 }; 2400 // GetBankAccountById = "getBankAccountById" 2401 2402 ``` 2403 ```typescript 2404 export interface GetBankAccountByIdRequest { 2405 bankAccountId: string; 2406 } 2407 2408 ``` 2409 2410 ### AddBankAccountsOp 2411 ```typescript 2412 export type AddBankAccountsOp = { 2413 op: WalletApiOperation.AddBankAccount; 2414 request: AddBankAccountRequest; 2415 response: AddBankAccountResponse; 2416 }; 2417 // AddBankAccount = "addBankAccount" 2418 2419 ``` 2420 ```typescript 2421 export interface AddBankAccountRequest { 2422 /** 2423 * Payto URI of the bank account that should be added. 2424 */ 2425 paytoUri: string; 2426 /** 2427 * Human-readable label for the account. 2428 */ 2429 label: string; 2430 /** 2431 * Currencies supported by the bank (if known). 2432 */ 2433 currencies?: string[] | undefined; 2434 /** 2435 * Bank account that this new account should replace. 2436 */ 2437 replaceBankAccountId?: string; 2438 } 2439 2440 ``` 2441 ```typescript 2442 export interface AddBankAccountResponse { 2443 /** 2444 * Identifier of the added bank account. 2445 */ 2446 bankAccountId: string; 2447 } 2448 2449 ``` 2450 2451 ### ForgetBankAccountsOp 2452 ```typescript 2453 export type ForgetBankAccountsOp = { 2454 op: WalletApiOperation.ForgetBankAccount; 2455 request: ForgetBankAccountRequest; 2456 response: EmptyObject; 2457 }; 2458 // ForgetBankAccount = "forgetBankAccount" 2459 2460 ``` 2461 ```typescript 2462 export interface ForgetBankAccountRequest { 2463 bankAccountId: string; 2464 } 2465 2466 ``` 2467 2468 ### SetExchangeTosAcceptedOp 2469 ```typescript 2470 /** 2471 * Accept a particular version of the exchange terms of service. 2472 */ 2473 export type SetExchangeTosAcceptedOp = { 2474 op: WalletApiOperation.SetExchangeTosAccepted; 2475 request: AcceptExchangeTosRequest; 2476 response: EmptyObject; 2477 }; 2478 // SetExchangeTosAccepted = "setExchangeTosAccepted" 2479 2480 ``` 2481 2482 ### SetExchangeTosForgottenOp 2483 ```typescript 2484 /** 2485 * Accept a particular version of the exchange terms of service. 2486 */ 2487 export type SetExchangeTosForgottenOp = { 2488 op: WalletApiOperation.SetExchangeTosForgotten; 2489 request: AcceptExchangeTosRequest; 2490 response: EmptyObject; 2491 }; 2492 // SetExchangeTosForgotten = "setExchangeTosForgotten" 2493 2494 ``` 2495 2496 ### GetExchangeTosOp 2497 ```typescript 2498 /** 2499 * Get the current terms of a service of an exchange. 2500 */ 2501 export type GetExchangeTosOp = { 2502 op: WalletApiOperation.GetExchangeTos; 2503 request: GetExchangeTosRequest; 2504 response: GetExchangeTosResult; 2505 }; 2506 // GetExchangeTos = "getExchangeTos" 2507 2508 ``` 2509 ```typescript 2510 export interface GetExchangeTosRequest { 2511 exchangeBaseUrl: string; 2512 acceptedFormat?: string[]; 2513 acceptLanguage?: string; 2514 } 2515 2516 ``` 2517 ```typescript 2518 export interface GetExchangeTosResult { 2519 /** 2520 * Markdown version of the current ToS. 2521 */ 2522 content: string; 2523 /** 2524 * Version tag of the current ToS. 2525 */ 2526 currentEtag: string; 2527 /** 2528 * Version tag of the last ToS that the user has accepted, 2529 * if any. 2530 */ 2531 acceptedEtag: string | undefined; 2532 /** 2533 * Accepted content type 2534 */ 2535 contentType: string; 2536 /** 2537 * Language of the returned content. 2538 * 2539 * If missing, language is unknown. 2540 */ 2541 contentLanguage: string | undefined; 2542 /** 2543 * Available languages as advertised by the exchange. 2544 */ 2545 tosAvailableLanguages: string[]; 2546 tosStatus: ExchangeTosStatus; 2547 } 2548 2549 ``` 2550 2551 ### GetDepositWireTypesOp 2552 ```typescript 2553 export type GetDepositWireTypesOp = { 2554 op: WalletApiOperation.GetDepositWireTypes; 2555 request: GetDepositWireTypesRequest; 2556 response: GetDepositWireTypesResponse; 2557 }; 2558 // GetDepositWireTypes = "getDepositWireTypes" 2559 2560 ``` 2561 ```typescript 2562 export interface GetDepositWireTypesRequest { 2563 currency?: string; 2564 /** 2565 * Optional scope info to further restrict the result. 2566 * Currency must match the currency field. 2567 */ 2568 scopeInfo?: ScopeInfo; 2569 } 2570 2571 ``` 2572 ```typescript 2573 export interface GetDepositWireTypesResponse { 2574 /** 2575 * Details for each wire type. 2576 */ 2577 wireTypeDetails: WireTypeDetails[]; 2578 } 2579 2580 ``` 2581 2582 ### GetDepositWireTypesForCurrencyOp 2583 ```typescript 2584 /** 2585 * Get wire types that can be used for a deposit operation 2586 * with the provided currency. 2587 * 2588 * @deprecated Use getDepositWireTypes instead 2589 */ 2590 export type GetDepositWireTypesForCurrencyOp = { 2591 op: WalletApiOperation.GetDepositWireTypesForCurrency; 2592 request: GetDepositWireTypesForCurrencyRequest; 2593 response: GetDepositWireTypesForCurrencyResponse; 2594 }; 2595 // GetDepositWireTypesForCurrency = "getDepositWireTypesForCurrency" 2596 2597 ``` 2598 ```typescript 2599 export interface GetDepositWireTypesForCurrencyRequest { 2600 currency: string; 2601 /** 2602 * Optional scope info to further restrict the result. 2603 * Currency must match the currency field. 2604 */ 2605 scopeInfo?: ScopeInfo; 2606 } 2607 2608 ``` 2609 ```typescript 2610 /** 2611 * Response with wire types that are supported for a deposit. 2612 * 2613 * In the future, we might surface more information here, such as debit restrictions 2614 * by the exchange, which then can be shown by UIs to the user before they 2615 * enter their payment information. 2616 */ 2617 export interface GetDepositWireTypesForCurrencyResponse { 2618 /** 2619 * @deprecated, use wireTypeDetails instead. 2620 */ 2621 wireTypes: string[]; 2622 /** 2623 * Details for each wire type. 2624 */ 2625 wireTypeDetails: WireTypeDetails[]; 2626 } 2627 2628 ``` 2629 2630 ### GetExchangeDetailedInfoOp 2631 ```typescript 2632 /** 2633 * Get the current terms of a service of an exchange. 2634 */ 2635 export type GetExchangeDetailedInfoOp = { 2636 op: WalletApiOperation.GetExchangeDetailedInfo; 2637 request: GetExchangeDetailedInfoRequest; 2638 response: ExchangeDetailedResponse; 2639 }; 2640 // GetExchangeDetailedInfo = "getExchangeDetailedInfo" 2641 2642 ``` 2643 ```typescript 2644 export interface GetExchangeDetailedInfoRequest { 2645 exchangeBaseUrl: string; 2646 } 2647 2648 ``` 2649 ```typescript 2650 export interface ExchangeDetailedResponse { 2651 exchange: ExchangeFullDetails; 2652 } 2653 2654 ``` 2655 ```typescript 2656 export interface ExchangeFullDetails { 2657 exchangeBaseUrl: string; 2658 currency: string; 2659 paytoUris: string[]; 2660 auditors: ExchangeAuditor[]; 2661 wireInfo: WireInfo; 2662 denomFees: DenomOperationMap<FeeDescription[]>; 2663 transferFees: Record<string, FeeDescription[]>; 2664 globalFees: FeeDescription[]; 2665 } 2666 2667 ``` 2668 ```typescript 2669 /** 2670 * Auditor information as given by the exchange in /keys. 2671 */ 2672 export interface ExchangeAuditor { 2673 /** 2674 * Auditor's public key. 2675 */ 2676 auditor_pub: string; 2677 /** 2678 * Base URL of the auditor. 2679 */ 2680 auditor_url: string; 2681 /** 2682 * List of signatures for denominations by the auditor. 2683 */ 2684 denomination_keys: AuditorDenomSig[]; 2685 } 2686 2687 ``` 2688 ```typescript 2689 /** 2690 * Signature by the auditor that a particular denomination key is audited. 2691 */ 2692 export interface AuditorDenomSig { 2693 /** 2694 * Denomination public key's hash. 2695 */ 2696 denom_pub_h: string; 2697 /** 2698 * The signature. 2699 */ 2700 auditor_sig: string; 2701 } 2702 2703 ``` 2704 ```typescript 2705 export interface WireInfo { 2706 feesForType: WireFeeMap; 2707 accounts: ExchangeWireAccount[]; 2708 } 2709 2710 ``` 2711 ```typescript 2712 export type WireFeeMap = { 2713 [wireMethod: string]: WireFee[]; 2714 }; 2715 2716 ``` 2717 ```typescript 2718 /** 2719 * Wire fee for one wire method 2720 */ 2721 export interface WireFee { 2722 /** 2723 * Fee for wire transfers. 2724 */ 2725 wireFee: AmountString; 2726 /** 2727 * Fees to close and refund a reserve. 2728 */ 2729 closingFee: AmountString; 2730 /** 2731 * Start date of the fee. 2732 */ 2733 startStamp: TalerProtocolTimestamp; 2734 /** 2735 * End date of the fee. 2736 */ 2737 endStamp: TalerProtocolTimestamp; 2738 /** 2739 * Signature made by the exchange master key. 2740 */ 2741 sig: string; 2742 } 2743 2744 ``` 2745 ```typescript 2746 export interface ExchangeWireAccount { 2747 payto_uri: string; 2748 conversion_url?: string; 2749 open_banking_gateway?: string; 2750 prepared_transfer_url?: string; 2751 credit_restrictions: AccountRestriction[]; 2752 debit_restrictions: AccountRestriction[]; 2753 master_sig: EddsaSignatureString; 2754 bank_label?: string; 2755 priority?: number; 2756 } 2757 2758 ``` 2759 ```typescript 2760 export type DenomOperationMap<T> = { 2761 [op in DenomOperation]: T; 2762 }; 2763 2764 ``` 2765 ```typescript 2766 export type DenomOperation = "deposit" | "withdraw" | "refresh" | "refund"; 2767 2768 ``` 2769 ```typescript 2770 export interface FeeDescription { 2771 group: string; 2772 from: AbsoluteTime; 2773 until: AbsoluteTime; 2774 fee?: AmountString; 2775 } 2776 2777 ``` 2778 2779 ### GetDefaultExchangesOp 2780 ```typescript 2781 /** 2782 * Get the current terms of a service of an exchange. 2783 */ 2784 export type GetDefaultExchangesOp = { 2785 op: WalletApiOperation.GetDefaultExchanges; 2786 request: EmptyObject; 2787 response: GetDefaultExchangesResponse; 2788 }; 2789 // GetDefaultExchanges = "getDefaultExchanges" 2790 2791 ``` 2792 ```typescript 2793 export interface GetDefaultExchangesResponse { 2794 defaultExchanges: { 2795 /** 2796 * A taler://withdraw-exchange URI for the 2797 * exchange. 2798 */ 2799 talerUri: string; 2800 /** 2801 * Currency offered by the exchange. 2802 */ 2803 currency: string; 2804 /** 2805 * Currency spec for the currency offered 2806 * by the exchange. 2807 */ 2808 currencySpec: CurrencySpecification; 2809 }[]; 2810 } 2811 2812 ``` 2813 2814 ### GetExchangeEntryByUrlOp 2815 ```typescript 2816 /** 2817 * Get the current terms of a service of an exchange. 2818 */ 2819 export type GetExchangeEntryByUrlOp = { 2820 op: WalletApiOperation.GetExchangeEntryByUrl; 2821 request: GetExchangeEntryByUrlRequest; 2822 response: GetExchangeEntryByUrlResponse; 2823 }; 2824 // GetExchangeEntryByUrl = "getExchangeEntryByUrl" 2825 2826 ``` 2827 ```typescript 2828 export interface GetExchangeEntryByUrlRequest { 2829 exchangeBaseUrl: string; 2830 } 2831 2832 ``` 2833 2834 ### GetExchangeResourcesOp 2835 ```typescript 2836 /** 2837 * Get resources associated with an exchange. 2838 */ 2839 export type GetExchangeResourcesOp = { 2840 op: WalletApiOperation.GetExchangeResources; 2841 request: GetExchangeResourcesRequest; 2842 response: GetExchangeResourcesResponse; 2843 }; 2844 // GetExchangeResources = "getExchangeResources" 2845 2846 ``` 2847 ```typescript 2848 export interface GetExchangeResourcesRequest { 2849 exchangeBaseUrl: string; 2850 } 2851 2852 ``` 2853 ```typescript 2854 export interface GetExchangeResourcesResponse { 2855 hasResources: boolean; 2856 } 2857 2858 ``` 2859 2860 ### DeleteExchangeOp 2861 ```typescript 2862 /** 2863 * Get resources associated with an exchange. 2864 */ 2865 export type DeleteExchangeOp = { 2866 op: WalletApiOperation.GetExchangeResources; 2867 request: DeleteExchangeRequest; 2868 response: EmptyObject; 2869 }; 2870 // GetExchangeResources = "getExchangeResources" 2871 2872 ``` 2873 ```typescript 2874 export interface DeleteExchangeRequest { 2875 exchangeBaseUrl: string; 2876 /** 2877 * Delete the exchange even if it's in use. 2878 */ 2879 purge?: boolean; 2880 } 2881 2882 ``` 2883 2884 ### GetCurrencySpecificationOp 2885 ```typescript 2886 export type GetCurrencySpecificationOp = { 2887 op: WalletApiOperation.GetCurrencySpecification; 2888 request: GetCurrencySpecificationRequest; 2889 response: GetCurrencySpecificationResponse; 2890 }; 2891 // GetCurrencySpecification = "getCurrencySpecification" 2892 2893 ``` 2894 ```typescript 2895 export interface GetCurrencySpecificationRequest { 2896 scope: ScopeInfo; 2897 } 2898 2899 ``` 2900 ```typescript 2901 export interface GetCurrencySpecificationResponse { 2902 currencySpecification: CurrencySpecification; 2903 } 2904 2905 ``` 2906 2907 ### CreateDepositGroupOp 2908 ```typescript 2909 /** 2910 * Create a new deposit group. 2911 * 2912 * Deposit groups are used to deposit multiple coins to a bank 2913 * account, usually the wallet user's own bank account. 2914 */ 2915 export type CreateDepositGroupOp = { 2916 op: WalletApiOperation.CreateDepositGroup; 2917 request: CreateDepositGroupRequest; 2918 response: CreateDepositGroupResponse; 2919 }; 2920 // CreateDepositGroup = "createDepositGroup" 2921 2922 ``` 2923 ```typescript 2924 export interface CreateDepositGroupRequest { 2925 depositPaytoUri: string; 2926 /** 2927 * Amount to deposit (effective amount). 2928 */ 2929 amount: AmountString; 2930 /** 2931 * Restrict the deposit to a certain scope. 2932 */ 2933 restrictScope?: ScopeInfo; 2934 /** 2935 * Use a fixed merchant private key. 2936 */ 2937 testingFixedPriv?: string; 2938 /** 2939 * Optional wire deadline for the deposits. 2940 */ 2941 wireDeadline?: TalerProtocolTimestamp; 2942 /** 2943 * Pre-allocated transaction ID. 2944 * Allows clients to easily handle notifications 2945 * that occur while the operation has been created but 2946 * before the creation request has returned. 2947 */ 2948 transactionId?: TransactionIdStr; 2949 } 2950 2951 ``` 2952 ```typescript 2953 /** 2954 * Response to a createDepositGroup request. 2955 */ 2956 export interface CreateDepositGroupResponse { 2957 /** 2958 * Transaction ID of the newly created deposit transaction. 2959 */ 2960 transactionId: TransactionIdStr; 2961 /** 2962 * Current state of the new deposit transaction. 2963 * Returned as a performance optimization, so that the UI 2964 * doesn't have to do a separate getTransactionById. 2965 */ 2966 txState: TransactionState; 2967 /** 2968 * @deprecated 2025-06-03, use transactionId instead. 2969 */ 2970 depositGroupId: string; 2971 } 2972 2973 ``` 2974 2975 ### CheckDepositOp 2976 ```typescript 2977 export type CheckDepositOp = { 2978 op: WalletApiOperation.CheckDeposit; 2979 request: CheckDepositRequest; 2980 response: CheckDepositResponse; 2981 }; 2982 // CheckDeposit = "checkDeposit" 2983 2984 ``` 2985 ```typescript 2986 export interface CheckDepositRequest { 2987 /** 2988 * Payto URI to identify the (bank) account that the exchange will wire 2989 * the money to. 2990 */ 2991 depositPaytoUri: string; 2992 /** 2993 * Amount that should be deposited. 2994 * 2995 * Raw amount, fees will be added on top. 2996 */ 2997 amount: AmountString; 2998 /** 2999 * Restrict the deposit to a certain scope. 3000 */ 3001 restrictScope?: ScopeInfo; 3002 /** 3003 * ID provided by the client to cancel the request. 3004 * 3005 * If the same request is made again with the same clientCancellationId, 3006 * all previous requests are cancelled. 3007 * 3008 * The cancelled request will receive an error response with 3009 * an error code that indicates the cancellation. 3010 * 3011 * The cancellation is best-effort, responses might still arrive. 3012 */ 3013 clientCancellationId?: string; 3014 } 3015 3016 ``` 3017 ```typescript 3018 export interface CheckDepositResponse { 3019 totalDepositCost: AmountString; 3020 effectiveDepositAmount: AmountString; 3021 fees: DepositGroupFees; 3022 kycSoftLimit?: AmountString; 3023 kycHardLimit?: AmountString; 3024 /** 3025 * Base URL of exchanges that would likely require soft KYC. 3026 */ 3027 kycExchanges?: string[]; 3028 } 3029 3030 ``` 3031 ```typescript 3032 export interface DepositGroupFees { 3033 coin: AmountString; 3034 wire: AmountString; 3035 refresh: AmountString; 3036 } 3037 3038 ``` 3039 3040 ### ExportDbToFileOp 3041 ```typescript 3042 /** 3043 * Export the database to a file. 3044 * 3045 * The target directory must already exist. 3046 */ 3047 export type ExportDbToFileOp = { 3048 op: WalletApiOperation.ExportDbToFile; 3049 request: ExportDbToFileRequest; 3050 response: ExportDbToFileResponse; 3051 }; 3052 // ExportDbToFile = "exportDbToFile" 3053 3054 ``` 3055 ```typescript 3056 export interface ExportDbToFileRequest { 3057 /** 3058 * Directory that the DB should be exported into. 3059 */ 3060 directory: string; 3061 /** 3062 * Stem of the exported DB filename. 3063 * 3064 * The final name will be ${directory}/${stem}.${extension}, 3065 * where the extension depends on the used DB backend. 3066 */ 3067 stem: string; 3068 /** 3069 * Force the format of the export. 3070 * 3071 * Currently only "json" is supported as a forced 3072 * export format. 3073 */ 3074 forceFormat?: string; 3075 } 3076 3077 ``` 3078 ```typescript 3079 export interface ExportDbToFileResponse { 3080 /** 3081 * Full path to the backup. 3082 */ 3083 path: string; 3084 } 3085 3086 ``` 3087 3088 ### ImportDbFromFileOp 3089 ```typescript 3090 /** 3091 * Export the database from a file. 3092 * 3093 * CAUTION: Overrides existing data. 3094 */ 3095 export type ImportDbFromFileOp = { 3096 op: WalletApiOperation.ImportDbFromFile; 3097 request: ImportDbFromFileRequest; 3098 response: EmptyObject; 3099 }; 3100 // ImportDbFromFile = "importDbFromFile" 3101 3102 ``` 3103 ```typescript 3104 export interface ImportDbFromFileRequest { 3105 /** 3106 * Full path to the backup. 3107 */ 3108 path: string; 3109 } 3110 3111 ``` 3112 3113 ### ListStoredBackupsOp 3114 ```typescript 3115 export type ListStoredBackupsOp = { 3116 op: WalletApiOperation.ListStoredBackups; 3117 request: EmptyObject; 3118 response: StoredBackupList; 3119 }; 3120 // ListStoredBackups = "listStoredBackups" 3121 3122 ``` 3123 ```typescript 3124 export interface StoredBackupList { 3125 storedBackups: { 3126 name: string; 3127 }[]; 3128 } 3129 3130 ``` 3131 3132 ### CreateStoredBackupsOp 3133 ```typescript 3134 export type CreateStoredBackupsOp = { 3135 op: WalletApiOperation.CreateStoredBackup; 3136 request: EmptyObject; 3137 response: CreateStoredBackupResponse; 3138 }; 3139 // CreateStoredBackup = "createStoredBackup" 3140 3141 ``` 3142 ```typescript 3143 export interface CreateStoredBackupResponse { 3144 name: string; 3145 } 3146 3147 ``` 3148 3149 ### RecoverStoredBackupsOp 3150 ```typescript 3151 export type RecoverStoredBackupsOp = { 3152 op: WalletApiOperation.RecoverStoredBackup; 3153 request: RecoverStoredBackupRequest; 3154 response: EmptyObject; 3155 }; 3156 // RecoverStoredBackup = "recoverStoredBackup" 3157 3158 ``` 3159 ```typescript 3160 export interface RecoverStoredBackupRequest { 3161 name: string; 3162 } 3163 3164 ``` 3165 3166 ### DeleteStoredBackupOp 3167 ```typescript 3168 export type DeleteStoredBackupOp = { 3169 op: WalletApiOperation.DeleteStoredBackup; 3170 request: DeleteStoredBackupRequest; 3171 response: EmptyObject; 3172 }; 3173 // DeleteStoredBackup = "deleteStoredBackup" 3174 3175 ``` 3176 ```typescript 3177 export interface DeleteStoredBackupRequest { 3178 name: string; 3179 } 3180 3181 ``` 3182 3183 ### CheckPeerPushDebitOp 3184 ```typescript 3185 /** 3186 * Check if initiating a peer push payment is possible 3187 * based on the funds in the wallet. 3188 */ 3189 export type CheckPeerPushDebitOp = { 3190 op: WalletApiOperation.CheckPeerPushDebit; 3191 request: CheckPeerPushDebitRequest; 3192 response: CheckPeerPushDebitOkResponse; 3193 }; 3194 // CheckPeerPushDebit = "checkPeerPushDebit" 3195 3196 ``` 3197 3198 ### CheckPeerPushDebitV2Op 3199 ```typescript 3200 /** 3201 * Check if initiating a peer push payment is possible 3202 * based on the funds in the wallet. 3203 */ 3204 export type CheckPeerPushDebitV2Op = { 3205 op: WalletApiOperation.CheckPeerPushDebitV2; 3206 request: CheckPeerPushDebitRequest; 3207 response: CheckPeerPushDebitResponse; 3208 }; 3209 // CheckPeerPushDebitV2 = "checkPeerPushDebitV2" 3210 3211 ``` 3212 ```typescript 3213 export type CheckPeerPushDebitResponse = 3214 | CheckPeerPushDebitOkResponse 3215 | CheckPeerPushDebitInsufficientBalanceResponse; 3216 3217 ``` 3218 ```typescript 3219 export interface CheckPeerPushDebitInsufficientBalanceResponse { 3220 type: "insufficient-balance"; 3221 insufficientBalanceDetails: PaymentInsufficientBalanceDetails; 3222 } 3223 3224 ``` 3225 3226 ### InitiatePeerPushDebitOp 3227 ```typescript 3228 /** 3229 * Initiate an outgoing peer push payment. 3230 */ 3231 export type InitiatePeerPushDebitOp = { 3232 op: WalletApiOperation.InitiatePeerPushDebit; 3233 request: InitiatePeerPushDebitRequest; 3234 response: InitiatePeerPushDebitResponse; 3235 }; 3236 // InitiatePeerPushDebit = "initiatePeerPushDebit" 3237 3238 ``` 3239 ```typescript 3240 export interface InitiatePeerPushDebitRequest { 3241 exchangeBaseUrl?: string; 3242 /** 3243 * Restrict the scope of funds that can be spent via the given 3244 * scope info. 3245 */ 3246 restrictScope?: ScopeInfo; 3247 partialContractTerms: PartialPeerContractTerms; 3248 } 3249 3250 ``` 3251 ```typescript 3252 export interface PartialPeerContractTerms { 3253 amount: AmountString; 3254 summary: string; 3255 icon_id?: string; 3256 purse_expiration?: TalerProtocolTimestamp; 3257 } 3258 3259 ``` 3260 ```typescript 3261 export interface InitiatePeerPushDebitResponse { 3262 exchangeBaseUrl: string; 3263 pursePub: string; 3264 mergePriv: string; 3265 contractPriv: string; 3266 transactionId: TransactionIdStr; 3267 } 3268 3269 ``` 3270 3271 ### PreparePeerPushCreditOp 3272 ```typescript 3273 /** 3274 * Check an incoming peer push payment. 3275 */ 3276 export type PreparePeerPushCreditOp = { 3277 op: WalletApiOperation.PreparePeerPushCredit; 3278 request: PreparePeerPushCreditRequest; 3279 response: PreparePeerPushCreditResponse; 3280 }; 3281 // PreparePeerPushCredit = "preparePeerPushCredit" 3282 3283 ``` 3284 ```typescript 3285 /** 3286 * Result of initiating a peer-push-credit payment. 3287 * 3288 * Either {@link talerUri} or {@link transactionId} must be specified. 3289 */ 3290 export interface PreparePeerPushCreditRequest { 3291 talerUri?: string; 3292 transactionId?: string; 3293 } 3294 3295 ``` 3296 ```typescript 3297 export interface PreparePeerPushCreditResponse { 3298 contractTerms: PeerContractTerms; 3299 amountRaw: AmountString; 3300 amountEffective: AmountString; 3301 transactionId: TransactionIdStr; 3302 /** 3303 * State of the existing or newly created transaction. 3304 */ 3305 txState: TransactionState; 3306 exchangeBaseUrl: string; 3307 scopeInfo: ScopeInfo; 3308 /** 3309 * @deprecated 3310 */ 3311 amount: AmountString; 3312 } 3313 3314 ``` 3315 3316 ### ConfirmPeerPushCreditOp 3317 ```typescript 3318 /** 3319 * Accept an incoming peer push payment. 3320 */ 3321 export type ConfirmPeerPushCreditOp = { 3322 op: WalletApiOperation.ConfirmPeerPushCredit; 3323 request: ConfirmPeerPushCreditRequest; 3324 response: AcceptPeerPushPaymentResponse; 3325 }; 3326 // ConfirmPeerPushCredit = "confirmPeerPushCredit" 3327 3328 ``` 3329 ```typescript 3330 export interface ConfirmPeerPushCreditRequest { 3331 transactionId: string; 3332 } 3333 3334 ``` 3335 ```typescript 3336 export interface AcceptPeerPushPaymentResponse { 3337 transactionId: TransactionIdStr; 3338 } 3339 3340 ``` 3341 3342 ### CheckPeerPullCreditOp 3343 ```typescript 3344 /** 3345 * Check fees for an outgoing peer pull payment. 3346 */ 3347 export type CheckPeerPullCreditOp = { 3348 op: WalletApiOperation.CheckPeerPullCredit; 3349 request: CheckPeerPullCreditRequest; 3350 response: CheckPeerPullCreditResponse; 3351 }; 3352 // CheckPeerPullCredit = "checkPeerPullCredit" 3353 3354 ``` 3355 ```typescript 3356 export interface CheckPeerPullCreditRequest { 3357 /** 3358 * Require using this particular exchange for this operation. 3359 */ 3360 exchangeBaseUrl?: string; 3361 restrictScope?: ScopeInfo; 3362 amount: AmountString; 3363 /** 3364 * ID provided by the client to cancel the request. 3365 * 3366 * If the same request is made again with the same clientCancellationId, 3367 * all previous requests are cancelled. 3368 * 3369 * The cancelled request will receive an error response with 3370 * an error code that indicates the cancellation. 3371 * 3372 * The cancellation is best-effort, responses might still arrive. 3373 */ 3374 clientCancellationId?: string; 3375 } 3376 3377 ``` 3378 ```typescript 3379 export interface CheckPeerPullCreditResponse { 3380 exchangeBaseUrl: string; 3381 amountRaw: AmountString; 3382 amountEffective: AmountString; 3383 /** 3384 * Number of coins that will be used, 3385 * can be used by the UI to warn if excessively large. 3386 */ 3387 numCoins: number; 3388 } 3389 3390 ``` 3391 3392 ### InitiatePeerPullCreditOp 3393 ```typescript 3394 /** 3395 * Initiate an outgoing peer pull payment. 3396 */ 3397 export type InitiatePeerPullCreditOp = { 3398 op: WalletApiOperation.InitiatePeerPullCredit; 3399 request: InitiatePeerPullCreditRequest; 3400 response: InitiatePeerPullCreditResponse; 3401 }; 3402 // InitiatePeerPullCredit = "initiatePeerPullCredit" 3403 3404 ``` 3405 ```typescript 3406 export interface InitiatePeerPullCreditRequest { 3407 exchangeBaseUrl?: string; 3408 partialContractTerms: PeerContractTerms; 3409 } 3410 3411 ``` 3412 ```typescript 3413 export interface InitiatePeerPullCreditResponse { 3414 /** 3415 * Taler URI for the other party to make the payment 3416 * that was requested. 3417 * 3418 * @deprecated since it's not necessarily valid yet until the tx is in the right state 3419 */ 3420 talerUri: string; 3421 transactionId: TransactionIdStr; 3422 } 3423 3424 ``` 3425 3426 ### PreparePeerPullDebitOp 3427 ```typescript 3428 /** 3429 * Prepare for an incoming peer pull payment. 3430 */ 3431 export type PreparePeerPullDebitOp = { 3432 op: WalletApiOperation.PreparePeerPullDebit; 3433 request: PreparePeerPullDebitRequest; 3434 response: PreparePeerPullDebitResponse; 3435 }; 3436 // PreparePeerPullDebit = "preparePeerPullDebit" 3437 3438 ``` 3439 ```typescript 3440 /** 3441 * Result of initiating a peer-pull-debit payment. 3442 * 3443 * Either {@link talerUri} or {@link transactionId} must be specified. 3444 */ 3445 export interface PreparePeerPullDebitRequest { 3446 talerUri?: string; 3447 transactionId?: string; 3448 } 3449 3450 ``` 3451 ```typescript 3452 export interface PreparePeerPullDebitResponse { 3453 contractTerms: PeerContractTerms; 3454 amountRaw: AmountString; 3455 amountEffective: AmountString; 3456 transactionId: TransactionIdStr; 3457 /** 3458 * State of the existing or newly created transaction. 3459 */ 3460 txState: TransactionState; 3461 exchangeBaseUrl: string; 3462 scopeInfo: ScopeInfo; 3463 /** 3464 * @deprecated Redundant field with bad name, will be removed soon. 3465 */ 3466 amount: AmountString; 3467 } 3468 3469 ``` 3470 3471 ### ConfirmPeerPullDebitOp 3472 ```typescript 3473 /** 3474 * Accept an incoming peer pull payment (i.e. pay the other party). 3475 */ 3476 export type ConfirmPeerPullDebitOp = { 3477 op: WalletApiOperation.ConfirmPeerPullDebit; 3478 request: ConfirmPeerPullDebitRequest; 3479 response: AcceptPeerPullPaymentResponse; 3480 }; 3481 // ConfirmPeerPullDebit = "confirmPeerPullDebit" 3482 3483 ``` 3484 ```typescript 3485 export interface ConfirmPeerPullDebitRequest { 3486 transactionId: TransactionIdStr; 3487 } 3488 3489 ``` 3490 ```typescript 3491 export interface AcceptPeerPullPaymentResponse { 3492 transactionId: TransactionIdStr; 3493 } 3494 3495 ``` 3496 3497 ### ValidateIbanOp 3498 ```typescript 3499 export type ValidateIbanOp = { 3500 op: WalletApiOperation.ValidateIban; 3501 request: ValidateIbanRequest; 3502 response: ValidateIbanResponse; 3503 }; 3504 // ValidateIban = "validateIban" 3505 3506 ``` 3507 ```typescript 3508 export interface ValidateIbanRequest { 3509 iban: string; 3510 } 3511 3512 ``` 3513 ```typescript 3514 export interface ValidateIbanResponse { 3515 valid: boolean; 3516 } 3517 3518 ``` 3519 3520 ### CanonicalizeBaseUrlOp 3521 ```typescript 3522 export type CanonicalizeBaseUrlOp = { 3523 op: WalletApiOperation.CanonicalizeBaseUrl; 3524 request: CanonicalizeBaseUrlRequest; 3525 response: CanonicalizeBaseUrlResponse; 3526 }; 3527 // CanonicalizeBaseUrl = "canonicalizeBaseUrl" 3528 3529 ``` 3530 ```typescript 3531 export interface CanonicalizeBaseUrlRequest { 3532 url: string; 3533 } 3534 3535 ``` 3536 ```typescript 3537 export interface CanonicalizeBaseUrlResponse { 3538 url: string; 3539 } 3540 3541 ``` 3542 3543 ### GetQrCodesForPaytoOp 3544 ```typescript 3545 export type GetQrCodesForPaytoOp = { 3546 op: WalletApiOperation.GetQrCodesForPayto; 3547 request: GetQrCodesForPaytoRequest; 3548 response: GetQrCodesForPaytoResponse; 3549 }; 3550 // GetQrCodesForPayto = "getQrCodesForPayto" 3551 3552 ``` 3553 ```typescript 3554 export interface GetQrCodesForPaytoRequest { 3555 paytoUri: string; 3556 } 3557 3558 ``` 3559 ```typescript 3560 export interface GetQrCodesForPaytoResponse { 3561 codes: QrCodeSpec[]; 3562 } 3563 3564 ``` 3565 3566 ### ConvertIbanAccountFieldToPaytoOp 3567 ```typescript 3568 export type ConvertIbanAccountFieldToPaytoOp = { 3569 op: WalletApiOperation.ConvertIbanAccountFieldToPayto; 3570 request: ConvertIbanAccountFieldToPaytoRequest; 3571 response: ConvertIbanAccountFieldToPaytoResponse; 3572 }; 3573 // ConvertIbanAccountFieldToPayto = "convertIbanAccountFieldToPayto" 3574 3575 ``` 3576 ```typescript 3577 export interface ConvertIbanAccountFieldToPaytoRequest { 3578 value: string; 3579 currency: string; 3580 } 3581 3582 ``` 3583 ```typescript 3584 export type ConvertIbanAccountFieldToPaytoResponse = 3585 | { 3586 ok: true; 3587 type: "iban" | "bban"; 3588 paytoUri: string; 3589 } 3590 | { 3591 ok: false; 3592 }; 3593 3594 ``` 3595 3596 ### ConvertIbanPaytoToAccountFieldOp 3597 ```typescript 3598 export type ConvertIbanPaytoToAccountFieldOp = { 3599 op: WalletApiOperation.ConvertIbanPaytoToAccountField; 3600 request: ConvertIbanPaytoToAccountFieldRequest; 3601 response: ConvertIbanPaytoToAccountFieldResponse; 3602 }; 3603 // ConvertIbanPaytoToAccountField = "convertIbanPaytoToAccountField" 3604 3605 ``` 3606 ```typescript 3607 export interface ConvertIbanPaytoToAccountFieldRequest { 3608 paytoUri: string; 3609 } 3610 3611 ``` 3612 ```typescript 3613 export interface ConvertIbanPaytoToAccountFieldResponse { 3614 type: "iban" | "bban"; 3615 value: string; 3616 } 3617 3618 ``` 3619 3620 ### GetBankingChoicesForPaytoOp 3621 ```typescript 3622 export type GetBankingChoicesForPaytoOp = { 3623 op: WalletApiOperation.GetBankingChoicesForPayto; 3624 request: GetBankingChoicesForPaytoRequest; 3625 response: GetBankingChoicesForPaytoResponse; 3626 }; 3627 // GetBankingChoicesForPayto = "getBankingChoicesForPayto" 3628 3629 ``` 3630 ```typescript 3631 export interface GetBankingChoicesForPaytoRequest { 3632 paytoUri: string; 3633 } 3634 3635 ``` 3636 ```typescript 3637 export interface GetBankingChoicesForPaytoResponse { 3638 choices: BankingChoiceSpec[]; 3639 } 3640 3641 ``` 3642 ```typescript 3643 export interface BankingChoiceSpec { 3644 label: string; 3645 type: "link"; 3646 uri: string; 3647 } 3648 3649 ``` 3650 3651 ### ExportDbOp 3652 ```typescript 3653 /** 3654 * Export the wallet database's contents to JSON. 3655 */ 3656 export type ExportDbOp = { 3657 op: WalletApiOperation.ExportDb; 3658 request: EmptyObject; 3659 response: any; 3660 }; 3661 // ExportDb = "exportDb" 3662 3663 ``` 3664 3665 ### ImportDbOp 3666 ```typescript 3667 export type ImportDbOp = { 3668 op: WalletApiOperation.ImportDb; 3669 request: ImportDbRequest; 3670 response: EmptyObject; 3671 }; 3672 // ImportDb = "importDb" 3673 3674 ``` 3675 ```typescript 3676 export interface ImportDbRequest { 3677 dump: any; 3678 } 3679 3680 ``` 3681 3682 ### ClearDbOp 3683 ```typescript 3684 /** 3685 * Dangerously clear the whole wallet database. 3686 */ 3687 export type ClearDbOp = { 3688 op: WalletApiOperation.ClearDb; 3689 request: EmptyObject; 3690 response: EmptyObject; 3691 }; 3692 // ClearDb = "clearDb" 3693 3694 ``` 3695 3696 ### RecycleOp 3697 ```typescript 3698 /** 3699 * Export a backup, clear the database and re-import it. 3700 */ 3701 export type RecycleOp = { 3702 op: WalletApiOperation.Recycle; 3703 request: EmptyObject; 3704 response: EmptyObject; 3705 }; 3706 // Recycle = "recycle" 3707 3708 ``` 3709 3710 ### ApplyDevExperimentOp 3711 ```typescript 3712 /** 3713 * Apply a developer experiment to the current wallet state. 3714 * 3715 * This allows UI developers / testers to play around without 3716 * an elaborate test environment. 3717 */ 3718 export type ApplyDevExperimentOp = { 3719 op: WalletApiOperation.ApplyDevExperiment; 3720 request: ApplyDevExperimentRequest; 3721 response: EmptyObject; 3722 }; 3723 // ApplyDevExperiment = "applyDevExperiment" 3724 3725 ``` 3726 ```typescript 3727 export interface ApplyDevExperimentRequest { 3728 devExperimentUri: string; 3729 } 3730 3731 ``` 3732 3733 ### RunIntegrationTestOp 3734 ```typescript 3735 /** 3736 * Run a simple integration test on a test deployment 3737 * of the exchange and merchant. 3738 */ 3739 export type RunIntegrationTestOp = { 3740 op: WalletApiOperation.RunIntegrationTest; 3741 request: IntegrationTestArgs; 3742 response: EmptyObject; 3743 }; 3744 // RunIntegrationTest = "runIntegrationTest" 3745 3746 ``` 3747 ```typescript 3748 export interface IntegrationTestArgs { 3749 exchangeBaseUrl: string; 3750 corebankApiBaseUrl: string; 3751 merchantBaseUrl: string; 3752 merchantAuthToken?: string; 3753 amountToWithdraw: AmountString; 3754 amountToSpend: AmountString; 3755 } 3756 3757 ``` 3758 3759 ### RunIntegrationTestV2Op 3760 ```typescript 3761 /** 3762 * Run a simple integration test on a test deployment 3763 * of the exchange and merchant. 3764 */ 3765 export type RunIntegrationTestV2Op = { 3766 op: WalletApiOperation.RunIntegrationTestV2; 3767 request: IntegrationTestV2Args; 3768 response: EmptyObject; 3769 }; 3770 // RunIntegrationTestV2 = "runIntegrationTestV2" 3771 3772 ``` 3773 ```typescript 3774 export interface IntegrationTestV2Args { 3775 exchangeBaseUrl: string; 3776 corebankApiBaseUrl: string; 3777 merchantBaseUrl: string; 3778 merchantAuthToken?: string; 3779 } 3780 3781 ``` 3782 3783 ### TestCryptoOp 3784 ```typescript 3785 /** 3786 * Test crypto worker. 3787 */ 3788 export type TestCryptoOp = { 3789 op: WalletApiOperation.TestCrypto; 3790 request: EmptyObject; 3791 response: any; 3792 }; 3793 // TestCrypto = "testCrypto" 3794 3795 ``` 3796 3797 ### WithdrawTestBalanceOp 3798 ```typescript 3799 /** 3800 * Make withdrawal on a test deployment of the exchange 3801 * and merchant. 3802 */ 3803 export type WithdrawTestBalanceOp = { 3804 op: WalletApiOperation.WithdrawTestBalance; 3805 request: WithdrawTestBalanceRequest; 3806 response: WithdrawTestBalanceResult; 3807 }; 3808 // WithdrawTestBalance = "withdrawTestBalance" 3809 3810 ``` 3811 ```typescript 3812 export interface WithdrawTestBalanceRequest { 3813 /** 3814 * Amount to withdraw. 3815 */ 3816 amount: AmountString; 3817 /** 3818 * Corebank API base URL. 3819 */ 3820 corebankApiBaseUrl: string; 3821 /** 3822 * Exchange to use for withdrawal. 3823 */ 3824 exchangeBaseUrl: string; 3825 /** 3826 * Force the usage of a particular denomination selection. 3827 * 3828 * Only useful for testing. 3829 */ 3830 forcedDenomSel?: ForcedDenomSel; 3831 /** 3832 * If set to true, treat the account created during 3833 * the withdrawal as a foreign withdrawal account. 3834 */ 3835 useForeignAccount?: boolean; 3836 } 3837 3838 ``` 3839 3840 ### WithdrawTestkudosOp 3841 ```typescript 3842 /** 3843 * Make a withdrawal of testkudos on test.taler.net. 3844 */ 3845 export type WithdrawTestkudosOp = { 3846 op: WalletApiOperation.WithdrawTestkudos; 3847 request: EmptyObject; 3848 response: WithdrawTestBalanceResult; 3849 }; 3850 // WithdrawTestkudos = "withdrawTestkudos" 3851 3852 ``` 3853 3854 ### TestPayOp 3855 ```typescript 3856 /** 3857 * Make a test payment using a test deployment of 3858 * the exchange and merchant. 3859 */ 3860 export type TestPayOp = { 3861 op: WalletApiOperation.TestPay; 3862 request: TestPayArgs; 3863 response: TestPayResult; 3864 }; 3865 // TestPay = "testPay" 3866 3867 ``` 3868 ```typescript 3869 export interface TestPayArgs { 3870 merchantBaseUrl: string; 3871 merchantAuthToken?: string; 3872 amount: AmountString; 3873 summary: string; 3874 forcedCoinSel?: ForcedCoinSel; 3875 } 3876 3877 ``` 3878 ```typescript 3879 export interface TestPayResult { 3880 /** 3881 * Number of coins used for the payment. 3882 */ 3883 numCoins: number; 3884 } 3885 3886 ``` 3887 3888 ### GetActiveTasksOp 3889 ```typescript 3890 export type GetActiveTasksOp = { 3891 op: WalletApiOperation.GetActiveTasks; 3892 request: EmptyObject; 3893 response: GetActiveTasksResponse; 3894 }; 3895 // GetActiveTasks = "getActiveTasks" 3896 3897 ``` 3898 ```typescript 3899 export interface GetActiveTasksResponse { 3900 tasks: ActiveTask[]; 3901 } 3902 3903 ``` 3904 ```typescript 3905 export interface ActiveTask { 3906 taskId: string; 3907 transaction: TransactionIdStr | undefined; 3908 firstTry: AbsoluteTime | undefined; 3909 nextTry: AbsoluteTime | undefined; 3910 retryCounter: number | undefined; 3911 lastError: TalerErrorDetail | undefined; 3912 } 3913 3914 ``` 3915 3916 ### GetPerformanceStatsOp 3917 ```typescript 3918 /** 3919 * Get a list of performance stats for diagnostics. 3920 * 3921 * Requires observability events to be enabled. Performance tables for the 3922 * current running wallet instance are generated from observability events and 3923 * stored in memory. 3924 * 3925 * Under each table, different types of duration for each operation 3926 * (e.g. `getBalances` wallet request) are included. 3927 */ 3928 export type GetPerformanceStatsOp = { 3929 op: WalletApiOperation.TestingGetPerformanceStats; 3930 request: GetPerformanceStatsRequest; 3931 response: GetPerformanceStatsResponse; 3932 }; 3933 // TestingGetPerformanceStats = "testingGetPerformanceStats" 3934 3935 ``` 3936 ```typescript 3937 export interface GetPerformanceStatsRequest { 3938 /** 3939 * Limit to N largest average performance stats of each table. 3940 * 3941 * When undefined, all performance stats will be returned. 3942 */ 3943 limit?: number; 3944 } 3945 3946 ``` 3947 ```typescript 3948 export interface GetPerformanceStatsResponse { 3949 stats: PerformanceTable; 3950 } 3951 3952 ``` 3953 ```typescript 3954 export type PerformanceTable = { 3955 [key in PerformanceStatType]?: PerformanceStat[]; 3956 }; 3957 3958 ``` 3959 ```typescript 3960 export declare enum PerformanceStatType { 3961 HttpFetch = "http-fetch", 3962 DbQuery = "db-query", 3963 Crypto = "crypto", 3964 WalletRequest = "wallet-request", 3965 WalletTask = "wallet-task", 3966 } 3967 3968 ``` 3969 ```typescript 3970 export type PerformanceStat = 3971 | { 3972 type: PerformanceStatType.HttpFetch; 3973 url: string; 3974 avgDurationMs: number; 3975 maxDurationMs: number; 3976 minDurationMs: number; 3977 totalDurationMs: number; 3978 count: number; 3979 } 3980 | { 3981 type: PerformanceStatType.DbQuery; 3982 name: string; 3983 location: string; 3984 avgDurationMs: number; 3985 maxDurationMs: number; 3986 minDurationMs: number; 3987 totalDurationMs: number; 3988 count: number; 3989 } 3990 | { 3991 type: PerformanceStatType.Crypto; 3992 operation: string; 3993 avgDurationMs: number; 3994 maxDurationMs: number; 3995 minDurationMs: number; 3996 totalDurationMs: number; 3997 count: number; 3998 } 3999 | { 4000 type: PerformanceStatType.WalletRequest; 4001 operation: string; 4002 avgDurationMs: number; 4003 maxDurationMs: number; 4004 minDurationMs: number; 4005 totalDurationMs: number; 4006 count: number; 4007 } 4008 | { 4009 type: PerformanceStatType.WalletTask; 4010 taskId: string; 4011 avgDurationMs: number; 4012 maxDurationMs: number; 4013 minDurationMs: number; 4014 totalDurationMs: number; 4015 count: number; 4016 }; 4017 4018 ``` 4019 ```typescript 4020 export type ObservabilityEvent = 4021 | { 4022 id: string; 4023 when: AbsoluteTime; 4024 type: ObservabilityEventType.HttpFetchStart; 4025 url: string; 4026 longPolling: boolean; 4027 } 4028 | { 4029 id: string; 4030 when: AbsoluteTime; 4031 type: ObservabilityEventType.HttpFetchFinishSuccess; 4032 url: string; 4033 status: number; 4034 durationMs: number; 4035 longPolling: boolean; 4036 } 4037 | { 4038 id: string; 4039 when: AbsoluteTime; 4040 type: ObservabilityEventType.HttpFetchFinishError; 4041 url: string; 4042 error: TalerErrorDetail; 4043 durationMs: number; 4044 longPolling: boolean; 4045 } 4046 | { 4047 type: ObservabilityEventType.DbQueryStart; 4048 name: string; 4049 location: string; 4050 } 4051 | { 4052 type: ObservabilityEventType.DbQueryFinishSuccess; 4053 name: string; 4054 location: string; 4055 durationMs: number; 4056 } 4057 | { 4058 type: ObservabilityEventType.DbQueryFinishError; 4059 name: string; 4060 location: string; 4061 error: TalerErrorDetail; 4062 durationMs: number; 4063 } 4064 | { 4065 type: ObservabilityEventType.RequestStart; 4066 name: string; 4067 } 4068 | { 4069 type: ObservabilityEventType.RequestFinishSuccess; 4070 operation: string; 4071 requestId: string; 4072 durationMs: number; 4073 } 4074 | { 4075 type: ObservabilityEventType.RequestFinishError; 4076 operation: string; 4077 requestId: string; 4078 durationMs: number; 4079 } 4080 | { 4081 type: ObservabilityEventType.TaskStart; 4082 taskId: string; 4083 } 4084 | { 4085 type: ObservabilityEventType.TaskStop; 4086 taskId: string; 4087 } 4088 | { 4089 type: ObservabilityEventType.TaskReset; 4090 taskId: string; 4091 } 4092 | { 4093 type: ObservabilityEventType.DeclareTaskDependency; 4094 taskId: string; 4095 } 4096 | { 4097 type: ObservabilityEventType.CryptoStart; 4098 operation: string; 4099 } 4100 | { 4101 type: ObservabilityEventType.CryptoFinishSuccess; 4102 operation: string; 4103 durationMs: number; 4104 } 4105 | { 4106 type: ObservabilityEventType.CryptoFinishError; 4107 operation: string; 4108 durationMs: number; 4109 } 4110 | { 4111 type: ObservabilityEventType.ShepherdTaskResult; 4112 taskId: string; 4113 resultType: string; 4114 durationMs: number; 4115 } 4116 | { 4117 type: ObservabilityEventType.Message; 4118 contents: string; 4119 } 4120 | { 4121 type: ObservabilityEventType.DeclareConcernsTransaction; 4122 transactionId: TransactionIdStr; 4123 }; 4124 4125 ``` 4126 4127 ### DumpCoinsOp 4128 ```typescript 4129 /** 4130 * Dump all coins of the wallet in a simple JSON format. 4131 */ 4132 export type DumpCoinsOp = { 4133 op: WalletApiOperation.DumpCoins; 4134 request: EmptyObject; 4135 response: CoinDumpJson; 4136 }; 4137 // DumpCoins = "dumpCoins" 4138 4139 ``` 4140 ```typescript 4141 /** 4142 * Easy to process format for the public data of coins 4143 * managed by the wallet. 4144 */ 4145 export interface CoinDumpJson { 4146 coins: Array<{ 4147 /** 4148 * The coin's denomination's public key. 4149 */ 4150 denomPub: DenominationPubKey; 4151 /** 4152 * Hash of denom_pub. 4153 */ 4154 denomPubHash: string; 4155 /** 4156 * Value of the denomination (without any fees). 4157 */ 4158 denomValue: string; 4159 /** 4160 * Public key of the coin. 4161 */ 4162 coinPub: string; 4163 /** 4164 * Base URL of the exchange for the coin. 4165 */ 4166 exchangeBaseUrl: string; 4167 /** 4168 * Public key of the parent coin. 4169 * Only present if this coin was obtained via refreshing. 4170 */ 4171 refreshParentCoinPub: string | undefined; 4172 /** 4173 * Public key of the reserve for this coin. 4174 * Only present if this coin was obtained via refreshing. 4175 */ 4176 withdrawalReservePub: string | undefined; 4177 /** 4178 * Status of the coin. 4179 */ 4180 coinStatus: CoinStatus; 4181 /** 4182 * Information about the age restriction 4183 */ 4184 ageCommitmentProof: AgeCommitmentProof | undefined; 4185 history: WalletCoinHistoryItem[]; 4186 }>; 4187 } 4188 4189 ``` 4190 ```typescript 4191 export type DenominationPubKey = RsaDenominationPubKey | CsDenominationPubKey; 4192 4193 ``` 4194 ```typescript 4195 export interface RsaDenominationPubKey { 4196 readonly cipher: DenomKeyType.Rsa; 4197 readonly rsa_public_key: string; 4198 readonly age_mask: number; 4199 } 4200 4201 ``` 4202 ```typescript 4203 export interface CsDenominationPubKey { 4204 readonly cipher: DenomKeyType.ClauseSchnorr; 4205 readonly age_mask: number; 4206 readonly cs_public_key: string; 4207 } 4208 4209 ``` 4210 ```typescript 4211 /** 4212 * Status of a coin. 4213 */ 4214 export declare enum CoinStatus { 4215 /** 4216 * Withdrawn and never shown to anybody. 4217 */ 4218 Fresh = "fresh", 4219 /** 4220 * Coin was lost as the denomination is not usable anymore. 4221 */ 4222 DenomLoss = "denom-loss", 4223 /** 4224 * Fresh, but currently marked as "suspended", thus won't be used 4225 * for spending. Used for testing. 4226 */ 4227 FreshSuspended = "fresh-suspended", 4228 /** 4229 * A coin that has been spent and refreshed. 4230 */ 4231 Dormant = "dormant", 4232 } 4233 4234 ``` 4235 ```typescript 4236 export interface AgeCommitmentProof { 4237 commitment: AgeCommitment; 4238 proof: AgeProof; 4239 } 4240 4241 ``` 4242 ```typescript 4243 export interface AgeCommitment { 4244 mask: number; 4245 /** 4246 * Public keys, one for each age group specified in the age mask. 4247 */ 4248 publicKeys: Edx25519PublicKeyEnc[]; 4249 } 4250 4251 ``` 4252 ```typescript 4253 export type Edx25519PublicKeyEnc = string & FlavorEdx25519PublicKeyEnc; 4254 4255 ``` 4256 ```typescript 4257 type FlavorEdx25519PublicKeyEnc = { 4258 readonly [isEdx25519PublicKeyEnc]?: true; 4259 }; 4260 4261 ``` 4262 ```typescript 4263 export interface AgeProof { 4264 /** 4265 * Private keys. Typically smaller than the number of public keys, 4266 * because we drop private keys from age groups that are restricted. 4267 */ 4268 privateKeys: Edx25519PrivateKeyEnc[]; 4269 } 4270 4271 ``` 4272 ```typescript 4273 export type Edx25519PrivateKeyEnc = string & FlavorEdx25519PrivateKeyEnc; 4274 4275 ``` 4276 ```typescript 4277 type FlavorEdx25519PrivateKeyEnc = { 4278 readonly [isEdx25519PrivateKeyEnc]?: true; 4279 }; 4280 4281 ``` 4282 ```typescript 4283 export type WalletCoinHistoryItem = 4284 | { 4285 type: "withdraw"; 4286 transactionId: TransactionIdStr; 4287 } 4288 | { 4289 type: "spend"; 4290 transactionId: TransactionIdStr; 4291 amount: AmountString; 4292 } 4293 | { 4294 type: "refresh"; 4295 transactionId: TransactionIdStr; 4296 amount: AmountString; 4297 } 4298 | { 4299 type: "recoup"; 4300 transactionId: TransactionIdStr; 4301 amount: AmountString; 4302 } 4303 | { 4304 type: "refund"; 4305 transactionId: TransactionIdStr; 4306 amount: AmountString; 4307 }; 4308 4309 ``` 4310 4311 ### TestingSetTimetravelOp 4312 ```typescript 4313 /** 4314 * Add an offset to the wallet's internal time. 4315 */ 4316 export type TestingSetTimetravelOp = { 4317 op: WalletApiOperation.TestingSetTimetravel; 4318 request: TestingSetTimetravelRequest; 4319 response: EmptyObject; 4320 }; 4321 // TestingSetTimetravel = "testingSetTimetravel" 4322 4323 ``` 4324 ```typescript 4325 export interface TestingSetTimetravelRequest { 4326 offsetMs: number; 4327 } 4328 4329 ``` 4330 4331 ### TestingWaitTransactionsFinalOp 4332 ```typescript 4333 /** 4334 * Wait until all transactions are in a final state. 4335 */ 4336 export type TestingWaitTransactionsFinalOp = { 4337 op: WalletApiOperation.TestingWaitTransactionsFinal; 4338 request: EmptyObject; 4339 response: EmptyObject; 4340 }; 4341 // TestingWaitTransactionsFinal = "testingWaitTransactionsFinal" 4342 4343 ``` 4344 4345 ### TestingWaitTasksDoneOp 4346 ```typescript 4347 /** 4348 * Wait until all transactions are in a final state. 4349 */ 4350 export type TestingWaitTasksDoneOp = { 4351 op: WalletApiOperation.TestingWaitTasksDone; 4352 request: EmptyObject; 4353 response: EmptyObject; 4354 }; 4355 // TestingWaitTasksDone = "testingWaitTasksDone" 4356 4357 ``` 4358 4359 ### TestingWaitRefreshesFinalOp 4360 ```typescript 4361 /** 4362 * Wait until all refresh transactions are in a final state. 4363 */ 4364 export type TestingWaitRefreshesFinalOp = { 4365 op: WalletApiOperation.TestingWaitRefreshesFinal; 4366 request: EmptyObject; 4367 response: EmptyObject; 4368 }; 4369 // TestingWaitRefreshesFinal = "testingWaitRefreshesFinal" 4370 4371 ``` 4372 4373 ### TestingWaitTransactionStateOp 4374 ```typescript 4375 /** 4376 * Wait until a transaction is in a particular state. 4377 */ 4378 export type TestingWaitTransactionStateOp = { 4379 op: WalletApiOperation.TestingWaitTransactionState; 4380 request: TestingWaitTransactionRequest; 4381 response: EmptyObject; 4382 }; 4383 // TestingWaitTransactionState = "testingWaitTransactionState" 4384 4385 ``` 4386 ```typescript 4387 export interface TestingWaitTransactionRequest { 4388 transactionId: TransactionIdStr; 4389 /** 4390 * Additional identifier that is used in the logs 4391 * to easily find the status of the particular wait 4392 * request. 4393 */ 4394 logId?: string; 4395 /** 4396 * After the timeout has passed, give up on 4397 * waiting for the desired state and raise 4398 * an error instead. 4399 */ 4400 timeout?: DurationUnitSpec; 4401 /** 4402 * If set to true, wait until the desired state 4403 * is reached with an error. 4404 */ 4405 requireError?: boolean; 4406 txState: 4407 | TransactionStatePattern 4408 | TransactionStatePattern[] 4409 | number 4410 | "nonpending"; 4411 } 4412 4413 ``` 4414 ```typescript 4415 export interface TransactionStatePattern { 4416 major: TransactionMajorState | TransactionStateWildcard; 4417 minor?: TransactionMinorState | TransactionStateWildcard; 4418 } 4419 4420 ``` 4421 4422 ### TestingWaitExchangeStateOp 4423 ```typescript 4424 /** 4425 * Wait until an exchange entry is in a particular state. 4426 */ 4427 export type TestingWaitExchangeStateOp = { 4428 op: WalletApiOperation.TestingWaitExchangeState; 4429 request: TestingWaitExchangeStateRequest; 4430 response: EmptyObject; 4431 }; 4432 // TestingWaitExchangeState = "testingWaitExchangeState" 4433 4434 ``` 4435 ```typescript 4436 export interface TestingWaitExchangeStateRequest { 4437 exchangeBaseUrl: string; 4438 walletKycStatus?: ExchangeWalletKycStatus; 4439 } 4440 4441 ``` 4442 4443 ### TestingWaitExchangeReadyOp 4444 ```typescript 4445 /** 4446 * Wait until an exchange entry is ready. 4447 * Returns an error if updating the exchange 4448 * failed. 4449 */ 4450 export type TestingWaitExchangeReadyOp = { 4451 op: WalletApiOperation.TestingWaitExchangeReady; 4452 request: TestingWaitExchangeReadyRequest; 4453 response: EmptyObject; 4454 }; 4455 // TestingWaitExchangeReady = "testingWaitExchangeReady" 4456 4457 ``` 4458 ```typescript 4459 export interface TestingWaitExchangeReadyRequest { 4460 exchangeBaseUrl: string; 4461 /** 4462 * Do not stop waiting even when the exchange is 4463 * in an error state. 4464 */ 4465 noBail?: boolean; 4466 /** 4467 * Force waiting until an update really happened. 4468 */ 4469 forceUpdate?: boolean; 4470 } 4471 4472 ``` 4473 4474 ### TestingPingOp 4475 ```typescript 4476 export type TestingPingOp = { 4477 op: WalletApiOperation.TestingPing; 4478 request: EmptyObject; 4479 response: EmptyObject; 4480 }; 4481 // TestingPing = "testingPing" 4482 4483 ``` 4484 4485 ### TestingGetReserveHistoryOp 4486 ```typescript 4487 export type TestingGetReserveHistoryOp = { 4488 op: WalletApiOperation.TestingGetReserveHistory; 4489 request: TestingGetReserveHistoryRequest; 4490 response: any; 4491 }; 4492 // TestingGetReserveHistory = "testingGetReserveHistory" 4493 4494 ``` 4495 ```typescript 4496 export interface TestingGetReserveHistoryRequest { 4497 reservePub: string; 4498 exchangeBaseUrl: string; 4499 } 4500 4501 ``` 4502 4503 ### TestingResetAllRetriesOp 4504 ```typescript 4505 /** 4506 * Reset all task/transaction retries, 4507 * resulting in immediate re-try of all operations. 4508 */ 4509 export type TestingResetAllRetriesOp = { 4510 op: WalletApiOperation.TestingResetAllRetries; 4511 request: EmptyObject; 4512 response: EmptyObject; 4513 }; 4514 // TestingResetAllRetries = "testingResetAllRetries" 4515 4516 ``` 4517 4518 ### TestingGetDenomStatsOp 4519 ```typescript 4520 /** 4521 * Get stats about an exchange denomination. 4522 */ 4523 export type TestingGetDenomStatsOp = { 4524 op: WalletApiOperation.TestingGetDenomStats; 4525 request: TestingGetDenomStatsRequest; 4526 response: TestingGetDenomStatsResponse; 4527 }; 4528 // TestingGetDenomStats = "testingGetDenomStats" 4529 4530 ``` 4531 ```typescript 4532 export interface TestingGetDenomStatsRequest { 4533 exchangeBaseUrl: string; 4534 } 4535 4536 ``` 4537 ```typescript 4538 export interface TestingGetDenomStatsResponse { 4539 numKnown: number; 4540 numOffered: number; 4541 numLost: number; 4542 } 4543 4544 ``` 4545 4546 ### TestingRunFixupOp 4547 ```typescript 4548 export type TestingRunFixupOp = { 4549 op: WalletApiOperation.TestingRunFixup; 4550 request: RunFixupRequest; 4551 response: EmptyObject; 4552 }; 4553 // TestingRunFixup = "testingRunFixup" 4554 4555 ``` 4556 ```typescript 4557 export interface RunFixupRequest { 4558 id: string; 4559 } 4560 4561 ``` 4562 4563 ### TestingGetDiagnosticsOp 4564 ```typescript 4565 export type TestingGetDiagnosticsOp = { 4566 op: WalletApiOperation.GetDiagnostics; 4567 request: EmptyObject; 4568 response: TestingGetDiagnosticsResponse; 4569 }; 4570 // GetDiagnostics = "getDiagnostics" 4571 4572 ``` 4573 ```typescript 4574 export interface TestingGetDiagnosticsResponse { 4575 version: 0; 4576 /** 4577 * Statistics about the size of object stores. 4578 */ 4579 idbObjectStoreCounts?: Record<string, number>; 4580 exchangeEntries: { 4581 exchangeBaseUrl: string; 4582 numDenoms: number; 4583 numWithdrawableDenoms: number; 4584 numCandidateWithdrawableDenoms: number; 4585 }[]; 4586 } 4587 4588 ``` 4589 4590 ### TestingGetFlightRecordsOp 4591 ```typescript 4592 export type TestingGetFlightRecordsOp = { 4593 op: WalletApiOperation.TestingGetFlightRecords; 4594 request: EmptyObject; 4595 response: TestingGetFlightRecordsResponse; 4596 }; 4597 // TestingGetFlightRecords = "testingGetFlightRecords" 4598 4599 ``` 4600 ```typescript 4601 export interface TestingGetFlightRecordsResponse { 4602 flightRecords: FlightRecordEntry[]; 4603 } 4604 4605 ``` 4606 ```typescript 4607 export interface FlightRecordEntry { 4608 timestamp: TalerPreciseTimestamp; 4609 target: string; 4610 event: FlightRecordEvent; 4611 } 4612 4613 ``` 4614 ```typescript 4615 export declare enum FlightRecordEvent { 4616 MeltGone = "melt-gone", 4617 WithdrawalRedenominate = "withdrawal-redenominate", 4618 } 4619 4620 ``` 4621 4622 ### TestingCorruptWithdrawalCoinSelOp 4623 ```typescript 4624 export type TestingCorruptWithdrawalCoinSelOp = { 4625 op: WalletApiOperation.TestingCorruptWithdrawalCoinSel; 4626 request: TestingCorruptWithdrawalCoinSelRequest; 4627 response: EmptyObject; 4628 }; 4629 // TestingCorruptWithdrawalCoinSel = "testingCorruptWithdrawalCoinSel" 4630 4631 ``` 4632 ```typescript 4633 export interface TestingCorruptWithdrawalCoinSelRequest { 4634 transactionId: TransactionIdStr; 4635 } 4636 4637 ``` 4638 4639 ### SetCoinSuspendedOp 4640 ```typescript 4641 /** 4642 * Set a coin as (un-)suspended. 4643 * Suspended coins won't be used for payments. 4644 */ 4645 export type SetCoinSuspendedOp = { 4646 op: WalletApiOperation.SetCoinSuspended; 4647 request: SetCoinSuspendedRequest; 4648 response: EmptyObject; 4649 }; 4650 // SetCoinSuspended = "setCoinSuspended" 4651 4652 ``` 4653 ```typescript 4654 export interface SetCoinSuspendedRequest { 4655 coinPub: string; 4656 suspended: boolean; 4657 } 4658 4659 ``` 4660 4661 ### ForceRefreshOp 4662 ```typescript 4663 /** 4664 * Force a refresh on coins where it would not 4665 * be necessary. 4666 */ 4667 export type ForceRefreshOp = { 4668 op: WalletApiOperation.ForceRefresh; 4669 request: ForceRefreshRequest; 4670 response: EmptyObject; 4671 }; 4672 // ForceRefresh = "forceRefresh" 4673 4674 ``` 4675 ```typescript 4676 export interface ForceRefreshRequest { 4677 refreshCoinSpecs: RefreshCoinSpec[]; 4678 } 4679 4680 ``` 4681 ```typescript 4682 export interface RefreshCoinSpec { 4683 coinPub: string; 4684 amount?: AmountString; 4685 } 4686 4687 ``` 4688 4689 ## Common Declarations 4690 ```typescript 4691 export interface InitRequest { 4692 config?: PartialWalletRunConfig; 4693 } 4694 ``` 4695 ```typescript 4696 export interface PartialWalletRunConfig { 4697 testing?: Partial<WalletRunConfig["testing"]>; 4698 features?: Partial<WalletRunConfig["features"]>; 4699 lazyTaskLoop?: Partial<WalletRunConfig["lazyTaskLoop"]>; 4700 logLevel?: Partial<WalletRunConfig["logLevel"]>; 4701 } 4702 ``` 4703 ```typescript 4704 export interface WalletRunConfig { 4705 /** 4706 * Unsafe options which it should only be used to create 4707 * testing environment. 4708 */ 4709 testing: { 4710 devModeActive: boolean; 4711 insecureTrustExchange: boolean; 4712 preventThrottling: boolean; 4713 skipDefaults: boolean; 4714 emitObservabilityEvents?: boolean; 4715 }; 4716 /** 4717 * Configurations values that may be safe to show to the user 4718 */ 4719 features: { 4720 allowHttp: boolean; 4721 /** 4722 * If set to true, enable V1 contracts. Otherwise, emulate v0 contracts 4723 * to wallet-core clients. 4724 * 4725 * Will become enabled by default in the future. 4726 * 4727 * Added 2025-08-19. 4728 */ 4729 enableV1Contracts: boolean; 4730 }; 4731 /** 4732 * Start processing tasks only when explicitly required, even after 4733 * init has been called. 4734 * 4735 * Useful when the wallet is started to make single read-only request, 4736 * as otherwise wallet-core starts making network request and process 4737 * unrelated pending tasks. 4738 */ 4739 lazyTaskLoop: boolean; 4740 /** 4741 * Global log level. 4742 */ 4743 logLevel: string; 4744 } 4745 ``` 4746 ```typescript 4747 export interface InitResponse { 4748 versionInfo: WalletCoreVersion; 4749 } 4750 ``` 4751 ```typescript 4752 export interface WalletCoreVersion { 4753 implementationSemver: string; 4754 implementationGitHash: string; 4755 /** 4756 * Wallet-core protocol version supported by this implementation 4757 * of the API ("server" version). 4758 */ 4759 version: string; 4760 exchange: string; 4761 merchant: string; 4762 bankIntegrationApiRange: string; 4763 bankConversionApiRange: string; 4764 corebankApiRange: string; 4765 /** 4766 * @deprecated as bank was split into multiple APIs with separate versioning 4767 */ 4768 bank: string; 4769 /** 4770 * @deprecated 4771 */ 4772 hash: string | undefined; 4773 /** 4774 * @deprecated will be removed 4775 */ 4776 devMode: boolean; 4777 } 4778 ``` 4779 ```typescript 4780 export type EmptyObject = Record<string, never>; 4781 ``` 4782 ```typescript 4783 export type AmountString = 4784 | (string & { 4785 [__amount_str]: true; 4786 }) 4787 | LitAmountString; 4788 ``` 4789 ```typescript 4790 export interface ContactEntry { 4791 /** 4792 * Contact alias 4793 */ 4794 alias: string; 4795 /** 4796 * Alias type 4797 */ 4798 aliasType: string; 4799 /** 4800 * mailbox URI 4801 */ 4802 mailboxBaseUri: string; 4803 /** 4804 * mailbox identity 4805 */ 4806 mailboxAddress: HashCodeString; 4807 /** 4808 * The source of this contact 4809 * may be a URI 4810 */ 4811 source: string; 4812 /** 4813 * The local petname of the contact 4814 */ 4815 petname: string; 4816 } 4817 ``` 4818 ```typescript 4819 export interface MailboxConfiguration { 4820 mailboxBaseUrl: string; 4821 privateKey: EddsaPrivateKeyString; 4822 privateEncryptionKey: string; 4823 expiration: Timestamp; 4824 payUri?: TalerUri; 4825 } 4826 ``` 4827 ```typescript 4828 export interface TalerProtocolTimestamp { 4829 /** 4830 * Seconds (as integer) since epoch. 4831 */ 4832 readonly t_s: number | "never"; 4833 readonly _flavor?: typeof flavor_TalerProtocolTimestamp; 4834 } 4835 ``` 4836 ```typescript 4837 /** 4838 * A parsed taler URI. 4839 */ 4840 export type TalerUri = 4841 | PayUriResult 4842 | PayTemplateUriResult 4843 | DevExperimentUri 4844 | PayPullUriResult 4845 | PayPushUriResult 4846 | BackupRestoreUri 4847 | RefundUriResult 4848 | WithdrawUriResult 4849 | WithdrawExchangeUri 4850 | AddExchangeUri 4851 | WithdrawalTransferResultUri 4852 | AddContactUri; 4853 ``` 4854 ```typescript 4855 /** 4856 * 4857 */ 4858 export interface PayUriResult { 4859 type: TalerUriAction.Pay; 4860 merchantBaseUrl: HostPortPath; 4861 orderId: string; 4862 sessionId: string; 4863 claimToken?: string; 4864 /** 4865 * Nonce priv, only present in the 4866 * "continue on mobile" payment flow. 4867 */ 4868 noncePriv?: string; 4869 } 4870 ``` 4871 ```typescript 4872 export type HostPortPath = string & { 4873 [__hostport_str]: true; 4874 }; 4875 ``` 4876 ```typescript 4877 export interface PayTemplateUriResult { 4878 type: TalerUriAction.PayTemplate; 4879 merchantBaseUrl: HostPortPath; 4880 templateId: string; 4881 sessionId?: string; 4882 fulfillmentUrl?: string; 4883 } 4884 ``` 4885 ```typescript 4886 export interface DevExperimentUri { 4887 type: TalerUriAction.DevExperiment; 4888 devExperimentId: string; 4889 query?: URLSearchParams; 4890 } 4891 ``` 4892 ```typescript 4893 interface URLSearchParams extends _URLSearchParams {} 4894 ``` 4895 ```typescript 4896 export interface PayPullUriResult { 4897 type: TalerUriAction.PayPull; 4898 exchangeBaseUrl: HostPortPath; 4899 contractPriv: string; 4900 } 4901 ``` 4902 ```typescript 4903 export interface PayPushUriResult { 4904 type: TalerUriAction.PayPush; 4905 exchangeBaseUrl: HostPortPath; 4906 contractPriv: string; 4907 } 4908 ``` 4909 ```typescript 4910 export interface BackupRestoreUri { 4911 type: TalerUriAction.Restore; 4912 walletRootPriv: string; 4913 providers: Array<HostPortPath>; 4914 } 4915 ``` 4916 ```typescript 4917 export interface RefundUriResult { 4918 type: TalerUriAction.Refund; 4919 merchantBaseUrl: HostPortPath; 4920 orderId: string; 4921 } 4922 ``` 4923 ```typescript 4924 export interface WithdrawUriResult { 4925 type: TalerUriAction.Withdraw; 4926 bankIntegrationApiBaseUrl: HostPortPath; 4927 withdrawalOperationId: string; 4928 externalConfirmation?: boolean; 4929 } 4930 ``` 4931 ```typescript 4932 export interface WithdrawExchangeUri { 4933 type: TalerUriAction.WithdrawExchange; 4934 exchangeBaseUrl: HostPortPath; 4935 amount?: AmountString; 4936 } 4937 ``` 4938 ```typescript 4939 export interface AddExchangeUri { 4940 type: TalerUriAction.AddExchange; 4941 exchangeBaseUrl: HostPortPath; 4942 } 4943 ``` 4944 ```typescript 4945 export interface WithdrawalTransferResultUri { 4946 type: TalerUriAction.WithdrawalTransferResult; 4947 ref: string; 4948 status?: "success" | "aborted"; 4949 } 4950 ``` 4951 ```typescript 4952 export interface AddContactUri { 4953 type: TalerUriAction.AddContact; 4954 alias: string; 4955 aliasType: string; 4956 mailboxBaseUri: string; 4957 mailboxIdentity: HashCodeString; 4958 sourceBaseUrl: string; 4959 } 4960 ``` 4961 ```typescript 4962 /** 4963 * Record metadata for mailbox messages 4964 */ 4965 export interface MailboxMessageRecord { 4966 originMailboxBaseUrl: string; 4967 downloadedAt: Timestamp; 4968 talerUri: string; 4969 } 4970 ``` 4971 ```typescript 4972 export type ScopeInfo = ScopeInfoGlobal | ScopeInfoExchange | ScopeInfoAuditor; 4973 ``` 4974 ```typescript 4975 export type ScopeInfoGlobal = { 4976 type: ScopeType.Global; 4977 currency: string; 4978 }; 4979 ``` 4980 ```typescript 4981 export type ScopeInfoExchange = { 4982 type: ScopeType.Exchange; 4983 currency: string; 4984 url: string; 4985 }; 4986 ``` 4987 ```typescript 4988 export interface Exchange { 4989 url: string; 4990 priority: Integer; 4991 master_pub: EddsaPublicKey; 4992 max_contribution?: AmountString; 4993 } 4994 ``` 4995 ```typescript 4996 export type ScopeInfoAuditor = { 4997 type: ScopeType.Auditor; 4998 currency: string; 4999 url: string; 5000 }; 5001 ``` 5002 ```typescript 5003 export type AccountRestriction = 5004 | RegexAccountRestriction 5005 | DenyAllAccountRestriction; 5006 ``` 5007 ```typescript 5008 export interface RegexAccountRestriction { 5009 type: "regex"; 5010 payto_regex: string; 5011 human_hint: string; 5012 human_hint_i18n?: InternationalizedString; 5013 } 5014 ``` 5015 ```typescript 5016 export interface InternationalizedString { 5017 [lang_tag: string]: string; 5018 } 5019 ``` 5020 ```typescript 5021 export interface DenyAllAccountRestriction { 5022 type: "deny"; 5023 } 5024 ``` 5025 ```typescript 5026 export interface TransactionsResponse { 5027 transactions: Transaction[]; 5028 } 5029 ``` 5030 ```typescript 5031 export type Transaction = 5032 | TransactionWithdrawal 5033 | TransactionPayment 5034 | TransactionRefund 5035 | TransactionRefresh 5036 | TransactionDeposit 5037 | TransactionPeerPullCredit 5038 | TransactionPeerPullDebit 5039 | TransactionPeerPushCredit 5040 | TransactionPeerPushDebit 5041 | TransactionInternalWithdrawal 5042 | TransactionRecoup 5043 | TransactionDenomLoss; 5044 ``` 5045 ```typescript 5046 /** 5047 * A withdrawal transaction (either bank-integrated or manual). 5048 */ 5049 export interface TransactionWithdrawal extends TransactionCommon { 5050 type: TransactionType.Withdrawal; 5051 /** 5052 * Exchange of the withdrawal. 5053 */ 5054 exchangeBaseUrl: string | undefined; 5055 /** 5056 * Amount that got subtracted from the reserve balance. 5057 */ 5058 amountRaw: AmountString; 5059 /** 5060 * Amount that actually was (or will be) added to the wallet's balance. 5061 */ 5062 amountEffective: AmountString; 5063 withdrawalDetails: WithdrawalDetails; 5064 } 5065 ``` 5066 ```typescript 5067 export interface TransactionCommon { 5068 transactionId: TransactionIdStr; 5069 type: TransactionType; 5070 timestamp: TalerPreciseTimestamp; 5071 /** 5072 * Scope of this tx 5073 */ 5074 scopes: ScopeInfo[]; 5075 /** 5076 * Transaction state, as per DD37. 5077 */ 5078 txState: TransactionState; 5079 /** 5080 * Wallet-internal state ID, only used for debugging and testing. 5081 */ 5082 stId: number; 5083 /** 5084 * Possible transitions based on the current state. 5085 */ 5086 txActions: TransactionAction[]; 5087 /** 5088 * Raw amount of the transaction (exclusive of fees or other extra costs). 5089 */ 5090 amountRaw: AmountString; 5091 /** 5092 * Amount added or removed from the wallet's balance (including all fees and other costs). 5093 */ 5094 amountEffective: AmountString; 5095 error?: TalerErrorDetail; 5096 abortReason?: TalerErrorDetail; 5097 failReason?: TalerErrorDetail; 5098 /** 5099 * If the transaction minor state is in KycRequired this field is going to 5100 * have the location where the user need to go to complete KYC information. 5101 */ 5102 kycUrl?: string; 5103 /** 5104 * KYC payto hash. Useful for testing, not so useful for UIs. 5105 */ 5106 kycPaytoHash?: string; 5107 /** 5108 * KYC access token. Useful for testing, not so useful for UIs. 5109 */ 5110 kycAccessToken?: string; 5111 kycAuthTransferInfo?: KycAuthTransferInfo; 5112 } 5113 ``` 5114 ```typescript 5115 export type TransactionIdStr = `txn:${string}:${string}` & { 5116 [__txId]: true; 5117 }; 5118 ``` 5119 ```typescript 5120 export declare enum TransactionType { 5121 Withdrawal = "withdrawal", 5122 InternalWithdrawal = "internal-withdrawal", 5123 Payment = "payment", 5124 Refund = "refund", 5125 Refresh = "refresh", 5126 Deposit = "deposit", 5127 PeerPushDebit = "peer-push-debit", 5128 PeerPushCredit = "peer-push-credit", 5129 PeerPullDebit = "peer-pull-debit", 5130 PeerPullCredit = "peer-pull-credit", 5131 Recoup = "recoup", 5132 DenomLoss = "denom-loss", 5133 } 5134 ``` 5135 ```typescript 5136 /** 5137 * Precise timestamp, typically used in the wallet-core 5138 * API but not in other Taler APIs so far. 5139 */ 5140 export interface TalerPreciseTimestamp { 5141 /** 5142 * Seconds (as integer) since epoch. 5143 */ 5144 readonly t_s: number | "never"; 5145 /** 5146 * Optional microsecond offset (non-negative integer). 5147 */ 5148 readonly off_us?: number; 5149 readonly _flavor?: typeof flavor_TalerPreciseTimestamp; 5150 } 5151 ``` 5152 ```typescript 5153 export interface TransactionState { 5154 major: TransactionMajorState; 5155 minor?: TransactionMinorState; 5156 } 5157 ``` 5158 ```typescript 5159 export declare enum TransactionMajorState { 5160 None = "none", 5161 Pending = "pending", 5162 Done = "done", 5163 Aborting = "aborting", 5164 Aborted = "aborted", 5165 Dialog = "dialog", 5166 Finalizing = "finalizing", 5167 Suspended = "suspended", 5168 SuspendedFinalizing = "suspended-finalizing", 5169 SuspendedAborting = "suspended-aborting", 5170 Failed = "failed", 5171 Expired = "expired", 5172 Deleted = "deleted", 5173 } 5174 ``` 5175 ```typescript 5176 export declare enum TransactionMinorState { 5177 AbortingBank = "aborting-bank", 5178 AcceptRefund = "accept-refund", 5179 AutoRefund = "auto-refund", 5180 BalanceKycRequired = "balance-kyc", 5181 Bank = "bank", 5182 BankConfirmTransfer = "bank-confirm-transfer", 5183 BankRegisterReserve = "bank-register-reserve", 5184 CheckRefund = "check-refund", 5185 ClaimProposal = "claim-proposal", 5186 CompletedByOtherWallet = "completed-by-other-wallet", 5187 CreatePurse = "create-purse", 5188 DeletePurse = "delete-purse", 5189 Deposit = "deposit", 5190 Exchange = "exchange", 5191 ExchangeWaitReserve = "exchange-wait-reserve", 5192 KycAuthRequired = "kyc-auth", 5193 KycInit = "kyc-init", 5194 KycRequired = "kyc", 5195 Merge = "merge", 5196 PaidByOther = "paid-by-other", 5197 Proposed = "proposed", 5198 Ready = "ready", 5199 RebindSession = "rebind-session", 5200 Refresh = "refresh", 5201 Refused = "refused", 5202 Repurchase = "repurchase", 5203 SubmitPayment = "submit-payment", 5204 Track = "track", 5205 Unknown = "unknown", 5206 Withdraw = "withdraw", 5207 } 5208 ``` 5209 ```typescript 5210 export declare enum TransactionAction { 5211 Delete = "delete", 5212 Suspend = "suspend", 5213 Resume = "resume", 5214 Abort = "abort", 5215 Fail = "fail", 5216 Retry = "retry", 5217 } 5218 ``` 5219 ```typescript 5220 export interface TalerErrorDetail { 5221 code: TalerErrorCode; 5222 when?: AbsoluteTime; 5223 hint?: string; 5224 [x: string]: unknown; 5225 } 5226 ``` 5227 ```typescript 5228 export interface AbsoluteTime { 5229 /** 5230 * Timestamp in milliseconds. 5231 */ 5232 readonly t_ms: number | "never"; 5233 readonly _flavor?: typeof flavor_AbsoluteTime; 5234 [opaque_AbsoluteTime]: true; 5235 } 5236 ``` 5237 ```typescript 5238 export interface Duration { 5239 /** 5240 * Duration in milliseconds. 5241 */ 5242 readonly d_ms: number | "forever"; 5243 } 5244 ``` 5245 ```typescript 5246 export interface DurationUnitSpec { 5247 seconds?: number; 5248 minutes?: number; 5249 hours?: number; 5250 days?: number; 5251 months?: number; 5252 years?: number; 5253 } 5254 ``` 5255 ```typescript 5256 export interface TalerProtocolDuration { 5257 readonly d_us: number | "forever"; 5258 } 5259 ``` 5260 ```typescript 5261 export interface KycAuthTransferInfo { 5262 /** 5263 * Payto URI of the account that must make the transfer. 5264 * 5265 * The KYC auth transfer will *not* work if it originates 5266 * from a different account. 5267 */ 5268 debitPaytoUri: string; 5269 /** 5270 * Account public key that must be included in the subject. 5271 */ 5272 accountPub: string; 5273 /** 5274 * Amount that the exchange expects to be deposited. 5275 * 5276 * Usually corresponds to the TINY_AMOUNT configuration of the exchange, 5277 * and thus is the smallest amount that can be transferred 5278 * via a bank transfer. 5279 */ 5280 amount: AmountString; 5281 /** 5282 * Possible target payto URIs. 5283 */ 5284 creditPaytoUris: string[]; 5285 } 5286 ``` 5287 ```typescript 5288 export type WithdrawalDetails = 5289 | WithdrawalDetailsForManualTransfer 5290 | WithdrawalDetailsForTalerBankIntegrationApi; 5291 ``` 5292 ```typescript 5293 interface WithdrawalDetailsForManualTransfer { 5294 type: WithdrawalType.ManualTransfer; 5295 /** 5296 * Payto URIs that the exchange supports. 5297 * 5298 * Already contains the amount and message. 5299 * 5300 * @deprecated in favor of exchangeCreditAccounts 5301 */ 5302 exchangePaytoUris: string[]; 5303 exchangeCreditAccountDetails?: WithdrawalExchangeAccountDetails[]; 5304 reservePub: string; 5305 /** 5306 * Is the reserve ready for withdrawal? 5307 */ 5308 reserveIsReady: boolean; 5309 /** 5310 * How long does the exchange wait to transfer back funds from a 5311 * reserve? 5312 */ 5313 reserveClosingDelay: TalerProtocolDuration; 5314 } 5315 ``` 5316 ```typescript 5317 export interface WithdrawalExchangeAccountDetails { 5318 /** 5319 * Payto URI to credit the exchange. 5320 * 5321 * Depending on whether the (manual!) withdrawal is accepted or just 5322 * being checked, this already includes the subject with the 5323 * reserve public key. 5324 */ 5325 paytoUri: string; 5326 /** 5327 * Status that indicates whether the account can be used 5328 * by the user to send funds for a withdrawal. 5329 * 5330 * ok: account should be shown to the user 5331 * error: account should not be shown to the user, UIs might render the error (in conversionError), 5332 * especially in dev mode. 5333 */ 5334 status: "ok" | "error"; 5335 /** 5336 * Transfer amount. Might be in a different currency than the requested 5337 * amount for withdrawal. 5338 * 5339 * Absent if this is a conversion account and the conversion failed. 5340 */ 5341 transferAmount?: AmountString; 5342 /** 5343 * Currency specification for the external currency. 5344 * 5345 * Only included if this account requires a currency conversion. 5346 */ 5347 currencySpecification?: CurrencySpecification; 5348 /** 5349 * Further restrictions for sending money to the 5350 * exchange. 5351 */ 5352 creditRestrictions?: AccountRestriction[]; 5353 /** 5354 * Label given to the account or the account's bank by the exchange. 5355 */ 5356 bankLabel?: string; 5357 priority?: number; 5358 /** 5359 * Error that happened when attempting to request the conversion rate. 5360 */ 5361 conversionError?: TalerErrorDetail; 5362 /** 5363 * Timestamp that indicates when the transfer options expire. 5364 * 5365 * If missing, options do not expire. 5366 */ 5367 transferExpiry?: TalerProtocolTimestamp; 5368 /** 5369 * Options for transfering funds to the exchange for the withdrawal. 5370 */ 5371 transferOptions: TransferOption[]; 5372 } 5373 ``` 5374 ```typescript 5375 /** 5376 * DD51 https://docs.taler.net/design-documents/051-fractional-digits.html 5377 */ 5378 export interface CurrencySpecification { 5379 name: string; 5380 num_fractional_input_digits: Integer; 5381 num_fractional_normal_digits: Integer; 5382 num_fractional_trailing_zero_digits: Integer; 5383 alt_unit_names: { 5384 [log10: string]: string; 5385 }; 5386 common_amounts?: AmountString[]; 5387 } 5388 ``` 5389 ```typescript 5390 export type TransferOption = 5391 | TransferOptionPayto 5392 | TransferOptionUri 5393 | TransferOptionSwissQrBill; 5394 ``` 5395 ```typescript 5396 export interface TransferOptionPayto { 5397 type: "payto"; 5398 paytoUri: string; 5399 qrCodes: QrCodeSpec[]; 5400 } 5401 ``` 5402 ```typescript 5403 /** 5404 * Specification of a QR code that includes payment information. 5405 */ 5406 export interface QrCodeSpec { 5407 /** 5408 * Type of the QR code. 5409 * 5410 * Depending on the type, different visual styles 5411 * might be applied. 5412 */ 5413 type: SupportedBankQr; 5414 /** 5415 * Content of the QR code that should be rendered. 5416 */ 5417 qrContent: string; 5418 } 5419 ``` 5420 ```typescript 5421 export type SupportedBankQr = "epc-qr" | "spc"; 5422 ``` 5423 ```typescript 5424 export interface TransferOptionUri { 5425 type: "uri"; 5426 uri: string; 5427 } 5428 ``` 5429 ```typescript 5430 export interface TransferOptionSwissQrBill { 5431 type: "ch-qr-bill"; 5432 paytoUri: string; 5433 qrReferenceNumber: string; 5434 qrCodes: QrCodeSpec[]; 5435 } 5436 ``` 5437 ```typescript 5438 interface WithdrawalDetailsForTalerBankIntegrationApi { 5439 type: WithdrawalType.TalerBankIntegrationApi; 5440 /** 5441 * Set to true if the bank has confirmed the withdrawal, false if not. 5442 * An unconfirmed withdrawal usually requires user-input and should be highlighted in the UI. 5443 * See also bankConfirmationUrl below. 5444 */ 5445 confirmed: boolean; 5446 /** 5447 * If the withdrawal is unconfirmed, this can include a URL for user 5448 * initiated confirmation. 5449 */ 5450 bankConfirmationUrl?: string; 5451 reservePub: string; 5452 /** 5453 * Is the reserve ready for withdrawal? 5454 */ 5455 reserveIsReady: boolean; 5456 /** 5457 * Is the bank transfer for the withdrawal externally confirmed? 5458 */ 5459 externalConfirmation?: boolean; 5460 exchangeCreditAccountDetails?: WithdrawalExchangeAccountDetails[]; 5461 } 5462 ``` 5463 ```typescript 5464 export interface TransactionPayment extends TransactionCommon { 5465 type: TransactionType.Payment; 5466 /** 5467 * Additional information about the payment. 5468 * 5469 * Only present if the information about the 5470 * order is already available. 5471 */ 5472 info: OrderShortInfo | undefined; 5473 /** 5474 * Full contract terms. 5475 * 5476 * Only included if explicitly included in the request. 5477 */ 5478 contractTerms?: MerchantContractTerms; 5479 /** 5480 * Amount that must be paid for the contract 5481 */ 5482 amountRaw: AmountString; 5483 /** 5484 * Amount that was paid, including deposit, wire and refresh fees. 5485 */ 5486 amountEffective: AmountString; 5487 /** 5488 * Amount that has been refunded by the merchant 5489 */ 5490 totalRefundRaw: AmountString; 5491 /** 5492 * Amount will be added to the wallet's balance after fees and refreshing 5493 */ 5494 totalRefundEffective: AmountString; 5495 /** 5496 * Amount pending to be picked up 5497 */ 5498 refundPending: AmountString | undefined; 5499 /** 5500 * Reference to applied refunds 5501 */ 5502 refunds: RefundInfoShort[]; 5503 /** 5504 * Is the wallet currently checking for a refund? 5505 */ 5506 refundQueryActive: boolean; 5507 /** 5508 * PoS confirmation codes, separated by newlines. 5509 * Only present for purchases that support PoS confirmation. 5510 */ 5511 posConfirmation: string | undefined; 5512 /** 5513 * Until when will the posConfirmation be valid? 5514 */ 5515 posConfirmationDeadline?: TalerProtocolTimestamp; 5516 /** 5517 * Did we receive the payment via a taler://pay-template/ URI 5518 * and did the URI contain a nfc=1 flag? 5519 */ 5520 posConfirmationViaNfc?: boolean; 5521 /** 5522 * In case this payment transaction was detected as a repurchase, 5523 * this is the transaction ID of the original payment. 5524 */ 5525 repurchaseTransactionId?: TransactionIdStr; 5526 } 5527 ``` 5528 ```typescript 5529 export interface OrderShortInfo { 5530 /** 5531 * Order ID, uniquely identifies the order within a merchant instance 5532 */ 5533 orderId: string; 5534 /** 5535 * Hash of the contract terms. 5536 */ 5537 contractTermsHash: string; 5538 /** 5539 * More information about the merchant 5540 */ 5541 merchant: MerchantInfo; 5542 /** 5543 * Summary of the order, given by the merchant 5544 */ 5545 summary: string; 5546 /** 5547 * Map from IETF BCP 47 language tags to localized summaries 5548 */ 5549 summary_i18n?: InternationalizedString; 5550 /** 5551 * URL of the fulfillment, given by the merchant 5552 */ 5553 fulfillmentUrl?: string; 5554 /** 5555 * Plain text message that should be shown to the user 5556 * when the payment is complete. 5557 */ 5558 fulfillmentMessage?: string; 5559 /** 5560 * Translations of fulfillmentMessage. 5561 */ 5562 fulfillmentMessage_i18n?: InternationalizedString; 5563 } 5564 ``` 5565 ```typescript 5566 export interface MerchantInfo { 5567 name: string; 5568 email?: string; 5569 website?: string; 5570 logo?: ImageDataUrl; 5571 address?: Location; 5572 jurisdiction?: Location; 5573 } 5574 ``` 5575 ```typescript 5576 export interface Location { 5577 country?: string; 5578 country_subdivision?: string; 5579 district?: string; 5580 town?: string; 5581 town_location?: string; 5582 post_code?: string; 5583 street?: string; 5584 building_name?: string; 5585 building_number?: string; 5586 address_lines?: string[]; 5587 } 5588 ``` 5589 ```typescript 5590 export type MerchantContractTerms = 5591 | MerchantContractTermsV0 5592 | MerchantContractTermsV1; 5593 ``` 5594 ```typescript 5595 export interface MerchantContractTermsV0 extends MerchantContractTermsCommon { 5596 version?: MerchantContractVersion.V0; 5597 amount: AmountString; 5598 max_fee: AmountString; 5599 } 5600 ``` 5601 ```typescript 5602 /** 5603 * Contract terms from a merchant. 5604 */ 5605 interface MerchantContractTermsCommon { 5606 h_wire: string; 5607 auto_refund?: TalerProtocolDuration; 5608 wire_method: string; 5609 summary: string; 5610 summary_i18n?: InternationalizedString; 5611 order_id: string; 5612 nonce: string; 5613 pay_deadline: TalerProtocolTimestamp; 5614 merchant: MerchantInfo; 5615 merchant_pub: string; 5616 delivery_date?: TalerProtocolTimestamp; 5617 delivery_location?: Location; 5618 exchanges: Exchange[]; 5619 products?: ProductSold[]; 5620 refund_deadline: TalerProtocolTimestamp; 5621 wire_transfer_deadline: TalerProtocolTimestamp; 5622 timestamp: TalerProtocolTimestamp; 5623 merchant_base_url: string; 5624 fulfillment_url?: string; 5625 public_reorder_url?: string; 5626 fulfillment_message?: string; 5627 fulfillment_message_i18n?: InternationalizedString; 5628 extra?: any; 5629 minimum_age?: Integer; 5630 default_money_pot?: Integer; 5631 } 5632 ``` 5633 ```typescript 5634 export interface ProductSold { 5635 product_id?: string; 5636 product_name?: string; 5637 description: string; 5638 description_i18n?: { 5639 [lang_tag: string]: string; 5640 }; 5641 quantity?: Integer; 5642 unit?: string; 5643 price?: AmountString; 5644 image?: ImageDataUrl; 5645 taxes?: Tax[]; 5646 delivery_date?: Timestamp; 5647 product_money_pot?: Integer; 5648 } 5649 ``` 5650 ```typescript 5651 export interface Tax { 5652 name: string; 5653 tax: AmountString; 5654 } 5655 ``` 5656 ```typescript 5657 export interface MerchantContractTermsV1 extends MerchantContractTermsCommon { 5658 version: MerchantContractVersion.V1; 5659 choices: MerchantContractChoice[]; 5660 token_families: { 5661 [token_family_slug: string]: MerchantContractTokenFamily; 5662 }; 5663 } 5664 ``` 5665 ```typescript 5666 export interface MerchantContractChoice { 5667 amount: AmountString; 5668 description?: string; 5669 description_i18n?: InternationalizedString; 5670 inputs: MerchantContractInput[]; 5671 outputs: MerchantContractOutput[]; 5672 max_fee: AmountString; 5673 } 5674 ``` 5675 ```typescript 5676 export interface MerchantContractInputToken { 5677 type: MerchantContractInputType.Token; 5678 token_family_slug: string; 5679 count?: Integer; 5680 } 5681 ``` 5682 ```typescript 5683 export type MerchantContractOutput = 5684 | MerchantContractOutputToken 5685 | MerchantContractOutputTaxReceipt; 5686 ``` 5687 ```typescript 5688 export interface MerchantContractOutputToken { 5689 type: MerchantContractOutputType.Token; 5690 token_family_slug: string; 5691 count?: Integer; 5692 valid_at?: Timestamp; 5693 key_index: Integer; 5694 } 5695 ``` 5696 ```typescript 5697 export interface MerchantContractOutputTaxReceipt { 5698 type: MerchantContractOutputType.TaxReceipt; 5699 donau_urls: string[]; 5700 amount?: AmountString; 5701 } 5702 ``` 5703 ```typescript 5704 export interface MerchantContractTokenFamily { 5705 name: string; 5706 description: string; 5707 description_i18n?: { 5708 [lang_tag: string]: string; 5709 }; 5710 keys: TokenIssuePublicKey[]; 5711 details: MerchantContractTokenDetails; 5712 critical: boolean; 5713 } 5714 ``` 5715 ```typescript 5716 export type TokenIssuePublicKey = 5717 | TokenIssueRsaPublicKey 5718 | TokenIssueCsPublicKey; 5719 ``` 5720 ```typescript 5721 export interface TokenIssueRsaPublicKey { 5722 cipher: "RSA"; 5723 rsa_pub: RsaPublicKey; 5724 signature_validity_start: Timestamp; 5725 signature_validity_end: Timestamp; 5726 } 5727 ``` 5728 ```typescript 5729 export interface TokenIssueCsPublicKey { 5730 cipher: "CS"; 5731 cs_pub: Cs25519Point; 5732 signature_validity_start: Timestamp; 5733 signature_validity_end: Timestamp; 5734 } 5735 ``` 5736 ```typescript 5737 export type MerchantContractTokenDetails = 5738 | MerchantContractSubscriptionTokenDetails 5739 | MerchantContractDiscountTokenDetails; 5740 ``` 5741 ```typescript 5742 export interface MerchantContractSubscriptionTokenDetails { 5743 class: MerchantContractTokenKind.Subscription; 5744 trusted_domains: string[]; 5745 } 5746 ``` 5747 ```typescript 5748 export interface MerchantContractDiscountTokenDetails { 5749 class: MerchantContractTokenKind.Discount; 5750 expected_domains: string[]; 5751 } 5752 ``` 5753 ```typescript 5754 export interface RefundInfoShort { 5755 transactionId: string; 5756 timestamp: TalerProtocolTimestamp; 5757 amountEffective: AmountString; 5758 amountRaw: AmountString; 5759 } 5760 ``` 5761 ```typescript 5762 export interface TransactionRefund extends TransactionCommon { 5763 type: TransactionType.Refund; 5764 amountRaw: AmountString; 5765 amountEffective: AmountString; 5766 refundedTransactionId: string; 5767 paymentInfo: RefundPaymentInfo | undefined; 5768 } 5769 ``` 5770 ```typescript 5771 /** 5772 * Summary information about the payment that we got a refund for. 5773 */ 5774 export interface RefundPaymentInfo { 5775 summary: string; 5776 summary_i18n?: InternationalizedString; 5777 /** 5778 * More information about the merchant 5779 */ 5780 merchant: MerchantInfo; 5781 } 5782 ``` 5783 ```typescript 5784 /** 5785 * A transaction shown for refreshes. 5786 * Only shown for (1) refreshes not associated with other transactions 5787 * and (2) refreshes in an error state. 5788 */ 5789 export interface TransactionRefresh extends TransactionCommon { 5790 type: TransactionType.Refresh; 5791 refreshReason: RefreshReason; 5792 /** 5793 * Transaction ID that caused this refresh. 5794 */ 5795 originatingTransactionId?: string; 5796 /** 5797 * Always zero for refreshes 5798 */ 5799 amountRaw: AmountString; 5800 /** 5801 * Fees, i.e. the effective, negative effect of the refresh 5802 * on the balance. 5803 * 5804 * Only applicable for stand-alone refreshes, and zero for 5805 * other refreshes where the transaction itself accounts for the 5806 * refresh fee. 5807 */ 5808 amountEffective: AmountString; 5809 refreshInputAmount: AmountString; 5810 refreshOutputAmount: AmountString; 5811 } 5812 ``` 5813 ```typescript 5814 /** 5815 * Reasons for why a coin is being refreshed. 5816 */ 5817 export declare enum RefreshReason { 5818 Manual = "manual", 5819 PayMerchant = "pay-merchant", 5820 PayDeposit = "pay-deposit", 5821 PayPeerPush = "pay-peer-push", 5822 PayPeerPull = "pay-peer-pull", 5823 Refund = "refund", 5824 AbortPay = "abort-pay", 5825 AbortDeposit = "abort-deposit", 5826 AbortPeerPushDebit = "abort-peer-push-debit", 5827 AbortPeerPullDebit = "abort-peer-pull-debit", 5828 Recoup = "recoup", 5829 BackupRestored = "backup-restored", 5830 Scheduled = "scheduled", 5831 } 5832 ``` 5833 ```typescript 5834 /** 5835 * Deposit transaction, which effectively sends 5836 * money from this wallet somewhere else. 5837 */ 5838 export interface TransactionDeposit extends TransactionCommon { 5839 type: TransactionType.Deposit; 5840 depositGroupId: string; 5841 /** 5842 * Target for the deposit. 5843 */ 5844 targetPaytoUri: string; 5845 /** 5846 * Raw amount that is being deposited 5847 */ 5848 amountRaw: AmountString; 5849 /** 5850 * Deposit account public key. 5851 */ 5852 accountPub: string; 5853 /** 5854 * Effective amount that is being deposited 5855 */ 5856 amountEffective: AmountString; 5857 wireTransferDeadline: TalerProtocolTimestamp; 5858 wireTransferProgress: number; 5859 /** 5860 * Did all the deposit requests succeed? 5861 */ 5862 deposited: boolean; 5863 trackingState: Array<DepositTransactionTrackingState>; 5864 } 5865 ``` 5866 ```typescript 5867 export interface DepositTransactionTrackingState { 5868 wireTransferId: string; 5869 timestampExecuted: TalerProtocolTimestamp; 5870 amountRaw: AmountString; 5871 wireFee: AmountString; 5872 } 5873 ``` 5874 ```typescript 5875 /** 5876 * Credit because we were paid for a P2P invoice we created. 5877 */ 5878 export interface TransactionPeerPullCredit extends TransactionCommon { 5879 type: TransactionType.PeerPullCredit; 5880 info: PeerInfoShort; 5881 /** 5882 * Exchange used. 5883 */ 5884 exchangeBaseUrl: string; 5885 /** 5886 * Amount that got subtracted from the reserve balance. 5887 */ 5888 amountRaw: AmountString; 5889 /** 5890 * Amount that actually was (or will be) added to the wallet's balance. 5891 */ 5892 amountEffective: AmountString; 5893 /** 5894 * URI to send to the other party. 5895 * 5896 * Only available in the right state. 5897 */ 5898 talerUri: string | undefined; 5899 } 5900 ``` 5901 ```typescript 5902 export interface PeerInfoShort { 5903 expiration: TalerProtocolTimestamp | undefined; 5904 summary: string | undefined; 5905 iconId: string | undefined; 5906 } 5907 ``` 5908 ```typescript 5909 /** 5910 * Debit because we paid someone's invoice. 5911 */ 5912 export interface TransactionPeerPullDebit extends TransactionCommon { 5913 type: TransactionType.PeerPullDebit; 5914 info: PeerInfoShort; 5915 /** 5916 * Exchange used. 5917 */ 5918 exchangeBaseUrl: string; 5919 amountRaw: AmountString; 5920 amountEffective: AmountString; 5921 } 5922 ``` 5923 ```typescript 5924 /** 5925 * We received money via a P2P payment. 5926 */ 5927 export interface TransactionPeerPushCredit extends TransactionCommon { 5928 type: TransactionType.PeerPushCredit; 5929 info: PeerInfoShort; 5930 /** 5931 * Exchange used. 5932 */ 5933 exchangeBaseUrl: string; 5934 /** 5935 * Amount that got subtracted from the reserve balance. 5936 */ 5937 amountRaw: AmountString; 5938 /** 5939 * Amount that actually was (or will be) added to the wallet's balance. 5940 */ 5941 amountEffective: AmountString; 5942 } 5943 ``` 5944 ```typescript 5945 /** 5946 * We sent money via a P2P payment. 5947 */ 5948 export interface TransactionPeerPushDebit extends TransactionCommon { 5949 type: TransactionType.PeerPushDebit; 5950 info: PeerInfoShort; 5951 /** 5952 * Exchange used. 5953 */ 5954 exchangeBaseUrl: string; 5955 /** 5956 * Amount that got subtracted from the reserve balance. 5957 */ 5958 amountRaw: AmountString; 5959 /** 5960 * Amount that actually was (or will be) added to the wallet's balance. 5961 */ 5962 amountEffective: AmountString; 5963 /** 5964 * URI to accept the payment. 5965 * 5966 * Only present if the transaction is in a state where the other party can 5967 * accept the payment. 5968 */ 5969 talerUri?: string; 5970 } 5971 ``` 5972 ```typescript 5973 /** 5974 * Internal withdrawal operation, only reported on request. 5975 * 5976 * Some transactions (peer-*-credit) internally do a withdrawal, 5977 * but only the peer-*-credit transaction is reported. 5978 * 5979 * The internal withdrawal transaction allows to access the details of 5980 * the underlying withdrawal for testing/debugging. 5981 * 5982 * It is usually not reported, so that amounts of transactions properly 5983 * add up, since the amountEffecive of the withdrawal is already reported 5984 * in the peer-*-credit transaction. 5985 */ 5986 export interface TransactionInternalWithdrawal extends TransactionCommon { 5987 type: TransactionType.InternalWithdrawal; 5988 /** 5989 * Exchange of the withdrawal. 5990 */ 5991 exchangeBaseUrl: string; 5992 /** 5993 * Amount that got subtracted from the reserve balance. 5994 */ 5995 amountRaw: AmountString; 5996 /** 5997 * Amount that actually was (or will be) added to the wallet's balance. 5998 */ 5999 amountEffective: AmountString; 6000 withdrawalDetails: WithdrawalDetails; 6001 } 6002 ``` 6003 ```typescript 6004 /** 6005 * The exchange revoked a key and the wallet recoups funds. 6006 */ 6007 export interface TransactionRecoup extends TransactionCommon { 6008 type: TransactionType.Recoup; 6009 } 6010 ``` 6011 ```typescript 6012 /** 6013 * A transaction to indicate financial loss due to denominations 6014 * that became unusable for deposits. 6015 */ 6016 export interface TransactionDenomLoss extends TransactionCommon { 6017 type: TransactionType.DenomLoss; 6018 lossEventType: DenomLossEventType; 6019 exchangeBaseUrl: string; 6020 } 6021 ``` 6022 ```typescript 6023 export declare enum DenomLossEventType { 6024 DenomExpired = "denom-expired", 6025 DenomVanished = "denom-vanished", 6026 DenomUnoffered = "denom-unoffered", 6027 } 6028 ``` 6029 ```typescript 6030 export interface AbortTransactionRequest { 6031 transactionId: TransactionIdStr; 6032 } 6033 ``` 6034 ```typescript 6035 export interface WithdrawUriInfoResponse { 6036 operationId: string; 6037 status: WithdrawalOperationStatusFlag; 6038 confirmTransferUrl?: string; 6039 currency: string; 6040 amount: AmountString | undefined; 6041 /** 6042 * Set to true if the user is allowed to edit the amount. 6043 * 6044 * Note that even with a non-editable amount, the amount 6045 * might be undefined at the beginning of the withdrawal 6046 * process. 6047 */ 6048 editableAmount: boolean; 6049 maxAmount: AmountString | undefined; 6050 wireFee: AmountString | undefined; 6051 defaultExchangeBaseUrl?: string; 6052 editableExchange: boolean; 6053 possibleExchanges: ExchangeListItem[]; 6054 } 6055 ``` 6056 ```typescript 6057 export type WithdrawalOperationStatusFlag = 6058 | "pending" 6059 | "selected" 6060 | "aborted" 6061 | "confirmed"; 6062 ``` 6063 ```typescript 6064 /** 6065 * Info about an exchange entry in the wallet. 6066 */ 6067 export interface ExchangeListItem { 6068 exchangeBaseUrl: string; 6069 masterPub: string | undefined; 6070 currency: string; 6071 paytoUris: string[]; 6072 tosStatus: ExchangeTosStatus; 6073 exchangeEntryStatus: ExchangeEntryStatus; 6074 exchangeUpdateStatus: ExchangeUpdateStatus; 6075 ageRestrictionOptions: number[]; 6076 walletKycStatus?: ExchangeWalletKycStatus; 6077 walletKycReservePub?: string; 6078 walletKycAccessToken?: string; 6079 walletKycUrl?: string; 6080 /** Threshold that we've requested to satisfy. */ 6081 walletKycRequestedThreshold?: string; 6082 /** 6083 * P2P payments are disabled with this exchange 6084 * (e.g. because no global fees are configured). 6085 */ 6086 peerPaymentsDisabled: boolean; 6087 directDepositsDisabled: boolean; 6088 /** Set to true if this exchange doesn't charge any fees. */ 6089 noFees: boolean; 6090 /** Most general scope that the exchange is a part of. */ 6091 scopeInfo: ScopeInfo; 6092 /** 6093 * Instructs wallets to use certain bank-specific 6094 * language (for buttons) and/or other UI/UX customization 6095 * for compliance with the rules of that bank. 6096 */ 6097 bankComplianceLanguage?: string; 6098 lastUpdateTimestamp: TalerPreciseTimestamp | undefined; 6099 /** 6100 * Information about the last error that occurred when trying 6101 * to update the exchange info. 6102 */ 6103 lastUpdateErrorInfo?: OperationErrorInfo; 6104 /** 6105 * Currency spec for the currency offered 6106 * by the exchange. 6107 */ 6108 currencySpec: CurrencySpecification; 6109 } 6110 ``` 6111 ```typescript 6112 export declare enum ExchangeTosStatus { 6113 Pending = "pending", 6114 Proposed = "proposed", 6115 Accepted = "accepted", 6116 MissingTos = "missing-tos", 6117 } 6118 ``` 6119 ```typescript 6120 export declare enum ExchangeEntryStatus { 6121 Preset = "preset", 6122 Ephemeral = "ephemeral", 6123 Used = "used", 6124 } 6125 ``` 6126 ```typescript 6127 export declare enum ExchangeUpdateStatus { 6128 Initial = "initial", 6129 InitialUpdate = "initial-update", 6130 Suspended = "suspended", 6131 UnavailableUpdate = "unavailable-update", 6132 Ready = "ready", 6133 ReadyUpdate = "ready-update", 6134 OutdatedUpdate = "outdated-update", 6135 } 6136 ``` 6137 ```typescript 6138 export declare enum ExchangeWalletKycStatus { 6139 Done = "done", 6140 /** 6141 * Wallet needs to request KYC status. 6142 */ 6143 LegiInit = "legi-init", 6144 /** 6145 * User requires KYC or AML. 6146 */ 6147 Legi = "legi", 6148 } 6149 ``` 6150 ```typescript 6151 export interface OperationErrorInfo { 6152 error: TalerErrorDetail; 6153 } 6154 ``` 6155 ```typescript 6156 export interface ForcedDenomSel { 6157 denoms: { 6158 value: AmountString; 6159 count: number; 6160 }[]; 6161 } 6162 ``` 6163 ```typescript 6164 export interface AcceptWithdrawalResponse { 6165 confirmTransferUrl?: string; 6166 transactionId: TransactionIdStr; 6167 } 6168 ``` 6169 ```typescript 6170 export interface PreparePayRequest { 6171 talerPayUri: string; 6172 } 6173 ``` 6174 ```typescript 6175 /** 6176 * Result of a prepare pay operation. 6177 */ 6178 export type PreparePayResult = 6179 | PreparePayResultInsufficientBalance 6180 | PreparePayResultAlreadyConfirmed 6181 | PreparePayResultPaymentPossible 6182 | PreparePayResultChoiceSelection; 6183 ``` 6184 ```typescript 6185 export interface PreparePayResultInsufficientBalance { 6186 status: PreparePayResultType.InsufficientBalance; 6187 transactionId: TransactionIdStr; 6188 /** 6189 * Scopes involved in this transaction. 6190 * 6191 * For the insufficient balance response, contains scopes 6192 * of *possible* payment providers. 6193 */ 6194 scopes: ScopeInfo[]; 6195 contractTerms: MerchantContractTermsV0; 6196 amountRaw: AmountString; 6197 talerUri: string; 6198 balanceDetails: PaymentInsufficientBalanceDetails; 6199 } 6200 ``` 6201 ```typescript 6202 /** 6203 * Detailed reason for why the wallet's balance is insufficient. 6204 */ 6205 export interface PaymentInsufficientBalanceDetails { 6206 /** 6207 * Amount requested by the merchant. 6208 */ 6209 amountRequested: AmountString; 6210 /** 6211 * Wire method for the requested payment, only applicable 6212 * for merchant payments. 6213 */ 6214 wireMethod?: string | undefined; 6215 /** 6216 * Hint as to why the balance is insufficient. 6217 * 6218 * If this hint is not provided, the balance hints of 6219 * the individual exchanges should be shown, as the overall 6220 * reason might be a combination of the reasons for different exchanges. 6221 */ 6222 causeHint?: InsufficientBalanceHint; 6223 /** 6224 * Balance of type "available" (see balance.ts for definition). 6225 */ 6226 balanceAvailable: AmountString; 6227 /** 6228 * Balance of type "material" (see balance.ts for definition). 6229 */ 6230 balanceMaterial: AmountString; 6231 /** 6232 * Balance of type "age-acceptable" (see balance.ts for definition). 6233 */ 6234 balanceAgeAcceptable: AmountString; 6235 /** 6236 * Balance of type "receiver-acceptable" (see balance.ts for definition). 6237 * 6238 * @deprecated (2025-12-05) use balanceReceiver[...]Acceptable instead. 6239 */ 6240 balanceReceiverAcceptable: AmountString; 6241 /** 6242 * Balance of type "receiver-exchange-url-acceptable" (see balance.ts for definition). 6243 */ 6244 balanceReceiverExchangeUrlAcceptable: AmountString; 6245 /** 6246 * Balance of type "receiver-exchange-pub-acceptable" (see balance.ts for definition). 6247 */ 6248 balanceReceiverExchangePubAcceptable: AmountString; 6249 /** 6250 * Balance of type "receiver-auditor-url-acceptable" (see balance.ts for definition). 6251 */ 6252 balanceReceiverAuditorUrlAcceptable: AmountString; 6253 /** 6254 * Balance of type "merchant-depositable" (see balance.ts for definition). 6255 */ 6256 balanceReceiverDepositable: AmountString; 6257 balanceExchangeDepositable: AmountString; 6258 /** 6259 * Maximum effective amount that the wallet can spend, 6260 * when all fees are paid by the wallet. 6261 */ 6262 maxEffectiveSpendAmount: AmountString; 6263 perExchange: { 6264 [url: string]: { 6265 balanceAvailable: AmountString; 6266 balanceMaterial: AmountString; 6267 balanceExchangeDepositable: AmountString; 6268 balanceAgeAcceptable: AmountString; 6269 /** 6270 * @deprecated (2025-12-05) use balanceReceiver[...]Acceptable instead. 6271 */ 6272 balanceReceiverAcceptable: AmountString; 6273 balanceReceiverExchangeUrlAcceptable: AmountString; 6274 balanceReceiverExchangePubAcceptable: AmountString; 6275 balanceReceiverAuditorUrlAcceptable: AmountString; 6276 balanceReceiverDepositable: AmountString; 6277 maxEffectiveSpendAmount: AmountString; 6278 /** 6279 * The exchange master public key configured by the merchant 6280 * backend differs from the one of the coins stored in the wallet. 6281 */ 6282 exchangeMasterPubMismatch: boolean; 6283 /** 6284 * Exchange doesn't have global fees configured for the relevant year, 6285 * p2p payments aren't possible. 6286 * 6287 * @deprecated (2025-02-18) use causeHint instead 6288 */ 6289 missingGlobalFees: boolean; 6290 /** 6291 * Hint that UIs should show to explain the insufficient 6292 * balance. 6293 */ 6294 causeHint?: InsufficientBalanceHint | undefined; 6295 }; 6296 }; 6297 } 6298 ``` 6299 ```typescript 6300 export declare enum InsufficientBalanceHint { 6301 /** 6302 * Merchant doesn't accept money from exchange(s) that the wallet supports. 6303 */ 6304 MerchantAcceptInsufficient = "merchant-accept-insufficient", 6305 /** 6306 * Merchant accepts funds from a matching exchange, but the funds can't be 6307 * deposited with the wire method. 6308 */ 6309 MerchantDepositInsufficient = "merchant-deposit-insufficient", 6310 /** 6311 * While in principle the balance is sufficient, 6312 * the age restriction on coins causes the spendable 6313 * balance to be insufficient. 6314 */ 6315 AgeRestricted = "age-restricted", 6316 /** 6317 * Wallet has enough available funds, 6318 * but the material funds are insufficient. Usually because there is a 6319 * pending refresh operation. 6320 */ 6321 WalletBalanceMaterialInsufficient = "wallet-balance-material-insufficient", 6322 /** 6323 * The wallet simply doesn't have enough available funds. 6324 * This is the "obvious" case of insufficient balance. 6325 */ 6326 WalletBalanceAvailableInsufficient = "wallet-balance-available-insufficient", 6327 /** 6328 * Exchange is missing the global fee configuration, thus fees are unknown 6329 * and funds from this exchange can't be used for p2p payments. 6330 */ 6331 ExchangeMissingGlobalFees = "exchange-missing-global-fees", 6332 /** 6333 * Even though the balance looks sufficient for the instructed amount, 6334 * the fees can be covered by neither the merchant nor the remaining wallet 6335 * balance. 6336 */ 6337 FeesNotCovered = "fees-not-covered", 6338 } 6339 ``` 6340 ```typescript 6341 export interface PreparePayResultAlreadyConfirmed { 6342 status: PreparePayResultType.AlreadyConfirmed; 6343 transactionId: TransactionIdStr; 6344 contractTerms: MerchantContractTerms; 6345 paid: boolean; 6346 amountRaw: AmountString; 6347 amountEffective: AmountString | undefined; 6348 /** 6349 * Scopes involved in this transaction. 6350 */ 6351 scopes: ScopeInfo[]; 6352 contractTermsHash: string; 6353 talerUri: string; 6354 } 6355 ``` 6356 ```typescript 6357 /** 6358 * Payment is possible. 6359 * 6360 * This response is only returned for v0 contracts 6361 * or when v1 are not enabled yet. 6362 */ 6363 export interface PreparePayResultPaymentPossible { 6364 status: PreparePayResultType.PaymentPossible; 6365 transactionId: TransactionIdStr; 6366 contractTerms: MerchantContractTermsV0; 6367 /** 6368 * Scopes involved in this transaction. 6369 */ 6370 scopes: ScopeInfo[]; 6371 amountRaw: AmountString; 6372 amountEffective: AmountString; 6373 /** 6374 * FIXME: Unclear why this is needed. Remove? 6375 */ 6376 contractTermsHash: string; 6377 /** 6378 * FIXME: Unclear why this is needed! Remove? 6379 */ 6380 talerUri: string; 6381 } 6382 ``` 6383 ```typescript 6384 /** 6385 * Unconfirmed contract v1 payment. 6386 */ 6387 export interface PreparePayResultChoiceSelection { 6388 status: PreparePayResultType.ChoiceSelection; 6389 transactionId: TransactionIdStr; 6390 contractTerms: MerchantContractTerms; 6391 contractTermsHash: string; 6392 talerUri: string; 6393 } 6394 ``` 6395 ```typescript 6396 export interface PreparePayTemplateRequest { 6397 talerPayTemplateUri: string; 6398 templateParams?: TemplateParams; 6399 } 6400 ``` 6401 ```typescript 6402 export type TemplateParams = { 6403 amount?: string; 6404 summary?: string; 6405 }; 6406 ``` 6407 ```typescript 6408 export interface PreparePayV2Result { 6409 transactionId: TransactionIdStr; 6410 } 6411 ``` 6412 ```typescript 6413 /** 6414 * Forced coin selection for deposits/payments. 6415 */ 6416 export interface ForcedCoinSel { 6417 coins: { 6418 value: AmountString; 6419 contribution: AmountString; 6420 }[]; 6421 } 6422 ``` 6423 ```typescript 6424 export interface ListDiscountsRequest { 6425 /** 6426 * Filter by hash of token issue public key. 6427 */ 6428 tokenIssuePubHash?: string; 6429 /** 6430 * Filter by merchant base URL. 6431 */ 6432 merchantBaseUrl?: string; 6433 } 6434 ``` 6435 ```typescript 6436 export interface DiscountListDetail { 6437 /** 6438 * Hash of token family info. 6439 */ 6440 tokenFamilyHash: string; 6441 /** 6442 * Hash of token issue public key. 6443 */ 6444 tokenIssuePubHash: string; 6445 /** 6446 * URL of the merchant issuing the token. 6447 */ 6448 merchantBaseUrl: string; 6449 /** 6450 * Name of the merchant instance issuing the token. 6451 */ 6452 merchantInfo?: MerchantInfo; 6453 /** 6454 * Human-readable name for the token family. 6455 */ 6456 name: string; 6457 /** 6458 * Human-readable description for the token family. 6459 */ 6460 description: string; 6461 /** 6462 * Optional map from IETF BCP 47 language tags to localized descriptions. 6463 */ 6464 descriptionI18n: any | undefined; 6465 /** 6466 * Start time of the token's validity period. 6467 */ 6468 validityStart: Timestamp; 6469 /** 6470 * End time of the token's validity period. 6471 */ 6472 validityEnd: Timestamp; 6473 /** 6474 * Number of tokens available to use. 6475 */ 6476 tokensAvailable: number; 6477 } 6478 ``` 6479 ```typescript 6480 export interface WalletBankAccountInfo { 6481 bankAccountId: string; 6482 paytoUri: string; 6483 /** 6484 * Did we previously complete a KYC process for this bank account? 6485 * 6486 * @deprecated no enough information since the kyc can be completed for one exchange but not for another 6487 * https://bugs.gnunet.org/view.php?id=9696 6488 */ 6489 kycCompleted: boolean; 6490 /** 6491 * Currencies supported by the bank, if known. 6492 */ 6493 currencies: string[] | undefined; 6494 label: string | undefined; 6495 } 6496 ``` 6497 ```typescript 6498 export interface AcceptExchangeTosRequest { 6499 exchangeBaseUrl: string; 6500 } 6501 ``` 6502 ```typescript 6503 export interface WireTypeDetails { 6504 paymentTargetType: string; 6505 /** 6506 * Only applicable for payment target type IBAN. 6507 * 6508 * Specifies whether the user wants to preferably 6509 * enter their bank account details as an IBAN 6510 * or as a BBAN. 6511 * 6512 * Mandatory for paymentTargetType="iban". 6513 */ 6514 preferredEntryType?: "iban" | "bban"; 6515 /** 6516 * Allowed hostnames for the deposit payto URI. 6517 * Only applicable to x-taler-bank. 6518 */ 6519 talerBankHostnames?: string[]; 6520 } 6521 ``` 6522 ```typescript 6523 export interface CheckPeerPushDebitRequest { 6524 /** 6525 * Preferred exchange to use for the p2p payment. 6526 */ 6527 exchangeBaseUrl?: string; 6528 /** 6529 * Instructed amount. 6530 * 6531 * FIXME: Allow specifying the instructed amount type. 6532 */ 6533 amount: AmountString; 6534 /** 6535 * Restrict the scope of funds that can be spent via the given 6536 * scope info. 6537 */ 6538 restrictScope?: ScopeInfo; 6539 /** 6540 * ID provided by the client to cancel the request. 6541 * 6542 * If the same request is made again with the same clientCancellationId, 6543 * all previous requests are cancelled. 6544 * 6545 * The cancelled request will receive an error response with 6546 * an error code that indicates the cancellation. 6547 * 6548 * The cancellation is best-effort, responses might still arrive. 6549 */ 6550 clientCancellationId?: string; 6551 } 6552 ``` 6553 ```typescript 6554 export interface CheckPeerPushDebitOkResponse { 6555 type: "ok"; 6556 amountRaw: AmountString; 6557 amountEffective: AmountString; 6558 /** 6559 * Exchange base URL. 6560 */ 6561 exchangeBaseUrl: string; 6562 /** 6563 * Maximum expiration date, based on how close the coins 6564 * used for the payment are to expiry. 6565 * 6566 * The value is based on when the wallet would typically 6567 * automatically refresh the coins on its own, leaving enough 6568 * time to get a refund for the push payment and refresh the 6569 * coin. 6570 */ 6571 maxExpirationDate: TalerProtocolTimestamp; 6572 /** 6573 * Default expiration, as given by the exchange 6574 * (or 1 week if the exchange does not specify it). 6575 */ 6576 defaultExpiration: TalerProtocolDuration; 6577 } 6578 ``` 6579 ```typescript 6580 /** 6581 * Contract terms between two wallets (as opposed to a merchant and wallet). 6582 */ 6583 export interface PeerContractTerms { 6584 amount: AmountString; 6585 summary: string; 6586 icon_id?: string; 6587 purse_expiration: TalerProtocolTimestamp; 6588 } 6589 ``` 6590 ```typescript 6591 export interface WithdrawTestBalanceResult { 6592 /** 6593 * Transaction ID of the newly created withdrawal transaction. 6594 */ 6595 transactionId: TransactionIdStr; 6596 /** 6597 * Account of the user registered for the withdrawal. 6598 */ 6599 accountPaytoUri: string; 6600 } 6601 ```