notifications.rst (15446B)
1 .. _wallet-notif-coin-recovery-progress: 2 3 **coin-recovery-progress** 4 5 Emitted while the :ts:op:`testingRecoverCoins` 6 operation scans an exchange for coins that belong to the wallet and recovers 7 them. The ``progressToken`` matches the progress token of the initiating 8 request. 9 10 The payload is a `CoinRecoveryProgressNotification` object. 11 12 .. ts:def:: CoinRecoveryProgressNotification 13 14 interface CoinRecoveryProgressNotification { 15 type: NotificationType.CoinRecoveryProgress; 16 exchangeBaseUrl: string; 17 progressToken: string; 18 phase: CoinRecoveryPhase; 19 numChecked: number; 20 numDiscovered: number; 21 numQueued: number; 22 numRecovered: number; 23 recoveredAmount: AmountString; 24 numIssues: number; 25 } 26 27 .. ts:def:: CoinRecoveryPhase 28 29 type CoinRecoveryPhase = 30 | "starting" 31 | "history" 32 | "derive" 33 | "melt" 34 | "reveal" 35 | "refresh" 36 | "complete" 37 | "incomplete" 38 | "failed" 39 | "cancelled"; 40 41 42 .. _wallet-notif-balance-change: 43 44 **balance-change** 45 46 Invalidates balance data, including flags and refresh information. The 47 monetary amounts need not have changed, for example when a refresh cost 48 becomes ready. Clients should re-query 49 :ts:op:`getBalances` in response. 50 51 The payload is a `BalanceChangeNotification` object. 52 53 .. ts:def:: BalanceChangeNotification 54 55 interface BalanceChangeNotification { 56 type: NotificationType.BalanceChange; 57 58 // If set to true, the balance change is internal to the wallet 59 // and not visible to the user. (For example when the material 60 // balance changes via a refresh, but the available balance 61 // stays the same.) 62 isInternal?: boolean; 63 64 // Transaction ID of the transaction that caused the balance 65 // update. Only used as a hint for debugging, should not be 66 // relied upon by clients. 67 hintTransactionId: string; 68 } 69 70 71 .. _wallet-notif-bank-account-change: 72 73 **bank-account-change** 74 75 Emitted when a bank account known to the wallet was added, changed or 76 deleted. Clients should re-query 77 :ts:op:`listBankAccounts`. 78 79 The payload is a `BankAccountChangeNotification` object. 80 81 .. ts:def:: BankAccountChangeNotification 82 83 interface BankAccountChangeNotification { 84 type: NotificationType.BankAccountChange; 85 86 // ID of the affected bank account. 87 bankAccountId: string; 88 } 89 90 91 .. _wallet-notif-backup-error: 92 93 **backup-error** 94 95 Signals the failure of a backup operation. The current wallet-core 96 implementation does not emit this notification. 97 98 The payload is a `BackupOperationErrorNotification` object. 99 100 .. ts:def:: BackupOperationErrorNotification 101 102 interface BackupOperationErrorNotification { 103 type: NotificationType.BackupOperationError; 104 error: TalerErrorDetail; 105 } 106 107 108 .. _wallet-notif-contact-added: 109 110 **contact-added** 111 112 Emitted when a contact was added to the wallet's address book. Clients 113 should re-query :ts:op:`getContacts`. 114 115 The payload is a `ContactAddedNotification` object. 116 117 .. ts:def:: ContactAddedNotification 118 119 interface ContactAddedNotification { 120 type: NotificationType.ContactAdded; 121 122 // The contact that was added. 123 contact: ContactEntry; 124 } 125 126 127 .. _wallet-notif-contact-deleted: 128 129 **contact-deleted** 130 131 Emitted when a contact was deleted from the wallet's address book. Clients 132 should re-query :ts:op:`getContacts`. 133 134 The payload is a `ContactDeletedNotification` object. 135 136 .. ts:def:: ContactDeletedNotification 137 138 interface ContactDeletedNotification { 139 type: NotificationType.ContactDeleted; 140 141 // The contact that was deleted. 142 contact: ContactEntry; 143 } 144 145 146 .. _wallet-notif-mailbox-message-added: 147 148 **mailbox-message-added** 149 150 Emitted when a message was added to the wallet's mailbox, for example a 151 payment request received from another wallet user. 152 153 The payload is a `MailboxMessageAddedNotification` object. 154 155 .. ts:def:: MailboxMessageAddedNotification 156 157 interface MailboxMessageAddedNotification { 158 type: NotificationType.MailboxMessageAdded; 159 160 // The message that was added. 161 message: MailboxMessageRecord; 162 } 163 164 165 .. _wallet-notif-mailbox-message-deleted: 166 167 **mailbox-message-deleted** 168 169 Emitted when a message was deleted from the wallet's mailbox. 170 171 The payload is a `MailboxMessageDeletedNotification` object. 172 173 .. ts:def:: MailboxMessageDeletedNotification 174 175 interface MailboxMessageDeletedNotification { 176 type: NotificationType.MailboxMessageDeleted; 177 178 // The message that was deleted. 179 message: MailboxMessageRecord; 180 } 181 182 183 .. _wallet-notif-transaction-state-transition: 184 185 **transaction-state-transition** 186 187 Emitted when a transaction moves from one state to another. Clients should 188 re-query the affected transaction; the ``causeHint`` is only a debugging 189 aid and must not be relied upon. 190 191 The payload is a `TransactionStateTransitionNotification` object. 192 193 .. ts:def:: TransactionStateTransitionNotification 194 195 interface TransactionStateTransitionNotification { 196 type: NotificationType.TransactionStateTransition; 197 198 // Identifier of the affected transaction. 199 transactionId: string; 200 201 // A hint as to why the transition happened. 202 // Should not be relied upon by clients. 203 causeHint: string | undefined; 204 205 // State before the transition. 206 oldTxState: TransactionState; 207 208 // State after the transition. 209 newTxState: TransactionState; 210 211 // Internal ID of the new state. Must not be used by the UI, 212 // only used for testing. 213 newStId: number; 214 215 // Short summary of the error for an error transition. 216 errorInfo?: ErrorInfoSummary; 217 } 218 219 .. ts:def:: ErrorInfoSummary 220 221 interface ErrorInfoSummary { 222 code: number; 223 hint?: string; 224 message?: string; 225 } 226 227 228 .. _wallet-notif-exchange-state-transition: 229 230 **exchange-state-transition** 231 232 Emitted when the state of an exchange entry changes. If 233 ``oldExchangeState`` is missing, the entry was newly created; if 234 ``newExchangeState`` is missing, the entry was deleted. 235 236 The payload is an `ExchangeStateTransitionNotification` object. 237 238 .. ts:def:: ExchangeStateTransitionNotification 239 240 interface ExchangeStateTransitionNotification { 241 type: NotificationType.ExchangeStateTransition; 242 243 // Identification of the exchange entry that this 244 // notification is about. 245 exchangeBaseUrl: string; 246 247 // A hint as to why the transition happened. 248 // Should not be relied upon by clients. 249 causeHint: string | undefined; 250 251 // If missing, the notification means that 252 // the exchange entry is newly created. 253 oldExchangeState?: ExchangeEntryState; 254 255 // New state of the exchange. 256 // If missing, the exchange entry got deleted. 257 newExchangeState?: ExchangeEntryState; 258 259 // Summary of the error that occurred when trying to update 260 // the exchange entry, if applicable. 261 errorInfo?: ErrorInfoSummary; 262 } 263 264 .. ts:def:: ExchangeEntryState 265 266 interface ExchangeEntryState { 267 // Status of the exchange's terms of service. 268 tosStatus: ExchangeTosStatus; 269 270 // Lifecycle status of the exchange entry. 271 exchangeEntryStatus: ExchangeEntryStatus; 272 273 // Status of the last update of the exchange's key material. 274 exchangeUpdateStatus: ExchangeUpdateStatus; 275 } 276 277 278 .. _wallet-notif-idle: 279 280 **idle** 281 282 Emitted when wallet-core becomes idle, that is when no background task 283 that keeps the wallet active is running anymore. Mainly useful for test 284 harnesses that wait for the wallet to quiesce. 285 286 The payload is an `IdleNotification` object. 287 288 .. ts:def:: IdleNotification 289 290 interface IdleNotification { 291 type: NotificationType.Idle; 292 } 293 294 295 .. _wallet-notif-task-observability-event: 296 297 **task-observability-event** 298 299 Reports a single observability event of a background task. These 300 notifications are only emitted when the testing option 301 ``emitObservabilityEvents`` is enabled in the wallet run configuration. 302 303 The payload is a `TaskProgressNotification` object. 304 305 .. ts:def:: TaskProgressNotification 306 307 interface TaskProgressNotification { 308 type: NotificationType.TaskObservabilityEvent; 309 taskId: string; 310 event: ObservabilityEvent; 311 } 312 313 .. ts:def:: ObservabilityEvent 314 315 type ObservabilityEvent = 316 | { 317 id: string; 318 when: AbsoluteTime; 319 type: ObservabilityEventType.HttpFetchStart; 320 url: string; 321 longPolling: boolean; 322 } 323 | { 324 id: string; 325 when: AbsoluteTime; 326 type: ObservabilityEventType.HttpFetchFinishSuccess; 327 url: string; 328 status: number; 329 durationMs: number; 330 longPolling: boolean; 331 } 332 | { 333 id: string; 334 when: AbsoluteTime; 335 type: ObservabilityEventType.HttpFetchFinishError; 336 url: string; 337 error: TalerErrorDetail; 338 durationMs: number; 339 longPolling: boolean; 340 } 341 | { 342 type: ObservabilityEventType.DbQueryStart; 343 name: string; 344 location: string; 345 } 346 | { 347 type: ObservabilityEventType.DbQueryFinishSuccess; 348 name: string; 349 location: string; 350 durationMs: number; 351 } 352 | { 353 type: ObservabilityEventType.DbQueryFinishError; 354 name: string; 355 location: string; 356 error: TalerErrorDetail; 357 durationMs: number; 358 } 359 | { 360 type: ObservabilityEventType.RequestStart; 361 name: string; 362 } 363 | { 364 type: ObservabilityEventType.RequestFinishSuccess; 365 operation: string; 366 requestId: string; 367 durationMs: number; 368 } 369 | { 370 type: ObservabilityEventType.RequestFinishError; 371 operation: string; 372 requestId: string; 373 durationMs: number; 374 } 375 | { 376 type: ObservabilityEventType.TaskStart; 377 taskId: string; 378 } 379 | { 380 type: ObservabilityEventType.TaskStop; 381 taskId: string; 382 } 383 | { 384 type: ObservabilityEventType.TaskReset; 385 taskId: string; 386 } 387 | { 388 type: ObservabilityEventType.DeclareTaskDependency; 389 taskId: string; 390 } 391 | { 392 type: ObservabilityEventType.CryptoStart; 393 operation: string; 394 } 395 | { 396 type: ObservabilityEventType.CryptoFinishSuccess; 397 operation: string; 398 durationMs: number; 399 } 400 | { 401 type: ObservabilityEventType.CryptoFinishError; 402 operation: string; 403 durationMs: number; 404 } 405 | { 406 type: ObservabilityEventType.ShepherdTaskResult; 407 taskId: string; 408 resultType: string; 409 durationMs: number; 410 } 411 | { 412 type: ObservabilityEventType.Message; 413 contents: string; 414 } 415 | { 416 type: ObservabilityEventType.DeclareConcernsTransaction; 417 transactionId: TransactionIdStr; 418 }; 419 420 .. ts:def:: ObservabilityEventType 421 422 enum ObservabilityEventType { 423 HttpFetchStart = "http-fetch-start", 424 HttpFetchFinishError = "http-fetch-finish-error", 425 HttpFetchFinishSuccess = "http-fetch-finish-success", 426 DbQueryStart = "db-query-start", 427 DbQueryFinishSuccess = "db-query-finish-success", 428 DbQueryFinishError = "db-query-finish-error", 429 RequestStart = "request-start", 430 RequestFinishSuccess = "request-finish-success", 431 RequestFinishError = "request-finish-error", 432 TaskStart = "task-start", 433 TaskStop = "task-stop", 434 TaskReset = "task-reset", 435 ShepherdTaskResult = "shepherd-task-result", 436 DeclareTaskDependency = "declare-task-dependency", 437 CryptoStart = "crypto-start", 438 CryptoFinishSuccess = "crypto-finish-success", 439 CryptoFinishError = "crypto-finish-error", 440 Message = "message", 441 442 // Declares that an observability event is relevant to a particular 443 // transaction. If emitted from a request/task, all past/future 444 // events for that request/task should be shown for the 445 // transaction as well. 446 DeclareConcernsTransaction = "declare-concerns-transaction", 447 } 448 449 450 .. _wallet-notif-request-observability-event: 451 452 **request-observability-event** 453 454 Reports a single observability event of an API request; ``requestId`` 455 matches the ``id`` of the corresponding request envelope. These 456 notifications are only emitted when the testing option 457 ``emitObservabilityEvents`` is enabled in the wallet run configuration. 458 459 The payload is a `RequestObservabilityEventNotification` object. 460 461 .. ts:def:: RequestObservabilityEventNotification 462 463 interface RequestObservabilityEventNotification { 464 type: NotificationType.RequestObservabilityEvent; 465 requestId: string; 466 operation: string; 467 event: ObservabilityEvent; 468 } 469 470 471 .. _wallet-notif-request-progress-error: 472 473 **request-progress-error** 474 475 Emitted when an attempt of a long-running request with a ``progressToken`` 476 failed and will be retried automatically after ``nextRetryDelay``. The 477 client can cancel the request with 478 :ts:op:`cancelProgressToken` or trigger an 479 immediate retry with 480 :ts:op:`retryProgressTokenNow`. 481 482 The payload is a `RequestProgressNotification` object. 483 484 .. ts:def:: RequestProgressNotification 485 486 interface RequestProgressNotification { 487 type: NotificationType.RequestProgressError; 488 progressToken: string; 489 operation: string; 490 error: TalerErrorDetail; 491 nextRetryDelay: TalerProtocolDuration; 492 retryCounter: number; 493 } 494 495 496 .. _wallet-notif-request-progress-phase: 497 498 **request-progress-phase** 499 500 Emitted when a long-running request with a ``progressToken`` takes longer 501 than expected: ``delayed`` after about five seconds, ``stalled`` after 502 about ten seconds (at which point the user may want to retry), and 503 ``done`` when the request finished and no further progress notifications 504 will be sent. 505 506 The payload is a `RequestProgressPhaseNotification` object. 507 508 .. ts:def:: RequestProgressPhaseNotification 509 510 interface RequestProgressPhaseNotification { 511 type: NotificationType.RequestProgressPhase; 512 progressToken: string; 513 operation: string; 514 515 // delayed: request is taking longer than expected (usually 516 // after 5s) 517 // stalled: request is taking *very* long, user can retry 518 // (usually after 10s) 519 // done: no further progress notifications will be sent 520 phase: "delayed" | "stalled" | "done"; 521 } 522 523 524 .. _wallet-notif-database-maintenance-progress: 525 526 **database-maintenance-progress** 527 528 Emitted while startup fixups or a database migration hold the database 529 gate, reporting progress of the maintenance operation. Intermediate 530 updates may be coalesced by wallet-core, but the first and the terminal 531 (``complete`` or ``failed``) events are always delivered. 532 533 The payload is a `DatabaseMaintenanceProgressNotification` object. 534 535 .. ts:def:: DatabaseMaintenanceProgressNotification 536 537 interface DatabaseMaintenanceProgressNotification { 538 type: NotificationType.DatabaseMaintenanceProgress; 539 operation: 540 | "indexeddb-fixup" 541 | "indexeddb-to-native-migration" 542 | "cross-backend-import"; 543 544 // Token of the API request that initiated this operation, 545 // when available. 546 progressToken?: string; 547 548 phase: "fixup" | "copy" | "verify" | "complete" | "failed"; 549 550 // Current fixup or backend-neutral store, when one is active. 551 step?: string; 552 553 completedSteps: number; 554 totalSteps: number; 555 556 // Records completed in the current phase across the 557 // whole migration. 558 processedRecords?: number; 559 560 // Total records in the whole migration, known before 561 // copying starts. 562 totalRecords?: number; 563 564 // Rough overall migration completion, from 0 through 100. 565 completionPercent?: number; 566 567 // Why the maintenance operation failed. Present when 568 // phase is "failed". 569 error?: TalerErrorDetail; 570 }