Compare commits

...
3 Commits
Author SHA1 Message Date
Chris Troutner 3761d139f1 Merge pull request #6 from Permissionless-Software-Foundation/ct-unstable
fix(endpoints): Tested endpoints, fixed some bugs and docs
2021-07-16 15:27:55 -07:00
Chris Troutner 006727cc9d fix(bch-js): Updating bch-js to v4.20.2 2021-07-16 15:26:21 -07:00
Chris Troutner bcd2a54aa7 fix(endpoints): Tested endpoints, fixed some bugs and docs 2021-07-16 15:19:03 -07:00
4 changed files with 369 additions and 488 deletions
+362 -481
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -23,7 +23,7 @@
},
"repository": "Permissionless-Software-Foundation/ipfs-bch-wallet-service",
"dependencies": {
"@psf/bch-js": "^4.20.1",
"@psf/bch-js": "^4.20.2",
"axios": "^0.21.1",
"bcryptjs": "^2.4.3",
"glob": "^7.1.6",
+3 -3
View File
@@ -244,16 +244,16 @@ class BCHRPC {
* @apiDescription Get data about a specific transaction.
*
* @apiExample Example usage:
* {"jsonrpc":"2.0","id":"555","method":"bch","params":{ "endpoint": "transaction", "hex": "0e3e2357e806b6cdb1f70b54c3a3a17b6714ee1f0e68bebb44a74b1efd512098"}}
* {"jsonrpc":"2.0","id":"555","method":"bch","params":{ "endpoint": "transaction", "txid": "01517ff1587fa5ffe6f5eb91c99cf3f2d22330cd7ee847e928ce90ca95bf781b"}}
*
*/
async transaction (rpcData) {
try {
// console.log('createUser rpcData: ', rpcData)
// console.log('transaction rpcData: ', rpcData)
const txid = rpcData.payload.params.txid
const data = await this.bchjs.Transaction.get(txid)
const data = await this.bchjs.Transaction.get(txid.toString())
// console.log(`data: ${JSON.stringify(data, null, 2)}`)
const retObj = data
+3 -3
View File
@@ -105,8 +105,8 @@ class BCHRESTController {
}
/**
* @api {post} /bch/utxos Balance
* @apiName Utxos
* @api {post} /bch/utxos UTXOs
* @apiName UTXOs
* @apiGroup REST BCH
* @apiDescription This endpoint returns UTXOs held at an address, hydrated
* with token information.
@@ -189,7 +189,7 @@ class BCHRESTController {
* @apiDescription Get data about a specific transaction.
*
* @apiExample Example usage:
* curl -H "Content-Type: application/json" -X POST -d '{ "txid": "0e3e2357e806b6cdb1f70b54c3a3a17b6714ee1f0e68bebb44a74b1efd512098" }' localhost:5001/bch/transaction
* curl -H "Content-Type: application/json" -X POST -d '{ "txid": "01517ff1587fa5ffe6f5eb91c99cf3f2d22330cd7ee847e928ce90ca95bf781b" }' localhost:5001/bch/transaction
*
* @apiSuccessExample {json} Success-Response:
* HTTP/1.1 200 OK