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