summaryrefslogtreecommitdiff
path: root/taler-wallet.rst
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2020-07-31 20:43:58 +0530
committerFlorian Dold <florian.dold@gmail.com>2020-07-31 20:43:58 +0530
commit454cfe38028263d68058f694ca7bf1b2cffbc290 (patch)
tree87f1abfe4c7cf7d93701d1ca0a0967c51de33c37 /taler-wallet.rst
parent0a173756d9452c2088d914572283115842613242 (diff)
downloaddocs-454cfe38028263d68058f694ca7bf1b2cffbc290.tar.gz
docs-454cfe38028263d68058f694ca7bf1b2cffbc290.tar.bz2
docs-454cfe38028263d68058f694ca7bf1b2cffbc290.zip
wallet api
Diffstat (limited to 'taler-wallet.rst')
-rw-r--r--taler-wallet.rst63
1 files changed, 63 insertions, 0 deletions
diff --git a/taler-wallet.rst b/taler-wallet.rst
index 78daad1..2ac95df 100644
--- a/taler-wallet.rst
+++ b/taler-wallet.rst
@@ -86,6 +86,69 @@ APIs and Data Formats
These APIs are still a work in progress and *not* final.
+Envelope Format
+---------------
+
+All API responses and notifications are returned in the
+following envelope:
+
+.. ts:def:: WalletCoreResponseEnvelope
+
+ type WalletCoreResponseEnvelope =
+ | WalletCoreSuccess
+ | WalletCoreError
+ | WalletCoreNotification
+
+.. ts:def:: WalletCoreSuccess
+
+ export interface WalletCoreSuccess {
+ type: "response";
+ operation: string,
+ // ID to correlate success response to request
+ id: string;
+ // Result type depends on operation
+ result: unknown;
+ }
+
+.. ts:def:: WalletCoreError
+
+ export interface WalletCoreError {
+ type: "error";
+ operation: string,
+ // ID to correlate success response to request
+ id: string;
+ error: WalletCoreErrorInfo;
+ }
+
+.. ts:def:: WalletCoreNotification
+
+ export interface WalletCoreSuccess {
+ type: "notification";
+
+ // actual type is WalletNotification,
+ // to be documented here
+ payload: any;
+ }
+
+.. ts:def:: WalletCoreErrorInfo
+
+ export interface WalletCoreErrorInfo {
+ // Numeric error code defined defined in the
+ // GANA gnu-taler-error-codes registry.
+ talerErrorCode: number;
+
+ // English description of the error code.
+ talerErrorHint: string;
+
+ // English diagnostic message that can give details
+ // for the instance of the error.
+ message: string;
+
+ // Error details, type depends
+ // on talerErrorCode
+ details: unknown;
+ }
+
Balances
--------