mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-27 15:45:48 +00:00
JS: Stubs for monitoring accounts.
This commit is contained in:
committed by
Stefan Thomas
parent
7d348d9e90
commit
f484bc36a8
25
src/js/account.js
Normal file
25
src/js/account.js
Normal file
@@ -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
|
||||||
58
src/js/network.js
Normal file
58
src/js/network.js
Normal file
@@ -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
|
||||||
Reference in New Issue
Block a user