types

package
v0.0.0-...-daabc20 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2020 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModuleName = "xnfts"
	Version    = "ics20-1"
	PortID     = ModuleName

	StoreKey     = ModuleName
	QuerierRoute = ModuleName
	RouterKey    = ModuleName
	PortKey      = "portID"
)

Variables

View Source
var (
	EventTypeNFTPacketTransfer             = "nft_packet_transfer"
	EventTypePayLicensingFeeAndNFTTransfer = "pay_licensing_fee_and_token_transfer"

	AttributeKeyReceiver   = "receiver"
	AttributeValueCategory = fmt.Sprintf("%s_%s", ibctypes.ModuleName, ModuleName)
)

Functions

func GetHexAddressFromBech32String

func GetHexAddressFromBech32String(addr string) sdk.AccAddress

func RegisterCodec

func RegisterCodec(cdc *codec.Codec)

RegisterCodec registers the IBC transfer types

func RegisterInterfaces

func RegisterInterfaces(registry cdctypes.InterfaceRegistry)

Types

type AccountKeeper

type AccountKeeper interface {
	GetAccount(ctx sdk.Context, addr sdk.AccAddress) authexported.Account
}

type BaseBankKeeper

type BaseBankKeeper interface {
	AddCoins(ctx sdk.Context, addr sdk.AccAddress, amount sdk.Coins) (sdk.Coins, error)
	SubtractCoins(ctx sdk.Context, addr sdk.AccAddress, amount sdk.Coins) (sdk.Coins, error)
}

type BaseNFTPacket

type BaseNFTPacket struct {
	PrimaryNFTID    string `json:"primary_nftid"`
	PrimaryNFTOwner string `json:"primary_nft_owner"`

	SecondaryNFTID    string `json:"secondary_nftid"`
	SecondaryNFTOwner string `json:"secondary_nft_owner"`

	AssetID string `json:"asset_id"`

	License      bool     `json:"license"`
	LicensingFee sdk.Coin `json:"licensing_fee"`
	RevenueShare sdk.Dec  `json:"revenue_share"`

	TwitterHandle string `json:"twitter_handle"`
}

func NewBaseNFTPacket

func NewBaseNFTPacket(primaryNFTID, secondaryNFTID, primaryNFTOwner, secondaryNFTOwner string,
	assetID, twitterHandle string, license bool, fee sdk.Coin, share sdk.Dec) BaseNFTPacket

func (BaseNFTPacket) GetBytes

func (nft BaseNFTPacket) GetBytes() []byte

func (BaseNFTPacket) MarshalJSON

func (nft BaseNFTPacket) MarshalJSON() ([]byte, error)

func (BaseNFTPacket) ProtoMessage

func (nft BaseNFTPacket) ProtoMessage()

func (*BaseNFTPacket) Reset

func (nft *BaseNFTPacket) Reset()

func (BaseNFTPacket) String

func (nft BaseNFTPacket) String() string

func (BaseNFTPacket) ToBaseTweetNFT

func (nft BaseNFTPacket) ToBaseTweetNFT() *nfts.BaseTweetNFT

func (*BaseNFTPacket) UnmarshalJSON

func (nft *BaseNFTPacket) UnmarshalJSON(bytes []byte) error

func (BaseNFTPacket) ValidateBasic

func (nft BaseNFTPacket) ValidateBasic() error

type ChannelKeeper

type ChannelKeeper interface {
	GetChannel(ctx sdk.Context, srcPort, srcChan string) (channel channel.Channel, found bool)
	GetNextSequenceSend(ctx sdk.Context, portID, channelID string) (uint64, bool)
	SendPacket(ctx sdk.Context, channelCap *capability.Capability, packet channelexported.PacketI) error
	PacketExecuted(ctx sdk.Context, chanCap *capability.Capability, packet channelexported.PacketI, acknowledgement []byte) error
	ChanCloseInit(ctx sdk.Context, portID, channelID string, chanCap *capability.Capability) error
}

type GenesisState

type GenesisState struct {
	PortID string `json:"port_id"`
}

func DefaultGenesis

func DefaultGenesis() GenesisState

type MsgPayLicensingFee

type MsgPayLicensingFee struct {
	Sender       sdk.AccAddress `json:"sender"`
	Recipient    string         `json:"recipient"`
	LicensingFee sdk.Coin       `json:"licensing_fee"`
	PrimaryNFTID string         `json:"primary_nft_id"`

	SrcPort    string `json:"src_port"`
	SrcChannel string `json:"src_channel"`
	DestHeight uint64 `json:"dest_height"`
}

func NewMsgPayLicensingFee

func NewMsgPayLicensingFee(
	sourcePort, sourceChannel, primaryNFTID string, destHeight uint64, fee sdk.Coin, sender sdk.AccAddress, receiver string,
) MsgPayLicensingFee

func (MsgPayLicensingFee) GetSignBytes

func (m MsgPayLicensingFee) GetSignBytes() []byte

func (MsgPayLicensingFee) GetSigners

func (m MsgPayLicensingFee) GetSigners() []sdk.AccAddress

func (MsgPayLicensingFee) Route

func (m MsgPayLicensingFee) Route() string

func (MsgPayLicensingFee) Type

func (m MsgPayLicensingFee) Type() string

func (MsgPayLicensingFee) ValidateBasic

func (m MsgPayLicensingFee) ValidateBasic() error

type MsgXNFTTransfer

type MsgXNFTTransfer struct {
	SourcePort    string         `json:"source_port"`
	SourceChannel string         `json:"source_channel"`
	DestHeight    uint64         `json:"dest_height"`
	Sender        sdk.AccAddress `json:"sender"`

	NFTInput
}

func NewMsgXNFTTransfer

func NewMsgXNFTTransfer(sourcePort, sourceChannel string, height uint64, sender sdk.AccAddress,
	nftInput NFTInput) MsgXNFTTransfer

func (MsgXNFTTransfer) GetSignBytes

func (m MsgXNFTTransfer) GetSignBytes() []byte

func (MsgXNFTTransfer) GetSigners

func (m MsgXNFTTransfer) GetSigners() []sdk.AccAddress

func (MsgXNFTTransfer) ProtoMessage

func (m MsgXNFTTransfer) ProtoMessage()

func (*MsgXNFTTransfer) Reset

func (m *MsgXNFTTransfer) Reset()

func (MsgXNFTTransfer) Route

func (m MsgXNFTTransfer) Route() string

func (*MsgXNFTTransfer) String

func (m *MsgXNFTTransfer) String() string

func (MsgXNFTTransfer) Type

func (m MsgXNFTTransfer) Type() string

func (MsgXNFTTransfer) ValidateBasic

func (m MsgXNFTTransfer) ValidateBasic() error

type NFTInput

type NFTInput struct {
	PrimaryNFTID string `json:"primary_nft_id"`
	Recipient    string `json:"recipient"`
	AssetID      string `json:"asset_id"`

	LicensingFee  sdk.Coin `json:"licensing_fee"`
	RevenueShare  sdk.Dec  `json:"revenue_share"`
	TwitterHandle string   `json:"twitter_handle"`
}

type NFTKeeper

type NFTKeeper interface {
	GetTweetNFTByID(ctx sdk.Context, id string) (nfts.BaseTweetNFT, bool)
	MintTweetNFT(ctx sdk.Context, nft nfts.BaseTweetNFT)
	GetAllTweetNFTs(ctx sdk.Context) []nfts.BaseTweetNFT
	GetTweetsOfAccount(ctx sdk.Context, address sdk.AccAddress) []nfts.BaseTweetNFT

	SetGlobalTweetCount(ctx sdk.Context, count uint64)
	GetGlobalTweetCount(ctx sdk.Context) uint64
	SetTweetIDToAccount(ctx sdk.Context, add sdk.AccAddress, id string)
}

type PacketPayLicensingFeeAndNFTTransfer

type PacketPayLicensingFeeAndNFTTransfer struct {
	PrimaryNFTID string   `json:"primary_nft_id"`
	LicensingFee sdk.Coin `json:"licensing_fee"`
	Recipient    string   `json:"recipient"`
	Sender       string   `json:"sender"`
}

func NewPacketPayLicensingFeeAndNFTTransfer

func NewPacketPayLicensingFeeAndNFTTransfer(fee sdk.Coin, recipient, sender, primaryNFTID string) PacketPayLicensingFeeAndNFTTransfer

func (PacketPayLicensingFeeAndNFTTransfer) GetBytes

func (PacketPayLicensingFeeAndNFTTransfer) MarshalJSON

func (p PacketPayLicensingFeeAndNFTTransfer) MarshalJSON() ([]byte, error)

func (PacketPayLicensingFeeAndNFTTransfer) String

func (*PacketPayLicensingFeeAndNFTTransfer) UnmarshalJSON

func (p *PacketPayLicensingFeeAndNFTTransfer) UnmarshalJSON(bytes []byte) error

func (PacketPayLicensingFeeAndNFTTransfer) ValidateBasic

func (p PacketPayLicensingFeeAndNFTTransfer) ValidateBasic() error

type PortKeeper

type PortKeeper interface {
	BindPort(ctx sdk.Context, portID string) *capability.Capability
}

type PostCreationPacketAcknowledgement

type PostCreationPacketAcknowledgement struct {
	Success bool   `json:"success" yaml:"success"`
	Error   string `json:"error" yaml:"error"`
}

func (PostCreationPacketAcknowledgement) GetBytes

func (ack PostCreationPacketAcknowledgement) GetBytes() []byte

type XNFTs

type XNFTs interface {
	GetBytes() []byte
}

Jump to

Keyboard shortcuts

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