@sqfasd
2017-01-16T13:37:49.000000Z
字数 4491
阅读 1606
未分类
get /uia/issuers?offset=0&limit=1
{
"success": true,
"issuers": [
{
"name": "issuername",
"desc": "issuer1_desc",
"issuerId": "14762548536863074694"
}
"count": 9
}
get /uia/issuers/:name
其中name
可以为发行商名称或账户地址
{
"success": true,
"issuer": {
"name": "eiSHesctQCbXA",
"desc": "valid desc",
"issuerId": "2592056580277537382"
}
}
get /uia/assets?offset=0&limit=1
{
"success": true,
"assets": [
{
"name": "issuername.BTC", // 资产名称
"desc": "asset1_desc", // 资产简介
"maximum": "10000000000000", // 发行上限
"precision": 6, // 精度,表示小数点后有几位数字
"strategy": "", // 发行策略
"quantity": "10000000000", // 现存总量
"height": 4, // 发行交易所在区块高度
"issuerId": "14762548536863074694", // 发行商账户地址
"acl": 1, // 1表示白名单,0表示黑名单
"writeoff": 0 //是否注销
}
],
"count": 9
get /uia/issuers/:name/assets?offset=0&limit=1
{
"success": true,
"assets": [
{
"name": "eiSHesctQCbXA.RUBY",
"desc": "valid desc",
"maximum": "10000",
"precision": 1,
"strategy": "quantity <= maximum / 10 * (height - genesisHeight)",
"quantity": "3000",
"height": 25,
"issuerId": "2592056580277537382",
"acl": 0,
"writeoff": 0
}
],
"count": 1
}
get /uia/assets/:name
{
"success": true,
"asset": {
"name": "eiSHesctQCbXA.RUBY",
"desc": "valid desc",
"maximum": "10000",
"precision": 1,
"strategy": "quantity <= maximum / 10 * (height - genesisHeight)",
"quantity": "3000",
"height": 25,
"issuerId": "2592056580277537382",
"acl": 0,
"writeoff": 0
}
}
get /uia/assets/:name/acl/:flag?offset=0&limit=1
flag可选值为0和1, 0表示黑名单,1表示白名单
{
"success": true,
"list": [
{
"address": "2592056580277537382"
}
],
"count": 1
}
get /uia/balances/:address?offset=0&limit=1
address 表示账户地址
{
"success": true,
"balances": [
{
"currency": "issuername.BTC",
"balance": "9999999970",
"maximum": "10000000000000",
"precision": 6,
"quantity": "10000000000",
"writeoff": 0
}
],
"count": 1
}
get /uia/transactions?ownerPublicKey=8065a105c785a08757727fded3a06f8f312e73ad40f1f3502e0232ea42e67efd&offset=0&limit=1
{
"success": true,
"transactions": [
{
"id": "260434858608363290",
"height": "3",
"blockId": "8276663638992099850",
"type": 9,
"timestamp": 16361139,
"senderPublicKey": "8065a105c785a08757727fded3a06f8f312e73ad40f1f3502e0232ea42e67efd",
"senderId": "14762548536863074694",
"recipientId": "",
"amount": 0,
"fee": 10000000,
"signature": "db3f1e968ce26e59e89b20591d764ee87b056a6fa78ebb7fa2af074951cd4ebb380d9f4d4cfe0d451ae64c66fa9c8228b332b5fca517a5e592ccdd436e21e50b",
"signSignature": "",
"signatures": null,
"confirmations": "391",
"asset": {
"issuer": {
"transactionId": "260434858608363290",
"name": "issuername",
"desc": "issuer1_desc"
}
},
"t_id": "260434858608363290"
}
],
"count": 8
}
注意这里asset与type相关,9 <= type <= 14, 根据不同的type从asset中取出不同的值
type=9
"asset": {
"uiaIssuer": {
"transactionId": "260434858608363290",
"name": "issuername",
"desc": "issuer1_desc"
}
},
展示: 注册了发行商 $name
type=10
"asset": {
"uiaAsset": {
"transactionId": "11613326283813789432",
"name": "issuername.BTC",
"desc": "asset1_desc",
"maximum": "10000000000000",
"precision": "6",
"strategy": ""
}
},
展示: 注册了资产 $name
type=11
"asset": {
"uiaFlags": {
"transactionId": "14649028077581400942",
"currency": "issuername.BTC",
"flagType": "1",
"flag": "1"
}
},
展示:
如果flagType==1 : 资产currency 被注销
type=12
"asset": {
"uiaAcl": {
"transactionId": "16597707943986371131",
"currency": "issuername.BTC",
"operator": "+",
"flag": "1",
"list": [
"196751217687897827",
"11053997261735317227"
]
}
},
展示:资产$currency 更新了访问控制列表
type=13
"asset": {
"uiaIssue": {
"transactionId": "10646196155790595088",
"currency": "issuername.BTC",
"amount": "10000000000"
}
},
展示: 资产amount
type=14
"asset": {
"uiaTransfer": {
"transactionId": "9105235822289198060",
"currency": "issuername.BTC",
"amount": "10"
}
},
展示:资产amount 到recipientId
var name = '发行商名称'
var desc = '发行商描述'
var trs = AschJS.uia.createIssuer(name, desc, secret, secondSecret)
var name = '资产名'
var desc = '资产描述'
var maximum = '1000000'
var precision = 3
var strategy = ''
var trs = AschJS.uia.createAsset(name, desc, maximum , precision, strategy, secret, secondSecret)
var currency = '资产名'
var flagType = 1
var flag = 0 // 0为黑名单, 1为白名单
var trs = AschJS.uia.createFlags(currency, flagType, flag, secret, secondSecret)
var currency = '资产名'
var flagType = 2
var flag =1
var trs = AschJS.uia.createFlags(currency, flagType, flag, secret, secondSecret)
var currency = '资产名'
var operator = '+' // '+'表示增加, ‘-’表示删除
var flag =0 // 0表示黑名单, 1表示白名单
var list = [
'14762548536863074694'
]
var trs = AschJS.uia.createAcl(currency, operator, flag, list, secret, secondSecret)
var currency = '资产名'
var amount = '100000'
var trs = AschJS.uia.createIssue(currency, amount, secret, secondSecret)
var currency = '资产名'
var amount = '100000'
var recipientId = '14762548536863074694'
var trs = AschJS.uia.createTransfer(currency, amount, recipientId, secret, secondSecret)