mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-24 06:05:51 +00:00
34 lines
706 B
JavaScript
34 lines
706 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
|
|
function connect(callback) {
|
|
this.remote.connect(callback);
|
|
}
|
|
|
|
function isConnected() {
|
|
return common.server.isConnected(this.remote);
|
|
}
|
|
|
|
function getServerStatus(callback) {
|
|
common.server.getStatus(this.remote, function(error, status) {
|
|
if (error) {
|
|
callback(new common.errors.RippledNetworkError(error.message));
|
|
} else {
|
|
callback(null, status);
|
|
}
|
|
});
|
|
}
|
|
|
|
function getFee(callback) {
|
|
const fee = this.remote.createTransaction()._computeFee();
|
|
callback(null, {fee: common.dropsToXrp(fee)});
|
|
}
|
|
|
|
|
|
module.exports = {
|
|
connect: connect,
|
|
isConnected: isConnected,
|
|
getServerStatus: getServerStatus,
|
|
getFee: getFee
|
|
};
|