123456789101112131415161718192021222324252627282930313233 |
- package service
- import (
- v1 "birdcall/api/chain/v1"
- "context"
- )
- type (
- IChain interface {
- NetWork(ctx context.Context, req *v1.NetWorkReq) (*v1.CommonRes, error)
- TokenPrice(ctx context.Context, req *v1.TokenPriceReq) (*v1.CommonRes, error)
- }
- )
- var (
- localChain IChain
- )
- func Chain() IChain {
- if localChain == nil {
- panic("implement not found for interface IChain, forgot register?")
- }
- return localChain
- }
- func RegisterChain(i IChain) {
- localChain = i
- }
|