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