Vessel Finance API
  1. User
Vessel Finance API
  • Introduction
  • General Info
  • HMAC Signature Guide
  • Poseidon Signature Guide
  • Internal Transfer Signature Guide
  • Error Code
  • Vessel REST API
    • Public
      • Market Data
        • 24hr Ticker Statistics
        • Kline / Candlestick Data
        • Order Book
        • Recent Trades List
        • Average Price
        • AMM Pool Last 24h Data
      • Exchange Data
        • Ticker Info
        • Asset Info
        • Trade Fee
        • AMM Pool Info
    • User
      • Asset
        • User Asset
        • Withdraw
        • Withdraw History
        • Deposit History
        • Claim History
        • Internal Transfer (Send)
        • Internal Transfer History
      • Order
        • Place Order
        • Cancel Order
        • Open Orders
        • Completed Orders
        • All Orders
        • Query Order
        • Modify Order
      • AMM
        • Add Liquidity
        • Remove Liquidity
        • Collect Fee
        • AMM Position
        • AMM Action History
      • Account
        • User Profile
        • User Trade List
  • Vessel WebSocket
    • Market
      • Order Book
      • K Line
      • Recent Trades
      • 24hr Ticker Statistics
      • Ticker Setting Upade
    • User
      • Authorize
      • Balance
      • Account
  1. User

Authorize

{{WSS_SERVER}}/ws/user
Last modified:2025-01-09 06:57:11
Before subscribing to user data channels, you need to authenticate by connecting to the authorization channel. Use your API key for authentication.

Message Structure#

Send Message#

1.
Type: Specifies the type of WebSocket message.
1.
Type: String.
2.
Value: "subscribe"
2.
Channel: Indicates the type of data to subscribe to (e.g., order book updates).
1.
Type: String.
2.
Value: "authorize"
3.
ID: A unique identifier for the subscription request. Write randomly or use any unique identifier.
1.
Type: String.
2.
Example. "authorize001"
4.
vesselApiKey: Associated with the user's account and you can get it from our website.
1.
Type: String.
2.
Example: "0x97cb025549d36946fe5a401454a437c0"
5.
vesselPassphrase: Associated with the user's account and you can get it from our website.
1.
Type: String.
2.
Example: "0xab750ece4cc84e4e47c9fe6f651905a7"
6.
vesselTimestamp: A timestamp indicating the time at which the request is made. It adds a time-based component to the authorization for increased security.
1.
Type: UNIX timestamp in milliseconds
2.
Example: 1703484873954
7.
vesselSignature: Generate by HMAC. The signature message vesselTimestamp + "websocket" + id. You can find comprehensive details on generating the signature in Sign Request by HMAC Guide.
1.
Type: String.
2.
Example: "IGYszasEmHbFIWX3XA1xZvnxtr4CPA0742GmnTBkRj8"

Send Message Example:#

{
  "type": "subscribe",
  "channel": "authorize",
  "id": "authorize",
  "vesselApiKey": "0x97cb025549d36946fe5a401454a437c0",
  "vesselPassphrase": "0xab750ece4cc84e4e47c9fe6f651905a7",
  "vesselTimestamp": 1703484873954,
  "vesselSignature": "IGYszasEmHbFIWX3XA1xZvnxtr4CPA0742GmnTBkRj8="
}

Receive Message#

1.
Error: Indicates whether an error occurred during the authorization process.
1.
Type: Bool
2.
Value: "false"
2.
Id: Identifies the authorization request.
1.
Type: String
2.
Value: "authorize"
3.
Msg: Indicates the outcome of the authorization attempt.
1.
Type: String
2.
Example: "success"

Receive Message Example:#

{
  error: false,
  id: "authorize",
  msg: "success"
}

Request

Header Params
VESSEL-API-KEY
string 
required
Default:
{{API_KEY}}
VESSEL-PASSPHRASE
string 
required
Default:
{{API_PASSPHRASE}}
VESSEL-SIGNATURE
string 
required
Use signRequest script to generate
VESSEL-TIMESTAMP
string 
required
Use signRequest script to set
Previous
User
Next
Balance
Built with