Lịch sử tên miền
#Lịch sử tên miền
Truy xuất nhật ký lịch sử của các hoạt động (chẳng hạn như đăng ký và cập nhật) được thực hiện trên PIVX name cụ thể.
Điểm cuối
POST https://indexer.pivx.name/v1.0/history/richard.pivx
Tham số đường dẫn
| Tham số | Loại | Bắt buộc | Mô tả |
|---|---|---|---|
domain_name | string | Có | Miền PIVX để truy vấn lịch sử (ví dụ: richard.pivx). |
Nội dung yêu cầu
Nội dung yêu cầu phải là một đối tượng JSON chứa các tham số sau:
| Tham số | Loại | Mặc định | Mô tả |
|---|---|---|---|
count | integer | Không có | Giới hạn số lượng mục tối đa được trả về trong một phản hồi. |
from_block_id | integer | Không có | Yêu cầu nhật ký lịch sử bắt đầu từ chiều cao khối cụ thể này. |
order | string | desc | Thứ tự sắp xếp của nhật ký lịch sử. Giá trị được chấp nhận: asc hoặc desc. |
Ví dụ về mã
- 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": 5332579,
"order": "asc"
}'
const url = 'https://indexer.pivx.name/v1.0/history/richard.pivx';
const data = {
count: 10,
from_block_id: 5332579,
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": 5332579,
"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' => 5332579,
'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);
Ví dụ về phản hồi
{
"response": [
{
"domain_block_id": 5432577,
"target_address": "ps12qtzaw6x3dh35xuukrqgk06e9ffx8szg2n2huqncwjsnj3ajczmklqgcx97kn63vwlge6gj2cmn",
"owner_pubkey": "3757ee1a8b3f10353ca6edd47b66920392b02e323dca3f3edddb5de142079a53",
"domain_tx": "5c16fa577b95d76fd54b11d4076a0509f45bc468c6a69f9e8f524b4f98d76635",
"op": "REG",
"nonce": 1780049890835,
"price": 0
},
{
"domain_block_id": 5432579,
"target_address": "ps1a5dvcrw8k49tcmmsmfh2d5cthhamfrxue4h3ervww2z625qwyarcflpznaxlalwk7trkyxas4ln",
"owner_pubkey": "3757ee1a8b3f10353ca6edd47b66920392b02e323dca3f3edddb5de142079a53",
"domain_tx": "d39bb4aeb116449cfcd9a40ff5a437b5b6957a62531e3dcf170bccf62816edf7",
"op": "UPD",
"nonce": 1780050207591,
"price": 0
},
{
"domain_block_id": 5434368,
"target_address": "ps1a5dvcrw8k49tcmmsmfh2d5cthhamfrxue4h3ervww2z625qwyarcflpznaxlalwk7trkyxas4ln",
"owner_pubkey": "3aa7910fa98101312acadc381af1fa72157a9d8dcce6c62655c7b4e9a69e2b32",
"domain_tx": "15395cac30c9a5f82374b26f4c9214669c7f828abe54a35ded530609057fd662",
"op": "CHG",
"nonce": 1780160609750,
"price": 0
}
]
}
| Lĩnh vực | Loại | Mô tả |
|---|---|---|
domain_block_id | int | PIVX block_id của thao tác |
target_address | chuỗi | Đang giải quyết địa chỉ Shielded |
op | chuỗi | Hoạt động được thực hiện trên tên |
owner_pubkey | chuỗi | Khóa công khai của chủ sở hữu tên |
domain_tx | chuỗi | PIVX tx_id của đăng ký tên |
nonce | int | Tăng dấu thời gian của hoạt động |
price | int | Giá bán tên miền (đối với LST hoặc MUA), nếu không thì 0 |