package model

import (
	"github.com/tech/sendico/pkg/db/storable"
	"github.com/tech/sendico/pkg/mservice"
)

type ChainAssetKey struct {
	Chain       ChainNetwork `bson:"chain" json:"chain" yaml:"chain" mapstructure:"chain"`
	TokenSymbol string       `bson:"tokenSymbol" json:"tokenSymbol" yaml:"tokenSymbol" mapstructure:"tokenSymbol"`
}

type ChainAsset struct {
	ChainAssetKey   `bson:",inline" json:",inline"`
	ContractAddress *string `bson:"contractAddress,omitempty" json:"contractAddress,omitempty"`
}

type ChainAssetDescription struct {
	storable.Base `bson:",inline" json:",inline"`
	Describable   `bson:",inline" json:",inline"`
	Asset         ChainAsset `bson:"asset" json:"asset"`
}

func (*ChainAssetDescription) Collection() string {
	return mservice.ChainAssets
}
