Skip to content

API-v2 (No-transfer Wallet)

Introduction

No-transfer wallet allows users to place bets without manually transferring funds to the Hash platform. When users log in successfully, the Hash platform automatically retrieves user funds for each bet, and bets can only be placed when sufficient funds are available.

Flow Chart

Flow Chart

1. Frontend Integration

Hash Game provides PC and H5 web pages for merchant application integration. Merchants can integrate with Hash Game frontend website through iframe embedding.

  • Frontend Address

Please contact the Hash Game team to obtain

  • Integration Method

    • Merchants assemble Hash Game lobby or individual game access addresses in the backend and embed them in the frontend.

    • Assembly content: https://${baseURL contact official to obtain}?merchant_id=0&entry=lobby&currency=USDT&token=&lang=en

    • Required Parameter Description

      • merchant_id - Merchant ID, obtained by merchants applying to Hash Game
      • entry - Game type, e.g., lobby for game hall, more details in Game Types
      • currency - Currency type, e.g., USDT, more details in Currency Types
      • token - User authorization code, merchant's user login authorization token
        • It is recommended to use bidirectional encryption/decryption, encrypting user key information into a string
        • Hash Game doesn't care about how this content is decrypted, the original content will be returned
        • Note: Due to GET parameter passing, please use URL encoding for this content
        • When this parameter doesn't exist or is empty, the game will show an unauthorized user popup
      • lang - Language code, more details in Language Code Description
      • home_url - Home page address or other page address (redirected to when user login expires)
      • theme - System theme, dark (dark mode), light (bright mode), default light mode
    • Embedded Link Example

      https://${baseURL}?merchant_id=1001&entry=lobby&currency=USDT&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3NDc4Mzg3ODksImhhbGxfaWQiOjEsImlhdCI6MTc0Nzc1MjM4OSwidXNlcl9pZCI6MX0.D-u6uFV5eZaNZ3zqqfO4hPIyvSuyjsfum9MUe4eFHvw&lang=en&theme=dark

2. Merchant Implementation

Protocol Compliance Requirements All interface implementations must strictly follow the Communication Protocol specifications, especially for Hash Game data encryption/decryption verification:

  1. Request parameters must be AES encrypted
  2. Response data must be verified and decrypted
  3. Merchant ID must be passed through Header

2.1 Get User

Interface: POST /api/v2/user/info

Brief Description

Get user information through token

Request Content

ParameterRequiredData TypeDescription
tokenYesstringUser authorization code

Success Response Data Fields

ParameterRequiredData TypeDescription
user_idYesint64Merchant partner's unique user identifier
usernameYesstringUser nickname
avatarYesstringUser avatar address

Example

json
{
  "code": 0,
  "data": {
    "user_id": 10001,
    "username": "testuser123",
    "avatar": "https://example.com/default.jpg"
  }
}

Error Response

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

2.2 User Balance

Interface: POST /api/v2/user/balance

Brief Description

Get user's currency balance through token

Request Content

ParameterRequiredData TypeDescription
tokenYesstringUser authorization code
currencyYesstringCurrency identifier ('USDT', 'TRX'), default USDT

Success Response Data Fields

ParameterRequiredData TypeDescription
user_idYesint64Merchant partner's unique user identifier
balanceYesfloat64Digital currency balance
currencyYesstringCurrency identifier ('USDT', 'TRX'), default USDT

Example

json
{
  "code": 0,
  "data": {
    "user_id": 10001,
    "balance": 1000.0,
    "currency": "USDT"
  }
}

Error Response

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

2.3 Order Placement

Interface: POST /api/v2/order/add

Brief Description

Request order placement with amount, bet is successful when third party returns success

Request Content

ParameterRequiredData TypeDescription
tokenYesstringUser authorization code
user_idYesint32Merchant partner's unique user identifier
order_noYesstringOrder number (unique)
usernameYesstringUsername
entry_keyYesstringGame identifier (refer to game type description)
round_idYesint64Number of rounds
currencyNostringCurrency identifier ('USDT', 'TRX'), default USDT
amountYesfloat64Bet amount
bet_infoYesstringBet details. This is a JSON string containing a JSON array.
Click to view sub-order structure and examples
Each element in the array is a JSON object representing bet details, with the following structure:
  • key: string - Play type, refer to play type description.
  • odds: int - Odds multiplied by 100
  • amount: float - Bet amount
  • is_win: bool - Is winning
  • prize: float - Prize distributed

Example (entire bet_info field value, note this is a string, internal JSON needs escaping):
"[{\"key\":\"Big\",\"name\":\"Big\",\"amount\":1,\"is_win\":true,\"prize\":200,\"odds\":200},{\"key\":\"Even\",\"name\":\"Even\",\"amount\":1,\"is_win\":true,\"prize\":200,\"odds\":200}]"

Success Response Data Fields

ParameterRequiredData TypeDescription
order_noYesstringOrder number
balanceYesfloat64Balance
currencyYesstringCurrency type

Error Response

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

2.4 Order Update

Interface: POST /api/v2/order/update

Brief Description

When user order status changes, such as from pending settlement to settled, repeatedly notify the user; Orders will be polled for notification before merchant returns correct results; once per minute, until 10 times after which notifications stop. If merchants need long-term maintenance shutdown, they can use 3.2 Order Details Interface to query results when the server restarts

Note When getting order status, do not settle repeatedly

Request Parameters

ParameterRequiredData TypeDescription
user_idYesstringMerchant partner's unique user identifier
usernameYesstringUser nickname
order_noYesstringOrder number (unique)
entry_keyYesstringGame identifier (refer to game integration documentation)
round_idYesint64/stringGame round number (value type depends on game type)
amountYesfloat64Total bet amount
currencyYesstringCurrency type, e.g.: USDT
statusYesint32Order status:
0-Pending
1-Success
2-Failed
3-Pending settlement
4-Cancelled
billNofloat64Bill amount (optional)
profitNofloat64Platform profit (optional)
prizeYesfloat64Prize distributed (tax included)
taxYesfloat64Tax
bonusYesfloat64Game special reward
bet_timeYesint64Bet time (unix millisecond timestamp)
reckon_timeNoint64Settlement time (unix millisecond timestamp, optional if not settled)
bet_infoYesstringBet details (JSON string format)
resultNostringGame result (optional)
is_winYesboolIs winning
remarkNostringRemarks (optional)

Success Response

ParameterRequiredData TypeDescription
codeYesint0
msgYesstringDescription
dataYesobjectObject information

Success data Return Parameter

ParameterRequiredData TypeDescription
order_noYesstringOrder number
balanceYesfloat64Balance after operation
currencyYesstringCurrency

Error Response

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

3. Hash Game Services

3.1 Game List

Interface: GET api/v2/game/list

Brief Description

Get platform's currently online games

Request Parameters

ParameterRequiredData TypeDescription
pageYesintPage number
page_sizeYesintItems per page
categoryNointCategory, default 1

List Item Description

Field NameTypeDescription
entrystringGame unique identifier
namestringGame name
iconstringGame icon

Return Parameter

json
{
  "code": 0,
  "msg": "SUCCESS",
  "data": {
    "list": [
      {
        "entry": "pc28-1",
        "name": "pc28 Advanced Room",
        "icon": "https:xxxx.jpg"
      }
    ],
    "page": 1,
    "page_size": 10
  }
}

Error Response

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

3.2 Game Login

Interface: GET api/v2/game/login

Brief Description

Login game

Request Parameters

ParameterRequiredData TypeDescription
entryYesstringGame identifier/ID
tokenYesstringtoken
currencyYesstringCurrency, default USDT
langNostringLanguage, default English

Success Structure Description

Field NameTypeDescription
game_urlstringLogin address

Return Parameter

json
{
  "code": 0,
  "msg": "SUCCESS",
  "data": {
    "game_url": "https://${baseURL}?merchant_id=1001&entry=lobby&currency=USDT&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3NDc4Mzg3ODksImhhbGxfaWQiOjEsImlhdCI6MTc0Nzc1MjM4OSwidXNlcl9pZCI6MX0.D-u6uFV5eZaNZ3zqqfO4hPIyvSuyjsfum9MUe4eFHvw&lang=en"
  }
}

Error Response

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

3.3 Order Query

Interface: GET api/v2/order/list

Brief Description

Platform all player order data, return Success and settled orders

Request Parameters

ParameterRequiredData TypeDescription
pageYesintPage number
page_sizeYesintItems per page
start_timeNointMillisecond timestamp, query start time, default start of today
end_timeNointMillisecond timestamp, query end time, default end of today
max_idNointMax pull value

List Item Description

Field NameTypeDescription
idint64Primary key id
order_nostringSystem unique order number
block_idstringBlock hash
user_idint64User ID
usernamestringUsername (masked)
game_codestringGame identifier
entry_keystringGame entry identifier code
entry_namestringGame entry name
room_idint32Room ID
room_namestringRoom name
round_idint64Game unique identifier
amountfloat64Order amount (including positive and negative)
currencystringCurrency code (CNY/USD etc.)
statusint32Order status (see status enumeration)
billfloat64Bill amount
profitfloat64Platform profit/loss (positive profit/negative loss)
prizefloat64Prize amount
taxfloat64Tax
bonusfloat64Extra reward amount
bet_timeint64Bet timestamp (seconds)
reckon_timeint64Settlement timestamp (0 if not settled)
bet_infostringBet details (JSON string format)
resultstringDraw result
is_winboolYesNo win
remarkstringRemark

Return Parameter

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": 10
  }
}

Error Response

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

3.4 Order Details

Interface: GET api/v2/order/details

Brief Description

Platform player order detailed information

Request Parameters

ParameterRequiredData TypeDescription
order_noYesstringOrder number (unique)

Success Response Data (200)

Field NameTypeDescription
order_nostringSystem unique order number
block_idstringBlock hash
user_idint64User ID
usernamestringUsername (masked)
game_codestringGame identifier
entry_keystringGame entry identifier code
entry_namestringGame entry name
room_idint32Room ID
room_namestringRoom name
round_idint64Game unique identifier
amountfloat64Order amount (including positive and negative)
currencystringCurrency code (CNY/USD etc.)
statusint32Order status (see status enumeration)
billfloat64Bill amount
profitfloat64Platform profit/loss (positive profit/negative loss)
prizefloat64Prize amount
taxfloat64Tax
bonusfloat64Extra reward amount
bet_timeint64Bet timestamp (seconds)
reckon_timeint64Settlement timestamp (0 if not settled)
bet_infostringBet details (JSON string format)
resultstringDraw result
is_winboolYesNo win
remarkstringRemark
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

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