Closed godmmt closed 11 months ago
為了方便這裡暫時先將 022 區分為 022-1、022-2
022-1 - Transaction History of Address 114007 and Address 110029 - website url : https://baifa-boy6tsv96-cafeca.vercel.app/en/app/transaction-list?addressId=114007&addressId=110029 (由 013 進入 022-1)
022-2 - Transaction List of Block 230676 - website url : https://baifa-boy6tsv96-cafeca.vercel.app/en/app/transaction-list?blockId=230676
007 Select period for transactions - website url : https://baifa-boy6tsv96-cafeca.vercel.app/en/app/chains/isun 在組件取得區間資料後重新渲染
008 - Get a block data from a chain website url : https://baifa-boy6tsv96-cafeca.vercel.app/en/app/chains/isun/block/230676
GET /app/transactions?address=${address1},${address2},...
預計改成:
GET /app/chains/:chainId/transactions?address=${address1},${address2},...
(與 007 合併)
GET /app/transactions?block_id=${blockId}
預計改成:
GET /app/chains/:chainId/blocks/:blockId/transactions
(新增為單獨一支 API,預計編號為 009)
HTTP Request: GET /app/chains/:chainId/transactions
GET /app/chains/:chainId/transactions?start_date=${startTimestamp}&end_date=${endTimestamp}
GET /app/chains/:chainId/transactions?address=${address1},${address2},...
Parameters:
start_date
and end_date
- required* (根據時間區段回傳資料)address
- required* (根據地址回傳交易清單)Request Example:
GET /app/chains/isun/transactions?start_date=1680176231&end_date=1679978900
Response Example:
{
"chainId": "isun",
"chainName": "iSunCloud",
"chainIcon": "/currencies/isun.svg",
"blockData": [
{
"id": "230020",
"chainId": "isun",
"createdTimestamp": 1673940795,
"stability": "MEDIUM"
},
{
"id": "230021",
"chainId": "isun",
"createdTimestamp": 1679978900,
"stability": "HIGH"
},
{
"id": "230022",
"chainId": "isun",
"createdTimestamp": 1680176231,
"stability": "LOW"
}
//...
],
"transactionData": [
{
"id": "930071",
"chainId": "isun",
"createdTimestamp": 1607957394,
"type": "Crypto Currency",
"status": "SUCCESS"
},
{
"id": "930072",
"chainId": "isun",
"createdTimestamp": 1679978900,
"type": "Evidence",
"status": "FAILED"
},
{
"id": "930073",
"chainId": "usdt",
"createdTimestamp": 1680176231,
"type": "NFT",
"status": "PENDING"
}
//...
]
}
Request Example:
GET /app/transactions?address=${114007},${110029},...
Response Example:
[
{
"id": "916841",
"chainId": "btc",
"createdTimestamp": 1678057313,
"type": "Crypto Currency",
"status": "SUCCESS"
},
{
"id": "910237",
"chainId": "btc",
"createdTimestamp": 1681731057,
"type": "Evidence",
"status": "SUCCESS"
},
{
"id": "910237",
"chainId": "btc",
"createdTimestamp": 1683905718,
"type": "Crypto Currency",
"status": "SUCCESS"
},
{
"id": "919472",
"chainId": "btc",
"createdTimestamp": 1689732890,
"type": "Evidence",
"status": "FAILED"
},
{
"id": "911837",
"chainId": "btc",
"createdTimestamp": 1690209183,
"type": "Crypto Currency",
"status": "PENDING"
}
// ...other transactions
]
HTTP Request: GET /app/chains/:chainId/blocks/:blockId/transactions
Parameters: none
Request Example: GET /app/chains/btc/blocks/230021/transactions
Response Example:
[
{
"id": "916841",
"chainId": "btc",
"createdTimestamp": 1678057313,
"type": "Crypto Currency",
"status": "SUCCESS"
},
{
"id": "910237",
"chainId": "btc",
"createdTimestamp": 1681731057,
"type": "Evidence",
"status": "SUCCESS"
},
{
"id": "910237",
"chainId": "btc",
"createdTimestamp": 1683905718,
"type": "Crypto Currency",
"status": "SUCCESS"
},
{
"id": "919472",
"chainId": "btc",
"createdTimestamp": 1689732890,
"type": "Evidence",
"status": "FAILED"
},
{
"id": "911837",
"chainId": "btc",
"createdTimestamp": 1690209183,
"type": "Crypto Currency",
"status": "PENDING"
}
// ...other transactions
]
022 - Transaction History from Addresses / Transaction List form a block HTTP Request:
GET /app/transactions?address=${address1},${address2},...
GET /app/transactions?block_id=${blockId}
Parameters: address
or block_id
(Cannot choose both) - required*
Request Example: GET /app/transactions?address=${114007},${110029},...
Response Example:
[
{
"id": "916841",
"chainId": "btc",
"createdTimestamp": 1678057313,
"type": "Crypto Currency",
"status": "SUCCESS"
},
{
"id": "910237",
"chainId": "btc",
"createdTimestamp": 1681731057,
"type": "Evidence",
"status": "SUCCESS"
},
{
"id": "910237",
"chainId": "btc",
"createdTimestamp": 1683905718,
"type": "Crypto Currency",
"status": "SUCCESS"
},
{
"id": "919472",
"chainId": "btc",
"createdTimestamp": 1689732890,
"type": "Evidence",
"status": "FAILED"
},
{
"id": "911837",
"chainId": "btc",
"createdTimestamp": 1690209183,
"type": "Crypto Currency",
"status": "PENDING"
}
// ...other transactions
]
took 2 pt need more 1 pt
TODO:
If this issue has been done, go update these issues below:
update API document #350 - took 1 pt update Mock API #351 - took 2 pt
update Postman mock server settings #352 & TEST #355 - took 0.5 pt
done.
Total time: 5.5 hours
討論: 022 拆分合併至其他的 API
022 - Transaction History from Addresses / Transaction List form a block
HTTP Request:
GET /app/transactions?address=${address1},${address2},...
GET /app/transactions?block_id=${blockId}
Parameters:
address
orblock_id
(Cannot choose both) - required*Request Example:
GET /app/transactions?address=${114007},${110029},...
Response Example:
007 - Select period for transactions
HTTP Request:
GET /app/chains/:chainId/transactions?start_date=${startTimestamp}&end_date=${endTimestamp}
Parameters:
start_date
andend_date
- required* (根據時間區段回傳資料)Request Example:
GET /app/chains/isun/transactions?start_date=1680176231&end_date=1679978900
Response Example:
008 - Get a block data from a chain
HTTP Request:
GET /app/chains/:chainId/blocks/:blockId
Parameters: none
Request Example:
GET /app/chains/isun/blocks/230021
Response Example: