-
Notifications
You must be signed in to change notification settings - Fork 1
explorer api erc20
dappstore123 edited this page Apr 2, 2019
·
1 revision
目前主网没有 erc20 代币。
浏览器api还支持不完善。
该接口用于ipos区块链浏览器。
查询erc20
GET /tokens.json
说明 这个json 是浏览器写死的
[{
"address": "0x085fb4f24031eaedbc2b611aa528f22343eb52db",
"symbol": "BEC",
"name": "BitEther",
"decimal": 8,
"abi": [{
"constant": false,
"inputs": [],
"name": "getEra",
"outputs": [{
"name": "",
"type": "uint256"
}, {
"name": "",
"type": "uint256"
}, {
"name": "",
"type": "uint256"
}, {
"name": "",
"type": "uint256"
}],
"payable": false,
"type": "function"
}, {
"constant": true,
"inputs": [],
"name": "name",
"outputs": [{
"name": "",
"type": "string"
}],
"payable": false,
"type": "function"
}, {
"constant": false,
"inputs": [{
"name": "_spender",
"type": "address"
}, {
"name": "_value",
"type": "uint256"
}],
"name": "approve",
"outputs": [{
"name": "success",
"type": "bool"
}],
"payable": false,
"type": "function"
}, {
"constant": true,
"inputs": [],
"name": "totalSupply",
"outputs": [{
"name": "",
"type": "uint256"
}],
"payable": false,
"type": "function"
}, {
"constant": false,
"inputs": [{
"name": "_from",
"type": "address"
}, {
"name": "_to",
"type": "address"
}, {
"name": "_value",
"type": "uint256"
}],
"name": "transferFrom",
"outputs": [{
"name": "success",
"type": "bool"
}],
"payable": false,
"type": "function"
}, {
"constant": false,
"inputs": [{
"name": "_eraBlock",
"type": "uint256"
}, {
"name": "_blockMined",
"type": "uint256"
}, {
"name": "_blockNumber",
"type": "uint256"
}, {
"name": "_rewardPrev",
"type": "uint256"
}, {
"name": "_reward",
"type": "uint256"
}],
"name": "getUnclaimed",
"outputs": [{
"name": "",
"type": "uint256"
}],
"payable": false,
"type": "function"
}, {
"constant": true,
"inputs": [],
"name": "decimals",
"outputs": [{
"name": "",
"type": "uint8"
}],
"payable": false,
"type": "function"
}, {
"constant": false,
"inputs": [{
"name": "_block",
"type": "uint256"
}],
"name": "getEraForBlock",
"outputs": [{
"name": "",
"type": "uint256"
}, {
"name": "",
"type": "uint256"
}, {
"name": "",
"type": "uint256"
}, {
"name": "",
"type": "uint256"
}],
"payable": false,
"type": "function"
}, {
"constant": false,
"inputs": [],
"name": "claim",
"outputs": [{
"name": "",
"type": "uint256"
}],
"payable": false,
"type": "function"
}, {
"constant": true,
"inputs": [{
"name": "_owner",
"type": "address"
}],
"name": "balanceOf",
"outputs": [{
"name": "balance",
"type": "uint256"
}],
"payable": false,
"type": "function"
}, {
"constant": true,
"inputs": [],
"name": "symbol",
"outputs": [{
"name": "",
"type": "string"
}],
"payable": false,
"type": "function"
}, {
"constant": false,
"inputs": [{
"name": "_to",
"type": "address"
}, {
"name": "_value",
"type": "uint256"
}],
"name": "transfer",
"outputs": [{
"name": "success",
"type": "bool"
}],
"payable": false,
"type": "function"
}, {
"constant": true,
"inputs": [{
"name": "_owner",
"type": "address"
}, {
"name": "_spender",
"type": "address"
}],
"name": "allowance",
"outputs": [{
"name": "remaining",
"type": "uint256"
}],
"payable": false,
"type": "function"
}, {
"inputs": [],
"type": "constructor"
}, {
"payable": false,
"type": "fallback"
}, {
"anonymous": false,
"inputs": [{
"indexed": true,
"name": "_from",
"type": "address"
}, {
"indexed": true,
"name": "_to",
"type": "address"
}, {
"indexed": false,
"name": "_value",
"type": "uint256"
}],
"name": "Transfer",
"type": "event"
}, {
"anonymous": false,
"inputs": [{
"indexed": true,
"name": "_owner",
"type": "address"
}, {
"indexed": true,
"name": "_spender",
"type": "address"
}, {
"indexed": false,
"name": "_value",
"type": "uint256"
}],
"name": "Approval",
"type": "event"
}, {
"anonymous": false,
"inputs": [{
"indexed": true,
"name": "_miner",
"type": "address"
}, {
"indexed": false,
"name": "_value",
"type": "uint256"
}, {
"indexed": false,
"name": "_current",
"type": "bool"
}],
"name": "Reward",
"type": "event"
}]
}
]
address : 合约地址
symbol : 代币符号
name : 代币名称
decimal : 小数点后长度
abi : api
示例
curl 'http://explorer.iposlab.com/tokens.json' -H 'Accept: application/json, text/plain, */*' --compressed
POST /tokenrelay
{"action":"info","address":"0x085b0fdf115aa9e16ae1bddd396ce1f993c52220"}
{
"balance": "0",
"total_supply": "1.135904972636339269907113e+24",
"count": 0,
"name": "ONEX Network",
"symbol": "ONEX",
"bytecode": "0x60606040"
}
balance : 地址含义ipos数量
total_supply : 代币总数
name : 代币名称
symbol : 代币符号
示例 不可用
curl 'http://explorer.iposlab.com/tokenrelay' -H 'Content-Type: application/json;charset=UTF-8' -H 'Accept: application/json, text/plain, */*' --data-binary '{"action":"info","address":"0x085b0fdf115aa9e16ae1bddd396ce1f993c52220"}' --compressed
POST /tokenrelay
{"action":"balanceOf","user":"0x79a08a72f137d6d6e17fd9aebb2afcf86195ca31","address":"0x085b0fdf115aa9e16ae1bddd396ce1f993c52220"}
user 用户地址
address 合约地址
{"tokens":"150000000"}
示例 不可用
curl 'http://explorer.iposlab.com/tokenrelay' -H 'Content-Type: application/json;charset=UTF-8' -H 'Accept: application/json, text/plain, */*' --data-binary '{"action":"balanceOf","user":"0x79a08a72f137d6d6e17fd9aebb2afcf86195ca31","address":"0x085b0fdf115aa9e16ae1bddd396ce1f993c52220"}' --compressed