메뉴 건너뛰기

목록
2023.02.05 17:14

나도 핫산시켜봤음

profile
조회 수 16 댓글 0 예스잼 0 노잼 0

No Attached Image

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import requests
import json
 
# Replace YOUR_API_KEY and YOUR_SECRET_KEY with your own API keys from Gate.io
api_key = "YOUR_API_KEY"
secret_key = "YOUR_SECRET_KEY"
 
# The endpoint for the trade API
url = "https://api.gateio.io/api2/1/private/marginTrade"
 
# The parameters for the trade API
params = {
    "currencyPair""btc_usdt"# the currency pair you want to trade
    "rate"9000# the rate at which you want to buy/sell
    "amount"0.01# the amount of the currency you want to buy/sell
    "tradeType""buy"# the type of trade, buy or sell
    "leverage"10 # the leverage you want to use
}
 
# Add the API key to the parameters
params["nonce"= 123456 # the nonce, a unique number for each API request
params["apikey"= api_key
 
# Sign the API request with the secret key
signature = hmac.new(secret_key.encode(), json.dumps(params).encode(), hashlib.sha512).hexdigest()
 
# Add the signature to the API request
headers = {
    "Sign": signature,
    "Key": api_key
}
 
# Make the API request
response = requests.post(url, data=params, headers=headers)
 
# Check the API response
if response.status_code == 200:
    # Parse the response JSON
    result = response.json()
    print(result)
else:
    # Print the error message
    print("Error:", response.text)
 
cs

 

 

API 문서보고 짜야될거 말한마디면 바로쓸수있게끔 짜주니까 신기하긴하네

gateio 마진거래 파이썬으로 짜달라한거임


공지 수용소닷컴 이용약관 asuka 2020.05.16
  1. 오라클 컴퓨트 인스턴스생성할때

  2. 개발자구인 도랏노

  3. 삭제된 게시글입니다.

  4. 삭제된 게시글입니다.

  5. 오라클 문의메일 회신왔네

  6. 오라클 가입오류 유명하네

  7. 오라클 클라우드 입밴당함

  8. 정보처리기사 공부 on

  9. 나도 핫산시켜봤음

  10. 트위터 API 유료화한다!

  11. 아마존이 800원 뺏어갔음

  12. ChatGPT 진짜 지리네... 말만 하...

  13. 윈도우에서 그냥 pip만 쓰다가

  14. 네이버 AI TECH 1차문제

  15. 이거 해석좀 해주셈

  16. 재미없는 취업공고

  17. Microsoft Visual Studio 2022를 ...

  18. C++로 GUI를 만들어야 된다는데

  19. 인스턴스 삭제하고 새로만들엇음..

  20. dma...

목록
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 11 ... 56 Next
/ 56