跳至主要内容

Create

需求描述

新增使用者收款資料 提供 networkaddresstoken_address 新增收款資料

以下是資料型別限制:

network 目前只接受 ["Ethereum", "BSC", "Polygon", "Arbitrum", "Avalanche"]

token_address 使用正則表達式 '^0x[0-9a-fA-F]{40}$' 驗證

address 使用正則表達式 '^0x[0-9a-fA-F]{40}$' 驗證

token 可以經由 /api/auth/token 取得 無效的 token 無法執行此操作

成功新增回傳 整筆收款資料的資訊,包含系統自動產生之 _id

Method

POST

Endpoint

  • /api/recipient/

Request Header

{
"Authorization": "Bearer {token}"
}

Request Body

{
"network": "string",
"address": "string",
"token_address": "string",
"nickname": "string",
}

Response

新增成功

  • HTTP Status Code: 200
{
"_id": "uuid",
"network": "string",
"address": "string",
"token_address": "string",
"user_id": "uuid",
"create_time": "timestamp",
}

使用者驗證失敗

  • HTTP Status Code: 401
{
"detail": "Invalid token.",
}