-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathconfig.go
181 lines (160 loc) · 4.69 KB
/
config.go
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
package main
import (
"bufio"
"os"
"strings"
ui "github.com/gizak/termui"
)
func loadDepositAddresses() map[string]string {
m := make(map[string]string)
f, err := os.Open("addresses.cfg")
if err != nil {
Log.Println(err)
return m
}
sc := bufio.NewScanner(f)
if err != nil {
Log.Println(err)
return m
}
for sc.Scan() {
arr := strings.Split(sc.Text(), " ")
if len(arr) == 2 {
m[arr[0]] = arr[1]
Log.Println("Loaded destination address:", arr[0], arr[1])
}
}
return m
}
// HeaderConfig is the configuration for the header which includes the logo and fox image
type HeaderConfig struct {
FoxX, FoxY int
FoxHeight, FoxWidth int
FoxTextFgColor ui.Attribute
LogoX, LogoY int
LogoHeight, LogoWidth int
LogoTextFgColor ui.Attribute
}
var DefaultHeaderConfig = &HeaderConfig{
FoxX: 75,
FoxY: 0,
FoxHeight: 8,
FoxWidth: 29,
FoxTextFgColor: ui.ColorCyan,
LogoX: 10,
LogoY: 1,
LogoWidth: 70,
LogoHeight: 7,
LogoTextFgColor: ui.ColorCyan,
}
type ExchangeConfig struct {
DepHeight, RecHeight, RetHeight int
DepWidth, RecWidth, RetWidth int
DepX, RecX, RetX int
DepY, RecY, RetY int
DepColor, RecColor, RetColor ui.Attribute
}
var DefaultExchangeConfig = &ExchangeConfig{
DepHeight: 3,
DepWidth: 46,
DepX: 67,
DepY: 15,
DepColor: ui.ColorRed,
RecHeight: 3,
RecWidth: 46,
RecX: 67,
RecY: 19,
RecColor: ui.ColorGreen,
RetHeight: 3,
RetWidth: 46,
RetX: 67,
RetY: 23,
RetColor: ui.ColorYellow,
}
type statsConfig struct {
x, y int
minWidth, maxWidth, rateWidth, feeWidth int
}
var defaultStatsConfig = statsConfig{
x: 1,
y: 8,
minWidth: 25,
maxWidth: 25,
rateWidth: 25,
feeWidth: 25,
}
type LoadingConfig struct {
X, Y int
Width, Height int
TextFgColor ui.Attribute
}
var DefaultLoadingConfig = &LoadingConfig{
X: 30,
Y: 10,
Width: 10,
Height: 3,
}
type setupConfig struct {
entryX int
entryWidth int
entryHeight int
amtY, addrY, retY int
helpX, helpY int
helpHeight, helpWidth int
}
var setupQuickConfig = &setupConfig{
entryX: 20,
entryWidth: 60,
entryHeight: 3,
addrY: 13,
retY: 20,
helpX: 15,
helpY: 26,
helpHeight: 4,
helpWidth: 71,
}
var setupPreciseConfig = &setupConfig{
entryX: 20,
entryWidth: 60,
entryHeight: 3,
amtY: 12,
addrY: 17,
retY: 22,
helpX: 15,
helpY: 26,
helpHeight: 4,
helpWidth: 71,
}
const FOX = ` ,^
; ;
\'.,'/ ; ;
/_ _\'-----';
\/' ,,,,,, ;
)// \))`
const SHAPESHIFT = "" +
" ____ _ ____ _ _ __ _ \n" +
" / ___|| |__ __ _ _ __ ___/ ___|| |__ (_)/ _| |_ \n" +
" \\___ \\| '_ \\ / _` | '_ \\ / _ \\___ \\| '_ \\| | |_| __|\n" +
" ___) | | | | (_| | |_) | __/___) | | | | | _| |_ \n" +
" |____/|_| |_|\\__,_| .__/ \\___|____/|_| |_|_|_| \\__|\n" +
" |_| "
/*
const SHAPESHIFT = `
_____ __ _____ __ _ ______
/ ___// /_ ____ _____ ___ / ___// /_ (_) __/ /_
\__ \/ __ \/ __ '/ __ \/ _ \\__ \/ __ \/ / /_/ __/
___/ / / / / /_/ / /_/ / __/__/ / / / / / __/ /_
/____/_/ /_/\__,_/ .___/\___/____/_/ /_/_/_/ \__/
/_/
`
*/
/*
const SHAPESHIFT = `
███████╗██╗ ██╗ █████╗ ██████╗ ███████╗███████╗██╗ ██╗██╗███████╗████████╗
██╔════╝██║ ██║██╔══██╗██╔══██╗██╔════╝██╔════╝██║ ██║██║██╔════╝╚══██╔══╝
███████╗███████║███████║██████╔╝█████╗ ███████╗███████║██║█████╗ ██║
╚════██║██╔══██║██╔══██║██╔═══╝ ██╔══╝ ╚════██║██╔══██║██║██╔══╝ ██║
███████║██║ ██║██║ ██║██║ ███████╗███████║██║ ██║██║██║ ██║
╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚══════╝╚══════╝╚═╝ ╚═╝╚═╝╚═╝ ╚═╝
`
*/