Documentation ¶
Index ¶
- Constants
- Variables
- func EncodeHex(b []byte) string
- func FromHex(s string) []byte
- func Hex2Bytes(str string) []byte
- func ParamKeyTable() paramtypes.KeyTable
- func RegisterCodec(cdc *codec.Codec)
- func ValidateGenesis(gs GenesisState) error
- type AccountKeeper
- type EthAddr
- type EthHash
- type EthereumAddress
- func (a EthereumAddress) Bytes() []byte
- func (a EthereumAddress) Empty() bool
- func (a EthereumAddress) Equals(other EthAddr) bool
- func (a EthereumAddress) Format(s fmt.State, verb rune)
- func (a EthereumAddress) Hex() string
- func (a EthereumAddress) Marshal() ([]byte, error)
- func (a EthereumAddress) MarshalJSON() ([]byte, error)
- func (a EthereumAddress) MarshalYAML() (interface{}, error)
- func (a *EthereumAddress) SetBytes(b []byte)
- func (a EthereumAddress) String() string
- func (a *EthereumAddress) Unmarshal(data []byte) error
- func (a *EthereumAddress) UnmarshalJSON(data []byte) error
- func (a *EthereumAddress) UnmarshalYAML(data []byte) error
- type EthereumTxHash
- func (h EthereumTxHash) Bytes() []byte
- func (h EthereumTxHash) Empty() bool
- func (h EthereumTxHash) Equals(other EthHash) bool
- func (h EthereumTxHash) Format(s fmt.State, verb rune)
- func (h EthereumTxHash) Hex() string
- func (h EthereumTxHash) Marshal() ([]byte, error)
- func (h EthereumTxHash) MarshalJSON() ([]byte, error)
- func (h EthereumTxHash) MarshalYAML() (interface{}, error)
- func (h *EthereumTxHash) SetBytes(b []byte)
- func (h EthereumTxHash) String() string
- func (h *EthereumTxHash) Unmarshal(data []byte) error
- func (h *EthereumTxHash) UnmarshalJSON(data []byte) error
- func (h *EthereumTxHash) UnmarshalYAML(data []byte) error
- type GenesisState
- type GetTokenSwapParams
- type MsgSwapRequest
- func (msg MsgSwapRequest) GetSignBytes() []byte
- func (msg MsgSwapRequest) GetSigners() []sdk.AccAddress
- func (msg MsgSwapRequest) Route() string
- func (msg MsgSwapRequest) Type() string
- func (msg MsgSwapRequest) ValidateAmount() error
- func (msg MsgSwapRequest) ValidateBasic() error
- func (msg MsgSwapRequest) ValidateReceiver() error
- func (msg MsgSwapRequest) ValidateTxHash() error
- type Params
- type SupplyKeeper
- type TokenSwapRecord
Constants ¶
const ( EthereumAddressLength = 20 EthereumTxHashLength = 32 )
const ( // ModuleName is the name of the module ModuleName = "tokenswap" // StoreKey is used to register the module's store StoreKey = ModuleName // QuerierRoute is the querier route for the tokenswap module QuerierRoute = ModuleName )
const ( // default paramspace for params keeper DefaultParamspace = ModuleName )
const (
GetTokenSwapRoute = "get"
)
query endpoints supported by the Querier
const RouterKey = "tokenswap"
RouterKey is used to route messages and queriers to the greeter module
Variables ¶
var ( ParamStoreKeyMultisigApproveAddress = []byte("MultisigApproveAddress") ParamStoreKeyMintingMultiplier = []byte("MintingMultiplier") ParamStoreKeyMintingEnabled = []byte("MintingEnabled") )
Parameter keys
var ModuleCdc *codec.Codec
Functions ¶
func FromHex ¶
FromHex returns the bytes represented by the hexadecimal string s. s may be prefixed with "0x".
func ParamKeyTable ¶
func ParamKeyTable() paramtypes.KeyTable
ParamKeyTable returns the parameter key table.
func RegisterCodec ¶
func ValidateGenesis ¶
func ValidateGenesis(gs GenesisState) error
ValidateGenesis validates the genesis state of distribution genesis input
Types ¶
type AccountKeeper ¶
type AccountKeeper interface {
GetAccount(sdk.Context, sdk.AccAddress) authexported.Account
}
AccountKeeper defines the expected account keeper
type EthAddr ¶
type EthAddr interface { Equals(EthAddr) bool Empty() bool Marshal() ([]byte, error) MarshalJSON() ([]byte, error) MarshalYAML() (interface{}, error) Bytes() []byte String() string Format(s fmt.State, verb rune) }
Address is a common interface for different types of addresses used by the SDK
type EthereumAddress ¶
type EthereumAddress [EthereumAddressLength]byte
func BytesToAddress ¶
func BytesToAddress(b []byte) EthereumAddress
func HexToAddress ¶
func HexToAddress(s string) (addr EthereumAddress, err error)
func (EthereumAddress) Bytes ¶
func (a EthereumAddress) Bytes() []byte
func (EthereumAddress) Empty ¶
func (a EthereumAddress) Empty() bool
func (EthereumAddress) Equals ¶
func (a EthereumAddress) Equals(other EthAddr) bool
func (EthereumAddress) Hex ¶
func (a EthereumAddress) Hex() string
Hex returns an EIP55-compliant hex string representation of the address.
func (EthereumAddress) Marshal ¶
func (a EthereumAddress) Marshal() ([]byte, error)
func (EthereumAddress) MarshalJSON ¶
func (a EthereumAddress) MarshalJSON() ([]byte, error)
func (EthereumAddress) MarshalYAML ¶
func (a EthereumAddress) MarshalYAML() (interface{}, error)
func (*EthereumAddress) SetBytes ¶
func (a *EthereumAddress) SetBytes(b []byte)
func (EthereumAddress) String ¶
func (a EthereumAddress) String() string
func (*EthereumAddress) Unmarshal ¶
func (a *EthereumAddress) Unmarshal(data []byte) error
Unmarshal sets the address to the given data. It is needed for protobuf compatibility.
func (*EthereumAddress) UnmarshalJSON ¶
func (a *EthereumAddress) UnmarshalJSON(data []byte) error
UnmarshalJSON unmarshals from JSON assuming Bech32 encoding.
func (*EthereumAddress) UnmarshalYAML ¶
func (a *EthereumAddress) UnmarshalYAML(data []byte) error
type EthereumTxHash ¶
type EthereumTxHash [EthereumTxHashLength]byte
func BytesToTxHash ¶
func BytesToTxHash(b []byte) EthereumTxHash
func HexToTxHash ¶
func HexToTxHash(s string) (addr EthereumTxHash, err error)
func (EthereumTxHash) Bytes ¶
func (h EthereumTxHash) Bytes() []byte
func (EthereumTxHash) Empty ¶
func (h EthereumTxHash) Empty() bool
func (EthereumTxHash) Equals ¶
func (h EthereumTxHash) Equals(other EthHash) bool
func (EthereumTxHash) Hex ¶
func (h EthereumTxHash) Hex() string
func (EthereumTxHash) Marshal ¶
func (h EthereumTxHash) Marshal() ([]byte, error)
func (EthereumTxHash) MarshalJSON ¶
func (h EthereumTxHash) MarshalJSON() ([]byte, error)
func (EthereumTxHash) MarshalYAML ¶
func (h EthereumTxHash) MarshalYAML() (interface{}, error)
func (*EthereumTxHash) SetBytes ¶
func (h *EthereumTxHash) SetBytes(b []byte)
func (EthereumTxHash) String ¶
func (h EthereumTxHash) String() string
func (*EthereumTxHash) Unmarshal ¶
func (h *EthereumTxHash) Unmarshal(data []byte) error
Unmarshal sets the address to the given data. It is needed for protobuf compatibility.
func (*EthereumTxHash) UnmarshalJSON ¶
func (h *EthereumTxHash) UnmarshalJSON(data []byte) error
UnmarshalJSON unmarshals from JSON assuming Bech32 encoding.
func (*EthereumTxHash) UnmarshalYAML ¶
func (h *EthereumTxHash) UnmarshalYAML(data []byte) error
type GenesisState ¶
type GenesisState struct {
Params Params `json:"params" yaml:"params"`
}
GenesisState - all distribution state that must be provided at genesis
func DefaultGenesisState ¶
func DefaultGenesisState() GenesisState
get raw genesis raw message for testing
func NewGenesisState ¶
func NewGenesisState(params Params) GenesisState
type GetTokenSwapParams ¶
type GetTokenSwapParams struct {
EthereumTxHash EthereumTxHash `json:"ethereum_tx_hash"`
}
GetTokenSwapParams defines the params for the following queries: - 'custom/tokenswap/get/'
func NewGetTokenSwapParams ¶
func NewGetTokenSwapParams(ethereumTxHash EthereumTxHash) GetTokenSwapParams
NewGetTokenSwapParams creates a new GetTokenSwapParams
type MsgSwapRequest ¶
type MsgSwapRequest struct { BurnTxHash EthereumTxHash EthereumSender EthereumAddress Receiver sdk.AccAddress AmountENG sdk.Dec SignerAddr sdk.AccAddress }
MsgSwapRequest defines the MsgSwapRequest Message
func NewMsgSwapRequest ¶
func NewMsgSwapRequest(burnTxHash EthereumTxHash, ethereumSender EthereumAddress, receiver sdk.AccAddress, signerAddr sdk.AccAddress, amountENG sdk.Dec) MsgSwapRequest
NewMsgSwapRequest Returns a new MsgSwapRequest
func (MsgSwapRequest) GetSignBytes ¶
func (msg MsgSwapRequest) GetSignBytes() []byte
GetSignBytes encodes the message for signing
func (MsgSwapRequest) GetSigners ¶
func (msg MsgSwapRequest) GetSigners() []sdk.AccAddress
GetSigners returns the addresses of those required to sign the message
func (MsgSwapRequest) Route ¶
func (msg MsgSwapRequest) Route() string
Route should return the name of the module
func (MsgSwapRequest) ValidateAmount ¶
func (msg MsgSwapRequest) ValidateAmount() error
func (MsgSwapRequest) ValidateBasic ¶
func (msg MsgSwapRequest) ValidateBasic() error
ValidateBasic runs stateless checks on the message
func (MsgSwapRequest) ValidateReceiver ¶
func (msg MsgSwapRequest) ValidateReceiver() error
func (MsgSwapRequest) ValidateTxHash ¶
func (msg MsgSwapRequest) ValidateTxHash() error
type Params ¶
type Params struct { MultisigApproveAddress sdk.AccAddress `json:"minting_approver_address" yaml:"minting_approver_address"` MintingMultiplier sdk.Dec `json:"minting_multiplier" yaml:"minting_multiplier"` MintingEnabled bool `json:"minting_enabled" yaml:"minting_enabled"` }
TokenSwap struct containing the data of the TokenSwap. json and yaml tags are used to specify field names when marshalled
func DefaultParams ¶
func DefaultParams() Params
DefaultParams returns default distribution parameters
func (*Params) ParamSetPairs ¶
func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs
ParamSetPairs returns the parameter set pairs.
func (Params) ValidateBasic ¶
ValidateBasic performs basic validation on distribution parameters.
type SupplyKeeper ¶
type SupplyKeeper interface { SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error MintCoins(ctx sdk.Context, name string, amt sdk.Coins) error BurnCoins(ctx sdk.Context, name string, amt sdk.Coins) error SetModuleAccount(sdk.Context, supplyexported.ModuleAccountI) }
SupplyKeeper defines the expected supply keeper
type TokenSwapRecord ¶
type TokenSwapRecord struct { BurnTxHash EthereumTxHash `json:"ethereum_tx_hash" yaml:"ethereum_tx_hash"` EthereumSender EthereumAddress `json:"ethereum_sender" yaml:"ethereum_sender"` Receiver sdk.AccAddress `json:"receiver" yaml:"receiver"` AmountUSCRT sdk.Coins `json:"amount_uscrt" yaml:"amount_uscrt"` Done bool `json:"done" yaml:"done"` }
TokenSwap struct containing the data of the TokenSwap. json and yaml tags are used to specify field names when marshalled
func NewTokenSwapRecord ¶
func NewTokenSwapRecord(burnTxHash EthereumTxHash, ethereumSender EthereumAddress, receiver sdk.AccAddress, AmountUSCRT sdk.Coins, done bool) TokenSwapRecord
NewTokenSwap Returns a new TokenSwap
func (TokenSwapRecord) String ¶
func (s TokenSwapRecord) String() string
String implement fmt.Stringer