From f484bc36a886cffc5479365719cae87b15ab6846 Mon Sep 17 00:00:00 2001 From: Arthur Britto Date: Sat, 10 Nov 2012 16:56:30 -0800 Subject: [PATCH] JS: Stubs for monitoring accounts. --- src/js/account.js | 25 ++++++++++++++++++++ src/js/network.js | 58 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 83 insertions(+) create mode 100644 src/js/account.js create mode 100644 src/js/network.js diff --git a/src/js/account.js b/src/js/account.js new file mode 100644 index 00000000..4c84eb6c --- /dev/null +++ b/src/js/account.js @@ -0,0 +1,25 @@ +// Routines for working with an account. +// +// Events: +// wallet_clean : True, iff the wallet has been updated. +// wallet_dirty : True, iff the wallet needs to be updated. +// balance : The current stamp balance. +// balance_proposed +// + +// var network = require("./network.js"); + +var EventEmitter = require('events').EventEmitter; +var Amount = require('./amount.js').Amount; +var UInt160 = require('./amount.js').UInt160; + +var Account = function (network, account) { + this._network = network; + this._account = UInt160.json_rewrite(account); + + return this; +}; + +exports.Account = Account; + +// vim:sw=2:sts=2:ts=8 diff --git a/src/js/network.js b/src/js/network.js new file mode 100644 index 00000000..a98cee30 --- /dev/null +++ b/src/js/network.js @@ -0,0 +1,58 @@ +// +// Access to the Ripple network via multiple untrusted servers or a single trusted server. +// +// Overview: +// Network configuration. +// Can leverage local storage to remember network configuration +// Aquires the network +// events: +// online +// offline +// + +var remote = require("./remote.js"); + +var opts_default = { + DEFAULT_VALIDATORS_SITE : "redstem.com", + + ips = { + } +}; + +// +// opts : { +// cache : undefined || { +// get : function () { return cached_value; }, +// set : function (value) { cached_value = value; }, +// }, +// +// // Where to get validators.txt if needed. +// DEFAULT_VALIDATORS_SITE : _domain_, +// +// // Validator.txt to use. +// validators : _txt_, +// } +// + +var Network = function (opts) { + +}; + +// Set the network configuration. +Network.protocol.configure = function () { + +}; + +// Target state: connectted +Network.protocol.start = function () { + +}; + +// Target state: disconnectted +Network.protocol.stop = function () { + +}; + +exports.Network = Network; + +// vim:sw=2:sts=2:ts=8