메뉴 건너뛰기

목록
2023.02.05 17:14

나도 핫산시켜봤음

profile
조회 수 76 댓글 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
 
# 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 마진거래 파이썬으로 짜달라한거임


List of Articles
번호 제목 글쓴이 날짜 조회 수 추천
공지 수용소닷컴 이용약관 file asuka 2020.05.16 4418 1
985 오라클 가입오류 유명하네 4 file 저능아 2023.02.07 181 0
984 오라클 클라우드 입밴당함 file 저능아 2023.02.06 67 0
983 정보처리기사 공부 on 2 그리드 2023.02.06 95 0
» 나도 핫산시켜봤음 저능아 2023.02.05 76 0
981 트위터 API 유료화한다! 3 그리드 2023.02.03 102 0
980 아마존이 800원 뺏어갔음 file 저능아 2023.02.03 60 0
979 ChatGPT 진짜 지리네... 말만 하면 코드를 다 짜줌 7 file midori 2023.01.30 128 0
978 윈도우에서 그냥 pip만 쓰다가 8 file 저능아 2023.01.30 87 0
977 네이버 AI TECH 1차문제 그리드 2023.01.26 66 0
976 이거 해석좀 해주셈 5 그리드 2023.01.20 94 0
975 재미없는 취업공고 그리드 2023.01.16 105 0
974 Microsoft Visual Studio 2022를 사용하여 첫 번째 C++ Windows Form 만들기 9 file 저능아 2023.01.15 537 1
973 C++로 GUI를 만들어야 된다는데 16 삼육두유 2023.01.15 97 0
972 인스턴스 삭제하고 새로만들엇음.. 6 file 저능아 2023.01.14 100 0
971 dma... 2 file 그리드 2023.01.14 117 0
970 어... ? 그리드 2023.01.13 79 0
969 삭제된 게시글입니다. 애옹쓰 2023.01.12 219 0
968 내일까지 컴퓨터공부 쉬겠음... 그리드 2023.01.12 102 0
967 2월까지 공부해야 할 것 1 그리드 2023.01.11 91 0
966 하입 씨팔 2 file 저능아 2023.01.11 103 0
목록
Board Pagination Prev 1 ... 6 7 8 9 10 11 12 13 14 15 ... 60 Next
/ 60

Sketchbook5, 스케치북5

Sketchbook5, 스케치북5