XFI Scan API
- xfiscan — cho mạng mainnet
- test.xfiscan — cho mạng testnet
Tiêu đề
Tên | Giá trị |
---|---|
Loại nội dung | application/json |
Xác thực | Bearer <token> |
Nội dung
Tên | Loại | Mô tả |
---|---|---|
name | string | Tên người dùng |
age | số | Tuổi của người dùng |
Phản hồi
- 200
- 400
{
"id": 1,
"name": "John",
"age": 30
}
{
"error": "Yêu cầu không hợp lệ"
}
txs - Truy vấn giao dịch
GET /api/1.0/txs
Lấy danh sách giao dịch.
Tham số
Tham số | Loại | Mô tả |
---|---|---|
from_height | string | Số khối từ. |
to_height | string | Số khối đến. |
address | string | Địa chỉ tài khoản. |
addresses | mảng[string] | Mảng địa chỉ tài khoản. |
txhash | string | Hash giao dịch. |
txhashes | mảng[string] | Mảng hash giao dịch. |
height | string | Độ cao khối. |
existsEVM | boolean | True - chỉ giao dịch phần EVM, false - chỉ giao dịch phần Cosmos. |
messageType | string | Loại tin nhắn giao dịch. |
page | số | Số trang. |
limit | số | Số lượng thực thể trao đi. |
sort | string | Trường sắp xếp nhận các giá trị có hoặc không có tiền tố "-" (dấu trừ) chỉ thị sự giảm hoặc tăng của trường được chỉ định. Ví dụ: '-height' là giảm dần, 'height' là tăng dần. |
Phản hồi mẫu
{
"docs": [
{
"txhash": "8a31d98d252be6dbec82fabc9b57a592e66e15bb70ea856bcf6f30c08e349e9a",
"addresses": [
"0x9449078b371ff30a90ec36fe6191f164cd527d64",
"mx1j3ys0zehrles4y8vxmlxry03vnx4yltyg2alsv"
],
"auth_info": {
"signer_infos": [],
"fee": {
"amount": [
{
"denom": "xfi",
"amount": "252031500000000000"
}
],
"gas_limit": "21000",
"payer": "",
"granter": ""
}
},
"body": {
"messages": [
{
"data": {
"chain_id": "4156",
"nonce": "10",
"gas_tip_cap": "1500000000",
"gas_fee_cap": "12001500000000",
"gas": "21000",
"to": "0x9449078b371ff30a90ec36fe6191f164cd527d64",
"value": "1000000000000000000",
"data": null,
"accesses": [],
"v": "0",
"r": "0x4b5b357aace26ec5f9ec1d402dcb9d77fe3adeba58535624c3cecee03c96c425",
"s": "0x05fde619bcb77662af9f1248c4435f6e4386c3bf9c60c1efae43429d61b9a96e",
"@type": "/ethermint.evm.v1.DynamicFeeTx",
"from": "0x9449078b371ff30a90ec36fe6191f164cd527d64",
"base_fee_per_gas": "10000000000000"
},
"size": 0,
"hash": "0xd18df3e4684b3f4b0904b1c05391602faf14aa68e318ac1509c5d1d25ad05b7b",
"from": "0x9449078b371ff30a90ec36fe6191f164cd527d64",
"@type": "/ethermint.evm.v1.MsgEthereumTx"
}
],
"memo": "",
"timeout_height": "0",
"extension_options": [
{
"@type": "/ethermint.evm.v1.ExtensionOptionsEthereumTx"
}
],
"non_critical_extension_options": []
},
"code": 0,
"codespace": "",
"evm_txhashes": [
"0xd18df3e4684b3f4b0904b1c05391602faf14aa68e318ac1509c5d1d25ad05b7b"
],
"gas_used": "21000",
"gas_wanted": "21000",
"height": 30,
"info": "",
"isEVM": true,
"logs": [
{
"msg_index": 0,
"events": [
{
"type": "ethereum_tx",
"attributes": [
{
"key": "amount",
"value": "1000000000000000000"
},
{
"key": "ethereumTxHash",
"value": "0xd18df3e4684b3f4b0904b1c05391602faf14aa68e318ac1509c5d1d25ad05b7b"
},
{
"key": "txIndex",
"value": "0"
},
{
"key": "txGasUsed",
"value": "21000"
},
{
"key": "txHash",
"value": "8A31D98D252BE6DBEC82FABC9B57A592E66E15BB70EA856BCF6F30C08E349E9A"
},
{
"key": "recipient",
"value": "0x9449078b371FF30A90EC36Fe6191F164Cd527D64"
}
]
},
{
"type": "message",
"attributes": [
{
"key": "action",
"value": "/ethermint.evm.v1.MsgEthereumTx"
},
{
"key": "module",
"value": "evm"
},
{
"key": "sender",
"value": "0x9449078b371FF30A90EC36Fe6191F164Cd527D64"
},
{
"key": "txType",
"value": "2"
}
]
},
{
"type": "tx_log",
"attributes": null
}
]
}
],
"signatures": [],
"timestamp": "2023-08-10T06:05:35.448Z",
"xds": []
}
],
"hasNext": true,
"limit": 1,
"page": 1
}
GET /api/1.0/txs/
Lấy hash của giao dịch.
Tham số
Tham số | Loại | Mô tả |
---|---|---|
hash | string | Hash giao dịch. Trường bắt buộc. |
Phản hồi mẫu
{
"txhash": "8a31d98d252be6dbec82fabc9b57a592e66e15bb70ea856bcf6f30c08e349e9a",
"addresses": [
"0x9449078b371ff30a90ec36fe6191f164cd527d64",
"mx1j3ys0zehrles4y8vxmlxry03vnx4yltyg2alsv"
],
"auth_info": {
"signer_infos": [],
"fee": {
"amount": [
{
"denom": "xfi",
"amount": "252031500000000000"
}
],
"gas_limit": "21000",
"payer": "",
"granter": ""
}
},
"body": {
"messages": [
{
"data": {
"chain_id": "4156",
"nonce": "10",
"gas_tip_cap": "1500000000",
"gas_fee_cap": "12001500000000",
"gas": "21000",
"to": "0x9449078b371ff30a90ec36fe6191f164cd527d64",
"value": "1000000000000000000",
"data": null,
"accesses": [],
"v": "0",
"r": "0x4b5b357aace26ec5f9ec1d402dcb9d77fe3adeba58535624c3cecee03c96c425",
"s": "0x05fde619bcb77662af9f1248c4435f6e4386c3bf9c60c1efae43429d61b9a96e",
"@type": "/ethermint.evm.v1.DynamicFeeTx",
"from": "0x9449078b371ff30a90ec36fe6191f164cd527d64",
"base_fee_per_gas": "10000000000000"
},
"size": 0,
"hash": "0xd18df3e4684b3f4b0904b1c05391602faf14aa68e318ac1509c5d1d25ad05b7b",
"from": "0x9449078b371ff30a90ec36fe6191f164cd527d64",
"@type": "/ethermint.evm.v1.MsgEthereumTx"
}
],
"memo": "",
"timeout_height": "0",
"extension_options": [
{
"@type": "/ethermint.evm.v1.ExtensionOptionsEthereumTx"
}
],
"non_critical_extension_options": []
},
"code": 0,
"codespace": "",
"evm_txhashes": [
"0xd18df3e4684b3f4b0904b1c05391602faf14aa68e318ac1509c5d1d25ad05b7b"
],
"gas_used": "21000",
"gas_wanted": "21000",
"height": 30,
"info": "",
"isEVM": true,
"logs": [
{
"msg_index": 0,
"events": [
{
"type": "ethereum_tx",
"attributes": [
{
"key": "amount",
"value": "1000000000000000000"
},
{
"key": "ethereumTxHash",
"value": "0xd18df3e4684b3f4b0904b1c05391602faf14aa68e318ac1509c5d1d25ad05b7b"
},
{
"key": "txIndex",
"value": "0"
},
{
"key": "txGasUsed",
"value": "21000"
},
{
"key": "txHash",
"value": "8A31D98D252BE6DBEC82FABC9B57A592E66E15BB70EA856BCF6F30C08E349E9A"
},
{
"key": "recipient",
"value": "0x9449078b371FF30A90EC36Fe6191F164Cd527D64"
}
]
},
{
"type": "message",
"attributes": [
{
"key": "action",
"value": "/ethermint.evm.v1.MsgEthereumTx"
},
{
"key": "module",
"value": "evm"
},
{
"key": "sender",
"value": "0x9449078b371FF30A90EC36Fe6191F164Cd527D64"
},
{
"key": "txType",
"value": "2"
}
]
},
{
"type": "tx_log",
"attributes": null
}
]
}
],
"signatures": [],
"timestamp": "2023-08-10T06:05:35.448Z",
"xds": []
}
blocks - truy vấn các khối
GET /api/1.0/blocks
Lấy danh sách khối.
Thông số
Thông số | Loại | Mô tả |
---|---|---|
chiều cao | string | Độ cao khối. |
từ_chiều cao | string | Số khối từ. |
đến_chiều cao | string | Số khối đến. |
trang | số | Số trang. |
giới hạn | số | Số lượng thực thể trao đi. |
sắp xếp | string | Trường sắp xếp chấp nhận các giá trị có hoặc không có tiền tố "-" (dấu trừ) để chỉ định việc giảm hoặc tăng của trường cụ thể Ví dụ: '-height' là giảm dần, 'height' là tăng dần. |
Phản hồi Mẫu
{
"docs": [
{
"block_hash": "9ef8bf42d1916b7617955ddce3da8e31c61ca1830d27e6ef718c2ee5f22d4059",
"app_hash": "8b651dcde4f67a1eada92185c8b5a3dd450369505f4e9d4df2059c8940c2f62c",
"block_size": "714",
"chain_id": "mineplex-testnet-2-5",
"consensus_hash": "16dbfd0aaa36e214d4e55a6eaadf68e9802dd4845dbd49eb58daa89f885d1fc0",
"data_hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"evidence_hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"evm": {
"baseFeePerGas": "500000000000",
"difficulty": "0",
"extraData": "0x",
"gasLimit": "20000000",
"gasUsed": "0",
"hash": "0x9ef8bf42d1916b7617955ddce3da8e31c61ca1830d27e6ef718c2ee5f22d4059",
"miner": "0x9b98f8601013ee11b88dd202c954965c59e12e65",
"nonce": "0x0000000000000000",
"number": "8241762",
"parentHash": "0x8d07a38af8b799c4f3e972fb44a1b76244e409e4811bd2a8032cced1d5549d26",
"transactions": []
},
"height": 8241762,
"last_block_hash": "8d07a38af8b799c4f3e972fb44a1b76244e409e4811bd2a8032cced1d5549d26",
"last_commit_hash": "f5352ae0162f664b3ad7b9872174bc363fa6dc60d66a03d5454afe5dc7787662",
"last_results_hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"next_validators_hash": "baac843746eabd58fff69cabccee6836d3c1259cc815c08533fba272842e7cfb",
"proposer": {
"address": "mxvaloper1nwv0scqsz0hprwyd6gpvj4ykt3v7ztn97kjwc5",
"description": {
"moniker": "validator1",
"identity": "",
"website": "",
"security_contact": "",
"details": ""
}
},
"sigs": [
{
"address": "mxvaloper1nwv0scqsz0hprwyd6gpvj4ykt3v7ztn97kjwc5",
"signed": true
},
{
"address": "mxvaloper17u9dufjvscqh56u4kd7ag236u0wu3zrw9e8fwc",
"signed": false
}
],
"timestamp": "2025-01-31T13:20:32.370Z",
"txs": [],
"validators_hash": "baac843746eabd58fff69cabccee6836d3c1259cc815c08533fba272842e7cfb",
"version": {
"block": "11"
}
}
],
"hasNext": true,
"limit": 1,
"page": 1
}
GET /api/1.0/blocks/latest
Nhận khối đã được xác nhận hiện tại.
Thông Số
Không có
Phản hồi Mẫu
{
"block_hash": "5e5fe4888e1d76bdb00c5d7097ed552d39676ba2d89abb17d777ce07dcbe081e",
"app_hash": "ad11a1a3261fafceff29decd2702065e42d6bea97d7f10d2120cbe4297b0bb92",
"block_size": "712",
"chain_id": "mineplex-testnet-2-5",
"consensus_hash": "16dbfd0aaa36e214d4e55a6eaadf68e9802dd4845dbd49eb58daa89f885d1fc0",
"data_hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"evidence_hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"evm": {
"baseFeePerGas": "500000000000",
"difficulty": "0",
"extraData": "0x",
"gasLimit": "20000000",
"gasUsed": "0",
"hash": "0x5e5fe4888e1d76bdb00c5d7097ed552d39676ba2d89abb17d777ce07dcbe081e",
"miner": "0x9b98f8601013ee11b88dd202c954965c59e12e65",
"nonce": "0x0000000000000000",
"number": "8242223",
"parentHash": "0x70af1a8df04ab529a97f47b1d892ff0a08839ecdbf77890255800f26b655b903",
"transactions": []
},
"height": 8242223,
"last_block_hash": "70af1a8df04ab529a97f47b1d892ff0a08839ecdbf77890255800f26b655b903",
"last_commit_hash": "3884227c2ed9983c56bb2f0ce15d3228423ed363ec790c8737c6f00cc1ca415c",
"last_results_hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"next_validators_hash": "baac843746eabd58fff69cabccee6836d3c1259cc815c08533fba272842e7cfb",
"proposer": {
"address": "mxvaloper1nwv0scqsz0hprwyd6gpvj4ykt3v7ztn97kjwc5",
"description": {
"moniker": "validator1",
"identity": "",
"website": "",
"security_contact": "",
"details": ""
}
},
"sigs": [
{
"address": "mxvaloper1nwv0scqsz0hprwyd6gpvj4ykt3v7ztn97kjwc5",
"signed": true
},
{
"address": "mxvaloper17u9dufjvscqh56u4kd7ag236u0wu3zrw9e8fwc",
"signed": false
}
],
"timestamp": "2025-01-31T14:00:03.220Z",
"txs": [],
"validators_hash": "baac843746eabd58fff69cabccee6836d3c1259cc815c08533fba272842e7cfb",
"version": {
"block": "11"
}
}
Nhận một khối cụ thể.
Thông Số
Tham Số | Loại | Mô Tả |
---|---|---|
chiều cao | chuỗi | Chiều cao khối. Trường bắt buộc. |
Phản hồi Mẫu
{
"block_hash": "98e7e6441ce004842396f5869b4d34fa2a43a2fc51810e791e632ec86798ba5b",
"app_hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"block_size": "347",
"chain_id": "mineplex-testnet-2-5",
"consensus_hash": "16dbfd0aaa36e214d4e55a6eaadf68e9802dd4845dbd49eb58daa89f885d1fc0",
"data_hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"evidence_hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"evm": {
"baseFeePerGas": "10000000000000",
"difficulty": "0",
"extraData": "0x",
"gasLimit": "20000000",
"gasUsed": "0",
"hash": "0x98e7e6441ce004842396f5869b4d34fa2a43a2fc51810e791e632ec86798ba5b",
"miner": "0xb6aba457a6bc2e53119fb442903fa018e0496800",
"nonce": "0x0000000000000000",
"number": "1",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"transactions": []
},
"height": 1,
"last_block_hash": "",
"last_commit_hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"last_results_hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"next_validators_hash": "4238f8531482f5edc3d6641d8180957815e2ed4af8869d826d09f7b214ac92d9",
"proposer": {
"address": "mxvaloper1k646g4axhsh9xyvlk3pfq0aqrrsyj6qqj85d5m",
"description": {
"moniker": "validator3",
"identity": "",
"website": "",
"security_contact": "",
"details": ""
}
},
"sigs": [
{
"address": "mxvaloper17qj66wq56dmh7zpurj966kdzks9dnfmhv26s92",
"signed": true
},
{
"address": "mxvaloper1nwv0scqsz0hprwyd6gpvj4ykt3v7ztn97kjwc5",
"signed": true
},
{
"address": "mxvaloper1k646g4axhsh9xyvlk3pfq0aqrrsyj6qqj85d5m",
"signed": true
},
{
"address": "mxvaloper17u9dufjvscqh56u4kd7ag236u0wu3zrw9e8fwc",
"signed": true
}
],
"timestamp": "2023-03-15T00:00:00.000Z",
"txs": [],
"validators_hash": "4238f8531482f5edc3d6641d8180957815e2ed4af8869d826d09f7b214ac92d9",
"version": {
"block": "11"
}
}
địa chỉ - Truy vấn cho các địa chỉ tài khoản
GET /api/1.0/addresses
Thu thập danh sách các địa chỉ tài khoản.
Thông Số
Tham Số | Loại | Mô Tả |
---|---|---|
địa chỉ | chuỗi | Địa chỉ Tài khoản. |
địa chỉ xác nhận | chuỗi | Địa chỉ Xác nhận. |
các địa chỉ | mảng [chuỗi] | Mảng địa chỉ tài khoản. |
số điện thoại khối | chuỗi | Số Khối. |
trang | số | Số Trang. |
giới hạn | số | Số lượng thực thể để trao tặng. |
sắp xếp | chuỗi |
Trường sắp xếp chấp nhận các giá trị có hoặc không có tiền tố "-" (dấu trừ) để chỉ định việc giảm hoặc tăng của trường cụ thể Ví dụ: '-height' là giảm dần, 'height' là tăng dần. |
Phản hồi Mẫu
{
"docs": [
{
"mx": "mx1j3ys0zehrles4y8vxmlxry03vnx4yltyg2alsv",
"blockNumber": 1711526,
"coins": [
{
"denom": "xfi",
"amount": "951704940132136241914269"
}
],
"delegations": [],
"evm": "0x9449078b371ff30a90ec36fe6191f164cd527d64",
"holdCoins": {
"xfi": "951704940132136241914269"
},
"isValidator": false,
"number": "90",
"redelegations": [],
"sequence": "1044",
"timestamp": "2023-11-30T06:39:44.316Z",
"unbonding_delegations": []
}
],
"hasNext": true,
"limit": 1,
"page": 1
}
GET /api/1.0/addresses/
Lấy địa chỉ bằng mã băm của địa chỉ tài khoản.
Thông Số
Tham Số | Loại | Mô Tả |
---|---|---|
địa chỉ | chuỗi |
Địa chỉ tài khoản Trường bắt buộc. | | không cóPhần thưởng | boolean | Phần thưởng nơi không cần thiết.
Phản hồi Mẫu
{
"mx": "mx1j3ys0zehrles4y8vxmlxry03vnx4yltyg2alsv",
"blockNumber": 1711526,
"coins": [
{
"denom": "xfi",
"amount": "951704940132136241914269"
}
],
"delegations": [],
"evm": "0x9449078b371ff30a90ec36fe6191f164cd527d64",
"holdCoins": {
"xfi": "951704940132136241914269"
},
"isValidator": false,
"number": "90",
"redelegations": [],
"sequence": "1044",
"timestamp": "2023-11-30T06:39:44.316Z",
"unbonding_delegations": [],
"rewards": {
"rewards": [],
"total": []
}
}
GET /api/1.0/addresses/rich-list/
Nhận danh sách các địa chỉ theo số lượng mã thông báo đã mua.
Thông Số
Tham Số | Loại | Mô Tả |
---|---|---|
loại | chuỗi | Loại mã thông báo (MPX hoặc XFI). Trường bắt buộc. |
Phản hồi Mẫu
{
"docs": [
{
"mx": "mx1f83rnk6s2kqcdl0knp8dj6p5s9u5km925spepg",
"blockNumber": 0,
"coins": [
{
"denom": "mpx",
"amount": "77605105225994146032010823"
},
{
"denom": "xfi",
"amount": "635906491456039568577746"
}
],
"delegations": [
{
"delegation": {
"delegator_address": "mx1f83rnk6s2kqcdl0knp8dj6p5s9u5km925spepg",
"validator_address": "mxvaloper1f83rnk6s2kqcdl0knp8dj6p5s9u5km92qmc8qh",
"shares": "999999999999999999999999.000000000000000000"
},
"balance": {
"denom": "mpx",
"amount": "990000004052981946152236"
}
},
{
"delegation": {
"delegator_address": "mx1f83rnk6s2kqcdl0knp8dj6p5s9u5km925spepg",
"validator_address": "mxvaloper1nwv0scqsz0hprwyd6gpvj4ykt3v7ztn97kjwc5",
"shares": "1.000000000000000000"
},
"balance": {
"denom": "mpx",
"amount": "1"
}
}
],
"evm": "0x49e239db50558186fdf6984ed9683481794b6caa",
"holdCoins": {
"xfi": "635906491456039568577746",
"mpx": "78595105230047127978163060"
},
"isValidator": false,
"number": "5",
"redelegations": [],
"sequence": "3",
"timestamp": "2024-10-06T13:39:56.390Z",
"unbonding_delegations": []
}
],
"hasNext": true,
"limit": 1,
"page": 1
}
bộ xác thực - Truy vấn bộ xác thực.
GET /api/1.0/validators
Lấy danh sách các bộ xác thực.
Tham số
Tham số | Loại | Mô tả |
---|---|---|
bộ xác thực bị nhốt | boolean | Nếu trường validatorJailed là true, điều đó có nghĩa là bộ xác thực bị khóa và tạm thời không thể tham gia quy trình xác nhận và nhận thưởng. |
trạng thái bộ xác thực | chuỗi | Trường lọc các bộ xác thực theo trạng thái hiện tại của chúng. |
ninĐịa chỉ | mảng [chuỗi] | Danh sách được truyền ninĐịa chỉ của mối đe dọa từ tìm kiếm. |
địa chỉ | chuỗi | Địa chỉ tài khoản. |
các địa chỉ | mảng [chuỗi] | Mảng địa chỉ tài khoản. |
trang | số | Số trang. |
giới hạn | số | Số lượng thực thể được trao. |
sắp xếp | chuỗi |
Trường sắp xếp nhận các giá trị có hoặc không có tiền tố “-” (dấu trừ) để chỉ sự giảm hoặc tăng của trường đặc biệt. Ví dụ: '-height' là giảm dần, 'height' là tăng dần.
Phản hồi Mẫu
{
"docs": [
{
"validator": {
"operator_address": "mxvaloper1f83rnk6s2kqcdl0knp8dj6p5s9u5km92qmc8qh",
"consensus_pubkey": {
"@type": "/cosmos.crypto.ed25519.PubKey",
"key": "4xr65XxFRDaSxDZeoOKUaA2ct5P0FOdFRo7aFrEwuA4="
},
"jailed": true,
"status": "BOND_STATUS_UNBONDED",
"tokens": "990198998156041678366202",
"delegator_shares": "1000201004143681884897493.256170380531418749",
"description": {
"moniker": "validator6",
"identity": "",
"website": "",
"security_contact": "",
"details": ""
},
"unbonding_height": "0",
"unbonding_time": "2023-05-29T09:38:56.327294001Z",
"commission": {
"commission_rates": {
"rate": "0.100000000000000000",
"max_rate": "0.200000000000000000",
"max_change_rate": "0.010000000000000000"
},
"update_time": "2023-03-15T00:00:00Z"
},
"min_self_delegation": "1",
"mxAddress": "mx1f83rnk6s2kqcdl0knp8dj6p5s9u5km925spepg",
"hexAddress": "f5eaed2e3f3afe488e66825802d31a00fb55aaad"
},
"active": true,
"signedBlocks": 0,
"unsignedBlocks": 0,
"delegators_count": "25",
"unbonding": [
{
"denom": "mpx",
"amount": "0"
}
],
"unclaimed": []
}
],
"hasNext": true,
"limit": 1,
"page": 1
}
GET /api/1.0/validators/
Lấy bộ xác thực qua địa chỉ.
Tham số
Tham số | Loại | Mô tả |
---|---|---|
địa chỉ | chuỗi |
Địa chỉ Bộ xác thực. Trường bắt buộc.
Phản hồi Mẫu
{
"validator": {
"operator_address": "mxvaloper1f83rnk6s2kqcdl0knp8dj6p5s9u5km92qmc8qh",
"consensus_pubkey": {
"@type": "/cosmos.crypto.ed25519.PubKey",
"key": "4xr65XxFRDaSxDZeoOKUaA2ct5P0FOdFRo7aFrEwuA4="
},
"jailed": true,
"status": "BOND_STATUS_UNBONDED",
"tokens": "990198998156041678366202",
"delegator_shares": "1000201004143681884897493.256170380531418749",
"description": {
"moniker": "validator6",
"identity": "",
"website": "",
"security_contact": "",
"details": ""
},
"unbonding_height": "0",
"unbonding_time": "2023-05-29T09:38:56.327294001Z",
"commission": {
"commission_rates": {
"rate": "0.100000000000000000",
"max_rate": "0.200000000000000000",
"max_change_rate": "0.010000000000000000"
},
"update_time": "2023-03-15T00:00:00Z"
},
"min_self_delegation": "1",
"mxAddress": "mx1f83rnk6s2kqcdl0knp8dj6p5s9u5km925spepg",
"hexAddress": "f5eaed2e3f3afe488e66825802d31a00fb55aaad"
},
"active": true,
"signedBlocks": 0,
"unsignedBlocks": 0,
"delegators_count": "25",
"unbonding": [
{
"denom": "mpx",
"amount": "0"
}
],
"unclaimed": []
}
thống kê - Lấy thống kê
GET /api/1.0/stat
Phản hồi Mẫu
{
"totalBlocks": 8242000,
"totalTransactions": 1234567,
"totalValidators": 42,
"activeValidators": 38,
"totalSupply": "1000000000000000000000000",
"bondedTokens": "750000000000000000000000",
"circulatingSupply": "800000000000000000000000",
"inflation": "8.5",
"communityPool": [
{
"denom": "xfi",
"amount": "10000000000000000000000"
}
]
}
nhật ký sự kiện - Nhật ký hợp đồng thông minh
Lấy nhật ký hợp đồng thông minh.
Tham số
Tham số | Loại | Mô tả |
---|---|---|
băm khối | chuỗi | Băm khối. |
địa chỉGốc | chuỗi | Địa chỉ đã gọi hợp đồng thông minh. |
băm giao dịch | chuỗi | Băm giao dịch. |
Chỉ số giao dịch | số | Chỉ số nhật ký trong giao dịch. |
số khối | chuỗi | Số khối. |
địa chỉ hợp đồng | chuỗi | Địa chỉ hợp đồng thông minh. |
trang | số | Số trang. |
giới hạn | số | Số lượng thực thể được trao. |
sắp xếp | chuỗi | Trường sắp xếp nhận các giá trị có hoặc không có tiền tố “-” (dấu trừ) để chỉ sự giảm hoặc tăng của trường đặc biệt. Ví dụ: '-height' là giảm dần, 'height' là tăng dần. |
Phản hồi Mẫu
{
"docs": [
{
"blockHash": "0x123abc...",
"blockNumber": 8241762,
"contractAddress": "0x456def...",
"originAddress": "0x789ghi...",
"transactionHash": "0xabc123...",
"transactionIndex": 0,
"logIndex": 1,
"topics": [
"0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925"
],
"data": "0x0000000000000000000000000000000000000000000000000de0b6b3a7640000",
"timestamp": "2025-01-31T13:20:32.370Z"
}
],
"hasNext": true,
"limit": 10,
"page": 1
}
hợp đồng - Truy vấn hợp đồng thông minh
Lấy hợp đồng thông minh.
Tham số
Tham số | Loại | Mô tả |
---|---|---|
địa chỉ hợp đồng | chuỗi | Địa chỉ Hợp đồng Thông minh. |
loại token | chuỗi | Tìm kiếm theo loại token. |
địa chỉ người tạo | chuỗi | Địa chỉ của người tạo hợp đồng. |
băm giao dịch | chuỗi | Băm hợp đồng. |
số khối | chuỗi | Số khối. |
đã xác minh | boolean | Hợp đồng thông minh có được xác minh hay không. |
trang | số | Số trang. |
giới hạn | số | Số lượng thực thể được trao. |
sắp xếp | chuỗi | Trường sắp xếp nhận các giá trị có hoặc không có tiền tố “-” (dấu trừ) để chỉ sự giảm hoặc tăng của trường đặc biệt. Ví dụ: '-height' là giảm dần, 'height' là tăng dần. |
Phản hồi Mẫu
**GET**/api/1.0/contracts/compiler-versions
Lấy danh sách phiên bản trình biên dịch.
Phản hồi Mẫu
[
"0.8.28",
"0.8.27",
"0.8.26",
"0.8.25",
"0.8.24",
"0.8.23",
"0.8.22",
"0.8.21",
"0.8.20",
"0.8.19",
"0.8.18",
"0.8.17",
"0.8.16",
"0.8.15",
"0.8.14",
"0.8.13",
"0.8.12",
"0.8.11",
"0.8.10",
"0.8.9",
"0.8.8",
"0.8.7",
"0.8.6",
"0.8.5",
"0.8.4",
"0.8.3",
"0.8.2",
"0.8.1",
"0.8.0",
"0.7.6",
"0.7.5",
"0.7.4",
"0.7.3",
"0.7.2",
"0.7.1",
"0.7.0",
"0.6.12",
"0.6.11",
"0.6.10",
"0.6.9",
"0.6.8",
"0.6.7",
"0.6.6",
"0.6.5",
"0.6.4",
"0.6.3",
"0.6.2",
"0.6.1",
"0.6.0",
"0.5.17",
"0.5.16",
"0.5.15",
"0.5.14",
"0.5.13",
"0.5.12",
"0.5.11",
"0.5.10",
"0.5.9",
"0.5.8",
"0.5.7",
"0.5.6",
"0.5.5",
"0.5.4",
"0.5.3",
"0.5.2",
"0.5.1",
"0.5.0",
"0.4.26",
"0.4.25",
"0.4.24",
"0.4.23",
"0.4.22",
"0.4.21",
"0.4.20",
"0.4.19",
"0.4.18",
"0.4.17",
"0.4.16",
"0.4.15",
"0.4.14",
"0.4.13",
"0.4.12",
"0.4.11",
"0.4.10"
]
GET /api/1.0/contracts/
Lấy địa chỉ của một hợp đồng thông minh.
Tham số
Tham số | Loại | Mô tả |
---|---|---|
địa chỉ | chuỗi | Địa chỉ hợp đồng. Trường bắt buộc. |
Mẫu phản hồi
{
"contractAddress": "0x10d1a6c0c2f4f1ab1924f7271b2cc95e94e8a223",
"creatorAddress": "0xa331f5c6b23c87d292da8b2118ebcc6a39633bb2",
"txHashCreate": "0x66cc14d6fc72561965e5f4a8088f17ae044fa4f0dc5a0eddfb3d1637022f6724",
"blockNumberCreate": "866356",
"timestamp": "2023-10-05T14:17:14.281Z",
"verified": true,
"tokenType": "CFC-20",
"name": "Sample Token",
"symbol": "STK",
"decimals": 18,
"totalSupply": "1000000000000000000000000",
"abi": "[{\"constant\":true,\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"type\":\"function\"}]",
"sourceCode": "pragma solidity ^0.8.0; contract SampleToken { ... }",
"compilerVersion": "v0.8.20+commit.a1b79de6"
}
POST /api/1.0/contracts/verify
Yêu cầu chịu trách nhiệm xác minh hợp đồng.
Sau khi xác minh thành công hợp đồng, Giao diện Nhị phân Ứng dụng (ABI) sẽ được lưu trữ trong cơ sở dữ liệu, cho phép bạn định nghĩa các phương thức của hợp đồng.
Nội dung yêu cầu
{
"contractAddress": "0x10d1a6c0c2f4f1ab1924f7271b2cc95e94e8a223",
"sourceCode": "pragma solidity ^0.8.0; contract SampleToken { string public name = \"Sample Token\"; }",
"contractName": "SampleToken",
"compilerVersion": "v0.8.20+commit.a1b79de6",
"optimization": false,
"runs": 200,
"constructorArguments": "",
"libraries": [
{
"name": "SafeMath",
"address": "0x1234567890abcdef1234567890abcdef12345678"
}
],
"evmVersion": "default",
"optimizationRuns": 0
}
các mã thông báo - Danh sách mã thông báo
GET /api/1.0/tokens
Lấy một danh sách các mã thông báo.
Tham số
Tham số | Loại | Mô tả |
---|---|---|
ký hiệu mã | chuỗi | Ký tự mã thông báo |
loại mã | chuỗi | Tìm kiếm theo loại mã thông báo. |
địa chỉ hợp đồng | chuỗi | Địa chỉ hợp đồng |
băm giao dịch | chuỗi | Băm của việc tạo mã thông báo. |
địa chỉ người tạo | chuỗi | Địa chỉ người tạo mã thông báo |
trang | số | Số trang. |
giới hạn | số | Số lượng thực thể để phân phối. |
sắp xếp | chuỗi | Trường sắp xếp nhận các giá trị có hoặc không có tiền tố "-" (dấu trừ) điều này biểu thị sự giảm dần hoặc tăng dần của trường được chỉ định. Ví dụ: '-height' là giảm dần, 'height' là tăng dần. |
Mẫu phản hồi
{
"docs": [
{
"contractAddress": "0x10d1a6c0c2f4f1ab1924f7271b2cc95e94e8a223",
"blockNumberCreate": "866356",
"creatorAddress": "0xa331f5c6b23c87d292da8b2118ebcc6a39633bb2",
"timestamp": "2023-10-05T14:17:14.281Z",
"tokenType": "CFC-20",
"txHashCreate": "0x66cc14d6fc72561965e5f4a8088f17ae044fa4f0dc5a0eddfb3d1637022f6724",
"transferCount": 12,
"holderCount": 2,
"name": "Sample Token",
"symbol": "STK",
"decimals": 18,
"totalSupply": "1000000000000000000000000"
},
{
"contractAddress": "0xb88a04d3eb73239377897607369a3af5e3f21ed3",
"blockNumberCreate": "866337",
"creatorAddress": "0xa331f5c6b23c87d292da8b2118ebcc6a39633bb2",
"timestamp": "2023-10-05T14:15:27.559Z",
"tokenType": "CFC-20",
"txHashCreate": "0x39a35b84ee7013edfdd1b03e5004e11302d08dfd01da366694529816a33e92ee",
"transferCount": 3,
"holderCount": 2,
"name": "Test Token",
"symbol": "TEST",
"decimals": 18,
"totalSupply": "500000000000000000000000"
}
],
"hasNext": true,
"limit": 10,
"page": 1
}
GET /api/1.0/tokens/
Nhận một mã thông báo.
Tham số
Tham số | Loại | Mô tả |
---|---|---|
địa chỉ | chuỗi | Địa chỉ mã thông báo. Trường bắt buộc. |
Mẫu phản hồi
{
"contractAddress": "0x10d1a6c0c2f4f1ab1924f7271b2cc95e94e8a223",
"name": "Sample Token",
"symbol": "STK",
"decimals": 18,
"totalSupply": "1000000000000000000000000",
"tokenType": "CFC-20",
"creatorAddress": "0xa331f5c6b23c87d292da8b2118ebcc6a39633bb2",
"txHashCreate": "0x66cc14d6fc72561965e5f4a8088f17ae044fa4f0dc5a0eddfb3d1637022f6724",
"blockNumberCreate": "866356",
"timestamp": "2023-10-05T14:17:14.281Z",
"transferCount": 12,
"holderCount": 2,
"verified": true
}
giao dịch-mã-thông-báo
Truy vấn các giao dịch đã mã hóa.
Tham số
Tham số | Loại | Mô tả |
---|---|---|
địa chỉ hợp đồng | chuỗi | Địa chỉ hợp đồng. |
số khối | chuỗi | Số khối. |
địa chỉ | chuỗi | Địa chỉ tài khoản. |
địa chỉ đến | chuỗi | Địa chỉ đến. |
địa chỉ từ | chuỗi | Địa chỉ từ. |
ký hiệu mã | chuỗi | Ký tự mã thông báo. |
tên mã | chuỗi | Tên của mã. |
băm giao dịch | chuỗi | Băm hợp đồng. |
id mã | chuỗi | ID mã thông báo. |
danh-sách-id-mã | dãy[chuỗi] | Danh sách ID mã thông báo. |
loại mã | chuỗi | Tìm kiếm theo loại mã thông báo. |
trang | số | Số trang. |
giới hạn | số | Số lượng thực thể để phân phối. |
sắp xếp | chuỗi | Trường sắp xếp nhận các giá trị có hoặc không có tiền tố "-" (dấu trừ) điều này biểu thị sự giảm dần hoặc tăng dần của trường được chỉ định. Ví dụ: '-height' là giảm dần, 'height' là tăng dần. |
Mẫu phản hồi
{
"docs": [
{
"blockNumber": "866356",
"transactionHash": "0x66cc14d6fc72561965e5f4a8088f17ae044fa4f0dc5a0eddfb3d1637022f6724",
"contractAddress": "0x10d1a6c0c2f4f1ab1924f7271b2cc95e94e8a223",
"addressFrom": "0xa331f5c6b23c87d292da8b2118ebcc6a39633bb2",
"addressTo": "0x9449078b371ff30a90ec36fe6191f164cd527d64",
"value": "1000000000000000000",
"tokenSymbol": "STK",
"tokenName": "Sample Token",
"tokenType": "CFC-20",
"tokenId": null,
"timestamp": "2023-10-05T14:17:14.281Z",
"logIndex": 1,
"transactionIndex": 0,
"erc1155Metadata": {
"tokenIds": [],
"amounts": []
}
}
],
"hasNext": true,
"limit": 10,
"page": 1
}
người giữ token
Lấy danh sách người giữ token.
Tham số | Kiểu | Mô tả |
---|---|---|
ký hiệu token | chuỗi | Ký tự token |
địa chỉ | chuỗi | Địa chỉ tài khoản. |
địa chỉ hợp đồng | chuỗi | Địa chỉ hợp đồng. |
số khối | chuỗi | Số khối. |
loại token | chuỗi | Tìm kiếm theo loại token. |
trang | số | Số trang. |
giới hạn | số | Số lượng thực thể cần bỏ qua. |
sắp xếp | chuỗi | Trường sắp xếp nhận các giá trị có hoặc không có tiền tố "-" (dấu trừ) để chỉ sự giảm hoặc tăng của trường đã chỉ định. Ví dụ: '-height' là giảm dần, 'height' là tăng dần. |
Phản hồi Mẫu
{
"docs": [
{
"address": "0x9449078b371ff30a90ec36fe6191f164cd527d64",
"contractAddress": "0x10d1a6c0c2f4f1ab1924f7271b2cc95e94e8a223",
"balance": "1000000000000000000",
"tokenSymbol": "STK",
"tokenName": "Token Mẫu",
"tokenType": "CFC-20",
"percentage": "50.0",
"timestamp": "2023-10-05T14:17:14.281Z"
},
{
"address": "0xa331f5c6b23c87d292da8b2118ebcc6a39633bb2",
"contractAddress": "0x10d1a6c0c2f4f1ab1924f7271b2cc95e94e8a223",
"balance": "1000000000000000000",
"tokenSymbol": "STK",
"tokenName": "Token Mẫu",
"tokenType": "CFC-20",
"percentage": "50.0",
"timestamp": "2023-10-05T14:17:14.281Z"
}
],
"hasNext": true,
"limit": 10,
"page": 1
}
Token-inventory - kho token ERC-721
Quản lý tài sản và hiển thị thông tin về các token có sẵn trong hệ thống blockchain.
Tham số | Kiểu | Mô tả |
---|---|---|
địa chỉ hợp đồng | chuỗi | Địa chỉ Hợp đồng Thông minh. |
địa chỉ người tạo | chuỗi | Địa chỉ người tạo hợp đồng. |
địa chỉ chủ sở hữu | chuỗi | Chuỗi đại diện cho địa chỉ chủ sở hữu token CFC-721 để kiểm tra kho hàng. |
danh sách token | chuỗi | Danh sách ID token. |
loại token | chuỗi | Tìm kiếm theo loại token. Các giá trị có sẵn: CFC-20, CFC-721 |
trang | số | Số trang. |
giới hạn | số | Số lượng thực thể cần bỏ qua. |
sắp xếp | chuỗi | Trường sắp xếp nhận các giá trị có hoặc không có tiền tố "-" (dấu trừ) để chỉ sự giảm hoặc tăng của trường đã chỉ định. Ví dụ: '-height' là giảm dần, 'height' là tăng dần. |
Phản hồi Mẫu
{
"docs": [
{
"contractAddress": "0x10d1a6c0c2f4f1ab1924f7271b2cc95e94e8a223",
"ownerAddress": "0x9449078b371ff30a90ec36fe6191f164cd527d64",
"tokenIds": ["1", "2", "3"],
"tokenType": "CFC-721",
"creatorAddress": "0xa331f5c6b23c87d292da8b2118ebcc6a39633bb2",
"timestamp": "2023-10-05T14:17:14.281Z",
"metadata": {
"name": "Bộ sưu tập NFT",
"description": "Bộ sưu tập NFT mẫu",
"image": "https://example.com/image.png",
"attributes": [
{
"trait_type": "độc đáo",
"value": "hiếm"
}
]
},
"xds": {
"name": "nft.xds",
"address": "0x9449078b371ff30a90ec36fe6191f164cd527d64"
}
}
],
"hasNext": true,
"limit": 10,
"page": 1
}
GET /api/1.0/token-inventory//
Kiểm tra tính sẵn có của kho hàng tại một địa chỉ cụ thể.
Tham số
Tham số | Kiểu | Mô tả |
---|---|---|
địa chỉ hợp đồng | chuỗi | Địa chỉ Hợp đồng Thông minh. |
tokenId | chuỗi | ID token. |
Phản hồi Mẫu
{
"contractAddress": "0x10d1a6c0c2f4f1ab1924f7271b2cc95e94e8a223",
"tokenId": "1",
"ownerAddress": "0x9449078b371ff30a90ec36fe6191f164cd527d64",
"tokenType": "CFC-721",
"metadata": {
"name": "NFT Mẫu #1",
"description": "Một vật sưu tầm kỹ thuật số độc đáo",
"image": "https://example.com/nft1.png",
"attributes": [
{
"trait_type": "độc đáo",
"value": "hiếm"
}
]
},
"xds": {
"name": "nft1.xds",
"address": "0x9449078b371ff30a90ec36fe6191f164cd527d64"
}
}
tìm kiếm
GET /api/1.0/search
Tìm kiếm địa chỉ, khối, giao dịch, hoặc token dựa vào một giá trị đã truyền vào.
Tham số | Kiểu | Mô tả |
---|---|---|
giá trị | chuỗi | Địa chỉ, khối, giao dịch hoặc token. Trường bắt buộc. |
Phản hồi Mẫu
{
"type": "địa chỉ",
"value": "0x9449078b371ff30a90ec36fe6191f164cd527d64",
"details": {
"address": "0x9449078b371ff30a90ec36fe6191f164cd527d64",
"balance": "1000000000000000000",
"isContract": false,
"transactionCount": 42
},
"xds": {
"name": "wallet.xds",
"address": "0x9449078b371ff30a90ec36fe6191f164cd527d64"
}
}
luồng
OPTIONS /api/1.0/stream/new-block
Nhận dữ liệu dòng của dữ liệu khối mới.
OPTIONS /api/1.0/stream/new-tx
Nhận dữ liệu dòng của các giao dịch mới.
Theo giao thức socketio.
Ví dụ cho js:
const socket = io(`https://test.xfiscan.com/stream`, {path: '/api/1.0/stream'})
socket.on('connect', () =&gt; {
console.log('connect');
})
socket.on('disconnect', (data) =&gt; console.log(data));
socket.on('new-block', (data) =&gt; console.log(data));
socket.on('new-txs, (data) =&gt; console.log(data));
Ở đâu:
URL kết nối | https://test.xfiscan.com/stream |
đường dẫn bắt tay | /api/1.0/stream |
khối mới | đăng ký để nhận các khối mới |
giao dịch mới | đăng ký để nhận các giao dịch mới |
Lấy ABI hợp đồng cho mã nguồn hợp đồng đã được xác minh
Trả về Giao diện Nhị phân Ứng dụng Hợp đồng (ABI) của một hợp đồng thông minh đã được xác minh.
**GET** /api/1.0/verify-contract
Yêu cầu
https://xfiscan.com/api/1.0/verify-contract
?chainid=1
&amp;module=contract
&amp;action=getabi
&amp;address=0xBB9bc244D798123fDe783fCc1C72d3Bb8C189413
&amp;apikey=YourApiKeyToken
Tham số
Tham số | Kiểu | Mô tả |
---|---|---|
địa chỉ | chuỗi | địa chỉ hợp đồng có mã nguồn đã được xác minh |
Phản hồi Mẫu
],\"name\":\"proposals\",\"outputs\":[{\"name\":\"recipient\",\"type\":\"address\"},,,,,,,,,,,],\"type\":\"function\"},,],\"name\":\"approve\",\"outputs\":[{\"name\":\"success\",\"type\":\"bool\"}],\"type\":\"function\"},],\"type\":\"function\"},],\"type\":\"function\"},],\"type\":\"function\"},],\"type\":\"function\"},],\"type\":\"function\"},],\"type\":\"function\"},,],\"name\":\"executeProposal\",\"outputs\":[{\"name\":\"_success\",\"type\":\"bool\"}],\"type\":\"function\"},,,],\"name\":\"transferFrom\",\"outputs\":[{\"name\":\"success\",\"type\":\"bool\"}],\"type\":\"function\"},],\"type\":\"function\"},],\"type\":\"function\"},],\"type\":\"function\"},],\"type\":\"function\"},],\"name\":\"allowedRecipients\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"type\":\"function\"},,],\"name\":\"transferWithoutReward\",\"outputs\":[{\"name\":\"success\",\"type\":\"bool\"}],\"type\":\"function\"},,,,,,,],\"name\":\"newProposal\",\"outputs\":[{\"name\":\"_proposalID\",\"type\":\"uint256\"}],\"type\":\"function\"},],\"name\":\"DAOpaidOut\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"type\":\"function\"},],\"type\":\"function\"},],\"name\":\"newContract\",\"outputs\":[],\"type\":\"function\"},],\"name\":\"balanceOf\",\"outputs\":[{\"name\":\"balance\",\"type\":\"uint256\"}],\"type\":\"function\"},,],\"name\":\"changeAllowedRecipients\",\"outputs\":[{\"name\":\"_success\",\"type\":\"bool\"}],\"type\":\"function\"},],\"type\":\"function\"},],\"name\":\"paidOut\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"type\":\"function\"},,],\"name\":\"splitDAO\",\"outputs\":[{\"name\":\"_success\",\"type\":\"bool\"}],\"type\":\"function\"},],\"type\":\"function\"},],\"type\":\"function\"},],\"type\":\"function\"},],\"type\":\"function\"},],\"name\":\"retrieveDAOReward\",\"outputs\":[{\"name\":\"_success\",\"type\":\"bool\"}],\"type\":\"function\"},],\"type\":\"function\"},,],\"name\":\"transfer\",\"outputs\":[{\"name\":\"success\",\"type\":\"bool\"}],\"type\":\"function\"},],\"type\":\"function\"},],\"name\":\"createTokenProxy\",\"outputs\":[{\"name\":\"success\",\"type\":\"bool\"}],\"type\":\"function\"},],\"name\":\"getNewDAOAddress\",\"outputs\":[{\"name\":\"_newDAO\",\"type\":\"address\"}],\"type\":\"function\"},,],\"name\":\"vote\",\"outputs\":[{\"name\":\"_voteID\",\"type\":\"uint256\"}],\"type\":\"function\"},],\"type\":\"function\"},],\"name\":\"rewardToken\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"type\":\"function\"},,,],\"name\":\"transferFromWithoutReward\",\"outputs\":[{\"name\":\"success\",\"type\":\"bool\"}],\"type\":\"function\"},,],\"name\":\"allowance\",\"outputs\":[{\"name\":\"remaining\",\"type\":\"uint256\"}],\"type\":\"function\"},],\"name\":\"changeProposalDeposit\",\"outputs\":[],\"type\":\"function\"},],\"name\":\"blocked\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"type\":\"function\"},],\"type\":\"function\"},,,,],\"name\":\"checkProposalCode\",\"outputs\":[{\"name\":\"_codeChecksOut\",\"type\":\"bool\"}],\"type\":\"function\"},],\"type\":\"function\"},,,,,,],\"type\":\"constructor\"},,,],\"name\":\"Transfer\",\"type\":\"event\"},,,],\"name\":\"Approval\",\"type\":\"event\"},],\"name\":\"FuelingToDate\",\"type\":\"event\"},,],\"name\":\"CreatedToken\",\"type\":\"event\"},,],\"name\":\"Refund\",\"type\":\"event\"},,,,,],\"name\":\"ProposalAdded\",\"type\":\"event\"},,,],\"name\":\"Voted\",\"type\":\"event\"},,,],\"name\":\"ProposalTallied\",\"type\":\"event\"},],\"name\":\"NewCurator\",\"type\":\"event\"},,],\"name\":\"AllowedRecipientChanged\",\"type\":\"event\"}]"
}
Nhận mã nguồn hợp đồng cho mã nguồn đã được xác minh
Trả về mã nguồn Solidity của một hợp đồng thông minh đã được xác minh.
Bạn cũng có thể tải xuống danh sách địa chỉ hợp đồng đã được xác minh dưới dạng tệp CSV của những hợp đồng mà nhà xuất bản mã đã cung cấp giấy phép nguồn mở tương ứng để phân phối lại.
**GET** api/1.0/verify-contract
Yêu cầu
https://xfiscan.com/api/1.0/verify-contract
?chainid=1
&amp;module=contract
&amp;action=getsourcecode
&amp;address=0xBB9bc244D798123fDe783fCc1C72d3Bb8C189413
&amp;apikey=YourApiKeyToken
Thông số
Tham số | Loại | Mô tả |
---|---|---|
địa chỉ | chuỗi | địa chỉ hợp đồng có mã nguồn đã được xác minh |
Phản hồi mẫu
contract Token is TokenInterface
function balanceOf(address _owner) constant returns (uint256 balance)
function transfer(address _to, uint256 _amount) noEther returns (bool success) else
}
function transferFrom(
address _from,
address _to,
uint256 _amount
) noEther returns (bool success) else
}
function approve(address _spender, uint256 _amount) returns (bool success)
function allowance(address _owner, address _spender) constant returns (uint256 remaining)
}
/*
This file is part of the DAO.
The DAO is free software: you can redistribute it and/or modify
it under the terms of the GNU lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
The DAO is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU lesser General Public License for more details.
You should have received a copy of the GNU lesser General Public License
along with the DAO. If not, see .
*/
/*
Basic account, used by the DAO contract to separately manage both the rewards
and the extraBalance accounts.
*/
contract ManagedAccountInterface
contract ManagedAccount is ManagedAccountInterface
// When the contract receives a transaction without data this is called.
// It counts the amount of ether it receives and stores it in
// accumulatedInput.
function()
function payOut(address _recipient, uint _amount) returns (bool) else
}
}
/*
This file is part of the DAO.
The DAO is free software: you can redistribute it and/or modify
it under the terms of the GNU lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
The DAO is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU lesser General Public License for more details.
You should have received a copy of the GNU lesser General Public License
along with the DAO. If not, see .
*/
/*
* Token Creation contract, used by the DAO to create its tokens and initialize
* its ether. Feel free to modify the divisor method to implement different
* Token Creation parameters
*/
contract TokenCreationInterface
contract TokenCreation is TokenCreationInterface, Token
function createTokenProxy(address _tokenHolder) returns (bool success)
return true;
}
throw;
}
function refund() noEther
}
}
function divisor() constant returns (uint divisor) else if (closingTime - 4 days &gt; now) else
}
}
/*
This file is part of the DAO.
The DAO is free software: you can redistribute it and/or modify
it under the terms of the GNU lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
The DAO is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU lesser General Public License for more details.
You should have received a copy of the GNU lesser General Public License
along with the DAO. If not, see .
*/
/*
Standard smart contract for a Decentralized Autonomous Organization (DAO)
to automate organizational governance and decision-making.
*/
contract DAOInterface
// Used only in the case of a newCurator proposal.
struct SplitData
// Used to restrict access to certain functions to only DAO Token Holders
modifier onlyTokenholders {}
/// @dev Constructor setting the Curator and the address
/// for the contract able to create another DAO as well as the parameters
/// for the DAO Token Creation
/// @param _curator The Curator
/// @param _daoCreator The contract able to (re)create this DAO
/// @param _proposalDeposit The deposit to be paid for a regular proposal
/// @param _minTokensToCreate Minimum required wei-equivalent tokens
/// to be created for a successful DAO Token Creation
/// @param _closingTime Date (in Unix time) of the end of the DAO Token Creation
/// @param _privateCreation If zero the DAO Token Creation is open to public, a
/// non-zero address means that the DAO Token Creation is only for the address
// This is the constructor: it can not be overloaded so it is commented out
// function DAO(
// address _curator,
// DAO_Creator _daoCreator,
// uint _proposalDeposit,
// uint _minTokensToCreate,
// uint _closingTime,
// address _privateCreation
// );
/// @notice Create Token with `msg.sender` as the beneficiary
/// @return Whether the token creation was successful
function () returns (bool success);
/// @dev This function is used to send ether back
/// to the DAO, it can also be used to receive payments that should not be
/// counted as rewards (donations, grants, etc.)
/// @return Whether the DAO received the ether successfully
function receiveEther() returns(bool);
/// @notice `msg.sender` creates a proposal to send `_amount` Wei to
/// `_recipient` with the transaction data `_transactionData`. If
/// `_newCurator` is true, then this is a proposal that splits the
/// DAO and sets `_recipient` as the new DAO's Curator.
/// @param _recipient Address of the recipient of the proposed transaction
/// @param _amount Amount of wei to be sent with the proposed transaction
/// @param _description String describing the proposal
/// @param _transactionData Data of the proposed transaction
/// @param _debatingPeriod Time used for debating a proposal, at least 2
/// weeks for a regular proposal, 10 days for new Curator proposal
/// @param _newCurator Bool defining whether this proposal is about
/// a new Curator or not
/// @return The proposal ID. Needed for voting on the proposal
function newProposal(
address _recipient,
uint _amount,
string _description,
bytes _transactionData,
uint _debatingPeriod,
bool _newCurator
) onlyTokenholders returns (uint _proposalID);
/// @notice Check that the proposal with the ID `_proposalID` matches the
/// transaction which sends `_amount` with data `_transactionData`
/// to `_recipient`
/// @param _proposalID The proposal ID
/// @param _recipient The recipient of the proposed transaction
/// @param _amount The amount of wei to be sent in the proposed transaction
/// @param _transactionData The data of the proposed transaction
/// @return Whether the proposal ID matches the transaction data or not
function checkProposalCode(
uint _proposalID,
address _recipient,
uint _amount,
bytes _transactionData
) constant returns (bool _codeChecksOut);
/// @notice Vote on proposal `_proposalID` with `_supportsProposal`
/// @param _proposalID The proposal ID
/// @param _supportsProposal Yes/No - support of the proposal
/// @return The vote ID.
function vote(
uint _proposalID,
bool _supportsProposal
) onlyTokenholders returns (uint _voteID);
/// @notice Checks whether proposal `_proposalID` with transaction data
/// `_transactionData` has been voted for or rejected, and executes the
/// transaction in the case it has been voted for.
/// @param _proposalID The proposal ID
/// @param _transactionData The data of the proposed transaction
/// @return Whether the proposed transaction has been executed or not
function executeProposal(
uint _proposalID,
bytes _transactionData
) returns (bool _success);
/// @notice ATTENTION! I confirm to move my remaining ether to a new DAO
/// with `_newCurator` as the new Curator, as has been
/// proposed in proposal `_proposalID`. This will burn my tokens. This can
/// not be undone and will split the DAO into two DAO's, with two
/// different underlying tokens.
/// @param _proposalID The proposal ID
/// @param _newCurator The new Curator of the new DAO
/// @dev This function, when called for the first time for this proposal,
/// will create a new DAO and send the sender's portion of the remaining
/// ether and Reward Tokens to the new DAO. It will also burn the DAO Tokens
/// of the sender.
function splitDAO(
uint _proposalID,
address _newCurator
) returns (bool _success);
/// @dev can only be called by the DAO itself through a proposal
/// updates the contract of the DAO by sending all ether and rewardTokens
/// to the new DAO. The new DAO needs to be approved by the Curator
/// @param _newContract the address of the new contract
function newContract(address _newContract);
/// @notice Add a new possible recipient `_recipient` to the whitelist so
/// that the DAO can send transactions to them (using proposals)
/// @param _recipient New recipient address
/// @dev Can only be called by the current Curator
/// @return Whether successful or not
function changeAllowedRecipients(address _recipient, bool _allowed) external returns (bool _success);
/// @notice Change the minimum deposit required to submit a proposal
/// @param _proposalDeposit The new proposal deposit
/// @dev Can only be called by this DAO (through proposals with the
/// recipient being this DAO itself)
function changeProposalDeposit(uint _proposalDeposit) external;
/// @notice Move rewards from the DAORewards managed account
/// @param _toMembers If true rewards are moved to the actual reward account
/// for the DAO. If not then it's moved to the DAO itself
/// @return Whether the call was successful
function retrieveDAOReward(bool _toMembers) external returns (bool _success);
/// @notice Get my portion of the reward that was sent to `rewardAccount`
/// @return Whether the call was successful
function getMyReward() returns(bool _success);
/// @notice Withdraw `_account`'s portion of the reward from `rewardAccount`
/// to `_account`'s balance
/// @return Whether the call was successful
function withdrawRewardFor(address _account) internal returns (bool _success);
/// @notice Send `_amount` tokens to `_to` from `msg.sender`. Prior to this
/// getMyReward() is called.
/// @param _to The address of the recipient
/// @param _amount The amount of tokens to be transfered
/// @return Whether the transfer was successful or not
function transferWithoutReward(address _to, uint256 _amount) returns (bool success);
/// @notice Send `_amount` tokens to `_to` from `_from` on the condition it
/// is approved by `_from`. Prior to this getMyReward() is called.
/// @param _from The address of the sender
/// @param _to The address of the recipient
/// @param _amount The amount of tokens to be transfered
/// @return Whether the transfer was successful or not
function transferFromWithoutReward(
address _from,
address _to,
uint256 _amount
) returns (bool success);
/// @notice Doubles the 'minQuorumDivisor' in the case quorum has not been
/// achieved in 52 weeks
/// @return Whether the change was successful or not
function halveMinQuorum() returns (bool _success);
/// @return total number of proposals ever created
function numberOfProposals() constant returns (uint _numberOfProposals);
/// @param _proposalID Id of the new curator proposal
/// @return Address of the new DAO
function getNewDAOAddress(uint _proposalID) constant returns (address _newDAO);
/// @param _account The address of the account which is checked.
/// @return Whether the account is blocked (not allowed to transfer tokens) or not.
function isBlocked(address _account) internal returns (bool);
/// @notice If the caller is blocked by a proposal whose voting deadline
/// has exprired then unblock him.
/// @return Whether the account is blocked (not allowed to transfer tokens) or not.
function unblockMe() returns (bool);
event ProposalAdded(
uint indexed proposalID,
address recipient,
uint amount,
bool newCurator,
string description
);
event Voted(uint indexed proposalID, bool position, address indexed voter);
event ProposalTallied(uint indexed proposalID, bool result, uint quorum);
event NewCurator(address indexed _newCurator);
event AllowedRecipientChanged(address indexed _recipient, bool _allowed);
}
// The DAO contract itself
contract DAO is DAOInterface, Token, TokenCreation
function DAO(
address _curator,
DAO_Creator _daoCreator,
uint _proposalDeposit,
uint _minTokensToCreate,
uint _closingTime,
address _privateCreation
) TokenCreation(_minTokensToCreate, _closingTime, _privateCreation)
function () returns (bool success)
function receiveEther() returns (bool)
function newProposal(
address _recipient,
uint _amount,
string _description,
bytes _transactionData,
uint _debatingPeriod,
bool _newCurator
) onlyTokenholders returns (uint _proposalID) else if (
!_newCurator
&amp;&amp; (!isRecipientAllowed(_recipient) || (_debatingPeriod &lt; minProposalDebatePeriod))
)
if (_debatingPeriod &gt; 8 weeks)
throw;
if (!isFueled
|| now &lt; closingTime
|| (msg.value &lt; proposalDeposit &amp;&amp; !_newCurator))
if (now + _debatingPeriod &lt; now) // prevents overflow
throw;
// to prevent a 51% attacker to convert the ether into deposit
if (msg.sender == address(this))
throw;
_proposalID = proposals.length++;
Proposal p = proposals[_proposalID];
p.recipient = _recipient;
p.amount = _amount;
p.description = _description;
p.proposalHash = sha3(_recipient, _amount, _transactionData);
p.votingDeadline = now + _debatingPeriod;
p.open = true;
//p.proposalPassed = False; // that's default
p.newCurator = _newCurator;
if (_newCurator)
p.splitData.length++;
p.creator = msg.sender;
p.proposalDeposit = msg.value;
sumOfProposalDeposits += msg.value;
ProposalAdded(
_proposalID,
_recipient,
_amount,
_newCurator,
_description
);
}
function checkProposalCode(
uint _proposalID,
address _recipient,
uint _amount,
bytes _transactionData
) noEther constant returns (bool _codeChecksOut)
function vote(
uint _proposalID,
bool _supportsProposal
) onlyTokenholders noEther returns (uint _voteID)
if (_supportsProposal) else
if (blocked[msg.sender] == 0) else if (p.votingDeadline &gt; proposals[blocked[msg.sender]].votingDeadline)
Voted(_proposalID, _supportsProposal, msg.sender);
}
function executeProposal(
uint _proposalID,
bytes _transactionData
) noEther returns (bool _success)
// Check if the proposal can be executed
if (now &lt; p.votingDeadline // has the voting deadline arrived?
// Have the votes been counted?
|| !p.open
// Does the transaction code match the proposal?
|| p.proposalHash != sha3(p.recipient, p.amount, _transactionData))
// If the curator removed the recipient from the whitelist, close the proposal
// in order to free the deposit and allow unblocking of voters
if (!isRecipientAllowed(p.recipient))
bool proposalCheck = true;
if (p.amount &gt; actualBalance())
proposalCheck = false;
uint quorum = p.yea + p.nay;
// require 53% for calling newContract()
if (_transactionData.length &gt;= 4 &amp;&amp; _transactionData[0] == 0x68
&amp;&amp; _transactionData[1] == 0x37 &amp;&amp; _transactionData[2] == 0xff
&amp;&amp; _transactionData[3] == 0x1e
&amp;&amp; quorum &lt; minQuorum(actualBalance() + rewardToken[address(this)]))
if (quorum &gt;= minQuorum(p.amount))
// Execute result
if (quorum &gt;= minQuorum(p.amount) &amp;&amp; p.yea &gt; p.nay &amp;&amp; proposalCheck)
}
closeProposal(_proposalID);
// Initiate event
ProposalTallied(_proposalID, _success, quorum);
}
function closeProposal(uint _proposalID) internal
function splitDAO(
uint _proposalID,
address _newCurator
) noEther onlyTokenholders returns (bool _success)
// If the new DAO doesn't exist yet, create the new DAO and store the
// current split data
if (address(p.splitData[0].newDAO) == 0)
// Move ether and assign new Tokens
uint fundsToBeMoved =
(balances[msg.sender] * p.splitData[0].splitBalance) /
p.splitData[0].totalSupply;
if (p.splitData[0].newDAO.createTokenProxy.value(fundsToBeMoved)(msg.sender) == false)
throw;
// Assign reward rights to new DAO
uint rewardTokenToBeMoved =
(balances[msg.sender] * p.splitData[0].rewardToken) /
p.splitData[0].totalSupply;
uint paidOutToBeMoved = DAOpaidOut[address(this)] * rewardTokenToBeMoved /
rewardToken[address(this)];
rewardToken[address(p.splitData[0].newDAO)] += rewardTokenToBeMoved;
if (rewardToken[address(this)] &lt; rewardTokenToBeMoved)
throw;
rewardToken[address(this)] -= rewardTokenToBeMoved;
DAOpaidOut[address(p.splitData[0].newDAO)] += paidOutToBeMoved;
if (DAOpaidOut[address(this)] &lt; paidOutToBeMoved)
throw;
DAOpaidOut[address(this)] -= paidOutToBeMoved;
// Burn DAO Tokens
Transfer(msg.sender, 0, balances[msg.sender]);
withdrawRewardFor(msg.sender); // be nice, and get his rewards
totalSupply -= balances[msg.sender];
balances[msg.sender] = 0;
paidOut[msg.sender] = 0;
return true;
}
function newContract(address _newContract)
//move all reward tokens
rewardToken[_newContract] += rewardToken[address(this)];
rewardToken[address(this)] = 0;
DAOpaidOut[_newContract] += DAOpaidOut[address(this)];
DAOpaidOut[address(this)] = 0;
}
function retrieveDAOReward(bool _toMembers) external noEther returns (bool _success)
else
DAOpaidOut[msg.sender] += reward;
return true;
}
function getMyReward() noEther returns (bool _success)
function withdrawRewardFor(address _account) noEther internal returns (bool _success)
function transfer(address _to, uint256 _value) returns (bool success) else
}
function transferWithoutReward(address _to, uint256 _value) returns (bool success)
function transferFrom(address _from, address _to, uint256 _value) returns (bool success) else
}
function transferFromWithoutReward(
address _from,
address _to,
uint256 _value
) returns (bool success)
function transferPaidOut(
address _from,
address _to,
uint256 _value
) internal returns (bool success)
function changeProposalDeposit(uint _proposalDeposit) noEther external
proposalDeposit = _proposalDeposit;
}
function changeAllowedRecipients(address _recipient, bool _allowed) noEther external returns (bool _success)
function isRecipientAllowed(address _recipient) internal returns (bool _isAllowed)
function actualBalance() constant returns (uint _actualBalance)
function minQuorum(uint _value) internal constant returns (uint _minQuorum)
function halveMinQuorum() returns (bool _success) else
}
function createNewDAO(address _newCurator) internal returns (DAO _newDAO)
function numberOfProposals() constant returns (uint _numberOfProposals)
function getNewDAOAddress(uint _proposalID) constant returns (address _newDAO)
function isBlocked(address _account) internal returns (bool) else
}
function unblockMe() returns (bool)
}
contract DAO_Creator
}
",
"ABI":"[{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"proposals\",\"outputs\":[{\"name\":\"recipient\",\"type\":\"address\"},,,,,,,,,,,],\"type\":\"function\"},,],\"name\":\"approve\",\"outputs\":[{\"name\":\"success\",\"type\":\"bool\"}],\"type\":\"function\"},],\"type\":\"function\"},],\"type\":\"function\"},],\"type\":\"function\"},],\"type\":\"function\"},],\"type\":\"function\"},],\"type\":\"function\"},,],\"name\":\"executeProposal\",\"outputs\":[{\"name\":\"_success\",\"type\":\"bool\"}],\"type\":\"function\"},,,],\"name\":\"transferFrom\",\"outputs\":[{\"name\":\"success\",\"type\":\"bool\"}],\"type\":\"function\"},],\"type\":\"function\"},],\"type\":\"function\"},],\"type\":\"function\"},],\"type\":\"function\"},],\"name\":\"allowedRecipients\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"type\":\"function\"},,],\"name\":\"transferWithoutReward\",\"outputs\":[{\"name\":\"success\",\"type\":\"bool\"}],\"type\":\"function\"},,,,,,,],\"name\":\"newProposal\",\"outputs\":[{\"name\":\"_proposalID\",\"type\":\"uint256\"}],\"type\":\"function\"},],\"name\":\"DAOpaidOut\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"type\":\"function\"},],\"type\":\"function\"},],\"name\":\"newContract\",\"outputs\":[],\"type\":\"function\"},],\"name\":\"balanceOf\",\"outputs\":[{\"name\":\"balance\",\"type\":\"uint256\"}],\"type\":\"function\"},,],\"name\":\"changeAllowedRecipients\",\"outputs\":[{\"name\":\"_success\",\"type\":\"bool\"}],\"type\":\"function\"},],\"type\":\"function\"},],\"name\":\"paidOut\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"type\":\"function\"},,],\"name\":\"splitDAO\",\"outputs\":[{\"name\":\"_success\",\"type\":\"bool\"}],\"type\":\"function\"},],\"type\":\"function\"},],\"type\":\"function\"},],\"type\":\"function\"},],\"type\":\"function\"},],\"name\":\"retrieveDAOReward\",\"outputs\":[{\"name\":\"_success\",\"type\":\"bool\"}],\"type\":\"function\"},],\"type\":\"function\"},,],\"name\":\"transfer\",\"outputs\":[{\"name\":\"success\",\"type\":\"bool\"}],\"type\":\"function\"},],\"type\":\"function\"},],\"name\":\"createTokenProxy\",\"outputs\":[{\"name\":\"success\",\"type\":\"bool\"}],\"type\":\"function\"},],\"name\":\"getNewDAOAddress\",\"outputs\":[{\"name\":\"_newDAO\",\"type\":\"address\"}],\"type\":\"function\"},,],\"name\":\"vote\",\"outputs\":[{\"name\":\"_voteID\",\"type\":\"uint256\"}],\"type\":\"function\"},],\"type\":\"function\"},],\"name\":\"rewardToken\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"type\":\"function\"},,,],\"name\":\"transferFromWithoutReward\",\"outputs\":[{\"name\":\"success\",\"type\":\"bool\"}],\"type\":\"function\"},,],\"name\":\"allowance\",\"outputs\":[{\"name\":\"remaining\",\"type\":\"uint256\"}],\"type\":\"function\"},],\"name\":\"changeProposalDeposit\",\"outputs\":[],\"type\":\"function\"},],\"name\":\"blocked\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"type\":\"function\"},],\"type\":\"function\"},,,,],\"name\":\"checkProposalCode\",\"outputs\":[{\"name\":\"_codeChecksOut\",\"type\":\"bool\"}],\"type\":\"function\"},],\"type\":\"function\"},,,,,,],\"type\":\"constructor\"},,,],\"name\":\"Transfer\",\"type\":\"event\"},,,],\"name\":\"Approval\",\"type\":\"event\"},],\"name\":\"FuelingToDate\",\"type\":\"event\"},,],\"name\":\"CreatedToken\",\"type\":\"event\"},,],\"name\":\"Refund\",\"type\":\"event\"},,,,,],\"name\":\"ProposalAdded\",\"type\":\"event\"},,,],\"name\":\"Voted\",\"type\":\"event\"},,,],\"name\":\"ProposalTallied\",\"type\":\"event\"},],\"name\":\"NewCurator\",\"type\":\"event\"},,],\"name\":\"AllowedRecipientChanged\",\"type\":\"event\"}]",
"ContractName":"DAO",
"CompilerVersion":"v0.3.1-2016-04-12-3ad5e82",
"OptimizationUsed":"1",
"Runs":"200",
"ConstructorArguments":"000000000000000000000000da4a4626d3e16e094de3225a751aab7128e965260000000000000000000000004a574510c7014e4ae985403536074abe582adfc80000000000000000000000000000000000000000000000001bc16d674ec80000000000000000000000000000000000000000000000000a968163f0a57b4000000000000000000000000000000000000000000000000000000000000057495e100000000000000000000000000000000000000000000000000000000000000000",
"EVMVersion":"Default",
"Library":"",
"LicenseType":"",
"Proxy":"0",
"Implementation":"",
"SwarmSource":""
}
]
}
Lấy Người Tạo Hợp Đồng và Mã Băm Giao Dịch Tạo Hợp Đồng
Trả về địa chỉ người tạo hợp đồng và mã băm giao dịch mà nó đã được tạo, tối đa 5 hợp đồng mỗi lần.
**LẤY** /api/1.0/verify-contract
Yêu Cầu
https://xfiscan.com/api/1.0/verify-contract
?chainid=1
&amp;module=contract
&amp;action=getcontractcreation
&amp;contractaddresses=0xB83c27805aAcA5C7082eB45C868d955Cf04C337F,
0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45,
0xe4462eb568E2DFbb5b0cA2D3DbB1A35C9Aa98aad,
0xdAC17F958D2ee523a2206206994597C13D831ec7,
0xf5b969064b91869fBF676ecAbcCd1c5563F591d0
&amp;apikey=MãApiKeyCủaBạn
Tham Số
Tham Số | Loại | Mô tả |
---|---|---|
contractaddresses | chuỗi | Các địa chỉ hợp đồng, tối đa 5 địa chỉ mỗi lần. |
Ví Dụ Phản Hồi
{
"status": "1",
"message": "OK",
"result": [
{
"contractAddress": "0xB83c27805aAcA5C7082eB45C868d955Cf04C337F",
"contractCreator": "0xa331f5c6b23c87d292da8b2118ebcc6a39633bb2",
"txHash": "0x66cc14d6fc72561965e5f4a8088f17ae044fa4f0dc5a0eddfb3d1637022f6724"
},
{
"contractAddress": "0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45",
"contractCreator": "0x1234567890abcdef1234567890abcdef12345678",
"txHash": "0x39a35b84ee7013edfdd1b03e5004e11302d08dfd01da366694529816a33e92ee"
}
]
}
Kiểm Tra Trạng Thái Xác Minh Mã Nguồn
Trả về trạng thái thành công hoặc lỗi của một yêu cầu xác minh hợp đồng.
**LẤY** /api/1.0/verify-contract
Yêu Cầu
https://xfiscan.com/api/1.0/verify-contract
?chainid=1
&amp;module=contract
&amp;action=checkverifystatus
&amp;guid=x3ryqcqr1zdknhfhkimqmizlcqpxncqc6nrvp3pgrcpfsqedqi
&amp;apikey=MãApiKeyCủaBạn
Tham Số
Tham Số | Loại | Mô tả |
---|---|---|
apikey | chuỗi | Token khoá API của bạn. |
module | chuỗi | Hợp đồng. |
action | chuỗi | Xác minh mã nguồn. Giá trị có sẵn: getabi , getsourececode , getcontractcreation , verifysourcecode , checkverifystatus , verifyproxycontract , checkproxyverification . |
address | chuỗi | Địa chỉ hợp đồng có mã nguồn đã xác minh. |
contractaddresses | mảng[chuỗi] | Các địa chỉ hợp đồng, tối đa 5 mỗi lần. |
guid | chuỗi | GUID duy nhất nhận từ yêu cầu xác minh. |
chainid | chuỗi | Chuỗi để gửi xác minh, chẳng hạn như 1 cho mainnet. |
Ví Dụ Phản Hồi
{
"status": "1",
"message": "OK",
"result": "Đạt - Đã xác minh"
}
Xác Minh Mã Nguồn
Điểm cuối này được giới hạn 100 xác minh/ngày, bất kể hạng API PRO.
Yêu cầu chịu trách nhiệm xác minh hợp đồng. Nộp mã nguồn hợp đồng tới một trình thám hiểm để xác minh.
**POST**/api/1.0/verify-contract
Yêu Cầu
https://xfiscan.com/api/1.0/verify-contract
?chainid=1
&amp;module=contract
&amp;action=verifysourcecode
&amp;apikey=MãApiKeyCủaBạn
Tham Số | Loại | Mô tả |
---|---|---|
chainid | chuỗi | Chuỗi để gửi xác minh, chẳng hạn như 1 cho mainnet. |
codeformat | chuỗi | Tệp đơn, sử dụng solidity-single-file JSON (khuyến nghị), hoặc solidity-standard-json-input . |
sourceCode | chuỗi | Mã nguồn Solidity. |
constructorArguments | chuỗi | Tùy chọn, bao gồm nếu hợp đồng của bạn sử dụng các tham số khởi tạo. |
contractaddresses | mảng[chuỗi] | Các địa chỉ hợp đồng, tối đa 5 mỗi lần. |
contractname | chuỗi | Tên của hợp đồng của bạn, ví dụ: Contracts/Verified.sol:Verified . |
compilerversion | chuỗi | Phiên bản trình biên dịch sử dụng, chẳng hạn: v0.8.24+commit.e11b9e09 . |
Danh sách phiên bản trình biên dịch
Lấy danh sách các phiên bản trình biên dịch.
**LẤY**/api/1.0/verify-contract/compiler-versions
Ví Dụ Phản Hồi
[
"v0.8.28+commit.7893614a",
"v0.8.27+commit.40a35a09",
"v0.8.26+commit.8a97fa7a",
"v0.8.25+commit.b61c2a91",
"v0.8.24+commit.e11b9e09",
"v0.8.23+commit.f704f362",
"v0.8.22+commit.4fc1097e",
"v0.8.21+commit.d9974bed",
"v0.8.20+commit.a1b79de6",
"v0.8.19+commit.7dd6d404",
"v0.8.18+commit.87f61d96",
"v0.8.17+commit.8df45f5f",
"v0.8.16+commit.07c72cc2",
"v0.8.15+commit.e14f2714",
"v0.8.14+commit.80d49f37",
"v0.8.13+commit.abaa5c0e"
]
XDS
LẤY/api/1.0/xds/grace-period
Điểm cuối này trả về thời gian "thời gian gia hạn" (tính bằng mili giây), được sử dụng để quản lý XDS.
Tham Số
Không có
Lược đồ Phản hồi
Tham Số | Loại | Mô tả |
---|---|---|
gracePeriod | số | Thời gian gia hạn tính bằng mili giây. |
Ví Dụ Phản Hồi
{
"gracePeriod": 2592000000
}
LẤY/api/1.0/xds/resolve/
Điểm cuối này truy xuất chi tiết của một tên XDS hoặc địa chỉ.
Tham Số
Tham Số | Loại | Mô tả |
---|---|---|
nameOrAddress | chuỗi | Tên XDS hoặc địa chỉ để giải quyết. |
Ví Dụ Phản Hồi
{
"name": "example.xds",
"address": "0x9449078b371ff30a90ec36fe6191f164cd527d64",
"cost": 1000000000000000000,
"createDate": "2023-10-05T14:17:14.281Z",
"expires": "2024-10-05T14:17:14.281Z",
"id": "66fc7d0a34e123456789abcd",
"label": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
"node": "0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890",
"owner": "0x9449078b371ff30a90ec36fe6191f164cd527d64",
"premium": 0,
"primary": true,
"updateDate": "2023-10-05T14:17:14.281Z",
"ownerXds": {
"address": "0x9449078b371ff30a90ec36fe6191f164cd527d64",
"name": "owner.xds",
"expires": "2024-10-05T14:17:14.281Z"
}
}
Lược đồ Phản hồi
Tham Số | Loại | Mô tả |
---|---|---|
name | chuỗi | Tên được giải quyết tới địa chỉ. |
address | chuỗi | Địa chỉ liên kết với tên XDS. |
cost | số | Chi phí của tên trong chuỗi khối. |
createDate | chuỗi (ngày-giờ) | Ngày tạo tên XDS. |
expires | chuỗi (ngày-giờ) | Ngày hết hạn của tên XDS. |
id | chuỗi | ID duy nhất của tên hoặc địa chỉ. |
label | chuỗi | Biểu diễn băm của nhãn tên. |
node | chuỗi | Biểu diễn băm của node tên. |
người sở hữu | chuỗi | Địa chỉ của chủ sở hữu tên. |
phí bảo hiểm | số | Chi phí bảo hiểm cho tên (nếu có). |
chính | boolean | Liệu tên có phải là chính (đúng/sai). |
ngày cập nhật | chuỗi (ngày-giờ) | Ngày cập nhật cuối của tên XDS. |
chủ sở hữu Xds | đối tượng | Chi tiết về XDS của chủ sở hữu (đối tượng lồng nhau). |
- địa chỉ | chuỗi | Địa chỉ của chủ sở hữu XDS. |
- tên | chuỗi | Tên liên kết với XDS của chủ sở hữu. |
- hết hạn | chuỗi (ngày-giờ) | Ngày hết hạn của XDS của chủ sở hữu. |
GET/api/1.0/xds/
Điểm cuối này truy xuất chi tiết về tên miền XDS (tương tự ENS).
Tham số
Tham số | Loại | Mô tả |
---|---|---|
tên | chuỗi | Tên XDS cần tra cứu. |
Phản hồi Mẫu
{
"name": "sample.xds",
"address": "0x9449078b371ff30a90ec36fe6191f164cd527d64",
"cost": 1000000000000000000,
"createDate": "2023-10-05T14:17:14.281Z",
"expires": "2024-10-05T14:17:14.281Z",
"id": "66fc7d0a34e123456789abcd",
"label": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
"node": "0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890",
"owner": "0x9449078b371ff30a90ec36fe6191f164cd527d64",
"premium": 0,
"primary": true,
"updateDate": "2023-10-05T14:17:14.281Z",
"ownerXds": {
"address": "0x9449078b371ff30a90ec36fe6191f164cd527d64",
"name": "owner.xds",
"expires": "2024-10-05T14:17:14.281Z"
}
}
Schema Phản hồi
Tham số | Loại | Mô tả |
---|---|---|
tên | chuỗi | Tên miền XDS |
địa chỉ | chuỗi | Địa chỉ liên kết với tên |
chi phí | số | Chi phí của tên miền trong đơn vị blockchain |
ngày tạo | chuỗi | Ngày khi tên được đăng ký |
hết hạn | chuỗi | Ngày hết hạn của tên |
id | chuỗi | Số định danh duy nhất của tên XDS |
nhãn | chuỗi | Hash nhãn của tên |
nút | chuỗi | Hash nút của tên |
chủ sở hữu | chuỗi | Địa chỉ chủ sở hữu của tên XDS |
phí bảo hiểm | số | Phí bảo hiểm cho tên (nếu có) |
chính | boolean | Liệu đây có phải là tên chính (đúng/sai) |
ngày cập nhật | chuỗi | Ngày sửa đổi cuối của bản ghi XDS |
chủ sở hữu Xds | đối tượng | Chi tiết của XDS của chủ sở hữu (đối tượng lồng nhau) |
- địa chỉ | chuỗi | Địa chỉ liên kết với chủ sở hữu |
- tên | chuỗi | Tên liên kết với chủ sở hữu |
- hết hạn | chuỗi | Ngày hết hạn của XDS của chủ sở hữu |
GET/api/1.0/xds
Điểm cuối này truy xuất danh sách tên XDS phân trang cùng metadata chi tiết.
Tham số | Loại | Mô tả |
---|---|---|
hết hạn | chuỗi (ngày-giờ) | Ngày hết hạn của tên XDS |
phí bảo hiểm | số | Phí bảo hiểm cho tên (nếu có) |
chủ sở hữu | chuỗi | Địa chỉ của chủ sở hữu |
tên | chuỗi | Tên XDS cần tìm kiếm |
địa chỉ | chuỗi | Địa chỉ blockchain liên kết với tên |
địa chỉ | mảng[chuỗi] | Mảng địa chỉ tài khoản nhiều |
nhãn | chuỗi | Đại diện hash nhãn của tên |
chi phí | số | Chi phí của tên XDS |
chính | boolean | Liệu tên có phải là chỉ số chính |
tên tìm kiếm | chuỗi | Truy vấn tìm kiếm tên |
trang | số | Số trang (mặc định: 1) |
giới hạn | số | Số bản ghi mỗi trang (mặc định: 10) |
sắp xếp | chuỗi | Trường sắp xếp (mặc định: -blockNumber ) |
chọn | chuỗi | Trường để bao gồm trong phần phản hồi |
Phản hồi Mẫu
{
"docs": [
{
"name": "example.xds",
"address": "0x9449078b371ff30a90ec36fe6191f164cd527d64",
"cost": 1000000000000000000,
"createDate": "2023-10-05T14:17:14.281Z",
"expires": "2024-10-05T14:17:14.281Z",
"id": "66fc7d0a34e123456789abcd",
"label": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
"node": "0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890",
"owner": "0x9449078b371ff30a90ec36fe6191f164cd527d64",
"premium": 0,
"primary": true,
"updateDate": "2023-10-05T14:17:14.281Z",
"ownerXds": {
"address": "0x9449078b371ff30a90ec36fe6191f164cd527d64",
"name": "owner.xds",
"expires": "2024-10-05T14:17:14.281Z"
}
}
],
"hasNext": true,
"limit": 10,
"page": 1
}
Schema Phản hồi
Tham số | Loại | Mô tả |
---|---|---|
tên | chuỗi | Tên miền XDS |
địa chỉ | chuỗi | Địa chỉ liên kết với tên |
chi phí | số | Chi phí của tên trong đơn vị blockchain |
ngày tạo | chuỗi (ngày-giờ) | Ngày khi tên được đăng ký |
hết hạn | chuỗi (ngày-giờ) | Ngày hết hạn của tên |
id | chuỗi ký tự | Mã định danh duy nhất của tên XDS |
nhãn | chuỗi ký tự | Mã băm của nhãn tên |
nút | chuỗi ký tự | Mã băm của nút tên |
chủ sở hữu | chuỗi ký tự | Địa chỉ của chủ sở hữu tên XDS |
cao cấp | số | Phí cao cấp cho tên (nếu có) |
chính | boolean | Xác định đây có phải là tên chính (true/false) không |
ngàyCậpNhật | chuỗi ký tự (ngày-giờ) | Ngày sửa đổi lần cuối của bản ghi XDS |
chủSởHữuXds | đối tượng | Chi tiết của XDS của chủ sở hữu (đối tượng lồng nhau) |
chủSởHữuXds.địaChỉ | chuỗi ký tự | Địa chỉ liên kết với chủ sở hữu |
chủSởHữuXds.tên | chuỗi ký tự | Tên liên kết với chủ sở hữu |
chủSởHữuXds.hếtHạn | chuỗi ký tự (ngày-giờ) | Ngày hết hạn của XDS của chủ sở hữu |
cònTrang | boolean | Chỉ định liệu có tồn tại thêm trang nào không |
trang | số | Số trang hiện tại |
giới hạn | số | Số bản ghi đư ợc trả về mỗi trang |