-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from guilyx/tests
Validate POST endpoints
- Loading branch information
Showing
6 changed files
with
181 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,8 @@ | |
import os | ||
from dotenv import load_dotenv | ||
|
||
import time | ||
|
||
load_dotenv() | ||
|
||
key = os.getenv("NEXO_PUBLIC_KEY") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import sys | ||
from os import path | ||
|
||
sys.path.append(path.dirname(path.dirname(path.abspath(__file__)))) | ||
|
||
import nexo | ||
import os | ||
from dotenv import load_dotenv | ||
|
||
|
||
load_dotenv() | ||
|
||
key = os.getenv("NEXO_PUBLIC_KEY") | ||
secret = os.getenv("NEXO_SECRET_KEY") | ||
|
||
client = nexo.Client(key, secret) | ||
|
||
# Buys 0.03 ETH with USDT at market price | ||
order_resp = client.place_order("ETH/USDT", "buy", "market", "0.03", serialize_json_to_object=True) | ||
print(order_resp) | ||
|
||
# Gets order details | ||
order = client.get_order_details(str(order_resp.order_id)) | ||
print(order) | ||
|
||
# Sells 0.03 ETH for USDT at limit price 2000 USDT | ||
order_resp = client.place_order("ETH/USDT", "sell", "limit", "0.03", "1500", serialize_json_to_object=True) | ||
print(order_resp) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters