Documentation ¶
Index ¶
- Constants
- Variables
- func GetCreatorKey(addr sdk.AccAddress) []byte
- func GetTrackByCreatorAddr(addr sdk.AccAddress, trackID string) []byte
- func GetTrackIDBytes(trackID string) []byte
- func GetTrackKey(trackID string) []byte
- func RegisterCodec(cdc *codec.Codec)
- func ShareKey(trackID string, entityAddr sdk.AccAddress) []byte
- func SharesKey(trackID string) []byte
- func ValidateGenesis(data GenesisState) error
- type Entity
- type GenesisState
- type MsgTrackAddShare
- type MsgTrackCreate
- type MsgTrackRemoveShare
- func (msg MsgTrackRemoveShare) GetSignBytes() []byte
- func (msg MsgTrackRemoveShare) GetSigners() []sdk.AccAddress
- func (msg MsgTrackRemoveShare) Route() string
- func (msg MsgTrackRemoveShare) String() string
- func (msg MsgTrackRemoveShare) Type() string
- func (msg MsgTrackRemoveShare) ValidateBasic() error
- type QueryCreatorTracksParams
- type QueryTrackParams
- type QueryTracksParams
- type Share
- type Track
Constants ¶
const ( // Track events EventTypeTrackCreate = "track_create" // Track attributes AttributeKeyTrackID = "track_id" AttributeKeyEntity = "entity" // Track Token attributes AttributeKeyTokenAmount = "token_amount" AttributeKeyTokenRecipient = "token_recipient" )
const ( // ModuleName is the name of the module ModuleName = "track" // StoreKey to be used when creating the KVStore StoreKey = ModuleName // RouterKey to be used for routing msgs RouterKey = ModuleName // QuerierRoute to be used for querierer msgs QuerierRoute = ModuleName // TODO: move to params MaxTrackInfoLength = 30 * 1024 )
const ( TypeMsgTrackCreate = "track_create" )
Content messages types and routes
const ( QueryParams = "params" QueryTracks = "tracks" QueryID = "id" QueryCreatorTracks = "creator_tracks" )
Variables ¶
var ( DefaultCodespace = ModuleName ErrUnknownTrack = sdkerrors.Register(ModuleName, 1, "unknown track") ErrInvalidAmount = sdkerrors.Register(ModuleName, 3, "invalid amount") ErrDuplicatedTrack = sdkerrors.Register(ModuleName, 4, "trackID is duplicated") )
var ( TrackKeyPrefix = []byte{0x00} TracksCreatorKeyPrefix = []byte{0x10} )
Keys for track store Items are stored with the following key: values
- 0x00<trackID_Bytes>: Track - 0x10<creatorAddr_Bytes><trackID_Bytes>: Track - 0x20<trackID_Bytes><entityAddr_Bytes>: Share
var ModuleCdc *codec.Codec
ModuleCdc defines the module codec
Functions ¶
func GetCreatorKey ¶ added in v0.4.0
func GetCreatorKey(addr sdk.AccAddress) []byte
func GetTrackByCreatorAddr ¶ added in v0.4.0
func GetTrackByCreatorAddr(addr sdk.AccAddress, trackID string) []byte
func GetTrackIDBytes ¶ added in v0.4.0
func GetTrackKey ¶ added in v0.4.0
func RegisterCodec ¶
RegisterCodec registers concrete types on codec
func ValidateGenesis ¶ added in v0.4.0
func ValidateGenesis(data GenesisState) error
ValidateGenesis validates the tracks genesis parameters
Types ¶
type Entity ¶ added in v0.4.0
type Entity struct { Address sdk.AccAddress `json:"address" yaml:"address"` }
type GenesisState ¶ added in v0.4.0
type GenesisState struct {
Tracks []Track `json:"tracks"`
}
GenesisState - all tracks state that must be provided at genesis
func DefaultGenesisState ¶ added in v0.4.0
func DefaultGenesisState() GenesisState
DefaultGenesisState - default GenesisState
func NewGenesisState ¶ added in v0.4.0
func NewGenesisState(tracks []Track) GenesisState
NewGenesisState creates a new GenesisState object
type MsgTrackAddShare ¶ added in v0.5.0
type MsgTrackAddShare struct {}
func NewMsgTrackAddShare ¶ added in v0.5.0
func NewMsgTrackAddShare(trackID string, share sdk.Coin, entity sdk.AccAddress) MsgTrackAddShare
func (MsgTrackAddShare) GetSignBytes ¶ added in v0.5.0
func (msg MsgTrackAddShare) GetSignBytes() []byte
GetSignBytes encodes the message for signing
func (MsgTrackAddShare) GetSigners ¶ added in v0.5.0
func (msg MsgTrackAddShare) GetSigners() []sdk.AccAddress
GetSigners defines whose signature is required
func (MsgTrackAddShare) Route ¶ added in v0.5.0
func (msg MsgTrackAddShare) Route() string
func (MsgTrackAddShare) String ¶ added in v0.5.0
func (msg MsgTrackAddShare) String() string
func (MsgTrackAddShare) Type ¶ added in v0.5.0
func (msg MsgTrackAddShare) Type() string
func (MsgTrackAddShare) ValidateBasic ¶ added in v0.5.0
func (msg MsgTrackAddShare) ValidateBasic() error
type MsgTrackCreate ¶ added in v0.4.0
type MsgTrackCreate struct { TrackID string `json:"track_id" yaml:"track_id"` TrackInfo []byte `json:"track_info" yaml:"track_info"` Entities []Entity `json:"entities" yaml:"entities"` Creator sdk.AccAddress `json:"creator" yaml:"creator"` }
func NewMsgTrackCreate ¶ added in v0.4.0
func NewMsgTrackCreate(trackID string, info []byte, creator sdk.AccAddress, entities []Entity) MsgTrackCreate
func (MsgTrackCreate) GetSignBytes ¶ added in v0.4.0
func (msg MsgTrackCreate) GetSignBytes() []byte
GetSignBytes encodes the message for signing
func (MsgTrackCreate) GetSigners ¶ added in v0.4.0
func (msg MsgTrackCreate) GetSigners() []sdk.AccAddress
GetSigners defines whose signature is required
func (MsgTrackCreate) Route ¶ added in v0.4.0
func (msg MsgTrackCreate) Route() string
func (MsgTrackCreate) String ¶ added in v0.4.0
func (msg MsgTrackCreate) String() string
func (MsgTrackCreate) Type ¶ added in v0.4.0
func (msg MsgTrackCreate) Type() string
func (MsgTrackCreate) ValidateBasic ¶ added in v0.4.0
func (msg MsgTrackCreate) ValidateBasic() error
type MsgTrackRemoveShare ¶ added in v0.5.0
type MsgTrackRemoveShare struct {}
func NewMsgTrackRemoveShare ¶ added in v0.5.0
func NewMsgTrackRemoveShare(trackID string, share sdk.Coin, entity sdk.AccAddress) MsgTrackRemoveShare
func (MsgTrackRemoveShare) GetSignBytes ¶ added in v0.5.0
func (msg MsgTrackRemoveShare) GetSignBytes() []byte
GetSignBytes encodes the message for signing
func (MsgTrackRemoveShare) GetSigners ¶ added in v0.5.0
func (msg MsgTrackRemoveShare) GetSigners() []sdk.AccAddress
GetSigners defines whose signature is required
func (MsgTrackRemoveShare) Route ¶ added in v0.5.0
func (msg MsgTrackRemoveShare) Route() string
func (MsgTrackRemoveShare) String ¶ added in v0.5.0
func (msg MsgTrackRemoveShare) String() string
func (MsgTrackRemoveShare) Type ¶ added in v0.5.0
func (msg MsgTrackRemoveShare) Type() string
func (MsgTrackRemoveShare) ValidateBasic ¶ added in v0.5.0
func (msg MsgTrackRemoveShare) ValidateBasic() error
type QueryCreatorTracksParams ¶ added in v0.4.0
type QueryCreatorTracksParams struct {
Creator sdk.AccAddress `json:"creator" yaml:"creator"`
}
type QueryTrackParams ¶
type QueryTrackParams struct {
ID uint64 `json:"id" yaml:"id"`
}
Params for queries
func NewQueryContentParams ¶ added in v0.4.0
func NewQueryContentParams(id uint64) QueryTrackParams
creates a new instance of QueryContentParams
type QueryTracksParams ¶
func DefaultQueryTracksParams ¶ added in v0.4.0
func DefaultQueryTracksParams(page, limit int) QueryTracksParams
type Track ¶
type Track struct { TrackID string `json:"track_id" yaml:"track_id"` // the bitsong unique track id **** Hash string `json:"hash" yaml:"hash"` // the track hash Uri string `json:"uri" yaml:"uri"` // bitsong uri for track e.g: bitsong:track:<track_id> **** TrackInfo []byte `json:"track_info" yaml:"track_info"` // Raw Track Info (see specs) Creator sdk.AccAddress `json:"creator" yaml:"creator"` // creator of the track StartTime time.Time `json:"start_time" yaml:"start_time"` EndTime time.Time `json:"end_time" yaml:"end_time"` }