-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
FG5D627N
committed
Mar 22, 2023
1 parent
4cda710
commit b07bf7b
Showing
4 changed files
with
87 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,19 @@ | ||
# SendWalletDisplay | ||
This is simple python script who read json and send them to minotor | ||
|
||
## How to use | ||
|
||
### install python | ||
|
||
https://www.python.org/downloads/ | ||
|
||
### Get the code | ||
|
||
#### from git | ||
|
||
- install git (https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) | ||
- | ||
|
||
### install dep | ||
|
||
`pip install -r req.txt` |
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,22 @@ | ||
import requests | ||
import json | ||
|
||
|
||
|
||
def load_json_file(): | ||
with open("wallet.json") as f: | ||
return json.loads(f.read()) | ||
|
||
|
||
def send_http_post(json_obj): | ||
r = requests.post('https://mythologic.fr:8080', json=json_obj) | ||
print(r.status_code, r.text) | ||
|
||
|
||
def main(): | ||
json_obj = load_json_file() | ||
send_http_post(json_obj) | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |
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 @@ | ||
requests |
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,47 @@ | ||
{ | ||
"pseudo": "Daviv09", | ||
"wallet_overview": [ | ||
{ | ||
"token": "eth", | ||
"amount": 0.20 | ||
}, | ||
{ | ||
"token": "sol", | ||
"amount": 10 | ||
}, | ||
{ | ||
"token": "atom", | ||
"amount": 80 | ||
}, | ||
{ | ||
"token": "evmos", | ||
"amount": 550 | ||
}, | ||
{ | ||
"token": "osmo", | ||
"amount": 260 | ||
}, | ||
{ | ||
"token": "cake", | ||
"amount": 180 | ||
}, | ||
{ | ||
"token": "dolz", | ||
"amount": 70000, | ||
"price": 0.01269 | ||
}, | ||
{ | ||
"token": "juno", | ||
"amount": 55 | ||
}, | ||
{ | ||
"token": "stz", | ||
"amount": 2800, | ||
"price": 0.00094023 | ||
}, | ||
{ | ||
"token": "axl", | ||
"amount": 205 | ||
} | ||
] | ||
} |