From f37ef1c2d53b90d8daea072eccf3e08db14b1cae Mon Sep 17 00:00:00 2001 From: "nicolas.dorier" Date: Thu, 28 Nov 2024 14:34:05 +0900 Subject: [PATCH] Improve doc for groups --- NBXplorer/wwwroot/api.json | 152 +++++++++++++++++++++++++++++++++++-- 1 file changed, 145 insertions(+), 7 deletions(-) diff --git a/NBXplorer/wwwroot/api.json b/NBXplorer/wwwroot/api.json index d18b523b..8a7e3593 100644 --- a/NBXplorer/wwwroot/api.json +++ b/NBXplorer/wwwroot/api.json @@ -1772,12 +1772,12 @@ } } }, - "/v1/cryptos/{cryptoCode}/derivations/{derivationScheme}/transactions": { + "/v1/cryptos/{cryptoCode}/groups/{groupId}/transactions": { "get": { - "summary": "Get transactions for a derivation scheme", - "description": "Retrieves a list of transactions associated with the specified derivation scheme (wallet).", + "summary": "Get transactions for a group", + "description": "Retrieves a list of transactions associated with the specified group.", "tags": [ - "Derivations", + "Groups", "Transactions" ], "parameters": [ @@ -1785,7 +1785,7 @@ "$ref": "#/components/parameters/CryptoCode" }, { - "$ref": "#/components/parameters/DerivationScheme" + "$ref": "#/components/parameters/GroupId" }, { "name": "includeTransaction", @@ -1816,16 +1816,154 @@ }, "example": 1732769717, "description": "Indicates the latest date up to which transactions should be retrieved, (default: null, unix time" + } + ], + "responses": { + "200": { + "description": "Transactions retrieved successfully.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TransactionResponse" + } + }, + "examples": { + "withoutTransaction": { + "summary": "Without raw transaction data", + "value": [ + { + "blockHash": "0000000000000000000...", + "confirmations": 3, + "height": 600000, + "transactionId": "abcd1234...", + "outputs": [ + { + "scriptPubKey": "76a91489abcdefabbaabbaabbaabbaabbaabbaabbaabba88ac", + "index": 0, + "value": 5000000000, + "keyPath": "0/0" + } + ], + "inputs": [ + { + "inputIndex": 0, + "transactionId": "efgh5678...", + "index": 1, + "scriptPubKey": "76a91489abcdefabbaabbaabbaabbaabbaabbaabbaabba88ac", + "value": 5000000000, + "address": "1BoatSLRHtKNngkdXEeobR76b53LETtpyT" + } + ], + "timestamp": 1638307200, + "balanceChange": 0, + "replaceable": false, + "replacing": null, + "replacedBy": null + } + ] + }, + "withTransaction": { + "summary": "With raw transaction data", + "value": [ + { + "blockHash": "0000000000000000000...", + "confirmations": 3, + "height": 600000, + "transactionId": "abcd1234...", + "transaction": "0200000001abcd1234...", + "outputs": [ + { + "scriptPubKey": "76a91489abcdefabbaabbaabbaabbaabbaabbaabbaabba88ac", + "index": 0, + "value": 5000000000, + "keyPath": "0/0" + } + ], + "inputs": [ + { + "inputIndex": 0, + "transactionId": "efgh5678...", + "index": 1, + "scriptPubKey": "76a91489abcdefabbaabbaabbaabbaabbaabbaabbaabba88ac", + "value": 5000000000, + "address": "1BoatSLRHtKNngkdXEeobR76b53LETtpyT" + } + ], + "timestamp": 1638307200, + "balanceChange": 0, + "replaceable": false, + "replacing": null, + "replacedBy": null + } + ] + } + } + } + } + }, + "404": { + "description": "Derivation scheme not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "error": "Derivation scheme not found.", + "code": 404 + } + } + } + } + } + } + }, + "/v1/cryptos/{cryptoCode}/derivations/{derivationScheme}/transactions": { + "get": { + "summary": "Get transactions for a derivation scheme", + "description": "Retrieves a list of transactions associated with the specified derivation scheme (wallet).", + "tags": [ + "Derivations", + "Transactions" + ], + "parameters": [ + { + "$ref": "#/components/parameters/CryptoCode" + }, + { + "$ref": "#/components/parameters/DerivationScheme" }, { - "name": "accountedOnly", + "name": "includeTransaction", "in": "query", "required": false, "schema": { "type": "boolean", "default": false }, - "description": "If true, only returns transactions that affect the wallet's balance." + "description": "Optional. If set to `true`, each transaction in the response will include the raw transaction data in hexadecimal format (`transaction` field). Default is `false`." + }, + { + "name": "from", + "in": "query", + "required": false, + "schema": { + "type": "integer" + }, + "example": 1732769702, + "description": "Indicates the earliest date from which transactions should be retrieved, (default: null, unix time)" + }, + { + "name": "to", + "in": "query", + "required": false, + "schema": { + "type": "integer" + }, + "example": 1732769717, + "description": "Indicates the latest date up to which transactions should be retrieved, (default: null, unix time" } ], "responses": {