This commit is contained in:
aozhiwei 2023-08-03 17:57:47 +08:00
parent 6e5ccde837
commit 3993f03efb

View File

@ -46,228 +46,7 @@ class TransactionRecord(object):
class Market(object):
def __init__(self):
self.internalApis = [
{
'name': 'tokenAuth',
'desc': 'tokenAuth',
'group': 'Market',
'url': 'webapp/index.php?c=Market&a=tokenAuth',
'params': [
['account', '', '钱包账号'],
['token', '', 'token'],
['net_id', '', '网络id'],
],
'response': [
_common.RspHead(),
['account', '', 'account'],
]
},
]
self.apis = [
{
'name': 'getNonce',
'desc': '获取登录认证nonce',
'group': 'Market',
'url': 'webapp/index.php?c=Market&a=getNonce',
'params': [
['account', '', '钱包账号'],
['token', '', 'token'],
['net_id', '', '网络id'],
],
'response': [
_common.RspHead(),
['state', 0, '0token无效客户端需签名 1token是有效的客户端不需要再次签名'],
['nonce', '', 'nonce'],
]
},
{
'name': 'auth',
'desc': '认证',
'group': 'Market',
'url': 'webapp/index.php?c=Market&a=auth',
'params': [
['account', '', '钱包账号'],
['tips', '', 'tips'],
['nonce', '', 'nonce'],
['signature', '', '签名'],
['net_id', '', '网络id'],
],
'response': [
_common.RspHead(),
['token', '', 'token'],
]
},
{
'name': 'getPreSaleInfo',
'desc': '获取预售信息',
'group': 'Market',
'url': 'webapp/index.php?c=Market&a=getPreSaleInfo',
'params': [
['account', '', '钱包账号'],
],
'response': [
_common.RspHead(),
['presale_info', _common.PreSaleInfo(), '预售信息'],
]
},
{
'name': 'searchBox',
'desc': '获取预售商品信息',
'group': 'Market',
'url': 'webapp/index.php?c=Market&a=searchBox',
'params': [
['account', 0, '钱包账号'],
['page', 0, '获取第几页数据'],
['sort', '', '排序字段'],
],
'response': [
_common.RspHead(),
['!rows', [_common.PreSaleBox()], '商品信息'],
['page', _common.Page(), '分页信息'],
]
},
{
'name': 'buyBox',
'desc': '购买箱子',
'group': 'Market',
'url': 'webapp/index.php?c=Market&a=buyBox',
'params': [
['token', '', 'token'],
['type', '', '注意是箱子id!!!(box_id)'],
['buyer_address', '', '购买者账号id'],
['price', '', 'price'],
['payment_token_address', '', 'payment_token_address'],
['nonce', '', 'nonce'],
['signature', '', '签名soliditySha3(type, payment_token_address, price, nonce), 签名的replace客户端做处理'],
['net_id', '', '网络id'],
],
'response': [
_common.RspHead(),
['order_id', '', '订单号(errcode = 0的时候根据订单号客户端定时调用queryOrder接口)查询状态'],
]
},
{
'name': 'openLuckyBox',
'desc': '开宝箱',
'group': 'Market',
'url': 'webapp/index.php?c=Market&a=openLuckyBox',
'params': [
['account', 0, '钱包账号'],
['token', '', 'token'],
['token_id', '', '宝箱token_id'],
['net_id', '', '网络id'],
],
'response': [
_common.RspHead(),
['!tokenIds', [''], '开出的物品tokenId列表'],
['nonce', '', 'nonce'],
['signature', '', 'signature'],
]
},
{
'name': 'getPhase3Box',
'desc': '开启第三阶段奖励',
'group': 'Market',
'url': 'webapp/index.php?c=Market&a=getPhase3box',
'params': [
['account', 0, '钱包账号'],
['token', '', 'token'],
['token_id', '', '宝箱token_id'],
['net_id', '', '网络id'],
],
'response': [
_common.RspHead(),
['!rows', [_common.Phase3Box()], '宝箱信息'],
]
},
{
'name': 'openPhase3Box',
'desc': '开启第三阶段奖励',
'group': 'Market',
'url': 'webapp/index.php?c=Market&a=openPhase3Box',
'params': [
['account', 0, '钱包账号'],
['token', '', 'token'],
['token_id', '', '宝箱token_id'],
['net_id', '', '网络id'],
['box_id', '', '箱子id'],
],
'response': [
_common.RspHead(),
]
},
{
'name': 'queryPhase3Box',
'desc': '查询阶段3开宝箱信息',
'group': 'Market',
'url': 'webapp/index.php?c=Market&a=queryPhase3Box',
'params': [
['account', 0, '钱包账号'],
['token', '', 'token'],
['net_id', '', '网络id'],
['box_id', '', '箱子id'],
],
'response': [
_common.RspHead(),
['state', '', '0:开启中 1:开启成功'],
['cec', 0, '奖励cec'],
['!nfts', [_common.NftDetail()], '获得的nft列表'],
]
},
{
'name': 'queryLuckyBox',
'desc': '查询开宝箱信息',
'group': 'Market',
'url': 'webapp/index.php?c=Market&a=queryLuckyBox',
'params': [
['account', 0, '钱包账号'],
['token', '', 'token'],
['token_id', '', '宝箱token_id'],
['txhash', '', 'txhash'],
['net_id', '', '网络id'],
],
'response': [
_common.RspHead(),
['state', '', '0:开启中 1:开启成功'],
['!nfts', [_common.NftDetail()], '获得的nft列表'],
]
},
{
'name': 'activateNft',
'desc': '激活nft',
'group': 'Market',
'url': 'webapp/index.php?c=Market&a=activateNft',
'params': [
['account', 0, '钱包账号'],
['token', '', 'token'],
['token_id', '', 'token_id'],
['net_id', '', '网络id'],
],
'response': [
_common.RspHead(),
['new_token_id', '', '新nft tokenid'],
['nonce', '', 'nonce'],
['signature', '', 'signature'],
]
},
{
'name': 'queryActivateResult',
'desc': '查询开宝箱信息',
'group': 'Market',
'url': 'webapp/index.php?c=Market&a=queryActivateResult',
'params': [
['account', 0, '钱包账号'],
['token', '', 'token'],
['token_id', '', '宝箱token_id'],
['txhash', '', 'txhash'],
['net_id', '', '网络id'],
],
'response': [
_common.RspHead(),
['state', '', '0:激活中 1:激活成功'],
['nft', _common.NftDetail(), '新nft信息'],
]
},
{
'name': 'queryOrder',
'desc': '查询订单状态',
@ -316,18 +95,6 @@ class Market(object):
['info', _common.NftDetail(), '商品详细信息'],
]
},
{
'name': '/api/nft/info',
'desc': '获取nft信息',
'group': 'Market',
'url': '/api/nft/info/{$tokenId}',
'params': [
['account', '', '账号id'],
],
'response': [
_common.NftView(),
]
},
{
'name': 'listSellNfts',
'desc': '获取上架出售的NFTs',
@ -520,5 +287,4 @@ class Market(object):
['!list', [TransactionRecord()], '交易记录列表'],
]
}
]