28 lines
577 B
Go
28 lines
577 B
Go
package main
|
|
|
|
import (
|
|
"context"
|
|
"crypto_alert_bot/internal/config"
|
|
"crypto_alert_bot/internal/entities"
|
|
"crypto_alert_bot/internal/logger"
|
|
"crypto_alert_bot/internal/provider/bybit"
|
|
"fmt"
|
|
)
|
|
|
|
func main() {
|
|
// read config
|
|
cfg := config.MustLoad()
|
|
// init logger
|
|
log := logger.NewAppLogger(&cfg.Logger)
|
|
log.Info("app started")
|
|
// init telegram bot
|
|
b := bybit.New(log, &cfg.Providers.Bybit)
|
|
price, err := b.Price(context.Background(), entities.Pair{
|
|
BaseCurrency: "BTC",
|
|
QuoteCurrency: "USDT",
|
|
})
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
fmt.Printf("%+v\n", price)
|
|
}
|