-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.go
56 lines (46 loc) · 995 Bytes
/
app.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
package main
import (
"github.com/1makarov/binance-nft-buy/internal/app"
acc "github.com/1makarov/binance-nft-buy/internal/domain/account"
"github.com/1makarov/binance-nft-buy/internal/pkg/account"
"github.com/1makarov/binance-nft-buy/internal/pkg/mysterybox"
"github.com/joho/godotenv"
"log"
"os"
)
func main() {
if err := initEnv(); err != nil {
log.Println(err)
return
}
a, err := account.InitAccount(acc.Setting{
Proxy: os.Getenv("PROXY"),
BAuth: &acc.BAuth{Cookie: os.Getenv("COOKIE"), Csrf: os.Getenv("CSRFTOKEN")},
})
if err != nil {
log.Println(err)
return
}
if err = a.HandleAccount(); err != nil {
log.Println(err)
return
}
boxList, err := mysterybox.GetActiveMysteryBoxList()
if err != nil {
log.Println(err)
return
}
box, err := boxList.SelectBox()
if err != nil {
log.Println(err)
return
}
if err = box.InitBox(); err != nil {
log.Println(err)
return
}
app.App(a, box)
}
func initEnv() error {
return godotenv.Load()
}