建立槓桿或保證金操作 REST APIEndpoint
資訊
Exchange API 呼叫不會消耗Quicknode 點數。透過此endpoint 進行的交易endpoint 附加建置商手續費。完整明細請參閱hyperliquidapi.com。若要使用您自己的建置商代碼進行白標服務,請與我們聯繫。
身體參數
動作
物件
必填
載入中...
類型
字串
載入中...
資產
字串或整數
載入中...
isCross
布林值
載入中...
槓桿
數字或字串
載入中...
isBuy
布林值
載入中...
ntli
數字
載入中...
退貨
雜湊
字串
載入中...
非重複數
整數
載入中...
動作
物件
載入中...
actionType
字串
載入中...
nextStep
字串
載入中...
請求
1curl -s -X POSTmainnet\2-H "Content-Type: application/json" \3-d '{4"action": {5"type": "updateLeverage",6"資產": "BTC",7"isCross": true,8「槓桿」:109}10}'11
1curl -s -X POSTmainnet\2-H "Content-Type: application/json" \3-d '{4"action": {5"type": "updateLeverage",6"資產": "BTC",7"isCross": true,8「槓桿」:109}10}'11
1const axios = require('axios');23const 資料 = {4action: {5類型: "updateLeverage",6資產: 「BTC」,7isCross: true,8槓桿: 109}10};1112axios.post('https://docs-demo.hype-mainnet.quiknode.pro/hypercore/exchange', data, {13headers: { 'Content-Type': 'application/json' }14})15.接著(回應 => 控制台.log(response.data))16.catchcatch(錯誤 => console.錯誤(錯誤));17
1const axios = require('axios');23const 資料 = {4action: {5類型: "updateLeverage",6資產: 「BTC」,7isCross: true,8槓桿: 109}10};1112axios.post('https://docs-demo.hype-mainnet.quiknode.pro/hypercore/exchange', data, {13headers: { 'Content-Type': 'application/json' }14})15.接著(回應 => 控制台.log(response.data))16.catchcatch(錯誤 => console.錯誤(錯誤));17
1匯入 請求2匯入 json34網址 = "mainnet"56有效載荷 = json.dumps({7"action": {8"類型": "updateLeverage",9「資產」: 「BTC」,10"isCross": True,11「槓桿」: 1012}13})1415標題 = {16「Content-Type」: 'application/json'17}1819回應 = 請求.請求("POST", url, headers=headers, data=有效載荷)2021列印(回應.text)22
1匯入 請求2匯入 json34網址 = "mainnet"56有效載荷 = json.dumps({7"action": {8"類型": "updateLeverage",9「資產」: 「BTC」,10"isCross": True,11「槓桿」: 1012}13})1415標題 = {16「Content-Type」: 'application/json'17}1819回應 = 請求.請求("POST", url, headers=headers, data=有效載荷)2021列印(回應.text)22
1需要 "uri"2require "json"3需要 "net/http"45網址 = URI("mainnet")67https = 網::HTTP.new(url.主機, 網址.port)8https.use_ssl = true910請求 = 淨額::HTTP::POST.新增(網址)11請求["Content-Type"] = "application/json"12請求。主體 = JSON.dump({13"action": {14"類型": "updateLeverage",15「資產」: 「BTC」,16"isCross": true,17「槓桿」: 1018}19})2021回應 = https.請求(請求)22puts 回應。read_body23
1需要 "uri"2require "json"3需要 "net/http"45網址 = URI("mainnet")67https = 網::HTTP.new(url.主機, 網址.port)8https.use_ssl = true910請求 = 淨額::HTTP::POST.新增(網址)11請求["Content-Type"] = "application/json"12請求。主體 = JSON.dump({13"action": {14"類型": "updateLeverage",15「資產」: 「BTC」,16"isCross": true,17「槓桿」: 1018}19})2021回應 = https.請求(請求)22puts 回應。read_body23