-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathrun.sh
executable file
·60 lines (55 loc) · 1.74 KB
/
run.sh
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/bash
function show_help() {
echo -e "\nYou can run a variety of Eulith examples from this script. Here are the options:\n"
echo " -e | ERC20 handling"
echo " -k | KMS"
echo " -s | Swap"
echo " -t <TO_ADDRESS> | Simple Transfer"
echo " -c | Transfer from toolkit contract"
echo " -u | Get Uniswap quotes (float price and sqrt limit) for a given volume without executing the trade"
echo " -a | Atomic transaction (all or nothing individual transactions sent as a bundle)"
echo " -m | Getting DEX market data: prices, spread, gas fees, etc"
echo " -p | Stream prices from Uniswap pool"
echo " -d | Defi Armor"
echo -e "\nIf you would like to examine the code for the examples, have a look at the files in the examples folder.\n"
}
function run_simple_transfer() {
python examples/simple_transfer.py "$1"
}
if [ $# -eq 0 ]; then
show_help
exit 1
fi
source venv/bin/activate
while getopts "h?ekst:cuampdw" opt; do
case "$opt" in
h|\?)
show_help
exit 0
;;
e) python examples/erc20_handling.py
;;
k) python examples/kms_signer.py
;;
s) python examples/swap_for_armor.py
;;
w) python examples/swap_for_wallet.py
;;
t) run_simple_transfer $OPTARG
;;
c) python examples/transfer_from_toolkit.py
;;
u) python examples/uniswap_sqrtlimit_quote.py
;;
a) python examples/atomic_transactions.py
;;
m) python examples/market_data.py
;;
p) python examples/uniswap_price_streaming.py
;;
d) python examples/defi_armor.py
;;
x) python examples/short.py
;;
esac
done