# Transaction

All transactions methods are below and detailed on their section.

## List transactions

> This endpoint lists transactions on the PIRI network based on the skip and limit parameters provided to it. The returned transactions are transactions confirmed by nodes.

```json
{"openapi":"3.0.3","info":{"title":"Pirichain API","version":"1.1.0"},"tags":[{"name":"Transaction","description":"All transactions methods are below and detailed on their section."}],"servers":[{"url":"https://core.pirichain.com","description":"Pirichain MainNet","variables":{}},{"url":"https://testnet.pirichain.com","description":"Pirichain TestNet","variables":{}},{"url":"https://{URL}","description":"You can only use https protocol for your custom environment.","variables":{"URL":{"default":"custom.network","description":"You can enter your custom endpoint which belong to Pirichain Network"}}},{"url":"http://{URL}","description":"Custom HTTP endpoint for development environment (not recommended for production).","variables":{"URL":{"default":"custom.network","description":"You can enter your custom endpoint which belong to Pirichain Network"}}}],"paths":{"/listTransactions":{"post":{"tags":["Transaction"],"summary":"List transactions","description":"This endpoint lists transactions on the PIRI network based on the skip and limit parameters provided to it. The returned transactions are transactions confirmed by nodes.","operationId":"listTransactions","requestBody":{"content":{"application/x-www-form-urlencoded":{"encoding":{},"schema":{"required":["skip","limit"],"type":"object","properties":{"skip":{"type":"number","default":0,"description":"Page count for skip according to limit value."},"limit":{"type":"number","default":10,"maximum":100,"description":"Record count for per page"}}}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json; charset=utf-8":{"schema":{"$ref":"#/components/schemas/listTransactions"}}}}},"deprecated":false}}},"components":{"schemas":{"listTransactions":{"title":"listTransactions","required":["docs","txCountTotal"],"type":"object","properties":{"docs":{"type":"array","items":{"$ref":"#/components/schemas/Doc"},"description":"Array of transaction documents"},"txCountTotal":{"type":"integer","format":"int32","description":"Total number of transactions"}}},"Doc":{"type":"object","properties":{"type":{"type":"integer","description":"Transaction type"},"isFromScenario":{"type":"boolean","description":"Indicates if transaction originated from a scenario"},"confirmed":{"type":"boolean","description":"Transaction confirmation status"},"confirmationCount":{"type":"integer","description":"Number of confirmations received"},"_id":{"type":"string","description":"Unique transaction identifier"},"transactionHash":{"type":"string","description":"Transaction hash"},"__v":{"type":"integer","description":"Version key"},"amount":{"type":"number","description":"Transaction amount"},"assetID":{"type":"integer","description":"Asset identifier (-1 for PIRI, positive for tokens)"},"blockHeight":{"type":"integer","description":"Block height where transaction was included"},"fee":{"type":"number","description":"Transaction fee"},"from":{"type":"string","description":"Sender address"},"pub":{"type":"string","description":"Public key"},"signature":{"type":"string","description":"Transaction signature"},"symbol":{"type":"string","description":"Asset symbol"},"timeStamp":{"type":"integer","description":"Transaction timestamp"},"to":{"type":"string","description":"Receiver address"},"validatorNodes":{"type":"array","items":{"$ref":"#/components/schemas/ValidatorNode"},"description":"Array of validator nodes that confirmed the transaction"}}},"ValidatorNode":{"title":"ValidatorNode","required":["_id","nodeName","message","dateTime","result"],"type":"object","properties":{"_id":{"type":"string"},"nodeName":{"type":"string"},"message":{"type":"string"},"dateTime":{"type":"string"},"result":{"type":"integer","format":"int32"}}}}}}
```

## List pool transactions

> This endpoint lists pending and unconfirmed transfers created in the PIRI network. The approval time for a transaction can vary depending on the approval times of the nodes. However, the time it takes for a transaction to be included in a block (once confirmed) is a maximum of 30 seconds.\
> \
> Another important point to note here is that if a transaction is confirmed but has been approved by an insufficient number of nodes for any reason, the maximum time that can pass for it to be reevaluated and approved by the nodes that did not confirm it is 6 hours. A transaction that is not confirmed within 6 hours will not undergo reconfirmation checks.\
> \
> \*\*Furthermore, in the PIRI network, if a transaction is not confirmed, it is not retained as an unconfirmed transaction in the system and is instantly disregarded.\*\*

```json
{"openapi":"3.0.3","info":{"title":"Pirichain API","version":"1.1.0"},"tags":[{"name":"Transaction","description":"All transactions methods are below and detailed on their section."}],"servers":[{"url":"https://core.pirichain.com","description":"Pirichain MainNet","variables":{}},{"url":"https://testnet.pirichain.com","description":"Pirichain TestNet","variables":{}},{"url":"https://{URL}","description":"You can only use https protocol for your custom environment.","variables":{"URL":{"default":"custom.network","description":"You can enter your custom endpoint which belong to Pirichain Network"}}},{"url":"http://{URL}","description":"Custom HTTP endpoint for development environment (not recommended for production).","variables":{"URL":{"default":"custom.network","description":"You can enter your custom endpoint which belong to Pirichain Network"}}}],"paths":{"/listPoolTransactions":{"post":{"tags":["Transaction"],"summary":"List pool transactions","description":"This endpoint lists pending and unconfirmed transfers created in the PIRI network. The approval time for a transaction can vary depending on the approval times of the nodes. However, the time it takes for a transaction to be included in a block (once confirmed) is a maximum of 30 seconds.\n\nAnother important point to note here is that if a transaction is confirmed but has been approved by an insufficient number of nodes for any reason, the maximum time that can pass for it to be reevaluated and approved by the nodes that did not confirm it is 6 hours. A transaction that is not confirmed within 6 hours will not undergo reconfirmation checks.\n\n**Furthermore, in the PIRI network, if a transaction is not confirmed, it is not retained as an unconfirmed transaction in the system and is instantly disregarded.**","operationId":"listPoolTransactions","responses":{"200":{"description":"OK","content":{"application/json; charset=utf-8":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/listPoolTransaction"}}}}}},"deprecated":false}}},"components":{"schemas":{"listPoolTransaction":{"title":"listPoolTransaction","required":["type","confirmed","confirmationCount","_id","validatorNodes","from","to","assetID","timeStamp","amount","transactionHash","fee","signature","pub","symbol","__v"],"type":"object","properties":{"type":{"type":"integer","format":"int32"},"confirmed":{"type":"boolean"},"confirmationCount":{"type":"integer","format":"int32"},"_id":{"type":"string"},"validatorNodes":{"type":"array","items":{"$ref":"#/components/schemas/ValidatorNode"},"description":"List of validator nodes that confirmed this transaction"},"from":{"type":"string"},"to":{"type":"string"},"assetID":{"type":"integer","format":"int32"},"timeStamp":{"type":"integer","format":"int64"},"amount":{"type":"integer","format":"int32"},"transactionHash":{"type":"string"},"fee":{"type":"number"},"signature":{"type":"string"},"pub":{"type":"string"},"symbol":{"type":"string"},"__v":{"type":"integer","format":"int32"}}},"ValidatorNode":{"title":"ValidatorNode","required":["_id","nodeName","message","dateTime","result"],"type":"object","properties":{"_id":{"type":"string"},"nodeName":{"type":"string"},"message":{"type":"string"},"dateTime":{"type":"string"},"result":{"type":"integer","format":"int32"}}}}}}
```

## List transactions by asset ID

> This endpoint returns the same result as the "listTransactions" endpoint, but specific to the specified asset type (PIRI or Token), based on the provided assetID parameter.

```json
{"openapi":"3.0.3","info":{"title":"Pirichain API","version":"1.1.0"},"tags":[{"name":"Transaction","description":"All transactions methods are below and detailed on their section."}],"servers":[{"url":"https://core.pirichain.com","description":"Pirichain MainNet","variables":{}},{"url":"https://testnet.pirichain.com","description":"Pirichain TestNet","variables":{}},{"url":"https://{URL}","description":"You can only use https protocol for your custom environment.","variables":{"URL":{"default":"custom.network","description":"You can enter your custom endpoint which belong to Pirichain Network"}}},{"url":"http://{URL}","description":"Custom HTTP endpoint for development environment (not recommended for production).","variables":{"URL":{"default":"custom.network","description":"You can enter your custom endpoint which belong to Pirichain Network"}}}],"paths":{"/listTransactionsByAssetID":{"post":{"tags":["Transaction"],"summary":"List transactions by asset ID","description":"This endpoint returns the same result as the \"listTransactions\" endpoint, but specific to the specified asset type (PIRI or Token), based on the provided assetID parameter.","operationId":"listTransactionsByAssetID","requestBody":{"content":{"application/x-www-form-urlencoded":{"encoding":{},"schema":{"required":["skip","limit","assetID"],"type":"object","properties":{"skip":{"type":"number","default":0,"description":"Page count for skip according to limit value."},"limit":{"type":"number","default":50,"maximum":100,"description":"Record count for per page"},"assetID":{"type":"string","description":"Asset ID"},"desc":{"type":"boolean","description":"Descending order","default":false}}}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json; charset=utf-8":{"schema":{"$ref":"#/components/schemas/listTransactionsByAssetID"}}}}},"deprecated":false}}},"components":{"schemas":{"listTransactionsByAssetID":{"title":"listTransactionsByAssetID","required":["doc","count"],"type":"object","properties":{"doc":{"type":"array","items":{"$ref":"#/components/schemas/Doc"},"description":"Array of transaction documents filtered by asset ID"},"count":{"type":"integer","format":"int32","description":"Total number of transactions matching the asset ID filter"}}},"Doc":{"type":"object","properties":{"type":{"type":"integer","description":"Transaction type"},"isFromScenario":{"type":"boolean","description":"Indicates if transaction originated from a scenario"},"confirmed":{"type":"boolean","description":"Transaction confirmation status"},"confirmationCount":{"type":"integer","description":"Number of confirmations received"},"_id":{"type":"string","description":"Unique transaction identifier"},"transactionHash":{"type":"string","description":"Transaction hash"},"__v":{"type":"integer","description":"Version key"},"amount":{"type":"number","description":"Transaction amount"},"assetID":{"type":"integer","description":"Asset identifier (-1 for PIRI, positive for tokens)"},"blockHeight":{"type":"integer","description":"Block height where transaction was included"},"fee":{"type":"number","description":"Transaction fee"},"from":{"type":"string","description":"Sender address"},"pub":{"type":"string","description":"Public key"},"signature":{"type":"string","description":"Transaction signature"},"symbol":{"type":"string","description":"Asset symbol"},"timeStamp":{"type":"integer","description":"Transaction timestamp"},"to":{"type":"string","description":"Receiver address"},"validatorNodes":{"type":"array","items":{"$ref":"#/components/schemas/ValidatorNode"},"description":"Array of validator nodes that confirmed the transaction"}}},"ValidatorNode":{"title":"ValidatorNode","required":["_id","nodeName","message","dateTime","result"],"type":"object","properties":{"_id":{"type":"string"},"nodeName":{"type":"string"},"message":{"type":"string"},"dateTime":{"type":"string"},"result":{"type":"integer","format":"int32"}}}}}}
```

## List transactions by address

> This endpoint returns the same result as the "listTransactions" endpoint, but only specific to the provided PIRI Address, based on the specified "address" parameter.

```json
{"openapi":"3.0.3","info":{"title":"Pirichain API","version":"1.1.0"},"tags":[{"name":"Transaction","description":"All transactions methods are below and detailed on their section."}],"servers":[{"url":"https://core.pirichain.com","description":"Pirichain MainNet","variables":{}},{"url":"https://testnet.pirichain.com","description":"Pirichain TestNet","variables":{}},{"url":"https://{URL}","description":"You can only use https protocol for your custom environment.","variables":{"URL":{"default":"custom.network","description":"You can enter your custom endpoint which belong to Pirichain Network"}}},{"url":"http://{URL}","description":"Custom HTTP endpoint for development environment (not recommended for production).","variables":{"URL":{"default":"custom.network","description":"You can enter your custom endpoint which belong to Pirichain Network"}}}],"paths":{"/listTransactionsByAddr":{"post":{"tags":["Transaction"],"summary":"List transactions by address","description":"This endpoint returns the same result as the \"listTransactions\" endpoint, but only specific to the provided PIRI Address, based on the specified \"address\" parameter.","operationId":"listTransactionsByAddr","requestBody":{"content":{"application/x-www-form-urlencoded":{"encoding":{},"schema":{"required":["skip","limit","address"],"type":"object","properties":{"skip":{"type":"number","default":0,"description":"Page count for skip according to limit value."},"limit":{"type":"number","default":50,"maximum":100,"description":"Record count for per page"},"address":{"type":"string","description":"PIRI Address"}}}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json; charset=utf-8":{"schema":{"$ref":"#/components/schemas/listTransactionsByAddr"}}}}},"deprecated":false}}},"components":{"schemas":{"listTransactionsByAddr":{"title":"listTransactionsByAddr","required":["doc","count"],"type":"object","properties":{"doc":{"type":"array","items":{"type":"object","properties":{"_id":{"type":"string"},"transactionHash":{"type":"string"},"amount":{"type":"number"},"assetID":{"type":"integer"},"blockHeight":{"type":"integer"},"confirmationCount":{"type":"integer"},"confirmed":{"type":"boolean"},"fee":{"type":"number"},"from":{"type":"string"},"to":{"type":"string"},"symbol":{"type":"string"},"timeStamp":{"type":"integer"},"type":{"type":"integer"},"pub":{"type":"string"},"signature":{"type":"string"},"validatorNodes":{"type":"array","items":{"$ref":"#/components/schemas/ValidatorNode"}},"customData":{"type":"array"}}},"description":"Array of transactions filtered by the specified address"},"count":{"type":"integer","format":"int32","description":"Total number of transactions for the specified address"}}},"ValidatorNode":{"title":"ValidatorNode","required":["_id","nodeName","message","dateTime","result"],"type":"object","properties":{"_id":{"type":"string"},"nodeName":{"type":"string"},"message":{"type":"string"},"dateTime":{"type":"string"},"result":{"type":"integer","format":"int32"}}}}}}
```

## Get transaction details

> This endpoint returns the details of a transaction created within the PIRI network. The parameter it takes is the "tx" value, which corresponds to the hash value associated with the transaction. It is also referred to as "transactionHash" within the schemas.\
> \
> The list of validating nodes that approved the transaction is included in the returned transaction as "validatorNodes."

```json
{"openapi":"3.0.3","info":{"title":"Pirichain API","version":"1.1.0"},"tags":[{"name":"Transaction","description":"All transactions methods are below and detailed on their section."}],"servers":[{"url":"https://core.pirichain.com","description":"Pirichain MainNet","variables":{}},{"url":"https://testnet.pirichain.com","description":"Pirichain TestNet","variables":{}},{"url":"https://{URL}","description":"You can only use https protocol for your custom environment.","variables":{"URL":{"default":"custom.network","description":"You can enter your custom endpoint which belong to Pirichain Network"}}},{"url":"http://{URL}","description":"Custom HTTP endpoint for development environment (not recommended for production).","variables":{"URL":{"default":"custom.network","description":"You can enter your custom endpoint which belong to Pirichain Network"}}}],"paths":{"/getTransaction":{"post":{"tags":["Transaction"],"summary":"Get transaction details","description":"This endpoint returns the details of a transaction created within the PIRI network. The parameter it takes is the \"tx\" value, which corresponds to the hash value associated with the transaction. It is also referred to as \"transactionHash\" within the schemas.\n\nThe list of validating nodes that approved the transaction is included in the returned transaction as \"validatorNodes.\"","operationId":"getTransaction","requestBody":{"content":{"application/x-www-form-urlencoded":{"encoding":{},"schema":{"required":["tx"],"type":"object","properties":{"tx":{"type":"string","description":"Transaction Hash"}}}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json; charset=utf-8":{"schema":{"$ref":"#/components/schemas/getTransaction"}}}}},"deprecated":false}}},"components":{"schemas":{"getTransaction":{"title":"getTransaction","required":["type","confirmed","confirmationCount","_id","transactionHash","__v","amount","assetID","blockHeight","fee","from","pub","signature","symbol","timeStamp","to","validatorNodes","customData","broadcastHex"],"type":"object","properties":{"type":{"type":"integer","format":"int32"},"confirmed":{"type":"boolean"},"confirmationCount":{"type":"integer","format":"int32"},"_id":{"type":"string"},"transactionHash":{"type":"string"},"__v":{"type":"integer","format":"int32"},"amount":{"type":"integer","format":"int32"},"assetID":{"type":"integer","format":"int32"},"blockHeight":{"type":"integer","format":"int32"},"fee":{"type":"number"},"from":{"type":"string"},"pub":{"type":"string"},"signature":{"type":"string"},"symbol":{"type":"string"},"timeStamp":{"type":"integer","format":"int64"},"to":{"type":"string"},"validatorNodes":{"type":"array","items":{"$ref":"#/components/schemas/ValidatorNode"},"description":"List of validator nodes that confirmed this transaction"},"customData":{"type":"array","items":{"type":"string"},"description":"Additional custom data associated with the transaction"},"broadcastHex":{"type":"string"}}},"ValidatorNode":{"title":"ValidatorNode","required":["_id","nodeName","message","dateTime","result"],"type":"object","properties":{"_id":{"type":"string"},"nodeName":{"type":"string"},"message":{"type":"string"},"dateTime":{"type":"string"},"result":{"type":"integer","format":"int32"}}}}}}
```

## Get pool transaction details

> This endpoint, like the "getTransaction" endpoint, returns the details of a pool transaction based on the specified "tx" parameter. However, once this transaction is confirmed, even if the provided "tx" information is correct, it will no longer return a result. In other words, this endpoint's response can be retrieved just before a transaction is confirmed.\
> \
> Additionally, the returned result will have a different schema from the result that will be returned after this transaction is confirmed (e.g., information such as "blockHeight" and "validatorNodes").

```json
{"openapi":"3.0.3","info":{"title":"Pirichain API","version":"1.1.0"},"tags":[{"name":"Transaction","description":"All transactions methods are below and detailed on their section."}],"servers":[{"url":"https://core.pirichain.com","description":"Pirichain MainNet","variables":{}},{"url":"https://testnet.pirichain.com","description":"Pirichain TestNet","variables":{}},{"url":"https://{URL}","description":"You can only use https protocol for your custom environment.","variables":{"URL":{"default":"custom.network","description":"You can enter your custom endpoint which belong to Pirichain Network"}}},{"url":"http://{URL}","description":"Custom HTTP endpoint for development environment (not recommended for production).","variables":{"URL":{"default":"custom.network","description":"You can enter your custom endpoint which belong to Pirichain Network"}}}],"paths":{"/getPoolTransaction":{"post":{"tags":["Transaction"],"summary":"Get pool transaction details","description":"This endpoint, like the \"getTransaction\" endpoint, returns the details of a pool transaction based on the specified \"tx\" parameter. However, once this transaction is confirmed, even if the provided \"tx\" information is correct, it will no longer return a result. In other words, this endpoint's response can be retrieved just before a transaction is confirmed.\n\nAdditionally, the returned result will have a different schema from the result that will be returned after this transaction is confirmed (e.g., information such as \"blockHeight\" and \"validatorNodes\").","operationId":"getPoolTransaction","requestBody":{"content":{"application/x-www-form-urlencoded":{"encoding":{},"schema":{"required":["tx"],"type":"object","properties":{"tx":{"type":"string","description":"Transaction Hash"}}}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json; charset=utf-8":{"schema":{"$ref":"#/components/schemas/GetPoolTransaction"}}}}},"deprecated":false}}},"components":{"schemas":{"GetPoolTransaction":{"title":"GetPoolTransaction","required":["type","confirmed","confirmationCount","_id","validatorNodes","from","to","assetID","timeStamp","amount","transactionHash","fee","signature","pub","symbol","__v"],"type":"object","properties":{"type":{"type":"integer","format":"int32"},"confirmed":{"type":"boolean"},"confirmationCount":{"type":"integer","format":"int32"},"_id":{"type":"string"},"validatorNodes":{"type":"array","items":{"$ref":"#/components/schemas/ValidatorNode"},"description":"List of validator nodes that confirmed this transaction"},"from":{"type":"string"},"to":{"type":"string"},"assetID":{"type":"integer","format":"int32"},"timeStamp":{"type":"integer","format":"int64"},"amount":{"type":"integer","format":"int32"},"transactionHash":{"type":"string"},"fee":{"type":"number"},"signature":{"type":"string"},"pub":{"type":"string"},"symbol":{"type":"string"},"__v":{"type":"integer","format":"int32"}}},"ValidatorNode":{"title":"ValidatorNode","required":["_id","nodeName","message","dateTime","result"],"type":"object","properties":{"_id":{"type":"string"},"nodeName":{"type":"string"},"message":{"type":"string"},"dateTime":{"type":"string"},"result":{"type":"integer","format":"int32"}}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://api.pirichain.com/transaction.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
