API-v1 (Transfer Wallet)
Introduction
Transfer wallet allows users to manually transfer funds to the Hash platform. All betting activities are completed within the Hash platform. When users are not playing on the Hash platform, they can manually withdraw funds from the Hash platform.
Flow Chart

API
1. User Interfaces
1.1 Create User
Interface: POST /api/v1/user/create
Brief Description
User registration interface. Users need to register before first use of the platform.
Request Parameters
| Parameter Name | Required | Type | Description | Example Value |
|---|---|---|---|---|
| username | Yes | string | Username (4-20 alphanumeric characters) | "testuser123" |
| password | Yes | string | Password (6-32 characters) | "p@ssw0rd" |
| nickname | No | string | Nickname (2-20 characters) | "Test User" |
Success Response (200)
| Field Name | Type | Description |
|---|---|---|
| user_id | int64 | System assigned unique user ID |
| username | string | User registration account |
| nickname | string | User nickname (empty string if not set) |
| avatar | string | User avatar URL |
| status | int32 | Account status (1 normal/0 disabled) |
| token | string | Authentication token (valid for 7 days) |
| jump_url | string | Redirect URL after login |
Example
{
"code": 0,
"data": {
"user_id": 10001,
"username": "testuser123",
"nickname": "Test User",
"avatar": "https://example.com/default.jpg",
"status": 1,
"token": "eyJhbGciOi...",
"jump_url": "/dashboard"
}
}Error Response
| Parameter | YesNoRequired | Data Type | Description |
|---|---|---|---|
| code | Yes | int | Error code (refer to error code documentation) |
| msg | Yes | string | Error description |
1.2 Login
Interface: POST /api/v1/user/login
Brief Description
User login interface to get game address and authentication token
Request Parameters
| Parameter Name | Required | Type | Description | Example Value |
|---|---|---|---|---|
| username | Yes | string | Username | "testuser123" |
| password | Yes | string | Password | "p@ssw0rd" |
| entry_key | Yes | string | Game entry code | "PC28_1" |
| currency | No | string | Currency type (default USDT) | "USDT" |
Success Response (200)
| Field Name | Type | Description |
|---|---|---|
| user_id | int64 | User ID |
| username | string | Username |
| nickname | string | User nickname |
| avatar | string | Avatar URL |
| status | int32 | Account status (1 normal) |
| token | string | Authentication token |
| jump_url | string | Game redirect URL |
Example
{
"code": 0,
"data": {
"user_id": 10001,
"username": "testuser123",
"nickname": "Test User",
"avatar": "https://example.com/avatar.jpg",
"status": 1,
"token": "eyJhbGciOi...",
"jump_url": "/game/pc28?token=eyJhbGciOi..."
}
}Error Response
| Parameter | YesNoRequired | Data Type | Description |
|---|---|---|---|
| code | Yes | int | Error code (refer to error code documentation) |
| msg | Yes | string | Error description |
1.3 Balance Query
Interface: GET /api/v1/user/balance
Brief Description
Get user's current balance
Request Parameters
| Parameter Name | Required | Type | Description | Example Value |
|---|---|---|---|---|
| user_id | Yes | int64 | User ID | 10001 |
| currency | No | string | Currency type (default USDT) | "USDT" |
Success Response (200)
| Field Name | Type | Description |
|---|---|---|
| user_id | int64 | User ID |
| balance | float64 | Account balance |
| currency | string | Currency type |
| frozen | float64 | Frozen amount (optional) |
Example
{
"code": 0,
"data": {
"user_id": 10001,
"balance": 1580.5,
"currency": "USDT",
"frozen": 200.0
}
}Error Response
| Parameter | YesNoRequired | Data Type | Description |
|---|---|---|---|
| code | Yes | int | Error code (refer to error code documentation) |
| msg | Yes | string | Error description |
1.4 Query User Information
Interface: GET /api/v1/user/user_info
Brief Description
Get user's basic information
Request Parameters
| Parameter Name | Required | Type | Description | Example Value |
|---|---|---|---|---|
| user_id | Yes | int64 | User ID | 10001 |
Success Response (200)
| Field Name | Type | Description |
|---|---|---|
| user_id | int64 | User ID |
| username | string | Username |
| nickname | string | User nickname |
| avatar | string | Avatar URL |
| status | string | Status |
| token | string | token |
Example
{
"code": 0,
"data": {
"user_id": 10001,
"username": "testuser123",
"nickname": "Test User",
"avatar": "https://example.com/avatar.jpg",
"status": 1
}
}Error Response
| Parameter | YesNoRequired | Data Type | Description |
|---|---|---|---|
| code | Yes | int | Error code (refer to error code documentation) |
| msg | Yes | string | Error description |
1.5 Update User Information
Interface: POST /api/v1/user/update
Brief Description
When user's nickname and avatar change, sync the information display
Request Parameters
| Parameter Name | Required | Type | Description | Example Value |
|---|---|---|---|---|
| user_id | Yes | int64 | User ID | 10001 |
| nickname | No | string | New nickname (2-20 characters) | "New nickname" |
| avatar | No | string | New avatar URL | "https://example.com/new_avatar.jpg" |
| password | No | string | New password (6-32 characters) | "newP@ss123" |
Success Response (200)
| Field Name | Type | Description |
|---|---|---|
| user_id | int64 | User ID |
| username | string | Username |
| nickname | string | Updated nickname |
| avatar | string | Updated avatar URL |
| update_time | int64 | Update timestamp (seconds) |
Example
{
"code": 0,
"data": {
"user_id": 10001,
"username": "testuser123",
"nickname": "New nickname",
"avatar": "https://example.com/new_avatar.jpg",
"update_time": 1675161600
}
}Error Response
| Parameter | YesNoRequired | Data Type | Description |
|---|---|---|---|
| code | Yes | int | Error code (refer to error code documentation) |
| msg | Yes | string | Error description |
1.6 Change User Status
Interface: POST /api/v1/user/update_status
Brief Description
Change user's status, sync information display
Request Parameters
| Parameter Name | Required | Type | Description | Example Value |
|---|---|---|---|---|
| user_id | Yes | int64 | User ID to operate on | 10001 |
| status | Yes | int32 | Target status (0 enabled/1 disabled/2 risk control) | 1 |
Success Response (200)
| Field Name | Type | Description |
|---|---|---|
| user_id | int64 | User ID |
| username | string | Username |
| nickname | string | Nickname |
| status | int32 | Status |
| avatar | string | Avatar |
| update_time | int64 | Operation timestamp (seconds) |
Example
{
"code": 0,
"data": {
"user_id": 10001,
"username": "testuser123",
"nickname": "New nickname",
"status": 1,
"avatar": "https://example.com/new_avatar.jpg",
"update_time": 1675161600
}
}Success Response
| Parameter | YesNoRequired | Data Type | Description |
|---|
Error Response
| Parameter | YesNoRequired | Data Type | Description |
|---|---|---|---|
| code | Yes | int | Error code (refer to error code documentation) |
| msg | Yes | string | Error description |
2. Transfer Interfaces
2.1 Transfer
Interface:POST /api/v1/transfer
Brief Description
Transfer funds between user wallet and platform account (positive number means transfer to platform, negative number means transfer out of platform)
Request Parameters
| Parameter Name | Required | Type | Description | Example Value |
|---|---|---|---|---|
| user_id | Yes | int64 | User unique identifier | "user_123456" |
| amount | Yes | float64 | Transfer amount (2 decimal places) | 100.50 |
| currency | Yes | string | Currency type | "USDT" |
Success Response (200)
| Parameter Name | Type | Description |
|---|---|---|
| user_id | int64 | User ID |
| order_no | string | System transaction serial number |
| balance | number | Latest account balance |
| currency | string | Currency type |
Example
{
"code": 0,
"data": {
"user_id": 111,
"order_no": "TS202308010001",
"currency": "USDT",
"balance": 1500.75
}
}Error Response
| Parameter | YesNoRequired | Data Type | Description |
|---|---|---|---|
| code | Yes | int | Error code (refer to error code documentation) |
| msg | Yes | string | Error description |
2.2 Transfer List Query
Interface:GET /api/v1/transfer/logs
Brief Description
Paginated query of user transfer history records
Request Parameters
| Parameter Name | Required | Type | Description | Example Value |
|---|---|---|---|---|
| username | Yes | string | Username | "user_123456" |
| page | No | int | Current page number (default 1) | 1 |
| page_size | No | int | Number of items per page (default 10, maximum 50) | 10 |
| start_time | No | string | Start time (YYYY-MM-DD format) | "2023-08-01" |
| end_time | No | string | End time (YYYY-MM-DD format) | "2023-08-31" |
| transfer_type | No | int | Transfer type (1 transfer in/2 transfer out) | 1 |
Success Response (200)
| Parameter Name | Type | Description |
|---|---|---|
| list | array | Transfer record list |
| page | int | Current page number |
| page_size | int | Number of items per page |
List Item Structure
| Parameter Name | Type | Description |
|---|---|---|
| order_no | string | Transfer order number/transaction serial number |
| user_id | int64 | User ID |
| username | string | Username |
| amount | float64 | Transfer amount |
| currency | string | Currency type, e.g. USDT |
| before | float64 | Balance before transfer |
| after | float64 | Balance after transfer |
| status | int32 | Transfer status: 1-Success 2-Failed |
| type | int32 | Transfer type: 1-Deposit 2-Withdrawal 3-Transfer to game 4-Transfer out of game |
| create_at | int64 | Creation time (unix timestamp) |
Example
{
"code": 0,
"data": {
"list": [
{
"order_no": "TS202308010001",
"user_id": 10001,
"username": "user123",
"amount": 100.5,
"fee": 0.0,
"currency": "USD",
"before": 500.0,
"after": 600.5,
"status": 1,
"type": 1,
"create_time": "2023-08-01 10:30:00"
}
],
"page": 1,
"page_size": 10
}
}Error Response
| Parameter | YesNoRequired | Data Type | Description |
|---|---|---|---|
| code | Yes | int | Error code (refer to error code documentation) |
| msg | Yes | string | Error description |
2.3 Transfer Status Query
Interface: GET /api/v1/transfer/status
Brief Description
Query the status of user's transfer records
Request Parameters
| Parameter Name | Required | Type | Description | Example Value |
|---|---|---|---|---|
| order_no | Yes | string | Transaction serial order number | "TS202308010001" |
Success Response (200)
| Parameter Name | Type | Description |
|---|---|---|
| order_no | string | Transfer order number/transaction serial number |
| user_id | int64 | User ID |
| username | string | Username |
| amount | float64 | Transfer amount |
| currency | string | Currency type, e.g. USDT |
| before | float64 | Balance before transfer |
| after | float64 | Balance after transfer |
| status | int32 | Transfer status: 1-Success 2-Failed |
| type | int32 | Transfer type: 1-Deposit 2-Withdrawal 3-Transfer to game 4-Transfer out of game |
| create_at | int64 | Creation time (unix timestamp) |
Example
{
"code": 0,
"data": {
"order_no": "TS202308010001",
"user_id": 10001,
"username": "user123",
"amount": 100.5,
"fee": 0.0,
"currency": "USD",
"before": 500.0,
"after": 600.5,
"status": 1,
"type": 1,
"create_time": "2023-08-01 10:30:00"
}
}Error Response
| Parameter | YesNoRequired | Data Type | Description |
|---|---|---|---|
| code | Yes | int | Error code (refer to error code documentation) |
| msg | Yes | string | Error description |
3. Order Interfaces
3.1 Order List Query
Interface:GET /api/v1/order/list
Brief Description
Order data for all players on the platform
Request Parameters
| Parameter | YesNoRequired | Data Type | Description |
|---|---|---|---|
| page | Yes | int | Page number |
| page_size | Yes | int | Items per page |
| start_time | Yes | int | Millisecond timestamp,Query start time, default to today's start milliseconds |
| end_time | Yes | int | Millisecond timestamp,Query end time, default to today's end milliseconds |
Success Response (200)
| Parameter Name | Type | Description |
|---|---|---|
| list | array | Transfer record list |
| page | int | Current page number |
| page_size | int | Total pages |
List Item Structure Description
| Field Name | Type | Description |
|---|---|---|
| order_no | string | System unique order number |
| block_id | string | Block hash |
| user_id | int64 | User ID |
| username | string | Username (desensitized) |
| game_code | string | Game identifier |
| entry_key | string | Game entry identifier code |
| entry_name | string | Game entry name |
| room_id | int32 | Room ID |
| room_name | string | Room name |
| round_id | int64 | Game round unique identifier |
| amount | float64 | Order amount (positive/negative) |
| currency | string | Currency code (CNY/USD etc.) |
| status | int32 | Order status (see status enumeration) |
| bill | float64 | Flow amount |
| profit | float64 | Platform profit/loss (positive for profit/negative for loss) |
| prize | float64 | Prize amount |
| tax | float64 | Tax |
| bonus | float64 | Additional bonus amount |
| bet_time | int64 | Bet timestamp (seconds) |
| reckon_time | int64 | Settlement timestamp (0 if not settled) |
| bet_info | string | Bet details (JSON string format) |
| result | string | Lottery result |
| is_win | bool | Is winning |
| remark | string | Remarks |
bet_info JSON Structure Example
[
{
"key": "Big",
"name": "Big",
"amount": 1,
"odds": 1.95,
"result": "win"
}
]Example
{
"code": 0,
"msg": "SUCCESS",
"data": {
"list": [
{
"user_id": 9,
"username": "RSwVUYp",
"order_no": "202506061653316411",
"block_id": "0000000004579244e0f582546c32e30225bf30c0fa9eb2f281334fd7b83ddf23",
"game_code": "pc28",
"entry_key": "pc28-1",
"entry_name": "",
"room_id": 1,
"room_name": "",
"round_id": 72847940,
"amount": 10,
"currency": "USDT",
"status": 3,
"bill": 0,
"profit": 0,
"prize": 0,
"tax": 0,
"bonus": 0,
"bet_time": 1749200012000,
"reckon_time": 0,
"bet_info": "[{\"key\":\"Big\",\"name\":\"Big\",\"odds\":200,\"amount\":10}]",
"result": "",
"is_win": false,
"remark": ""
}
],
"page": 1,
"page_size": 20
}
}Error Response
| Parameter | YesNoRequired | Data Type | Description |
|---|---|---|---|
| code | Yes | int | Error code (refer to error code documentation) |
| msg | Yes | string | Error description |
3.2 Order Details
Interface:GET /v1/order/details
Brief Description
Platform player order details
Request Parameters
| Parameter | YesNoRequired | Data Type | Description |
|---|---|---|---|
| order_no | Yes | string | Order number (unique) |
Success Response data (200)
List Item Structure Description
| Field Name | Type | Description |
|---|---|---|
| order_no | string | System unique order number |
| block_id | string | Block hash |
| user_id | int64 | User ID |
| username | string | Username (desensitized) |
| game_code | string | Game identifier |
| entry_key | string | Game entry identifier code |
| entry_name | string | Game entry name |
| room_id | int32 | Room ID |
| room_name | string | Room name |
| round_id | int64 | Game round unique identifier |
| amount | float64 | Order amount (positive/negative) |
| currency | string | Currency code (CNY/USD etc.) |
| status | int32 | Order status (see status enumeration) |
| bill | float64 | Flow amount |
| profit | float64 | Platform profit/loss (positive for profit/negative for loss) |
| prize | float64 | Prize amount |
| tax | float64 | Tax |
| bonus | float64 | Additional bonus amount |
| bet_time | int64 | Bet timestamp (seconds) |
| reckon_time | int64 | Settlement timestamp (0 if not settled) |
| bet_info | string | Bet details (JSON string format) |
| result | string | Lottery result |
| is_win | bool | Is winning |
| remark | string | Remarks |
Success Response
{
"code": 0,
"msg": "SUCCESS",
"data": {
"user_id": 9,
"username": "RSwVUYp",
"order_no": "202506061653316411",
"block_id": "0000000004579244e0f582546c32e30225bf30c0fa9eb2f281334fd7b83ddf23",
"game_code": "pc28",
"entry_key": "pc28-1",
"entry_name": "",
"room_id": 1,
"room_name": "",
"round_id": 72847940,
"amount": 10,
"currency": "USDT",
"status": 3,
"bill": 0,
"profit": 0,
"prize": 0,
"tax": 0,
"bonus": 0,
"bet_time": 1749200012000,
"reckon_time": 0,
"bet_info": "[{\"key\":\"Big\",\"name\":\"Big\",\"odds\":200,\"amount\":10}]",
"result": "",
"is_win": false,
"remark": ""
}
}Error Response
| Parameter | YesNoRequired | Data Type | Description |
|---|---|---|---|
| code | Yes | int | Error code (refer to error code documentation) |
| msg | Yes | string | Error description |

