gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [taler-web-common] branch master updated: auditor calls


From: gnunet
Subject: [GNUnet-SVN] [taler-web-common] branch master updated: auditor calls
Date: Thu, 16 Mar 2017 18:23:37 +0100

This is an automated email from the git hooks/post-receive script.

dold pushed a commit to branch master
in repository web-common.

The following commit(s) were added to refs/heads/master by this push:
     new d7e0135  auditor calls
d7e0135 is described below

commit d7e013594d15388b1a7342a44a0e9c8d4ecca82d
Author: Florian Dold <address@hidden>
AuthorDate: Thu Mar 16 18:23:35 2017 +0100

    auditor calls
---
 taler-wallet-lib.js | 40 ++++++++++++++++++++++++++++++++++++++++
 taler-wallet-lib.ts | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++
 tsconfig.json       |  3 ++-
 3 files changed, 93 insertions(+), 1 deletion(-)

diff --git a/taler-wallet-lib.js b/taler-wallet-lib.js
index b7d1262..b160918 100644
--- a/taler-wallet-lib.js
+++ b/taler-wallet-lib.js
@@ -226,6 +226,46 @@ var taler;
         internalPay(p);
     }
     taler.pay = pay;
+    function internalAddAuditor(d) {
+        // either the callback gets called,
+        // or the wallet will redirect the browser
+        callWallet("taler-add-auditor", d);
+    }
+    taler.internalAddAuditor = internalAddAuditor;
+    function addAuditor(d) {
+        if (!installed) {
+            logVerbose && console.log("delaying call to 'addAuditor' until GNU 
Taler wallet is present");
+            taler.onPresent(function () {
+                addAuditor(d);
+            });
+            return;
+        }
+        internalAddAuditor(d);
+    }
+    taler.addAuditor = addAuditor;
+    function internalCheckAuditor(url) {
+        return new Promise(function (resolve, reject) {
+            callWallet("taler-check-auditor", url, function (x) { return 
resolve(x); });
+        });
+    }
+    taler.internalCheckAuditor = internalCheckAuditor;
+    /**
+     * Check if an auditor is already added to the wallet.
+     *
+     * Same-origin restrictions apply.
+     */
+    function checkAuditor(url) {
+        if (!installed) {
+            logVerbose && console.log("delaying call to 'checkAuditor' until 
GNU Taler wallet is present");
+            return new Promise(function (resolve, reject) {
+                taler.onPresent(function () {
+                    resolve(checkAuditor(url));
+                });
+            });
+        }
+        return internalCheckAuditor(url);
+    }
+    taler.checkAuditor = checkAuditor;
     function initTaler() {
         function handleUninstall() {
             installed = false;
diff --git a/taler-wallet-lib.ts b/taler-wallet-lib.ts
index 6fe3c28..aca5395 100644
--- a/taler-wallet-lib.ts
+++ b/taler-wallet-lib.ts
@@ -261,6 +261,57 @@ namespace taler {
     internalPay(p);
   }
 
+  export interface AuditorDetail {
+    currency: string;
+    url: string;
+    auditorPub: string;
+    expirationStamp: number;
+  }
+
+
+  export function internalAddAuditor(d: AuditorDetail) {
+    // either the callback gets called,
+    // or the wallet will redirect the browser
+    callWallet("taler-add-auditor", d);
+  }
+
+
+  export function addAuditor(d: AuditorDetail) {
+    if (!installed) {
+      logVerbose && console.log("delaying call to 'addAuditor' until GNU Taler 
wallet is present");
+      taler.onPresent(() => {
+        addAuditor(d);
+      });
+      return;
+    }
+    internalAddAuditor(d);
+  }
+
+
+  export function internalCheckAuditor(url: string): 
Promise<AuditorDetail|undefined> {
+    return new Promise<AuditorDetail|undefined>((resolve, reject) => {
+      callWallet("taler-check-auditor", url, (x: any) => resolve(x as 
AuditorDetail));
+    });
+  }
+
+
+  /**
+   * Check if an auditor is already added to the wallet.
+   *
+   * Same-origin restrictions apply.
+   */
+  export function checkAuditor(url: string): Promise<AuditorDetail|undefined> {
+    if (!installed) {
+      logVerbose && console.log("delaying call to 'checkAuditor' until GNU 
Taler wallet is present");
+      return new Promise<AuditorDetail|undefined>((resolve, reject) => {
+        taler.onPresent(() => {
+          resolve(checkAuditor(url));
+        });
+      });
+    }
+    return internalCheckAuditor(url);
+  }
+
 
   function initTaler() {
 
diff --git a/tsconfig.json b/tsconfig.json
index 30712d1..1a14563 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -6,7 +6,8 @@
     "noImplicitReturns": true,
     "noFallthroughCasesInSwitch": true,
     "strictNullChecks": true,
-    "noImplicitAny": true
+    "noImplicitAny": true,
+    "lib": ["ES6", "DOM"]
   },
   "files": [
     "taler-wallet-lib.ts",

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]