@sqfasd
2017-05-06T11:09:41.000000Z
字数 2564
阅读 1450
本文档仅供前端参考使用,后端功能正在实现中
get /api/uia/assets/applying
{
"success": true,
"assets": [
{
"name": "普洱茶", // 资产名称
"currency": "PEB", // 资产符号
"desc": "普洱茶简介", // 资产简介
"category": "010101", // 资产分类编号
"precision": 6, // 精度,表示小数点后有几位数字
"estimatePrice": 10, // 初始发行价
"estimateUnit": "USD", // 初始发行价单位
"issuerId": "14762548536863074694", // 发行商账户地址
"unlockCondition": 1, // 解锁条件
"extra": "......", // 其他资产信息,json打包
"approved": 0
}
],
"count": 9
}
get /api/uia/assets/approved
{
"success": true,
"assets": [
{
"name": "普洱茶", // 资产名称
"currency": "PEB", // 资产符号
"desc": "普洱茶简介", // 资产简介
"category": "010101", // 资产分类编号
"precision": 6, // 精度,表示小数点后有几位数字
"estimatePrice": 10, // 初始发行价
"estimateUnit": "USD", // 初始发行价单位
"issuerId": "14762548536863074694", // 发行商账户地址
"unlockCondition": 1, // 解锁条件
"extra": "......", // 其他资产信息,json打包
"approved": 1
}
],
"count": 9
}
get /api/uia/assets/:currency/voters
{
"success": true,
"votes": [
{
"voter": "delegate1", // 投票者
"weight": "500", // 投票权重
}
],
"count": 9
}
get /api/uia/categories/0
{
"success": true,
"categories": [
{
"id": "01",
"attrs": ["食品生鲜"],
"hasChildren": true
},
{
"id": "02",
"attrs": ["服装"],
"hasChildren": true
}
],
"count": 9
}
get /api/uia/categories/:id
{
"success": true,
"categories": [
{
"id": "1001",
"attrs": ["比特币"],
"hasChildren": false
},
{
"id": "1002",
"attrs": ["莱特币"],
"hasChildren": false
1}
],
"count": 9
}
attrs表示商品分类名称,可能有多种语言的翻译,第一个是中文, 第二个是英文
get /api/uia/issues/applying
{
success: true,
issues: [
{
transactionId: "431dd812d00e2c7a9242b1b0f1bbf33b80b27e4a8bf333755673ab3ac0ff9d08",
currency: "PuerBank.PEB",
amount: "10000000",
exchangeRate: "0.2",
senderId: "A7KaYaLnWhSwCzrFVeE1TcXCQUY8WHB9hR"
}
],
count: 1
}
get /api/uia/issues/:id/voters
其中id为从上个接口获取的transactionId
{
"success": true,
"votes": [
{
"voter": "delegate1", // 投票者
"weight": "500", // 投票权重
}
],
"count": 9
}
var username = '13100933931'
var password = 'fdsfds7fds9fdsaofhdjs'
var account = AschJS.createAccount(username, password)
var extra = JSON.stringify({
key1: value1,
key2: value2
})
var payload = {
name: '普洱茶',
currency: 'issuer.PEB',
desc: '资产描述',
category: '010203',
precision: 1,
maximum: '10000000',
estimateUnit: 'USD',
estimatePrice: '1.5',
exerciseUnit: '10',
unlockCondition: 0,
extra: extra
}
var trs = AschJS.uia.createAsset(payload, secret, secondSecret)
estimateUnit表示估值单位,需要从指定列表中选择,列表为['USD', 'RMB', 'JPY', 'EUR', 'GBP']
extra表示扩展字段,是一个json对象序列化后的字符串
unlockCondition表示资产解锁条件,需要从指定列表中选择,列表为
[
{
label: '委员会投票解锁',
value: 1
},
{
label: 'ICO合约解锁',
value: 2
}
]
其中label为下列菜单展示内容,value为传给后端的参数
var trs = AschJS.uia.createApproval(topic, value, secret, secondSecret)
var trs = AschJS.uia.createApproval(topic, value, secret, secondSecret)
对资产注册进行投票时,value为资产的currency
对某次资产发行投票时,value为资产发行transactionId