fix(endpoints): Tested endpoints, fixed some bugs and docs

This commit is contained in:
Chris Troutner
2021-07-16 15:19:03 -07:00
parent 70155c7b90
commit bcd2a54aa7
4 changed files with 566 additions and 3225 deletions
+559 -3218
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": "../bch-js",
"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