hh

package
v0.0.0-...-03d3e23 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 12, 2019 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConnectionID         = "market_connection"
	CounterpartyID       = "hub"
	CounterpartyClientID = "me"
)
View Source
const (
	QueryNFToken  = "NFToken"
	QueryNFTokens = "NFTokens"
)

Query endpoints supported by the hh Querier.

View Source
const ModuleName = "hh"
View Source
const RouterKey = ModuleName
View Source
const StoreKey = "hh"

StoreKey to be used when creating the KVStore

Variables

View Source
var ModuleCdc = codec.New()

Functions

func GetCmdListTokens

func GetCmdListTokens(queryRoute string, cdc *codec.Codec) *cobra.Command

func GetCmdTokenInfo

func GetCmdTokenInfo(queryRoute string, cdc *codec.Codec) *cobra.Command

func GetCmdTransferInfo

func GetCmdTransferInfo(queryRoute string, cdc *codec.Codec) *cobra.Command

func GetCmdTransferToken

func GetCmdTransferToken(cdc *codec.Codec) *cobra.Command

func InitGenesis

func InitGenesis(ctx sdk.Context, keeper Keeper, state GenesisState) []abci.ValidatorUpdate

func NewHandler

func NewHandler(keeper Keeper) sdk.Handler

NewHandler returns a handler for "hh" type messages.

func NewQuerier

func NewQuerier(keeper Keeper) sdk.Querier

NewQuerier is the module level router for state queries

func RegisterCodec

func RegisterCodec(cdc *codec.Codec)

RegisterCodec registers concrete types on the Amino codec

func RegisterRoutes

func RegisterRoutes(cliCtx context.CLIContext, r *mux.Router, cdc *codec.Codec, storeName string)

RegisterRoutes - Central function to define routes that get registered by the main application

func ValidateGenesis

func ValidateGenesis(data GenesisState) error

Types

type AppModule

type AppModule struct {
	AppModuleBasic
	// contains filtered or unexported fields
}

func NewAppModule

func NewAppModule(k Keeper, bankKeeper bank.Keeper, icbKeeper ibc.Keeper) AppModule

NewAppModule creates a new AppModule Object

func (AppModule) BeginBlock

func (am AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) types.Tags

func (AppModule) EndBlock

func (AppModule) ExportGenesis

func (am AppModule) ExportGenesis(ctx sdk.Context) json.RawMessage

func (AppModule) GetQueryCmd

func (am AppModule) GetQueryCmd(cdc *codec.Codec) *cobra.Command

func (AppModule) GetTxCmd

func (am AppModule) GetTxCmd(cdc *codec.Codec) *cobra.Command

func (AppModule) InitGenesis

func (am AppModule) InitGenesis(ctx types.Context, data json.RawMessage) []abci.ValidatorUpdate

func (AppModule) Name

func (AppModule) Name() string

func (AppModule) NewHandler

func (am AppModule) NewHandler() types.Handler

func (AppModule) NewQuerierHandler

func (am AppModule) NewQuerierHandler() types.Querier

func (AppModule) QuerierRoute

func (am AppModule) QuerierRoute() string

func (AppModule) RegisterInvariants

func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry)

func (AppModule) RegisterRESTRoutes

func (am AppModule) RegisterRESTRoutes(cliCtx context.CLIContext, r *mux.Router)

func (AppModule) Route

func (am AppModule) Route() string

type AppModuleBasic

type AppModuleBasic struct{}

app module Basics object

func (AppModuleBasic) DefaultGenesis

func (AppModuleBasic) DefaultGenesis() json.RawMessage

func (AppModuleBasic) GetQueryCmd

func (AppModuleBasic) GetQueryCmd(*codec.Codec) *cobra.Command

func (AppModuleBasic) GetTxCmd

func (AppModuleBasic) GetTxCmd(cdc *codec.Codec) *cobra.Command

func (AppModuleBasic) Name

func (AppModuleBasic) Name() string

func (AppModuleBasic) RegisterCodec

func (AppModuleBasic) RegisterCodec(cdc *codec.Codec)

func (AppModuleBasic) RegisterRESTRoutes

func (AppModuleBasic) RegisterRESTRoutes(cliCtx context.CLIContext, r *mux.Router)

func (AppModuleBasic) ValidateGenesis

func (AppModuleBasic) ValidateGenesis(bz json.RawMessage) error

Validation check of the Genesis

type BaseNFT

type BaseNFT struct {
	ID          string         `json:"id,omitempty"`       // id of the token; not exported to clients
	Owner       sdk.AccAddress `json:"owner,string"`       // account address that owns the NFT
	Name        string         `json:"name,string"`        // name of the token
	Description string         `json:"description,string"` // unique description of the NFT
	Image       string         `json:"image,string"`       // image path
	TokenURI    string         `json:"token_uri,string"`   // optional extra properties available fo querying
}

BaseNFT non fungible token definition

func NewBaseNFT

func NewBaseNFT(ID string, owner sdk.AccAddress, tokenURI, description, image, name string) BaseNFT

NewBaseNFT creates a new NFT instance

func (BaseNFT) String

func (m BaseNFT) String() string

type GenesisState

type GenesisState struct {
	NFTRecords []NFT               `json:"nft_records"`
	AuthData   auth.GenesisState   `json:"auth"`
	BankData   bank.GenesisState   `json:"bank"`
	Accounts   []*auth.BaseAccount `json:"accounts"`
}

func DefaultGenesisState

func DefaultGenesisState() GenesisState

func ExportGenesis

func ExportGenesis(ctx sdk.Context, k Keeper) GenesisState

func NewGenesisState

func NewGenesisState(nftRecords []NFT) GenesisState

type Keeper

type Keeper struct {
	// contains filtered or unexported fields
}

Keeper maintains the link to data storage and exposes getter/setter methods for the various parts of the state machine

func NewKeeper

func NewKeeper(coinKeeper bank.Keeper, ibcKeeper ibck.Keeper, accountKeeper auth.AccountKeeper, feeCollectionKeeper auth.FeeCollectionKeeper, storeKey sdk.StoreKey, cdc *codec.Codec) Keeper

NewKeeper creates new instances of the hh Keeper

func (Keeper) BuyNFToken

func (k Keeper) BuyNFToken(ctx sdk.Context, nfTokenID string, buyer sdk.AccAddress) error

func (Keeper) DeleteNFT

func (k Keeper) DeleteNFT(ctx sdk.Context, tokenID string)

func (Keeper) GetNFTIterator

func (k Keeper) GetNFTIterator(ctx sdk.Context) sdk.Iterator

func (Keeper) GetNFToken

func (k Keeper) GetNFToken(ctx sdk.Context, tokenID string) *NFT

func (Keeper) GetNFTokens

func (k Keeper) GetNFTokens(ctx sdk.Context) []NFT

func (Keeper) PutNFTokenOnTheMarket

func (k Keeper) PutNFTokenOnTheMarket(ctx sdk.Context, token NFT, sender sdk.AccAddress) error

func (Keeper) StoreNFT

func (k Keeper) StoreNFT(ctx sdk.Context, nft NFT, owner sdk.AccAddress)

type MsgBuyNFToken

type MsgBuyNFToken struct {
	Sender    sdk.AccAddress
	NFTokenID string
	Price     sdk.Coins
}

MsgBuyNFToken.

func NewMsgBuyNFToken

func NewMsgBuyNFToken(tokenID string, price sdk.Coins, sender sdk.AccAddress) MsgBuyNFToken

NewMsgBuyNFToken is a constructor function for MsgBuyNFToken

func (MsgBuyNFToken) GetSignBytes

func (msg MsgBuyNFToken) GetSignBytes() []byte

GetSignBytes encodes the message for signing

func (MsgBuyNFToken) GetSigners

func (msg MsgBuyNFToken) GetSigners() []sdk.AccAddress

GetSigners defines whose signature is required

func (MsgBuyNFToken) Route

func (msg MsgBuyNFToken) Route() string

Route should return the name of the module

func (MsgBuyNFToken) Type

func (msg MsgBuyNFToken) Type() string

Type should return the action

func (MsgBuyNFToken) ValidateBasic

func (msg MsgBuyNFToken) ValidateBasic() sdk.Error

ValidateBasic runs stateless checks on the message

type MsgPutNFTokenOnTheMarket

type MsgPutNFTokenOnTheMarket struct {
	Sender sdk.AccAddress
	Token  NFT
}

MsgPutNFTokenOnTheMarket.

func NewMsgPutNFTokenOnTheMarket

func NewMsgPutNFTokenOnTheMarket(token NFT, sender sdk.AccAddress) MsgPutNFTokenOnTheMarket

NewMsgPutNFTokenOnTheMarket is a constructor function for MsgPutNFTokenOnTheMarket

func (MsgPutNFTokenOnTheMarket) GetSignBytes

func (msg MsgPutNFTokenOnTheMarket) GetSignBytes() []byte

GetSignBytes encodes the message for signing

func (MsgPutNFTokenOnTheMarket) GetSigners

func (msg MsgPutNFTokenOnTheMarket) GetSigners() []sdk.AccAddress

GetSigners defines whose signature is required

func (MsgPutNFTokenOnTheMarket) Route

func (msg MsgPutNFTokenOnTheMarket) Route() string

Route should return the name of the module

func (MsgPutNFTokenOnTheMarket) Type

func (msg MsgPutNFTokenOnTheMarket) Type() string

Type should return the action

func (MsgPutNFTokenOnTheMarket) ValidateBasic

func (msg MsgPutNFTokenOnTheMarket) ValidateBasic() sdk.Error

ValidateBasic runs stateless checks on the message

type MsgTransferTokenToZone

type MsgTransferTokenToZone struct {
	Owner   sdk.AccAddress
	TokenID string

	//fixme fill it
	ConnectionID         string
	CounterpartyID       string
	CounterpartyClientID string
}

func NewMsgTransferTokenToZone

func NewMsgTransferTokenToZone(owner sdk.AccAddress, tokenID string, zoneID string) MsgTransferTokenToZone

NewMsgCreateNFT is a constructor function for MsgCreateNFT

func (MsgTransferTokenToZone) GetSignBytes

func (msg MsgTransferTokenToZone) GetSignBytes() []byte

GetSignBytes encodes the message for signing

func (MsgTransferTokenToZone) GetSigners

func (msg MsgTransferTokenToZone) GetSigners() []sdk.AccAddress

GetSigners defines whose signature is required

func (MsgTransferTokenToZone) Route

func (msg MsgTransferTokenToZone) Route() string

Route should return the name of the module

func (MsgTransferTokenToZone) Type

func (msg MsgTransferTokenToZone) Type() string

Type should return the action

func (MsgTransferTokenToZone) ValidateBasic

func (msg MsgTransferTokenToZone) ValidateBasic() sdk.Error

ValidateBasic runs stateless checks on the message

type NFT

type NFT struct {
	BaseNFT
	OnSale bool      `json:"on_sale"`
	Price  sdk.Coins `json:"price"`
}

func (NFT) String

func (m NFT) String() string

type ProofPacket

type ProofPacket struct {
}

func (*ProofPacket) GetKey

func (p *ProofPacket) GetKey() []byte

func (*ProofPacket) Verify

func (p *ProofPacket) Verify(commitment.Root, []byte) error

type QueryResNFTokens

type QueryResNFTokens []NFT

func (QueryResNFTokens) String

func (m QueryResNFTokens) String() string

type SendTokenPacket

type SendTokenPacket struct {
	Token *BaseNFT `json:"token"`
}

func NewSendTokenPacket

func NewSendTokenPacket(token *BaseNFT) *SendTokenPacket

func (*SendTokenPacket) Commit

func (m *SendTokenPacket) Commit() []byte

func (*SendTokenPacket) Timeout

func (m *SendTokenPacket) Timeout() uint64

type Transfer

type Transfer struct {
	// TODO: obviously there should be at least "complete", "in progress" and "failed"
	// TODO: states, but I'm not sure we should bother about that.
	Complete bool `json:"complete"`
}

func NewTransfer

func NewTransfer() Transfer

func (Transfer) String

func (m Transfer) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL