package initialize

import (
	"ffie-admin/server/global"

	"github.com/blockcypher/gobcy/v2"
	"go.uber.org/zap"
)

func BlockCypherInit() {
	blockcypherConfig := global.GVA_CONFIG.BlockCypher
	if blockcypherConfig.Token == "" {
		global.GVA_LOG.Warn("未配置 BlockCypher token")
		return
	}
	bc := gobcy.API{Token: blockcypherConfig.Token, Coin: "btc", Chain: "main"}
	global.GVA_GOBCY = bc
	chainInfo, _ := bc.GetChain()
	global.GVA_LOG.Info("btc", zap.Any("bc", chainInfo))
}
