Documentation ¶
Index ¶
- Constants
- Variables
- func ParamsKeyTable() params.KeyTable
- func RegisterCodec(cdc *codec.Codec)
- func SwapKey(hash EthereumHash) []byte
- type EthereumHash
- func (e EthereumHash) Bytes() []byte
- func (e EthereumHash) Hex() string
- func (e EthereumHash) Marshal() ([]byte, error)
- func (e EthereumHash) MarshalJSON() ([]byte, error)
- func (e *EthereumHash) SetBytes(b []byte)
- func (e EthereumHash) String() string
- func (e *EthereumHash) Unmarshal(data []byte) error
- func (e *EthereumHash) UnmarshalJSON(data []byte) error
- type GenesisState
- type MsgSwap
- type Params
- type QuerySwapParams
- type QuerySwapsParams
- type Swap
- type Swaps
Constants ¶
View Source
const ( AttributeKeyTxHash = "tx_hash" AttributeKeyAddress = "address" AttributeKeyAmount = "amount" )
View Source
const ( ModuleName = "swap" QuerierRoute = ModuleName DefaultParamspace = ModuleName )
View Source
const ( DefaultSwapEnabled = false DefaultSwapDenom = "tsent" )
View Source
const ( QuerySwap = "Swap" QuerySwaps = "Swaps" )
View Source
const (
EthereumHashLength = 32
)
Variables ¶
View Source
var ( ErrorMarshal = errors.Register(ModuleName, 101, "error occurred while marshalling") ErrorUnmarshal = errors.Register(ModuleName, 102, "error occurred while unmarshalling") ErrorUnknownMsgType = errors.Register(ModuleName, 103, "unknown message type") ErrorUnknownQueryType = errors.Register(ModuleName, 104, "unknown query type") ErrorInvalidField = errors.Register(ModuleName, 105, "invalid field") ErrorSwapIsDisabled = errors.Register(ModuleName, 106, "swap is disabled") ErrorDuplicateSwap = errors.Register(ModuleName, 108, "duplicate swap") )
View Source
var ( ParamsSubspace = ModuleName RouterKey = ModuleName StoreKey = ModuleName )
View Source
var ( KeySwapEnabled = []byte("SwapEnabled") KeySwapDenom = []byte("SwapDenom") KeyApproveBy = []byte("ApproveBy") )
View Source
var (
DefaultApproveBy = sdk.AccAddress(rand.Bytes(20))
)
View Source
var ( EventModuleName = sdk.NewEvent( sdk.EventTypeMessage, sdk.NewAttribute(sdk.AttributeKeyModule, ModuleName), ) )
View Source
var (
EventTypeSet = fmt.Sprintf("%s:set", ModuleName)
)
View Source
var (
ModuleCdc *codec.Codec
)
View Source
var (
SwapKeyPrefix = []byte{0x10}
)
Functions ¶
func ParamsKeyTable ¶
func RegisterCodec ¶
func SwapKey ¶
func SwapKey(hash EthereumHash) []byte
Types ¶
type EthereumHash ¶
type EthereumHash [EthereumHashLength]byte
func BytesToHash ¶
func BytesToHash(b []byte) EthereumHash
func (EthereumHash) Bytes ¶
func (e EthereumHash) Bytes() []byte
func (EthereumHash) Hex ¶
func (e EthereumHash) Hex() string
func (EthereumHash) Marshal ¶
func (e EthereumHash) Marshal() ([]byte, error)
func (EthereumHash) MarshalJSON ¶
func (e EthereumHash) MarshalJSON() ([]byte, error)
func (*EthereumHash) SetBytes ¶
func (e *EthereumHash) SetBytes(b []byte)
func (EthereumHash) String ¶
func (e EthereumHash) String() string
func (*EthereumHash) Unmarshal ¶
func (e *EthereumHash) Unmarshal(data []byte) error
func (*EthereumHash) UnmarshalJSON ¶
func (e *EthereumHash) UnmarshalJSON(data []byte) error
type GenesisState ¶
func DefaultGenesisState ¶
func DefaultGenesisState() GenesisState
func NewGenesisState ¶
func NewGenesisState(swaps Swaps, params Params) GenesisState
type MsgSwap ¶
type MsgSwap struct { From sdk.AccAddress `json:"from"` TxHash EthereumHash `json:"tx_hash"` Receiver sdk.AccAddress `json:"receiver"` Amount sdk.Int `json:"amount"` }
func NewMsgSwap ¶
func NewMsgSwap(from sdk.AccAddress, txHash EthereumHash, receiver sdk.AccAddress, amount sdk.Int) MsgSwap
func (MsgSwap) GetSignBytes ¶
func (MsgSwap) GetSigners ¶
func (m MsgSwap) GetSigners() []sdk.AccAddress
func (MsgSwap) ValidateBasic ¶
type Params ¶
type Params struct { SwapEnabled bool `json:"swap_enabled"` SwapDenom string `json:"swap_denom"` ApproveBy sdk.AccAddress `json:"approve_by"` }
func DefaultParams ¶
func DefaultParams() Params
func NewParams ¶
func NewParams(swapEnabled bool, swapDenom string, approveBy sdk.AccAddress) Params
func (*Params) ParamSetPairs ¶
func (p *Params) ParamSetPairs() params.ParamSetPairs
type QuerySwapParams ¶
type QuerySwapParams struct {
TxHash EthereumHash `json:"tx_hash"`
}
func NewQuerySwapParams ¶
func NewQuerySwapParams(txHash EthereumHash) QuerySwapParams
type QuerySwapsParams ¶
func NewQuerySwapsParams ¶
func NewQuerySwapsParams(skip, limit int) QuerySwapsParams
type Swap ¶
type Swap struct { TxHash EthereumHash `json:"tx_hash"` Receiver sdk.AccAddress `json:"receiver"` Amount sdk.Coin `json:"amount"` }
Click to show internal directories.
Click to hide internal directories.