Transaction
All transactions methods are below and detailed on their section.
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.
Page count for skip according to limit value.
0
Record count for per page
10
OK
POST /listTransactions HTTP/1.1
Host: core.pirichain.com
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 21
"skip=0&limit=10"
OK
{
"docs": [
{
"type": -1,
"isFromScenario": false,
"confirmed": true,
"confirmationCount": 11,
"_id": "<id>",
"transactionHash": "<hash>",
"__v": 11,
"amount": 442998,
"assetID": -1,
"blockHeight": 3390788,
"fee": 0.1,
"from": "<address>",
"pub": "<public_key>",
"signature": "<signature>",
"symbol": "PIRI",
"timeStamp": 1697808542434,
"to": "<address>",
"validatorNodes": [
{
"_id": "<id>",
"nodeName": "ORTAYLI",
"message": "Success",
"dateTime": "2023-10-20T13:29:03.087Z",
"result": 1
}
]
}
],
"txCountTotal": 3650
}
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.
OK
POST /listPoolTransactions HTTP/1.1
Host: core.pirichain.com
Accept: */*
OK
[
{
"type": -1,
"confirmed": true,
"confirmationCount": 5,
"_id": "<id>",
"validatorNodes": [
{
"_id": "<id>",
"nodeName": "BIRUNI",
"message": "Success",
"dateTime": "2022-09-21T13:41:08.737Z",
"result": 1
}
],
"from": "<address>",
"to": "<address>",
"assetID": 10001,
"timeStamp": 1663767668559,
"amount": 1,
"transactionHash": "<hash>",
"fee": 0.1,
"signature": "<signature>",
"pub": "<public_key>",
"symbol": "ALP",
"__v": 5
}
]
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.
Page count for skip according to limit value.
0
Record count for per page
50
Asset ID
Descending order
false
OK
POST /listTransactionsByAssetID HTTP/1.1
Host: core.pirichain.com
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 51
"skip=0&limit=50&assetID='text'&desc=false"
OK
{
"doc": [
{
"type": -1,
"confirmed": true,
"confirmationCount": 4,
"_id": "62bcba17df067436f89b4614",
"transactionHash": "d06c8321172778f953b1b10fb80c19d445585026a2c93552d5d56c57f9a92165",
"__v": 4,
"amount": 0,
"assetID": -1,
"blockHeight": 78,
"fee": 0.1555,
"from": "PRTMRdsmVMCydZocVnBhobskk86DsfU9cx2CveDaUsT",
"pub": "04965d5685aa7f2880fbae206417e398b90a1c159107743e42358efdecc5fa6cf949c9a64de9d6a73de53fd6a7eabd93b6dbdedee6d86819f65ce1376790acea2d",
"signature": "3046022100f0f4e4f46e54776f426a84941c8712e3c739afdbe1283d7a8d01b81725c316af022100890e2dd7498aeb7fa482da92ba7d4775c232ac917e18ae349775185f98f537b7",
"symbol": "PIRI",
"timeStamp": 1656535541429,
"validatorNodes": [
{
"_id": "62bcb9f59a5eee60f879a4bd",
"nodeName": "KUSCU",
"message": "Success",
"dateTime": "2022-06-29T20:45:41.605Z",
"result": 1
}
]
}
],
"count": 1589387
}
This endpoint returns the same result as the "listTransactions" endpoint, but only specific to the provided PIRI Address, based on the specified "address" parameter.
Page count for skip according to limit value.
0
Record count for per page
50
PIRI Address
OK
POST /listTransactionsByAddr HTTP/1.1
Host: core.pirichain.com
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 38
"skip=0&limit=50&address='text'"
OK
{
"doc": [
{
"_id": "ABC123",
"transactionHash": "4547292a63ae...",
"amount": 15196,
"from": "PRTMR5pDr...",
"to": "PRTMPtfr5...",
"symbol": "PIRI"
},
{
"_id": "DEF456",
"transactionHash": "617bd58222...",
"amount": 1,
"from": "PRTMPtfr5...",
"to": "PRTMR5pDr...",
"symbol": "ALP"
}
],
"count": 79
}
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."
Transaction Hash
OK
POST /getTransaction HTTP/1.1
Host: core.pirichain.com
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 13
"tx='text'"
OK
{
"type": -1,
"confirmed": true,
"confirmationCount": 5,
"_id": "<id>",
"transactionHash": "<hash>",
"__v": 5,
"amount": 1,
"assetID": 10001,
"blockHeight": 646433,
"fee": 0.1,
"from": "<address>",
"pub": "<public_key>",
"signature": "<signature>",
"symbol": "ALP",
"timeStamp": 1663145884271,
"to": "<address>",
"validatorNodes": [
{
"_id": "<id>",
"nodeName": "HAREZMI",
"message": "Success",
"dateTime": "2022-09-14T08:58:04.428Z",
"result": 1
}
],
"customData": [],
"broadcastHex": "<hex_data>"
}
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").
Transaction Hash
OK
POST /getPoolTransaction HTTP/1.1
Host: core.pirichain.com
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 13
"tx='text'"
OK
{
"type": -1,
"confirmed": true,
"confirmationCount": 5,
"_id": "<id>",
"validatorNodes": [
{
"_id": "<id>",
"nodeName": "HAREZMI",
"message": "Success",
"dateTime": "2022-09-21T14:10:01.111Z",
"result": 1
}
],
"from": "<address>",
"to": "<address>",
"assetID": 10001,
"timeStamp": 1663769400919,
"amount": 1,
"transactionHash": "<hash>",
"fee": 0.1,
"signature": "<signature>",
"pub": "<public_key>",
"symbol": "ALP",
"__v": 5
}
Was this helpful?