麦子网页钱包ETH接口

2020/07/25 note 共 4670 字,约 14 分钟

jsonrpc接口

POST https://jsonrpc.maiziqianbao.net/  
{jsonrpc: "2.0", id: 1, method: "eth_getBalance",…}  
id: 1  
jsonrpc: "2.0"  
method: "eth_getBalance"  
params: ["0xdf7a39507e28ec1cadb7efb50cd0751c1b0e5ea1", "latest"]  
  
{"jsonrpc":"2.0","result":"0x0","id":1}  

获取token余额

GET https://api.maiziqianbao.net/apiEth/getTokensBalancesByAddress?v=1.0&address=0xa51eea2f9ba9be60c960170012c8632ce7a76e62  
  
{  
    "success":true,  
    "data":{  
        "tokenLists":[  
            {  
                "balance":"88888800000000",  
                "price_cny":"0.0000",  
                "decimals":8,  
                "symbol":"KICK",  
                "contractAddress":"0xc12d1c73ee7dc3615ba4e37e4abfdbddfa38907e"  
            },  
            {  
                "balance":"217732939377000000000000",  
                "price_cny":"0.0000",  
                "decimals":18,  
                "symbol":"HOT",  
                "contractAddress":"0x6c6ee5e31d828de241282b9606c8e98ea48526e2"  
            },  
            {  
                "balance":"300000000000000000000",  
                "price_cny":"53.5439",  
                "decimals":18,  
                "symbol":"LINK",  
                "contractAddress":"0x514910771af9ca656af840dff83e8264ecf986ca"  
            }]  
    },  
    "message":""  
}  

gasPriceOracle

GET https://www.etherchain.org/api/gasPriceOracle  
  
{"safeLow":"77.0","standard":"78.0","fast":"81.0","fastest":"89.0"}  

getErc20TransPagingByAddress

POST https://api.maiziqianbao.net/apiEth/getErc20TransPagingByAddress?v=1.0  
{"address":"0xdf7a39507e28ec1cadb7efb50cd0751c1b0e5ea1"}  
  
{"address":"0xdf7a39507e28ec1cadb7efb50cd0751c1b0e5ea1"}  

getEthTransPagingByAddress

POST https://api.maiziqianbao.net/apiEth/getEthTransPagingByAddress?v=1.0  
{"address":"0xdf7a39507e28ec1cadb7efb50cd0751c1b0e5ea1"}  
  
{"success":true,"data":{"txs":[],"total":0},"message":""}  

baseCoinPub

GET https://market.maiziqianbao.net/api/baseCoinPub?v=1.0&code=2275c300e95de840fe9ebc87b3a84f9a&time=1595649416  
  
{"success":true,"data":{"legal":[{"name":"\u4eba\u6c11\u5e01","alias":"CNY","symbol":"\uffe5","rmb":"1","point":"2"},{"name":"\u7f8e\u5143","alias":"USD","symbol":"$","rmb":"7.02","point":"4"},{"name":"\u97e9\u5143","alias":"KRW","symbol":"\u20a9","rmb":"0.0058","point":"2"}],"virtual":[{"name":"\u6bd4\u7279\u5e01","alias":"BTC","symbol":"\u20bf","rmb":"67104.5","point":"8"},{"name":"EOS","alias":"EOS","symbol":"","rmb":"18.52","point":"2"},{"name":"\u4ee5\u592a\u574a","alias":"ETH","symbol":"\u039e","rmb":"1981.5","point":"6"},{"name":"MDS","alias":"MDS","symbol":"","rmb":"0.0223","point":"2"},{"name":"NEO","alias":"NEO","symbol":"NEO","rmb":"79.64","point":"6"},{"name":"TRX","alias":"TRX","symbol":"TRX","rmb":"0.1275","point":"4"}]},"message":""}  
  
{  
  "success":true,  
  "data":{  
    "legal":[  
      {"name":"人民币","alias":"CNY","symbol":"¥","rmb":"1","point":"2"},  
      {"name":"美元","alias":"USD","symbol":"$","rmb":"7.02","point":"4"},  
      {"name":"韩元","alias":"KRW","symbol":"₩","rmb":"0.0058","point":"2"}  
    ],  
    "virtual":[  
      {"name":"比特币","alias":"BTC","symbol":"₿","rmb":"67104.5","point":"8"},  
      {"name":"EOS","alias":"EOS","symbol":"","rmb":"18.52","point":"2"},  
      {"name":"以太坊","alias":"ETH","symbol":"Ξ","rmb":"1981.5","point":"6"},  
      {"name":"MDS","alias":"MDS","symbol":"","rmb":"0.0223","point":"2"},  
      {"name":"NEO","alias":"NEO","symbol":"NEO","rmb":"79.64","point":"6"},  
      {"name":"TRX","alias":"TRX","symbol":"TRX","rmb":"0.1275","point":"4"}  
    ]},  
  "message":""}  

code和time字段计算方法:

time = System.currentTimeMillis() / 1000  
code = md5(time + sha256("SQscorK9G1ZnlCPo" + time) + time)  

tokenListPub

GET https://market.maiziqianbao.net/api/tokenListPub?type=1&code=13b47af2dc549d2058a9bd3fb9ec9312&time=1595649415  
  
{"success":true,"data":[{"ID":"1","name":"Ethereum","alias":"ETH","symbol":"ETH","img":"http:\/\/doc.xinchain.org\/token-logo\/ETH_Ethereum.png","address":"","fixed":"1","point":"4","decimals":"18","type":"1","subType":"ERC20","gasLimit":"25000","last2Rmb":"1988.4150"},{"ID":"2","name":"MediShares","alias":"MDS","symbol":"MDS","img":"http:\/\/doc.xinchain.org\/token-logo\/MDS_MediShares.png","address":"0x66186008c1050627f979d464eabb258860563dbe","fixed":"1","point":"4","decimals":"18","type":"1","subType":"ERC20","gasLimit":"100000","last2Rmb":"0.0238"},{"ID":"2370","name":"MATH Token","alias":"MATH","symbol":"MATH","img":"http:\/\/doc.xinchain.org\/token-logo\/1_MATH_MATH2.png","address":"0x08d967bb0134f2d07f7cfb6e246680c53927dd30","fixed":"0","point":"4","decimals":"18","type":"1","subType":"ERC20","gasLimit":"100000","last2Rmb":"1.2482"},...省略一堆...],"message":""}  
  
{  
    "success":true,  
    "data":[  
        {  
            "ID":"1",  
            "name":"Ethereum",  
            "alias":"ETH",  
            "symbol":"ETH",  
            "img":"http:\/\/doc.xinchain.org\/token-logo\/ETH_Ethereum.png",  
            "address":"",  
            "fixed":"1",  
            "point":"4",  
            "decimals":"18",  
            "type":"1",  
            "subType":"ERC20",  
            "gasLimit":"25000",  
            "last2Rmb":"1988.4150"  
        },  
        {  
            "ID":"2",  
            "name":"MediShares",  
            "alias":"MDS",  
            "symbol":"MDS",  
            "img":"http:\/\/doc.xinchain.org\/token-logo\/MDS_MediShares.png",  
            "address":"0x66186008c1050627f979d464eabb258860563dbe",  
            "fixed":"1",  
            "point":"4",  
            "decimals":"18",  
            "type":"1",  
            "subType":"ERC20",  
            "gasLimit":"100000",  
            "last2Rmb":"0.0238"  
        },  
        ...  
        ],  
    "message":""  
}  

文档信息

Search

    Table of Contents