도메인 이력
특정 PIVX 이름에 대해 수행된 연산(등록 및 변경 등)의 이력 로그를 반환합니다.
엔드포인트
POST https://indexer.pivx.name/v1.0/history/richard.pivx
경로 매개변수
| 매개변수 | 타입 | 필수 | 설명 |
|---|---|---|---|
domain_name | string | 예 | 이력을 조회할 PIVX 도메인(예: richard.pivx). |
요청 본문
요청 본문은 다음 매개변수를 담은 JSON 객체여야 합니다:
| 매개변수 | 타입 | 기본값 | 설명 |
|---|---|---|---|
count | integer | 100 | 반환할 최대 행 수로, 최대 500입니다. 더 큰 값은 500으로 줄어듭니다. |
from_block_id | integer | 없음 | 이 블록 이후의 행만 반환합니다. asc이면 이후 블록에서, desc이면 이전 블록에서 가져오며 이 블록 자체는 제외됩니다. 지정하지 않으면 목록은 가장 오래된 행(asc) 또는 가장 최근 행(desc)부터 시작합니다. |
from_nonce | integer | 없음 | from_block_id와 함께일 때만: 가지고 있는 마지막 행의 nonce. 그러면 목록은 그 블록 전체 이후가 아니라 바로 그 행 다음부터 이어집니다. 페이지 나누기를 참고하세요. |
order | string | desc | 정렬 순서: asc 또는 desc. 행은 블록 순, 그다음 nonce 순으로 정렬됩니다. |
코드 예시
- cURL
- JavaScript
- Python
- PHP
curl -X POST https://indexer.pivx.name/v1.0/history/richard.pivx \
-H "Content-Type: application/json" \
-d '{
"count": 10,
"from_block_id": 5537000,
"order": "asc"
}'
const url = 'https://indexer.pivx.name/v1.0/history/richard.pivx';
const data = {
count: 10,
from_block_id: 5537000,
order: 'asc'
};
fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(data)
})
.then(response => response.json())
.then(result => console.log(result))
.catch(error => console.error('Error:', error));
import requests
url = "https://indexer.pivx.name/v1.0/history/richard.pivx"
payload = {
"count": 10,
"from_block_id": 5537000,
"order": "asc"
}
headers = {
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
<?php
$url = 'https://indexer.pivx.name/v1.0/history/richard.pivx';
$data = [
'count' => 10,
'from_block_id' => 5537000,
'order' => 'asc'
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Content-Type: application/json'
]);
$response = curl_exec($ch);
curl_close($ch);
$result = json_decode($response, true);
print_r($result);
응답 예시
{
"response": [
{
"domain_block_id": 5537326,
"domain_ts": 1784808285,
"target_address": "ps1f84lvgj0awz2yf2zha5d5gddhd4j88g0kzj5cwp776vhxp5fdjqe7e95cdx2qs5e7fcvg3ds3yq",
"owner_pubkey": "3757ee1a8b3f10353ca6edd47b66920392b02e323dca3f3edddb5de142079a53",
"domain_tx": "388241ffc5bf8ba3d7633d132298d157e26d6ac127ff8d162f26e7203084df08",
"op": "REG",
"nonce": 1784808228,
"price": 0
},
{
"domain_block_id": 5537369,
"domain_ts": 1784812590,
"target_address": "ps1f84lvgj0awz2yf2zha5d5gddhd4j88g0kzj5cwp776vhxp5fdjqe7e95cdx2qs5e7fcvg3ds3yq",
"owner_pubkey": "3757ee1a8b3f10353ca6edd47b66920392b02e323dca3f3edddb5de142079a53",
"domain_tx": "4d5419af400966616ba9325f78bb3cac2ff1229fd4d39ed022a9fc113ee4b67e",
"op": "LST",
"nonce": 1784812534,
"price": 200000
},
{
"domain_block_id": 5537421,
"domain_ts": 1784815647,
"target_address": "ps1yq6m9k7hn4wzp3gv5xun8kf0eq2dm3ay5r7vc6t9jl0sxh2pw8dz4knmg7uve3cqr6t5hxj9fda",
"owner_pubkey": "66a998241f62b4c8e4340f6e840b4570ac1d2d9840e2e42f62e713a34244f098",
"domain_tx": "3834eb36ca816f1bd9074c546ec64b3a361aca67e88c35b1586fe4ec1ae60095",
"op": "BUY",
"nonce": 1784815586,
"price": 0
},
{
"domain_block_id": 5538248,
"domain_ts": 1784878331,
"target_address": "ps1yq6m9k7hn4wzp3gv5xun8kf0eq2dm3ay5r7vc6t9jl0sxh2pw8dz4knmg7uve3cqr6t5hxj9fda",
"owner_pubkey": "66a998241f62b4c8e4340f6e840b4570ac1d2d9840e2e42f62e713a34244f098",
"domain_tx": "3c08640ed394b1a270abddcc3ca873c13793629c6a148ad0b5585003ca9e632a",
"op": "LST",
"nonce": 1784878114,
"price": 10012345678
},
{
"domain_block_id": 5538248,
"domain_ts": 1784878331,
"target_address": "ps1yq6m9k7hn4wzp3gv5xun8kf0eq2dm3ay5r7vc6t9jl0sxh2pw8dz4knmg7uve3cqr6t5hxj9fda",
"owner_pubkey": "66a998241f62b4c8e4340f6e840b4570ac1d2d9840e2e42f62e713a34244f098",
"domain_tx": "9ad75f893c002f21e9bbc3c6cdf4e151477293d64a013aa773db26598c1d5d11",
"op": "ULT",
"nonce": 1784878293,
"price": 0
}
]
}
| 필드 | 타입 | 설명 |
|---|---|---|
domain_block_id | int | 연산이 포함된 PIVX 블록 |
domain_ts | int | 그 블록의 시각(Unix 초) |
target_address | string | 연산 후 이름이 해석되는 주소 |
op | string | 연산: REG, UPD, CHG, LST, ULT 또는 BUY |
owner_pubkey | string | 연산 후 이름 소유자의 공개 키 |
domain_tx | string | 이 연산을 실은 PIVX 트랜잭션의 해시 |
nonce | int | 연산의 nonce: 이름에 대한 연산마다 증가하는 타임스탬프 |
price | int | 연산 후의 판매 가격(satoshi 단위): LST이면 등록 가격, 그 외에는 0. BUY 행은 이름이 더 이상 판매 중이 아니므로 0을 표시하며, 지불된 가격은 그 이전 마지막 LST의 가격입니다 |
페이지 나누기
긴 이력을 페이지 단위로 읽으려면 각 페이지의 마지막 행을 커서로 다시 보내세요. 그 행의 domain_block_id를 from_block_id로, nonce를 from_nonce로 보냅니다. 둘 다 보내야 합니다. 한 블록에 같은 이름에 대한 연산이 여러 개 있을 수 있고(위 예시에서는 블록 5538248의 LST와 ULT), 페이지가 그 사이에서 끝날 수 있기 때문입니다. from_block_id만 보내면 다음 페이지는 다음 블록에서 시작하여 그 블록의 나머지를 건너뜁니다. 요청한 것보다(더 많이 요청했다면 500보다) 행이 적은 페이지가 마지막 페이지입니다.
from_nonce를 from_block_id 없이 보내거나 그 값이 음이 아닌 정수가 아니면 One or several params provided have wrong value 오류가 응답되며, 음수이거나 정수가 아닌 count도 마찬가지입니다.