This commit is contained in:
aozhiwei 2024-08-06 09:12:53 +08:00
parent 43b388709a
commit 6b996fba00
6 changed files with 0 additions and 451 deletions

View File

@ -1,17 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
<title>loading</title>
</head>
<body>
<script type="text/javascript">
(function () {
var _dc = (new Date()).valueOf() + Math.random();
document.write("<script type='text/javascript' src='loader.js?_dc=" + _dc + "'><\/script>");
})();
</script>
</body>
</html>

View File

@ -1,3 +0,0 @@
(function () {
window.location.href = "1.0.1/index.html";
})();

View File

@ -1,28 +0,0 @@
<mxfile host="65bd71144e">
<diagram id="6-OvJa2UTW0QZlagzmDQ" name="Page-1">
<mxGraphModel dx="630" dy="580" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="0">
<root>
<mxCell id="0"/>
<mxCell id="1" parent="0"/>
<mxCell id="6" value="Lifeline1" style="shape=umlLifeline;perimeter=lifelinePerimeter;whiteSpace=wrap;html=1;container=1;collapsible=0;recursiveResize=0;outlineConnect=0;" vertex="1" parent="1">
<mxGeometry x="90" y="360" width="100" height="300" as="geometry"/>
</mxCell>
<mxCell id="7" value="" style="shape=umlDestroy;dashed=0;" vertex="1" parent="6">
<mxGeometry x="30" y="280" width="40" height="40" as="geometry"/>
</mxCell>
<mxCell id="8" value="Lifeline1" style="shape=umlLifeline;perimeter=lifelinePerimeter;whiteSpace=wrap;html=1;container=1;collapsible=0;recursiveResize=0;outlineConnect=0;" vertex="1" parent="1">
<mxGeometry x="270" y="360" width="100" height="300" as="geometry"/>
</mxCell>
<mxCell id="9" value="" style="shape=umlDestroy;dashed=0;" vertex="1" parent="8">
<mxGeometry x="30" y="280" width="40" height="40" as="geometry"/>
</mxCell>
<mxCell id="10" value="Lifeline1" style="shape=umlLifeline;perimeter=lifelinePerimeter;whiteSpace=wrap;html=1;container=1;collapsible=0;recursiveResize=0;outlineConnect=0;" vertex="1" parent="1">
<mxGeometry x="450" y="360" width="100" height="300" as="geometry"/>
</mxCell>
<mxCell id="11" value="" style="shape=umlDestroy;dashed=0;" vertex="1" parent="10">
<mxGeometry x="30" y="280" width="40" height="40" as="geometry"/>
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>

View File

@ -1,234 +0,0 @@
## 回调函数
1.ceg支付回调
地址: <https://game2006api-test.kingsome.cn/webapp/index.php?c=Callback&a=dispatch&action=gameItemMallBuyOk>
调用方: web3server
参数说明:
| 参数名 | 类型 | 必填 | 说明 |
| ----------- | ------ | ---- | ------------------------ |
| trans\_id | string | 是 | 事务id |
| order\_id | string | 是 | 订单id |
返回说明:
```javascript
{
"errcode": 0, //0成功 1已发货 2订单不存在
"errmsg": ""
}
```
2.购买ceg回调
地址: <https://game2006api-test.kingsome.cn/webapp/index.php?c=Callback&a=dispatch&action=ShopBuyGoodsDirect>
调用方: 链上购买服务(hongliang)
请求方法: [GET]
参数说明:
| 参数名 | 类型 |必填 | 说明 |
| ----------- | ------- | ----- | --------------------------------------------------------- |
| account_id | string | 是 | 账户id (中心化游戏账号,充值成功后会给绑定的账号一些奖励) |
| oreder_id | string | 是 | 订单id |
| status | string | 是 | 订单状态 |
| id | string | 是 | goods_id |
| txhash | string | 是 | txhash |
| sign | string | 是 | 签名 |
调用说明:
```
// let repdata = {
// account_id: string
// order_id: string
// status: string
// id: string
// txhash: string
// }
// 我返回给你这些数据和一个sign字段,
// sign使用上面 repdata 按key 顺序排后, 组成key1=val1&key2=val2后, 使用hmac_sha256 hash, key是
// PENDING = 0, // 初始状态
// TRANSFERING = 1, //只有国库模式才会有该状态
// TRANSFERED = 2, //只有国库模式才会有该状态
// SUCCESS = 9, // 成功的最终状态
// TRANSFER_FAIL = 98, // 转账错误
// FAIL = 99, // 也是错误
//
```
返回说明:
```
{
"errcode": 0, // 0 操作成功
"errmsg" : ""
}
```
3.内购回调
调用方: 内购服务(hongliang)
地址: <https://game2006api-test.kingsome.cn/webapp/index.php?c=Callback&a=dispatch&action=ShopInappPurchaseDiamonds>
请求方法 [POST]
参数说明:
| 参数名 | 类型 |必填 | 说明 |
| ----------- | ------- | ---- | ------------------------------------------------- |
| channel | string | 是 | google or apple |
| records | array | 是 | 订单表,一次返回多个 |
| sign | string | 是 | 签名 |
调用说明:
```
// {
// channel: 'google',
// sign: '123456677' // 签名字段
// records: [{
// productId: '2999', // 从google play console获取的product id
// gameOrderId: '1231321312', // 开始支付时, 从游戏相关服务那获得的订单id
// orderId: 'GPA.3355-1172-9416-16839', // 从google develope API 获取的订单id
// status: 9, // 订单状态, 上报的订单状态一般只有2种情况, 9: 支付成功, 96: 用户退款
// }]
// }
// let reportData: any = {
// channel: 'google',
// records,
// }
// const hashSort = ''
// const signStr = 'channel=google&' + records.map(record =>Object.keys(record).sort().map(key => `${key}=${record[key]}`).join('&')).join('&')
// const sign = hmacsha256(signStr, hashSort)
// 定义一个空数组,用来存放每个记录的键值对字符串
```
返回说明:
```
{
"errcode": 0, // 0 操作成功
"errmsg" : ""
}
```
4.Market上架商品回调
地址: <https://game2006api-test.kingsome.cn/webapp/index.php?c=Callback&a=dispatch&action=MarketSellOrderOk>
参数说明:
| 参数名 | 类型 |必填 | 说明 |
| ----------- | ------- | ---- | ------------------------------------------------- |
| tokenId | string | 是 | tokenId |
| owner | string | 是 | 商品持有者 |
| nftToken | string | 是 | nftToken |
| amount | string | 是 | 数量 |
| orderId | string | 是 | 链上订单id |
| currency | string | 是 | 交易所需币种 |
| price | string | 是 | 出售价格 |
返回说明:
```javascript
{
"errcode": 0, //0成功 1已发货 2订单不存在
"errmsg": ""
}
```
5.Market下架商品回调
地址: <https://game2006api-test.kingsome.cn/webapp/index.php?c=Callback&a=dispatch&action=MarketCancelOrderOk>
参数说明:
| 参数名 | 类型 |必填 | 说明 |
| ----------- | ------- | ---- | ------------------------------------------------- |
| orderId | string | 是 | 链上订单id |
| nftToken | string | 是 | nftToken |
| tokenId | string | 是 | tokenId |
返回说明:
```javascript
{
"errcode": 0, //0成功 1已发货 2订单不存在
"errmsg": ""
}
```
6.Market更新商品价格回调
地址: <https://game2006api-test.kingsome.cn/webapp/index.php?c=Callback&a=dispatch&action=MarketPriceUpdateOrderOk>
参数说明:
| 参数名 | 类型 |必填 | 说明 |
| ----------- | ------- | ---- | ------------------------------------------------- |
| orderId | string | 是 | 链上订单id |
| nftToken | string | 是 | notToken |
| tokenId | string | 是 | tokenId |
| priceOld | string | 是 | 原价格 |
| price | string | 是 | 更新价格 |
返回说明:
```javascript
{
"errcode": 0, //0成功 1已发货 2订单不存在
"errmsg": ""
}
```
7.Market购买商品回调
地址: <https://game2006api-test.kingsome.cn/webapp/index.php?c=Callback&a=dispatch&action=MarketBuyOrderOk>
参数说明:
| 参数名 | 类型 | 必填 | 说明 |
| ----------- | ------- | ---- | ------------------------------------------------- |
| tokenId | string | 是 | tokenId |
| orderId | string | 是 | 链上订单id |
| nftToken | string | 是 | nftToken |
| amount | string | 是 | 数量 |
| seller | string | 是 | 卖家地址>> |
| buyer | string | 是 | 买家地址<< |
| crc20 | string | 是 | crc20 |
| price | string | 是 | 价格 |
返回说明:
```javascript
{
"errcode": 0, //0成功 1已发货 2订单不存在
"errmsg": ""
}
```
8.Maket购买商品回调(仅支持金币)
地址: <https://game2006api-test.kingsome.cn/webapp/index.php?c=Callback&a=dispatch&action=GameItemMarketBuyOk>
参数说明:
| 参数名 | 类型 |必填 | 说明 |
| ----------- | ------- | ---- | ------------------------------------------------- |
| address | string | 是 | 用户钱包地址 |
| order_id | string | 是 | 购买订单id |
返回说明:
```javascript
{
"errcode": 0, //0成功 1已发货 2订单不存在
"errmsg": ""
}
```

View File

@ -1,149 +0,0 @@
<mxfile host="65bd71144e">
<diagram id="RhfSRgj28ZWy9lpzOC5h" name="Page-1">
<mxGraphModel dx="946" dy="807" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="0">
<root>
<mxCell id="0"/>
<mxCell id="1" parent="0"/>
<mxCell id="45" value="" style="edgeStyle=none;html=1;" edge="1" parent="1" source="41" target="44">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="80" value="" style="edgeStyle=none;html=1;" edge="1" parent="1" source="41" target="79">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="41" value="User" style="shape=umlActor;verticalLabelPosition=bottom;verticalAlign=top;html=1;outlineConnect=0;" vertex="1" parent="1">
<mxGeometry x="40" y="200" width="30" height="60" as="geometry"/>
</mxCell>
<mxCell id="55" value="" style="edgeStyle=none;html=1;" edge="1" parent="1" source="42" target="54">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="42" value="User" style="shape=umlActor;verticalLabelPosition=bottom;verticalAlign=top;html=1;outlineConnect=0;" vertex="1" parent="1">
<mxGeometry x="40" y="550" width="30" height="60" as="geometry"/>
</mxCell>
<mxCell id="49" value="" style="edgeStyle=none;html=1;" edge="1" parent="1" source="44" target="48">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="44" value="调用上架合约" style="whiteSpace=wrap;html=1;verticalAlign=top;" vertex="1" parent="1">
<mxGeometry x="200" y="200" width="120" height="60" as="geometry"/>
</mxCell>
<mxCell id="51" value="" style="edgeStyle=none;html=1;" edge="1" parent="1" source="48" target="50">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="48" value="修改NFT Owner" style="whiteSpace=wrap;html=1;verticalAlign=top;" vertex="1" parent="1">
<mxGeometry x="400" y="200" width="120" height="60" as="geometry"/>
</mxCell>
<mxCell id="53" value="" style="edgeStyle=none;html=1;" edge="1" parent="1" source="50" target="52">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="50" value="同步NFT中心化数据 Owner" style="whiteSpace=wrap;html=1;verticalAlign=top;" vertex="1" parent="1">
<mxGeometry x="600" y="200" width="120" height="60" as="geometry"/>
</mxCell>
<mxCell id="76" value="增加一个订单" style="edgeStyle=none;html=1;" edge="1" parent="1" source="52" target="63">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="52" value="同步中心化货架信息" style="whiteSpace=wrap;html=1;verticalAlign=top;" vertex="1" parent="1">
<mxGeometry x="800" y="200" width="120" height="60" as="geometry"/>
</mxCell>
<mxCell id="70" value="" style="edgeStyle=none;html=1;" edge="1" parent="1" source="54" target="69">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="54" value="购买NFT" style="whiteSpace=wrap;html=1;verticalAlign=top;" vertex="1" parent="1">
<mxGeometry x="200" y="550" width="120" height="60" as="geometry"/>
</mxCell>
<mxCell id="60" value="" style="edgeStyle=none;html=1;" edge="1" parent="1" source="56" target="59">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="56" value="User" style="shape=umlActor;verticalLabelPosition=bottom;verticalAlign=top;html=1;outlineConnect=0;" vertex="1" parent="1">
<mxGeometry x="40" y="380" width="30" height="60" as="geometry"/>
</mxCell>
<mxCell id="59" value="检索上架NFT" style="whiteSpace=wrap;html=1;verticalAlign=top;" vertex="1" parent="1">
<mxGeometry x="200" y="430" width="120" height="60" as="geometry"/>
</mxCell>
<mxCell id="77" style="edgeStyle=none;html=1;entryX=1;entryY=0;entryDx=0;entryDy=15;entryPerimeter=0;" edge="1" parent="1" source="61" target="63">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="78" value="为检索缓存NFT数据" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="77">
<mxGeometry x="0.0816" y="-1" relative="1" as="geometry">
<mxPoint as="offset"/>
</mxGeometry>
</mxCell>
<mxCell id="61" value="NFTs 721" style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;size=15;" vertex="1" parent="1">
<mxGeometry x="830" y="780" width="60" height="80" as="geometry"/>
</mxCell>
<mxCell id="75" value="同步中心化NFT Owner" style="edgeStyle=none;html=1;" edge="1" parent="1" source="62" target="61">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="62" value="链上NFTs" style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;size=15;" vertex="1" parent="1">
<mxGeometry x="590" y="780" width="60" height="80" as="geometry"/>
</mxCell>
<mxCell id="65" value="" style="edgeStyle=none;html=1;entryX=1;entryY=1;entryDx=0;entryDy=0;" edge="1" parent="1" source="63" target="59">
<mxGeometry relative="1" as="geometry">
<mxPoint x="520" y="665" as="targetPoint"/>
</mxGeometry>
</mxCell>
<mxCell id="66" value="直接从货架表检索已上架的NFTs" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];rotation=30;" vertex="1" connectable="0" parent="65">
<mxGeometry x="-0.2491" y="4" relative="1" as="geometry">
<mxPoint as="offset"/>
</mxGeometry>
</mxCell>
<mxCell id="86" style="edgeStyle=none;html=1;exitX=0.855;exitY=1;exitDx=0;exitDy=-4.35;exitPerimeter=0;" edge="1" parent="1" source="63" target="85">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="690" y="890"/>
</Array>
</mxGeometry>
</mxCell>
<mxCell id="87" value="特殊性多个上架指向同一token" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="86">
<mxGeometry x="0.4509" relative="1" as="geometry">
<mxPoint as="offset"/>
</mxGeometry>
</mxCell>
<mxCell id="63" value="Market货架" style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;size=15;" vertex="1" parent="1">
<mxGeometry x="590" y="620" width="80" height="90" as="geometry"/>
</mxCell>
<mxCell id="71" style="edgeStyle=none;html=1;entryX=0;entryY=0;entryDx=0;entryDy=15;entryPerimeter=0;" edge="1" parent="1" source="69" target="62">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="72" value="成功后修改Owner" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];rotation=15;" vertex="1" connectable="0" parent="71">
<mxGeometry x="-0.3761" y="-2" relative="1" as="geometry">
<mxPoint as="offset"/>
</mxGeometry>
</mxCell>
<mxCell id="73" style="edgeStyle=none;html=1;" edge="1" parent="1" source="69" target="63">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="74" value="成功后删除货架上的订单" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];rotation=-5;" vertex="1" connectable="0" parent="73">
<mxGeometry x="-0.0746" relative="1" as="geometry">
<mxPoint as="offset"/>
</mxGeometry>
</mxCell>
<mxCell id="69" value="调用购买合约" style="whiteSpace=wrap;html=1;verticalAlign=top;" vertex="1" parent="1">
<mxGeometry x="200" y="690" width="120" height="60" as="geometry"/>
</mxCell>
<mxCell id="81" style="edgeStyle=none;html=1;" edge="1" parent="1" source="79" target="62">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="82" value="成功后修改上架价格信息" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];rotation=60;" vertex="1" connectable="0" parent="81">
<mxGeometry x="-0.5924" y="-1" relative="1" as="geometry">
<mxPoint as="offset"/>
</mxGeometry>
</mxCell>
<mxCell id="83" style="edgeStyle=none;html=1;" edge="1" parent="1" source="62" target="63">
<mxGeometry relative="1" as="geometry">
<mxPoint x="520" y="480" as="sourcePoint"/>
</mxGeometry>
</mxCell>
<mxCell id="84" value="同步货架售价" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="83">
<mxGeometry x="0.0058" y="-3" relative="1" as="geometry">
<mxPoint as="offset"/>
</mxGeometry>
</mxCell>
<mxCell id="79" value="调用更新价格合约" style="whiteSpace=wrap;html=1;verticalAlign=top;" vertex="1" parent="1">
<mxGeometry x="200" y="280" width="120" height="60" as="geometry"/>
</mxCell>
<mxCell id="85" value="NFTs 1155" style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;size=15;" vertex="1" parent="1">
<mxGeometry x="830" y="880" width="60" height="80" as="geometry"/>
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>

View File

@ -1,20 +0,0 @@
@startuml
'https://plantuml.com/sequence-diagram
autonumber
Client -> Web3: bc connect
Web3 --> Client: return chainId->net_id, account
Client -> Server: getNonce{account,net_id}
Server --> Client: return Nonce{nonce}
Client -> Server: auth{account, nonce, signature, tips}
Server --> Client: return {token}
Client -> Server: sellMyNft{account, token, nft_token, s_price, payment_token_address, nonce, signature, net_id}
Server --> Client: return ok
Client -> Server: buyNft{account, token, nft_token, payment_token_address, nonce, signature, net_id}
Server --> Client: return ok
@enduml