开发中心 介绍文档 公开合约

公开合约

验证Token合法性
功能类型  验证Token合法性
请求格式  POST
请求地址  http://macwt.sdgl.com.cn/maccnt/v4.1/?52490/func/Appkey/107909662.html?EnterID=89739
提交参数  action|token
提交说明 必填字段: action|token
说明:
action为固定值:VerifyTokenAddress
token:为token地址
返回参数说明 {"errCode":1,"Msg":"********"}
如果errCode==0则成功
v2.0更新说明 未作更新

交易查询2.0(根据Token地址)
功能类型  交易查询2.0(根据Token地址)
请求格式  POST
请求地址  http://macwt.sdgl.com.cn/maccnt/v4.1/?52490/func/Appkey/107909662.html?EnterID=89739
提交参数  action|token|jytype|pageevery|page
提交说明 必填字段: action|token|jytype|pageevery|page
说明:
action为固定值:GetTransactionRecord2
token:为token地址
jytype:为交易类型(缺省为0)(0全部,1转入,2转出)
pageevery:为每页条数(缺省为10)
page:为页数,即显示第几页的数据(缺省为1)
返回参数说明 {"errCode":0,"Msg":"u606du559cuff0cu83b7u53d6u6210u529f","Allnum":"2","Content":[{"blockheight":2265,"blockhash":"******","jyitemid":"4521","hash":"交易哈希","fromtoken":"******","totoken":"******","amount":"0.00000001","time":"2019-01-22 22:58:28","note":""},{"fromtoken":"******","totoken":"******","amount":"1.00000000","time":"2019-01-19 14:01:56","note":"u6d4bu8bd5"}]} 如果errCode==0则成功
Allnum为返回总交易数
Content为交易详情列表(blockheight为区块高度,blockhash为区块hash值,jyitemid为交易ID,hash为交易hash值)
v2.0更新说明
1、可替换原来合约"交易查询(根据Token地址)"
2、不再返回AssetBalance(MAT资产余额)
3、不再返回LockedBalance(锁仓MAT数)
3、action固定值由GetTransRecordAds改成了GetTransactionRecord2
4、新增返回值Allnum(总交易数)
5、交易详情列表新增返回值:blockhash(区块hash值)

资产余额查询(根据Token地址)
功能类型  资产余额查询(根据Token地址)
请求格式  POST
请求地址  http://macwt.sdgl.com.cn/maccnt/v4.1/?52490/func/Appkey/107909662.html?EnterID=89739
提交参数  action|tokenaddress
提交说明 必填字段: action|tokenaddress
说明:
action为固定值:GetAssetBalanceAds
返回参数说明 {"errCode":0,"Msg":"u606du559cuff0cu83b7u53d6u6210u529f","AssetBalance":"0.72000000","LockedBalance":"9900.00000000"} 如果errCode==0则成功,AssetBalance为MAT资产余额,LockedBalance为锁仓MAT数
v2.0更新说明 未作更新

交易查询(根据区块hash)
功能类型  交易查询(根据区块hash)
请求格式  POST
请求地址  http://macwt.sdgl.com.cn/maccnt/v4.1/?52490/func/Appkey/107909662.html?EnterID=89739
提交参数  action|blockhash
提交说明 必填字段: action|blockhash
说明:
action为固定值:GetTransRecordBlockhash
blockhash:为区块hash
返回参数说明 {"errCode":0,"Msg":"u67e5u8be2u6210u529f","blockheight":20,"blockhash":"34b9595a212d287b28a7e97c2a1e91667d87077f6e0238d49f96d60203f54e38","jynum":"2","time":"1547899788124","Content":[{"jyitemid":"30","hash":"2ef8099d1ed2a07be0c901ac80d81bb180693e35ce480f55ef07ccb47e5cc45b","fromtoken":"MACc61f92588c2FEQAJUlVHcgUAgAV","totoken":"MACua5b2af6509bpQCHIgVVRgUSVAB","amount":"1.00000000","time":"1547899788124","note":""},{"jyitemid":"29","hash":"7db5fbf980c0ce25f3decbad9bad05071a42fb2bc6e784fc4e811bcfa0757cc0","fromtoken":"MACb41108b2888K8wBUJ1ADIlUTBAA","totoken":"MACce94fb755f0AQgVDYlVDEVVTBQC","amount":"0.10000000","time":"1547899788124","note":""}]} 如果errCode==0则成功
v2.0更新说明 未作更新

交易查询(根据区块高度)
功能类型  交易查询(根据区块高度)
请求格式  POST
请求地址  http://macwt.sdgl.com.cn/maccnt/v4.1/?52490/func/Appkey/107909662.html?EnterID=89739
提交参数  action|height
提交说明 必填字段: action|height
说明:
action为固定值:GetTransactionRecordHight
返回参数说明 {"errCode":0,"Msg":"u67e5u8be2u6210u529f","newgao":29191,"blockhash":"f9a318ac78d411f75834f760da83f96f0c8fddc5d3ae0507f21aa79e73f3b976","parenthash":"731b0b337dc5816abac96776634b72447a7ba5ba1422e26ac7c3bf5d30c3b16d","jynum":"1","time":"1547888858342","Content":[{"jyitemid":"4","hash":"0b63d7a097db7a30a32f688fce27e467459be999715eefa84afb7969096a913c","fromtoken":"MACc9f4d9c312aEMlDVFgAHEwBAUgV","totoken":"MACu6312d7bebbLMgCVFAAVFgATZlU","amount":"1.00000000","time":"1547888858342","note":"macu5e73u53f0u5145u503c"}]} 如果errCode==0则成功
v2.0更新说明 未作更新

交易查询(根据交易hash)
功能类型  交易查询(根据交易hash)
请求格式  POST
请求地址  http://macwt.sdgl.com.cn/maccnt/v4.1/?52490/func/Appkey/107909662.html?EnterID=89739
提交参数  action|hash
提交说明 必填字段: action|hash
说明:
action为固定值:GetTransactionRecordHash
hash:为交易hash
返回参数说明 {"errCode":0,"Msg":"u67e5u8be2u6210u529f","Content":[{"time":"1547898605322","blockhight":15,"fromtoken":"MACh5e02ce6285LIwDRdQBVhwBBYgV","totoken":"MAChc7cf729b8bAcQBXRVBWdQUCkAB","amount":"1.00000000","note":""}]} 如果errCode==0则成功,
v2.0更新说明 未作更新

交易查询(根据交易ID)
功能类型  交易查询(根据交易ID)
请求格式  POST
请求地址  http://macwt.sdgl.com.cn/maccnt/v4.1/?52490/func/Appkey/107909662.html?EnterID=89739
提交参数  action|tranid
提交说明 必填字段: action|tranid
说明:
action为固定值:PubGetTransactionRecord
tranid:为交易ID
返回参数说明 {"errCode":0,"Msg":"u606du559cuff0cu83b7u53d6u6210u529f","blockheight":12,"blockhash":"ff9f91fa4da3af6421f923754668844f5a6cc31f50efe30932f6a4d1773f64d3","hash":"73f2d73680e3466ee47a24f90d8b06329713876db2bb7af08e86d00f6414cecd","fromtoken":"MACb317145d09dS5wUBIFAAkgUEUVU","totoken":"MACh5e02ce6285LIwDRdQBVhwBBYgV","amount":"5.00000000","time":"2019-01-19 19:30:54","note":""} 如果errCode==0则成功,
v2.0更新说明
1、返回的time(时间)格式由时间戳换成精确到秒的日期格式
2、新增返回值:hash(交易hash值)

区块最新高度查询
功能类型  区块最新高度查询
请求格式  POST
请求地址  http://macwt.sdgl.com.cn/maccnt/v4.1/?52490/func/Appkey/107909662.html?EnterID=89739
提交参数  action
提交说明 必填字段: action
说明:
action为固定值:GetBlockHeight
返回参数说明 {"errCode":0,"Msg":"sucess","BlockHeight":5526} 如果errCode==0则成功,BlockHeight为区块高度
v2.0更新说明 未作更新

区块列表查询(公开)
功能类型  区块列表查询(公开)
请求格式  POST
请求地址  http://macwt.sdgl.com.cn/maccnt/v4.1/?52490/func/Appkey/107909662.html?EnterID=89739
提交参数  action|pageevery|page
提交说明 必填字段:action|
说明:
action为固定值:GetBlockList
pageevery:为每页条数(缺省为10)
page:为页数,即显示第几页的数据(缺省为1)
返回参数说明 {"errCode":0,"Msg":"u606du559cuff0cu83b7u53d6u6210u529f","Allnum":"67022","Content":[{"blockheight":67022,"blockhash":"624c056064d75de1201984867a420bd62b3c8b8cf5dddde3fdab91683bbacb8b","jynum":"1","amount":"15.00000000","time":"2019-06-01 23:56:31","time2":"1u5206u949fu524d"},{"blockheight":67021,"blockhash":"d85d5f3bd2c0a1b36171bcfe50c9d938198502b1186f2cc9b3841d916e99b6fd","jynum":"1","amount":"29.90087570","time":"2019-06-01 23:55:28","time2":"2u5206u949fu524d"},{"blockheight":67020,"blockhash":"304428e58be1b30d5caef6650fa461bdff091d386fb4f2de9aa26a76291ef087","jynum":"1","amount":"500.65000000","time":"2019-06-01 23:52:53","time2":"5u5206u949fu524d"}]} 返回说明:
如果errCode==0则成功
Allnum为返回总区块数量
Content为区块详情列表(blockheight为区块高度,blockhash为区块hash值,jynum为打包交易数量,amount为交易总额,time为出块时间,time2为出块时间【格式为几秒前】)
v2.0更新说明
此接口为v2.0新增

交易列表查询(公开)
功能类型  交易列表查询(公开)
请求格式  POST
请求地址  http://macwt.sdgl.com.cn/maccnt/v4.1/?52490/func/Appkey/107909662.html?EnterID=89739
提交参数  action|pageevery|page
提交说明 必填字段: action|pageevery|page
说明:
action为固定值:GetTxList
pageevery:为每页条数(缺省为10)
page:为页数,即显示第几页的数据(缺省为1)
返回参数说明 {"errCode":0,"Msg":"u606du559cuff0cu83b7u53d6u6210u529f","Allnum":"2","Content":[{"blockheight":2265,"blockhash":"******","jyitemid":"4521","hash":"交易哈希","fromtoken":"******","totoken":"******","amount":"0.00000001","time":"2019-01-22 22:58:28","note":""},{"fromtoken":"******","totoken":"******","amount":"1.00000000","time":"2019-01-19 14:01:56","note":"u6d4bu8bd5"}]} 如果errCode==0则成功
Allnum为返回总交易数
Content为交易详情列表(blockheight为区块高度,blockhash为区块hash值,jyitemid为交易ID,hash为交易hash值)
v2.0更新说明
此接口为v2.0新增


MAC多原链认证实测超千万TPS,直击商业应用落地场景痛点。