-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.sh
executable file
·202 lines (181 loc) · 6.82 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
#!/bin/bash
# This script was coded by @bxdoan
# Please give me credits if you us any codes from here.
# GitHub: https://github.com/bxdoan
# Email: [email protected]
EC='\033[0m' # end coloring
HL='\033[0;33m' # high-lighted color
ER='\033[0;31m' # red color
CM='\033[0;32m' # comment color
GR='\033[0;32m' # green color
WH='\033[0;37m' # white color
clear
banner() {
printf "${GR}
░##### ░# # ░# # ░## ░# ░# ░###### ░#######
░# # ░# # ░# # ░# # ░# ░# ░# ░#
░# # ░# ░# # ░# # ░# ░# ░# ░#
░##### ░# ░# ## # ░###### ░# ░# ░###### ░#
░# ░# ░## ## ░# # ░# ░# ░# ░#
░# ░# ░## ## ░# # ░# ░# ░# ░#
░# ░# ░# # ░# # ░###### ░###### ░###### ░#
Coded by \e[1;94m@bxdoan\e[1;92m
Email: [email protected]
${EC}
"
}
script() {
printf "${GR}
[1] address Get your wallet address
[2] balance Get balance
[3] config Config for wallet
[4] network Config network for wallet
[5] create Create new keypair
[6] search Search token information by search key
[7] transfer Transfer for wallet
[8] token Config token address for wallet
[0] exit Exit
${EC}
"
read -p $'\n\e[1;92m[\e[0m\e[1;77m*\e[0m\e[1;92m]\e[1;93m Choose an option: \e[1;93m' option
if [[ $option == 1 || $option == 01 ]]; then
printf "\n\e[1;92m This process will take a few moments ...\n\n\e[1;92m"
./pywallet.py address
script
elif [[ $option == 2 || $option == 02 ]]; then
printf "\n\e[1;92m Please wait ...\n\n\e[1;92m"
./pywallet.py balance
script
elif [[ $option == 3 || $option == 03 ]]; then
printf "${GR}\nWhat do you want get config or set config ?\n
[1] get Get config
[2] set Set config
[0] exit Exit
${EC}
"
read -p $'\n\e[1;92m[\e[0m\e[1;77m*\e[0m\e[1;92m]\e[1;93m Choose an option: \e[1;92m' optionconfig
if [[ $optionconfig == 1 || $optionconfig == 01 ]]; then
printf "\n\e[1;92m Please wait ...\n\n\e[1;92m"
./pywallet.py config get
script
elif [[ $optionconfig == 2 || $optionconfig == 02 ]]; then
printf "\nEnter url (None for using default)...\n"
read -p $'\n\n\e[1;92m[\e[0m\e[1;77m*\e[0m\e[1;92m]\e[1;93m Enter url: \e[1;92m' url
printf "\nEnter keypair path (None for using default) ...\n"
read -p $'\n\n\e[1;92m[\e[0m\e[1;77m*\e[0m\e[1;92m]\e[1;93m Enter keypair path: \e[1;92m' keypair
printf "\n\e[1;92m Please wait ...\n\n\e[1;92m"
if [[ $url == "" ]]; then
python3 ./pywallet.py config set --keypair $keypair
elif [[ $keypair == "" ]]; then
python3 ./pywallet.py config set --url $url
else
python3 ./pywallet.py config set --url $url --keypair $keypair
fi
python3 ./pywallet.py config set
script
else
script
fi
script
elif [[ $option == 4 || $option == 04 ]]; then
printf "${GR}\nWhat do you want get network or set network ?\n
[1] get Get network config
[2] set Set network config
[0] exit Exit
${EC}
"
read -p $'\n\e[1;92m[\e[0m\e[1;77m*\e[0m\e[1;92m]\e[1;93m Choose an option: \e[1;92m' optionconfig
if [[ $optionconfig == 1 || $optionconfig == 01 ]]; then
printf "\n\e[1;92m Please wait ...\n\n\e[1;92m"
./pywallet.py network get
script
elif [[ $optionconfig == 2 || $optionconfig == 02 ]]; then
printf "\nEnter network (None for using eth)...\n"
read -p $'\n\n\e[1;92m[\e[0m\e[1;77m*\e[0m\e[1;92m]\e[1;93m Enter network: \e[1;92m' network
python3 ./pywallet.py network set $network
script
else
script
fi
elif [[ $option == 5 || $option == 05 ]]; then
printf "\n\e[1;92m Please wait ...\n\n\e[1;92m"
python3 ./pywallet.py create
script
elif [[ $option == 6 || $option == 06 ]]; then
printf "\n\nEnter search key ...\n"
read -p $'\n\n\e[1;92m[\e[0m\e[1;77m*\e[0m\e[1;92m]\e[1;93m Enter search key: \e[1;92m' key_search
printf "\n\nEnter network (None is eth) ...\n"
read -p $'\n\n\e[1;92m[\e[0m\e[1;77m*\e[0m\e[1;92m]\e[1;93m Enter network: \e[1;92m' network
if [[ $network == "" ]]; then
network="eth"
fi
python3 ./pywallet.py search "$key_search" -n $network
script
elif [[ $option == 7|| $option == 07 ]]; then
printf "\nEnter receiver address ...\n"
read -p $'\n\e[1;92m[\e[0m\e[1;77m*\e[0m\e[1;92m]\e[1;93m Enter address: \e[1;92m' reicever
printf "\nEnter amount ...\n"
read -p $'\n\e[1;92m[\e[0m\e[1;77m*\e[0m\e[1;92m]\e[1;93m Enter amount: \e[1;92m' amount
printf "\nEnter token address (None is Native token) ...\n"
read -p $'\n\e[1;92m[\e[0m\e[1;77m*\e[0m\e[1;92m]\e[1;93m Enter token address: \e[1;92m' token_address
if [[ $token_address == "" ]]; then
token_address="Native token"
fi
python3 ./pywallet.py transfer "$reicever" "$amount" -t "$token_address"
script
elif [[ $option == 8 || $option == 08 ]]; then
printf "${GR}\nWhat do you want get token address or set token address ?\n
[1] get Get token address config
[2] set Set token address config
[3] del Delete token address config
[0] exit Exit
${EC}
"
read -p $'\n\e[1;92m[\e[0m\e[1;77m*\e[0m\e[1;92m]\e[1;93m Choose an option: \e[1;92m' optionconfig
if [[ $optionconfig == 1 || $optionconfig == 01 ]]; then
printf "\n\e[1;92m Please wait ...\n\n\e[1;92m"
printf "\nEnter network (None for using your default config)...\n"
read -p $'\n\n\e[1;92m[\e[0m\e[1;77m*\e[0m\e[1;92m]\e[1;93m Enter network: \e[1;92m' network
if [[ $network == "" ]]; then
./pywallet.py token get
else
./pywallet.py token get -n $network
fi
script
elif [[ $optionconfig == 2 || $optionconfig == 02 ]]; then
printf "\nEnter address...\n"
read -p $'\n\n\e[1;92m[\e[0m\e[1;77m*\e[0m\e[1;92m]\e[1;93m Enter address: \e[1;92m' address
printf "\nEnter network (None for using your default config)...\n"
read -p $'\n\n\e[1;92m[\e[0m\e[1;77m*\e[0m\e[1;92m]\e[1;93m Enter network: \e[1;92m' network
if [[ $network == "" ]]; then
./pywallet.py token set $address
else
./pywallet.py token set $address --network $network
fi
script
elif [[ $optionconfig == 3 || $optionconfig == 03 ]]; then
printf "\nEnter address ...\n"
read -p $'\n\n\e[1;92m[\e[0m\e[1;77m*\e[0m\e[1;92m]\e[1;93m Enter address: \e[1;92m' address
printf "\nEnter network (None for using your default config)...\n"
read -p $'\n\n\e[1;92m[\e[0m\e[1;77m*\e[0m\e[1;92m]\e[1;93m Enter network: \e[1;92m' network
if [[ $network == "" ]]; then
./pywallet.py token del $address
else
./pywallet.py token del $address --network $network
fi
script
else
script
fi
elif [[ $option == 0 || $option == 00 ]]; then
exit 0
else
printf "Command not found!
NOTE: If you get any problem while using this tool than please report to
email: [email protected]
github: https://github.com/bxdoan
"
fi
}
banner
script