aboutsummaryrefslogtreecommitdiff
path: root/extension/background/wallet.js
diff options
context:
space:
mode:
Diffstat (limited to 'extension/background/wallet.js')
-rw-r--r--extension/background/wallet.js38
1 files changed, 35 insertions, 3 deletions
diff --git a/extension/background/wallet.js b/extension/background/wallet.js
index ec7b3fb40..c6fbb5780 100644
--- a/extension/background/wallet.js
+++ b/extension/background/wallet.js
@@ -1,8 +1,40 @@
-// Nothing here yet.
-// Eventually, the backend for the wallet will be implemented here.
-
'use strict';
//chrome.browserAction.setBadgeBackgroundColor({color: "#000"})
chrome.browserAction.setBadgeText({text: "42"})
chrome.browserAction.setTitle({title: "Taler: 42 EUR"})
+
+function test_emscripten ()
+{
+ var cur_time = TWRALLgetCurrentTime();
+ var fancy_time = TWRgetFancyTime(cur_time);
+ console.log('current time: '+ fancy_time);
+}
+
+test_emscripten();
+
+DB.open(function () {
+ console.log ("DB: ready");
+});
+
+chrome.runtime.onMessage.addListener(
+ function (req, sender, onresponse) {
+ console.log("Message: " + req.type +
+ (sender.tab
+ ? " from a content script: "+ sender.tab.url
+ : " from the extension"));
+ switch (req.type)
+ {
+ case "WALLET_GET":
+ DB.wallet_get (onresponse);
+ break;
+
+ case "TRANSACTION_LIST":
+ DB.transaction_list (onresponse);
+ break;
+
+ case "RESERVE_LIST":
+ DB.reserve_list (onresponse);
+ break;
+ }
+ });