207 lines
8.3 KiB
Python
207 lines
8.3 KiB
Python
import _common
|
||
|
||
class AAMarket(object):
|
||
|
||
def __init__(self):
|
||
self.apis = [
|
||
{
|
||
'method': 'POST',
|
||
'name': '/api/market/product/list/:net_id',
|
||
'desc': '获取上架出售的NFTs(瀑布流式api)',
|
||
'group': '!AAMarket',
|
||
'url': 'https://market-test.kingsome.cn/api/market/product/list/:net_id',
|
||
'is_json_params': True,
|
||
'request_params': [
|
||
[':net_id', 0, '链id'],
|
||
],
|
||
'params': [
|
||
['page_size', 0, '每页大小'],
|
||
['cursor', '', '游标 第一页传空'],
|
||
['search', [
|
||
['name', '', '名字查询 空(所有)'],
|
||
], '模糊查询'],
|
||
['filter', [
|
||
['price_min', '', '价格下限 空(无下限)'],
|
||
['price_max', '', '价格上限 空(无上限)'],
|
||
['!item_ids', [0], '道具id列表 空(所有)'],
|
||
['!hero_ranks', [0], '英雄品阶列表 空(所有)']
|
||
], '过滤条件'],
|
||
['sort', [
|
||
['!fields', [
|
||
['name', '', '字段名 目前支持的字段(price)'],
|
||
['type', 0, '排序方式 -1:倒序 0:默认排序 1:正序'],
|
||
], '排序字段']
|
||
], '排序规则'],
|
||
],
|
||
'response': [
|
||
_common.RspHead(),
|
||
['page', _common.StreamPage(), '分页信息'],
|
||
['!rows', [_common.MarketGoods()], '数据'],
|
||
]
|
||
},
|
||
{
|
||
'method': 'GET',
|
||
'name': '/api/market/product/category/:net_id',
|
||
'desc': '获取上架出售的NFTs分类数量',
|
||
'group': '!AAMarket',
|
||
'url': 'https://market-test.kingsome.cn/api/market/product/list/:net_id',
|
||
'params': [
|
||
[':net_id', 0, '链id'],
|
||
],
|
||
'response': [
|
||
_common.RspHead(),
|
||
['!data', [
|
||
['item_id', 0, '道具id'],
|
||
['num', 0, '商品数量'],
|
||
], '分类数量'],
|
||
]
|
||
},
|
||
{
|
||
'name': '/api/market/transaction/history/:net_id/:account_address',
|
||
'desc': '获取账号交易历史',
|
||
'group': '!AAMarket',
|
||
'url': 'https://market-test.kingsome.cn/api/market/transaction/history/:net_id/:account_address',
|
||
'params': [
|
||
[':net_id', 0, '链id'],
|
||
[':account_address', '', '钱包地址'],
|
||
['type', '', '0:全部 1:买进 2:卖出'],
|
||
['page_size', 0, '每页大小'],
|
||
['cursor', '', '游标 第一页传空'],
|
||
],
|
||
'response': [
|
||
_common.RspHead(),
|
||
['page', _common.StreamPage(), '分页信息'],
|
||
['!rows', [_common.NftInfo()], '数据'],
|
||
]
|
||
},
|
||
{
|
||
'name': '/api/asset/:net_id/:account_address',
|
||
'desc': '获取账号资产',
|
||
'group': '!AAMarket',
|
||
'url': 'https://market-test.kingsome.cn/api/asset/:net_id/:account_address',
|
||
'params': [
|
||
[':net_id', 0, '链id'],
|
||
[':account_address', '', '钱包地址'],
|
||
['type', '', '0:全部 1:上架中 2:未上架'],
|
||
['page_size', 0, '每页大小'],
|
||
['cursor', '', '游标 第一页传空'],
|
||
['search_name', '', 'nft名字 空(所有)'],
|
||
],
|
||
'response': [
|
||
_common.RspHead(),
|
||
['page', _common.StreamPage(), '分页信息'],
|
||
['!rows', [_common.NftInfo()], '数据'],
|
||
]
|
||
},
|
||
{
|
||
'method': 'POST',
|
||
'name': '/api/hero/use/:net_id',
|
||
'desc': '使用英雄(带入游戏内)',
|
||
'group': '!AAMarket',
|
||
'url': 'https://market-test.kingsome.cn/api/hero/use/:net_id',
|
||
'is_json_params': True,
|
||
'request_params': [
|
||
[':net_id', 0, '链id'],
|
||
['account_address', '', '钱包地址'],
|
||
],
|
||
'params': [
|
||
['!token_ids', [''], 'tokenId列表'],
|
||
],
|
||
'response': [
|
||
_common.RspHead(),
|
||
['trans_id', '', '事务id'],
|
||
['!params', [''], '合约参数列表'],
|
||
]
|
||
},
|
||
{
|
||
'method': 'POST',
|
||
'name': '/api/guld_bullion/use/:net_id',
|
||
'desc': '使用金砖(生成金币带入游戏内)',
|
||
'group': '!AAMarket',
|
||
'url': 'https://market-test.kingsome.cn/api/gold_bullion/use/:net_id',
|
||
'is_json_params': True,
|
||
'request_params': [
|
||
[':net_id', 0, '链id'],
|
||
['account_address', '', '钱包地址'],
|
||
],
|
||
'params': [
|
||
['!token_ids', [''], 'tokenId列表'],
|
||
],
|
||
'response': [
|
||
_common.RspHead(),
|
||
['trans_id', '', '事务id'],
|
||
['!params', [''], '合约参数列表'],
|
||
]
|
||
},
|
||
{
|
||
'method': 'GET',
|
||
'name': '/api/shopcart/list',
|
||
'desc': '购物车-商品列表',
|
||
'group': '!AAMarket',
|
||
'url': 'https://market-test.kingsome.cn/api/shopcart/list',
|
||
'headers': _common.JwtHeader,
|
||
'permission': _common.LoginRequired,
|
||
'params': [
|
||
],
|
||
'response': [
|
||
_common.RspHead(),
|
||
['!data', [_common.MarketGoods()], '数据'],
|
||
]
|
||
},
|
||
{
|
||
'method': 'POST',
|
||
'name': '/api/shopcart/add',
|
||
'desc': '购物车-添加商品',
|
||
'group': '!AAMarket',
|
||
'url': 'https://market-test.kingsome.cn/api/shopcart/add',
|
||
'headers': _common.JwtHeader,
|
||
'permission': _common.LoginRequired,
|
||
'is_json_params': True,
|
||
'params': [
|
||
['net_id', 0, '链id'],
|
||
['!tokens', [
|
||
['token_id', '', 'token_id'],
|
||
['token_type', 0, '1: hero 11:gold bullion'],
|
||
], 'nft list']
|
||
],
|
||
'response': [
|
||
_common.RspHead(),
|
||
]
|
||
},
|
||
{
|
||
'method': 'POST',
|
||
'name': '/api/shopcart/del',
|
||
'desc': '购物车-删除商品',
|
||
'group': '!AAMarket',
|
||
'url': 'https://market-test.kingsome.cn/api/shopcart/del',
|
||
'headers': _common.JwtHeader,
|
||
'permission': _common.LoginRequired,
|
||
'is_json_params': True,
|
||
'params': [
|
||
['net_id', 0, '链id'],
|
||
['!tokens', [
|
||
['token_id', '', 'token_id'],
|
||
['token_type', 0, '1: hero 11:gold bullion'],
|
||
], 'nft list']
|
||
],
|
||
'response': [
|
||
_common.RspHead(),
|
||
]
|
||
},
|
||
{
|
||
'method': 'POST',
|
||
'name': '/api/shopcart/clear',
|
||
'desc': '购物车-清空购物车',
|
||
'group': '!AAMarket',
|
||
'url': 'https://market-test.kingsome.cn/api/shopcart/clear',
|
||
'headers': _common.JwtHeader,
|
||
'permission': _common.LoginRequired,
|
||
'params': [
|
||
['net_id', 0, '链id'],
|
||
],
|
||
'response': [
|
||
_common.RspHead(),
|
||
]
|
||
},
|
||
]
|