Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:bigearth/rest.bitbox.earth into …
Browse files Browse the repository at this point in the history
…develop
  • Loading branch information
cloneearth committed May 21, 2018
2 parents cd93f43 + d467c01 commit 3b3b082
Show file tree
Hide file tree
Showing 3 changed files with 201 additions and 31 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

206 changes: 196 additions & 10 deletions public/bitbox-rest-v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -1363,7 +1363,10 @@
],
"responses": {
"200": {
"description": "successful operation"
"description": "successful operation",
"schema": {
"$ref": "#/definitions/transactionDetails"
}
},
"400": {
"description": "Invalid Command"
Expand Down Expand Up @@ -1400,7 +1403,10 @@
],
"responses": {
"200": {
"description": "successful operation"
"description": "successful operation",
"schema": {
"$ref": "#/definitions/CreateMultisig"
}
},
"400": {
"description": "Invalid Command"
Expand Down Expand Up @@ -1430,7 +1436,10 @@
],
"responses": {
"200": {
"description": "successful operation"
"description": "successful operation",
"schema": {
"$ref": "#/definitions/ValidateAddress"
}
},
"400": {
"description": "Invalid Command"
Expand Down Expand Up @@ -1836,24 +1845,201 @@
},
}
},
"RawMempool": {
"RawMempool": {
"type": "object",
"properties": {
"size": {
"properties": {
"size": {
"type": "number"
},
"bytes": {
"bytes": {
"type": "number"
},
"usage": {
"usage": {
"type": "number"
},
"maxmempool": {
"maxmempool": {
"type": "number"
},
"mempoolminfee": {
"mempoolminfee": {
"type": "number"
}
}
},
"transactionDetails": {
"type": "object",
"properties": {
"txid": {
"type": "string"
},
"version": {
"type": "number"
},
"locktime": {
"type": "number"
},
"vin": {
"type": "array",
"items": {
"type": "object",
"properties": {
"txid": {
"type": "string"
},
"vout": {
"type": "number"
},
"sequence": {
"type": "number"
},
"n": {
"type": "number"
},
"scriptSig": {
"type": "object",
"properties": {
"hex": {
"type": "string"
},
"asm": {
"type": "string"
},
"value": {
"type": "number"
},
"legacyAddress": {
"type": "string"
},
"cashAddress": {
"type": "string"
}
}
}
}
}
},
"vout": {
"type": "array",
"items": {
"objects": {
"type": "object",
"properties": {
"value": {
"type": "number"
},
"n": {
"type": "number"
},
"scriptPubkey": {
"type": "object",
"properties": {
"hex": {
"type": "string"
},
"asm": {
"type": "string"
},
"addresses": {
"type": "array",
"items": {
"address": {
"type": "string"
}
}
},
"type": {
"type": "string"
}
}
},
"spentTxId": {
"type": "string"
},
"spentIndex": {
"type": "number"
},
"spentHeight": {
"type": "number"
}
}
},
"type": "object",
"properties": {
"value": {
"type": "number"
},
"n": {
"type": "number"
},
"scriptPubkey": {
"type": "object",
"properties": {
"hex": {
"type": "string"
},
"asm": {
"type": "string"
}
}
},
"spentTxId": {
"type": "string"
},
"spentIndex": {
"type": "number"
},
"spentHeight": {
"type": "number"
}
}
}
},
"blockhash": {
"type": "string"
},
"blockheight": {
"type": "number"
},
"confirmations": {
"type": "number"
},
"time": {
"type": "blocktime"
},
"valueOut": {
"type": "number"
},
"size": {
"type": "number"
},
"valueIn": {
"type": "number"
},
"fees": {
"type": "number"
}
}
},
"ValidateAddress": {
"type": "object",
"properties": {
"isvalid": {
"type": "boolean"
},
"address": {
"type": "string"
},
"scriptPubKey": {
"type": "string"
},
"ismine": {
"type": "boolean"
},
"iswatchonly": {
"type": "boolean"
},
"isscript": {
"type": "boolean"
}
}
}
}
Expand Down
24 changes: 4 additions & 20 deletions routes/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,23 @@ router.get('/', function(req, res, next) {
router.get('/estimateSmartFee/:nblocks', function(req, res, next) {
BITBOX.Util.estimateSmartFee(parseInt(req.params.nblocks))
.then((result) => {
res.json({ result: result });
res.json(result);
}, (err) => { console.log(err);
});
});

router.get('/estimateSmartPriority/:nblocks', function(req, res, next) {
BITBOX.Util.estimateSmartPriority(parseInt(req.params.nblocks))
.then((result) => {
res.json({ result: result });
res.json(result);
}, (err) => { console.log(err);
});
});

router.get('/createMultisig/:nrequired/:keys', function(req, res, next) {
BITBOX.Util.createMultisig(parseInt(req.params.nrequired), req.params.keys)
.then((result) => {
res.json({ result: result });
res.json(result);
}, (err) => { console.log(err);
});
});
Expand All @@ -54,26 +54,10 @@ router.get('/estimatePriority/:nblocks', function(req, res, next) {
});
});

router.get('/signMessageWithPrivKey/:privkey/:message', function(req, res, next) {
BITBOX.Util.signMessageWithPrivKey(req.params.privkey, req.params.message)
.then((result) => {
res.json(result);
}, (err) => { console.log(err);
});
});

router.get('/validateAddress/:address', function(req, res, next) {
BITBOX.Util.validateAddress(req.params.address)
.then((result) => {
res.json({ result: result });
}, (err) => { console.log(err);
});
});

router.get('/verifyMessage/:address/:signature/:message', function(req, res, next) {
BITBOX.Util.verifyMessage(req.params.address, req.params.signature, req.params.message)
.then((result) => {
res.json({ result: result });
res.json(result);
}, (err) => { console.log(err);
});
});
Expand Down

0 comments on commit 3b3b082

Please sign in to comment.