Skip to content

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

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 NameRequiredTypeDescriptionExample Value
usernameYesstringUsername (4-20 alphanumeric characters)"testuser123"
passwordYesstringPassword (6-32 characters)"p@ssw0rd"
nicknameNostringNickname (2-20 characters)"Test User"

Success Response (200)

Field NameTypeDescription
user_idint64System assigned unique user ID
usernamestringUser registration account
nicknamestringUser nickname (empty string if not set)
avatarstringUser avatar URL
statusint32Account status (1 normal/0 disabled)
tokenstringAuthentication token (valid for 7 days)
jump_urlstringRedirect URL after login

Example

json
{
  "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

ParameterYesNoRequiredData TypeDescription
codeYesintError code (refer to error code documentation)
msgYesstringError 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 NameRequiredTypeDescriptionExample Value
usernameYesstringUsername"testuser123"
passwordYesstringPassword"p@ssw0rd"
entry_keyYesstringGame entry code"PC28_1"
currencyNostringCurrency type (default USDT)"USDT"

Success Response (200)

Field NameTypeDescription
user_idint64User ID
usernamestringUsername
nicknamestringUser nickname
avatarstringAvatar URL
statusint32Account status (1 normal)
tokenstringAuthentication token
jump_urlstringGame redirect URL

Example

json
{
  "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

ParameterYesNoRequiredData TypeDescription
codeYesintError code (refer to error code documentation)
msgYesstringError description

1.3 Balance Query

Interface: GET /api/v1/user/balance

Brief Description

Get user's current balance

Request Parameters

Parameter NameRequiredTypeDescriptionExample Value
user_idYesint64User ID10001
currencyNostringCurrency type (default USDT)"USDT"

Success Response (200)

Field NameTypeDescription
user_idint64User ID
balancefloat64Account balance
currencystringCurrency type
frozenfloat64Frozen amount (optional)

Example

json
{
  "code": 0,
  "data": {
    "user_id": 10001,
    "balance": 1580.5,
    "currency": "USDT",
    "frozen": 200.0
  }
}

Error Response

ParameterYesNoRequiredData TypeDescription
codeYesintError code (refer to error code documentation)
msgYesstringError description

1.4 Query User Information

Interface: GET /api/v1/user/user_info

Brief Description

Get user's basic information

Request Parameters

Parameter NameRequiredTypeDescriptionExample Value
user_idYesint64User ID10001

Success Response (200)

Field NameTypeDescription
user_idint64User ID
usernamestringUsername
nicknamestringUser nickname
avatarstringAvatar URL
statusstringStatus
tokenstringtoken

Example

json
{
  "code": 0,
  "data": {
    "user_id": 10001,
    "username": "testuser123",
    "nickname": "Test User",
    "avatar": "https://example.com/avatar.jpg",
    "status": 1
  }
}

Error Response

ParameterYesNoRequiredData TypeDescription
codeYesintError code (refer to error code documentation)
msgYesstringError 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 NameRequiredTypeDescriptionExample Value
user_idYesint64User ID10001
nicknameNostringNew nickname (2-20 characters)"New nickname"
avatarNostringNew avatar URL"https://example.com/new_avatar.jpg"
passwordNostringNew password (6-32 characters)"newP@ss123"

Success Response (200)

Field NameTypeDescription
user_idint64User ID
usernamestringUsername
nicknamestringUpdated nickname
avatarstringUpdated avatar URL
update_timeint64Update timestamp (seconds)

Example

json
{
  "code": 0,
  "data": {
    "user_id": 10001,
    "username": "testuser123",
    "nickname": "New nickname",
    "avatar": "https://example.com/new_avatar.jpg",
    "update_time": 1675161600
  }
}

Error Response

ParameterYesNoRequiredData TypeDescription
codeYesintError code (refer to error code documentation)
msgYesstringError 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 NameRequiredTypeDescriptionExample Value
user_idYesint64User ID to operate on10001
statusYesint32Target status (0 enabled/1 disabled/2 risk control)1

Success Response (200)

Field NameTypeDescription
user_idint64User ID
usernamestringUsername
nicknamestringNickname
statusint32Status
avatarstringAvatar
update_timeint64Operation timestamp (seconds)

Example

json
{
  "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

ParameterYesNoRequiredData TypeDescription

Error Response

ParameterYesNoRequiredData TypeDescription
codeYesintError code (refer to error code documentation)
msgYesstringError 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 NameRequiredTypeDescriptionExample Value
user_idYesint64User unique identifier"user_123456"
amountYesfloat64Transfer amount (2 decimal places)100.50
currencyYesstringCurrency type"USDT"

Success Response (200)

Parameter NameTypeDescription
user_idint64User ID
order_nostringSystem transaction serial number
balancenumberLatest account balance
currencystringCurrency type

Example

json
{
  "code": 0,
  "data": {
    "user_id": 111,
    "order_no": "TS202308010001",
    "currency": "USDT",
    "balance": 1500.75
  }
}

Error Response

ParameterYesNoRequiredData TypeDescription
codeYesintError code (refer to error code documentation)
msgYesstringError description

2.2 Transfer List Query

Interface:GET /api/v1/transfer/logs

Brief Description

Paginated query of user transfer history records

Request Parameters

Parameter NameRequiredTypeDescriptionExample Value
usernameYesstringUsername"user_123456"
pageNointCurrent page number (default 1)1
page_sizeNointNumber of items per page (default 10, maximum 50)10
start_timeNostringStart time (YYYY-MM-DD format)"2023-08-01"
end_timeNostringEnd time (YYYY-MM-DD format)"2023-08-31"
transfer_typeNointTransfer type (1 transfer in/2 transfer out)1

Success Response (200)

Parameter NameTypeDescription
listarrayTransfer record list
pageintCurrent page number
page_sizeintNumber of items per page

List Item Structure

Parameter NameTypeDescription
order_nostringTransfer order number/transaction serial number
user_idint64User ID
usernamestringUsername
amountfloat64Transfer amount
currencystringCurrency type, e.g. USDT
beforefloat64Balance before transfer
afterfloat64Balance after transfer
statusint32Transfer status:
1-Success
2-Failed
typeint32Transfer type:
1-Deposit
2-Withdrawal
3-Transfer to game
4-Transfer out of game
create_atint64Creation time (unix timestamp)

Example

json
{
  "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

ParameterYesNoRequiredData TypeDescription
codeYesintError code (refer to error code documentation)
msgYesstringError 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 NameRequiredTypeDescriptionExample Value
order_noYesstringTransaction serial order number"TS202308010001"

Success Response (200)

Parameter NameTypeDescription
order_nostringTransfer order number/transaction serial number
user_idint64User ID
usernamestringUsername
amountfloat64Transfer amount
currencystringCurrency type, e.g. USDT
beforefloat64Balance before transfer
afterfloat64Balance after transfer
statusint32Transfer status:
1-Success
2-Failed
typeint32Transfer type:
1-Deposit
2-Withdrawal
3-Transfer to game
4-Transfer out of game
create_atint64Creation time (unix timestamp)

Example

json
{
  "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

ParameterYesNoRequiredData TypeDescription
codeYesintError code (refer to error code documentation)
msgYesstringError 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

ParameterYesNoRequiredData TypeDescription
pageYesintPage number
page_sizeYesintItems per page
start_timeYesintMillisecond timestamp,Query start time, default to today's start milliseconds
end_timeYesintMillisecond timestamp,Query end time, default to today's end milliseconds

Success Response (200)

Parameter NameTypeDescription
listarrayTransfer record list
pageintCurrent page number
page_sizeintTotal pages

List Item Structure Description

Field NameTypeDescription
order_nostringSystem unique order number
block_idstringBlock hash
user_idint64User ID
usernamestringUsername (desensitized)
game_codestringGame identifier
entry_keystringGame entry identifier code
entry_namestringGame entry name
room_idint32Room ID
room_namestringRoom name
round_idint64Game round unique identifier
amountfloat64Order amount (positive/negative)
currencystringCurrency code (CNY/USD etc.)
statusint32Order status (see status enumeration)
billfloat64Flow amount
profitfloat64Platform profit/loss (positive for profit/negative for loss)
prizefloat64Prize amount
taxfloat64Tax
bonusfloat64Additional bonus amount
bet_timeint64Bet timestamp (seconds)
reckon_timeint64Settlement timestamp (0 if not settled)
bet_infostringBet details (JSON string format)
resultstringLottery result
is_winboolIs winning
remarkstringRemarks

bet_info JSON Structure Example

json
[
  {
    "key": "Big",
    "name": "Big",
    "amount": 1,
    "odds": 1.95,
    "result": "win"
  }
]

Example

json
{
  "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

ParameterYesNoRequiredData TypeDescription
codeYesintError code (refer to error code documentation)
msgYesstringError description

3.2 Order Details

Interface:GET /v1/order/details

Brief Description

Platform player order details

Request Parameters

ParameterYesNoRequiredData TypeDescription
order_noYesstringOrder number (unique)

Success Response data (200)

List Item Structure Description

Field NameTypeDescription
order_nostringSystem unique order number
block_idstringBlock hash
user_idint64User ID
usernamestringUsername (desensitized)
game_codestringGame identifier
entry_keystringGame entry identifier code
entry_namestringGame entry name
room_idint32Room ID
room_namestringRoom name
round_idint64Game round unique identifier
amountfloat64Order amount (positive/negative)
currencystringCurrency code (CNY/USD etc.)
statusint32Order status (see status enumeration)
billfloat64Flow amount
profitfloat64Platform profit/loss (positive for profit/negative for loss)
prizefloat64Prize amount
taxfloat64Tax
bonusfloat64Additional bonus amount
bet_timeint64Bet timestamp (seconds)
reckon_timeint64Settlement timestamp (0 if not settled)
bet_infostringBet details (JSON string format)
resultstringLottery result
is_winboolIs winning
remarkstringRemarks

Success Response

json
{
  "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

ParameterYesNoRequiredData TypeDescription
codeYesintError code (refer to error code documentation)
msgYesstringError description