数字产权项目帮助中心
DPR数字产权平台帮助文档

DPR BASE对接链上接口

...

来自于:用户8909

最后更新时间: 大约 2 年前

接口通用格式

  1. 接口统一采用http post方式调用,请求内容采用JSON编码格式

  2. 请求格式

    {
    	"requestNo":"xxxxxx" //请求业务编号,全局唯一,用于查询及幂等
    	"data":{ //请求数据
    		“filed1”:"value1",
    		“filed2”:"value2",
    		...
    	}
    }
    
  3. 返回格式

    {
    	"code":200 //返回码
    	"msg":"msg"
    	"data":{ //返回数据
    		“filed1”:"value1",
    		“filed2”:"value2",
    		...
    	}
    }
    

交易提交

生成新账户

https://{domain}/rest/v1/account/genNewAccount

【入参列表:无】

【出参列表】

字段名称 字段类型 备注
address * string 地址
pubKey * string 公钥
priKey * string 私钥
转账gas

https://{domain}/rest/v1/gas/grantGas

【入参列表】

字段名称 字段类型 备注
from * string 发放者地址
to * string 接收者地址
amount * int 发放数量
priKey * string 发放者的私钥

【返回列表】

字段名称 字段类型 备注
txHash * string 交易hash
存证类DP上链

https://{domain}/rest/v1/dp/save/legal

【入参列表】

字段名称 字段类型 备注
from * string 创建者地址
owner * string 拥有者地址
dpType * string 数字资产类型
name * string 数字资产名称
dpHash * string 数字资产内容hash(唯一)
url * string 数字资产URL
extend * string 扩展信息
priKey * string 创建者的私钥

【返回列表】

字段名称 字段类型 备注
txHash * string 交易hash
非同质化DP上链

https://{domain}/rest/v1/dp/save/dpr721

字段名称 字段类型 备注
from * string 创建者地址
owner * string 拥有者地址
dpType * string 数字资产类型
name * string 数字资产名称
dpHash * string 数字资产内容hash
url * string 数字资产URL
extend * string 扩展信息
symbol * string 数字资产代码
totalSupply * int 总发行量:=0-无限增发、>0固定数量
approveMintAddressList * array 授权可铸造的地址数组(平台地址)
transferStatus * int 交易状态:
1-自由交易
2-不可交易
3-有效期后可自由交易
priKey * string 创建者私钥

【返回列表】

字段名称 字段类型 备注
txHash * string 交易hash
商家授权平台铸造DPR

https://{domain}/rest/v1/dpr/approveMint

【入参列表】

字段名称 字段类型 备注
from * string 授权者地址(商家地址)
to * string 获得铸造权地址(平台地址)
dpid * string 数字资产唯一标识(链上地址)
priKey * string 授权者的私钥(商家)

【返回列表】

字段名称 字段类型 备注
txHash * string 交易hash
商家授权平台使用gas

https://{domain}/rest/v1/gas/approveGas

【入参列表】

字段名称 字段类型 备注
from * string 授权者地址(商家地址)
to * string 接收者地址(平台地址)
amount * int 授权数量
备注:当amount=0时即取消授权
priKey * string 授权者的私钥(商家)

【返回列表】

字段名称 字段类型 备注
txHash * string 交易hash
DPR销毁

https://{domain}/rest/v1/dpr/burn

【入参列表】

字段名称 字段类型 备注
from * string 商家地址(owner)
dprid * string DPR唯一标识
priKey * string 商家私钥

【返回列表】

字段名称 字段类型 备注
txHash * string 交易hash
铸造非同质化DPR

https://{domain}/rest/v1/dpr/mint721

【入参列表】

字段名称 字段类型 备注
from * string 平台地址
to * string 接收者地址(用户地址)
dpid * string 数字资产唯一标识
businessNo * string 业务编号(唯一)
expireTime * int 过期时间
priKey * string 平台私钥

【返回列表】

字段名称 字段类型 备注
txHash * string 交易hash
DPR交易

https://{domain}/rest/v1/dpr/transfer

【入参列表】

字段名称 字段类型 备注
from * string 转出者地址
to * string 转入者地址
dprid * string DPR唯一标识
priKey * string 转出者私钥

【返回列表】

字段名称 字段类型 备注
txHash * string 交易hash
添加GAS转账白名单

https://{domain}/rest/v1/gas/addWhiteList

【入参列表】

字段名称 字段类型 备注
from * string Admin地址
addressList * array 白名单地址数组
priKey * string Admin私钥

【返回列表】

字段名称 字段类型 备注
txHash * string 交易hash

交易查询

根据请求编号查询交易结果

https://{domain}/rest/v1/tx/query/result

【入参列表】

字段名称 字段类型 备注
requestNo * string 请求编号

【出参列表】

字段名称 字段类型 备注
status * int 交易状态:
1-成功
2-失败
3-处理中
4-未查询到交易
txHash string 交易hash
gasUsed int 已花费的手续费
txTime int 交易时间
errMsg string 失败信息
DP详情查询

https://{domain}/rest/v1/dp/query/detail

【入参列表】

字段名称 字段类型 备注
dpid * string DP唯一标识

【出参列表】

字段名称 字段类型 备注
from * string 创建者地址
owner * string 拥有者地址
dpType * string 数字资产类型
name * string 数字资产名称
dpHash * string 数字资产内容hash
url * string 数字资产URL
extend * string 扩展信息
symbol string 数字资产代码
totalSupply int 总发行量:=0-无限增发、>0固定数量
approveMintAddressList array 授权可铸造的地址数组(平台地址)
transferStatus int 交易状态:
1-自由交易
2-不可交易
3-有效期后可自由交易
DPR详情查询

https://{domain}/rest/v1/dpr/query/detail

【入参列表】

字段名称 字段类型 备注
dprid * string DPR唯一标识

【出参列表】

字段名称 字段类型 备注
dpid * string DP唯一标识
owner * string 拥有者
businessNo string 业务编号(唯一)
expireTime int 过期时间
DPR单笔交易查询

https://{domain}/rest/v1/dpr/query/tx

【入参列表】

字段名称 字段类型 备注
requestNo * string 请求唯一标识

【出参列表】

字段名称 字段类型 备注
dprid * string DPR唯一标识
from * string 转出者
to * string 转入者
txHash * string 交易HASH
txTime * int 交易时间
DPR权益流转流水查询

https://{domain}/rest/v1/dpr/query/txList

【入参列表】

字段名称 字段类型 备注
dprid * string DPR唯一标识

【出参列表-数组】

字段名称 字段类型 备注
dprid * string DPR唯一标识
from * string 转出者
to * string 转入者
txHash * string 交易HASH
txTime * int 交易时间
GAS单笔转账记录查询

https://{domain}/rest/v1/gas/query/tx

【入参列表】

字段名称 字段类型 备注
requestNo * string 请求唯一标识

【出参列表】

字段名称 字段类型 备注
from * string 转出者
to * string 转入者
amount * int 转账数量
txHash * string 交易HASH
txTime * int 交易时间
查询Gas余额

https://{domain}/rest/v1/gas/query/balance

【入参列表】

字段名称 字段类型 备注
from * string 地址

【出参列表】

字段名称 字段类型 备注
balance * int 余额
查询Gas授权余额

https://{domain}/rest/v1/gas/query/allowance

【入参列表】

字段名称 字段类型 备注
from * string 授权者
to * string 被授权者

【出参列表】

字段名称 字段类型 备注
balance * int 授权余额
查询出块节点列表

https://{domain}/rest/v1/validator/query/list

【入参列表:无】

【出参列表】

字段名称 字段类型 备注
address * string 地址
DpId查询

https://{domain}/rest/v1/dp/query/dpId

【入参列表】

字段名称 字段类型 备注
requestNo * string 请求唯一标识

【出参列表】

字段名称 字段类型 备注
dpId * string dpId
DprId查询

https://{domain}/rest/v1/dpr/query/dprId

【入参列表】

字段名称 字段类型 备注
requestNo * string 请求唯一标识

【出参列表】

字段名称 字段类型 备注
dprId * string dprId