Commit 0c84ad7b authored by Hugo's avatar Hugo

add js合约

parent 0af31f0b
This diff is collapsed.
# 一、接口描述
# 一、接口描述
## 1 发布事件
### 1.1 生成发布事件的交易(未签名)
**请求报文:**
```json
{
"jsonrpc":"2.0",
"method": "Chain33.CreateTransaction",
"params": [
{
"execer": "oracle",
"actionName": "EventPublish",
"payload": {
"type": "string",
"subType": "string",
"time": int64,
"content": "string",
"introduction": "string"
}
}
],
"id": int32
}
```
**参数说明:**
|参数|类型|说明|
|----|----|----|
|type|string|事件类型|
|subType|string|事件子类型|
|time|int64|事件结果预计公布时间,UTC时间|
|content|string|事件内容,例如可以用json格式表示|
|introduction|string|事件介绍|
**响应报文**
```json
{
"id": int32,
"result": "string",
"error": null
}
```
**参数说明:**
|参数|类型|说明|
|----|----|----|
|result|string|交易十六进制编码后的字符串|
**示例**
Request:
```json
{
"method": "Chain33.CreateTransaction",
"params": [
{
"execer": "oracle",
"actionName": "EventPublish",
"payload": {
"type": "football",
"subType": "Premier League",
"time": 1548084600,
"content": "test",
"introduction": "test2"
}
}
],
"id": 0
}
```
Response:
```json
{
"id": 0,
"result": "0a066f7261636c65123138010a2d1208666f6f7462616c6c1a0e5072656d696572204c656167756520f8ca97e2052a04746573743205746573743220a08d06309a95a2ce81b6aabf1d3a22314350794a7152427a4c4b537a504c44416845454d64666f53464450513965477448",
"error": null
}
```
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment