mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-19 19:55:51 +00:00
@@ -47,9 +47,9 @@
|
||||
"scripts": {
|
||||
"build": "gulp",
|
||||
"clean": "rm -rf dist/npm && rm -rf build/flow",
|
||||
"typecheck": "babel -i runtime --blacklist flow -d build/flow/ src/ && flow",
|
||||
"compile": "babel -i runtime -d dist/npm/ src/",
|
||||
"compile-with-source-maps": "babel -i runtime -s -t -d dist/npm/ src/",
|
||||
"typecheck": "babel --optional runtime --blacklist flow -d build/flow/ src/ && flow",
|
||||
"compile": "babel --optional runtime -d dist/npm/ src/ && cp -r src/api/common/schemas/ dist/npm/api/common/schemas/",
|
||||
"compile-with-source-maps": "babel --optional runtime -s -t -d dist/npm/ src/",
|
||||
"prepublish": "npm run clean && npm run compile",
|
||||
"test": "istanbul test _mocha",
|
||||
"coveralls": "cat ./coverage/lcov.info | coveralls",
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
var fs = require('fs');
|
||||
var Amount = require('../dist/npm').Amount;
|
||||
var Ledger = require('../dist/npm/ledger').Ledger;
|
||||
var Ledger = require('../dist/npm').Ledger;
|
||||
|
||||
function parse_options(from, flags) {
|
||||
var argv = from.slice(),
|
||||
|
||||
@@ -24,8 +24,12 @@ function loadSchema(filepath) {
|
||||
}
|
||||
}
|
||||
|
||||
function endsWith(str, suffix) {
|
||||
return str.indexOf(suffix, str.length - suffix.length) !== -1;
|
||||
}
|
||||
|
||||
function loadSchemas(dir) {
|
||||
const filenames = fs.readdirSync(dir).filter(name => name.endsWith('.json'));
|
||||
const filenames = fs.readdirSync(dir).filter(name => endsWith(name, '.json'));
|
||||
const schemas = filenames.map(name => loadSchema(path.join(dir, name)));
|
||||
return _.indexBy(schemas, 'title');
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ function getFeeDrops(remote) {
|
||||
return remote.feeTx(feeUnits).to_text();
|
||||
}
|
||||
|
||||
/*:: type Callback = (err: typeof Error, data: {tx_json: any}) => void */
|
||||
/*:: type Callback = (err: ?(typeof Error), data: {tx_json: any}) => void */
|
||||
function createTxJSON(transaction: any, remote: any,
|
||||
instructions: any, callback: Callback): void {
|
||||
common.validate.instructions(instructions);
|
||||
|
||||
Reference in New Issue
Block a user