Documentation ¶
Index ¶
- Constants
- Variables
- func ParamKeyTable() params.KeyTable
- func RegisterCodec(cdc *codec.Codec)
- type CodeType
- type CoinSwapReceipt
- type CoinSwapRecord
- type CoinSwapRecordStorage
- type MsgCoinSwap
- func (msg MsgCoinSwap) GetMsgs() []sdk.Msg
- func (msg MsgCoinSwap) GetSignBytes() []byte
- func (msg MsgCoinSwap) GetSigners() []sdk.AccAddress
- func (msg MsgCoinSwap) Route() string
- func (msg MsgCoinSwap) ToRecord() CoinSwapRecord
- func (msg MsgCoinSwap) Type() string
- func (msg MsgCoinSwap) ValidateBasic() sdk.Error
- type QueryReceiptByHashParams
Constants ¶
View Source
const ( // module name ModuleName = "coinswap" // StoreKey is the default store key for guardian StoreKey = ModuleName // RouterKey is the message route for guardian RouterKey = ModuleName // QuerierRoute is the querier route for the guardian store. QuerierRoute = StoreKey )
View Source
const ( RecordStatusWaited = 1 RecordStatusSucceed = 2 RecordStatusFailed = 3 )
View Source
const (
DefaultParamspace = ModuleName
)
Default parameter namespace
View Source
const (
QueryReceiptByHash = "queryReceiptByHash"
)
View Source
const (
TypeMsgCoinSwap = "coinswap"
)
Variables ¶
View Source
var ModuleCdc = codec.New()
ModuleCdc defines the codec to be used by evm module
View Source
var ( // key for constant fee parameter RefreshPoint = []byte("RefreshPoint") )
Functions ¶
func RegisterCodec ¶
RegisterCodec registers concrete types and interfaces on the given codec.
Types ¶
type CodeType ¶
const ( DefaultCodespace sdk.CodespaceType = ModuleName CodeInvalidInput CodeType = 101 CodeInvalidAddress CodeType = sdk.CodeInvalidAddress CodeInternal CodeType = sdk.CodeInternal CodeUnknownRequest CodeType = sdk.CodeUnknownRequest )
type CoinSwapReceipt ¶
type CoinSwapReceipt struct { Status int `json:"status"` // 兑换状态(1:wait, 2:finished, 0:invalid) Receipt string `json:"receipt"` // 用户提币凭据 }
代币兑换交易收条,用于返回一段凭据,用户使用凭据去目标链提取兑换的币
func (CoinSwapReceipt) String ¶
func (c CoinSwapReceipt) String() string
type CoinSwapRecord ¶
type CoinSwapRecord struct { TxHash string `json:"txHash"` // 抵押交易hash FromChain int `json:"fromChain"` // 原始链 FromAddr string `json:"fromAddr"` // 抵押者地址 Token int `json:"token"` // 代币类型 Value uint64 `json:"value"` // 抵押数量 ToAddr string `json:"toAddr"` // 接收铸币的地址 ToChain int `json:"toChain"` // 目标链 EventType int `json:"eventType"` // 事件类型(1: 铸币 0:销毁) AddedBlock uint64 `json:"addedBlock"` // 记录产生的区块号 }
func (CoinSwapRecord) Hash ¶
func (c CoinSwapRecord) Hash() []byte
func (CoinSwapRecord) String ¶
func (c CoinSwapRecord) String() string
type CoinSwapRecordStorage ¶
type CoinSwapRecordStorage struct { Record CoinSwapRecord `json:"record"` Receipt CoinSwapReceipt `json:"receipt"` }
func (CoinSwapRecordStorage) String ¶
func (c CoinSwapRecordStorage) String() string
type MsgCoinSwap ¶
type MsgCoinSwap struct { Sender string `json:"sender"` // 交易发送者 TxHash string `json:"txHash"` // 抵押交易hash FromChain int `json:"fromChain"` // 原始链 FromAddr string `json:"fromAddr"` // 抵押者地址 Token int `json:"token"` // 代币类型 Value uint64 `json:"value"` // 抵押数量 ToAddr string `json:"toAddr"` // 接收铸币的地址 ToChain int `json:"toChain"` // 目标链 EventType int `json:"eventType"` // 事件类型(1: 铸币 0:销毁) }
coinswap msg got from borker node.
func NewMsgCoinSwap ¶
func (MsgCoinSwap) GetMsgs ¶
func (msg MsgCoinSwap) GetMsgs() []sdk.Msg
GetMsgs returns a single MsgSetAccName as an sdk.Msg.
func (MsgCoinSwap) GetSignBytes ¶
func (msg MsgCoinSwap) GetSignBytes() []byte
GetSignBytes encodes the message for signing
func (MsgCoinSwap) GetSigners ¶
func (msg MsgCoinSwap) GetSigners() []sdk.AccAddress
GetSigners defines whose signature is required
func (MsgCoinSwap) Route ¶
func (msg MsgCoinSwap) Route() string
Route should return the name of the module
func (MsgCoinSwap) ToRecord ¶
func (msg MsgCoinSwap) ToRecord() CoinSwapRecord
func (MsgCoinSwap) ValidateBasic ¶
func (msg MsgCoinSwap) ValidateBasic() sdk.Error
ValidateBasic runs stateless checks on the message
type QueryReceiptByHashParams ¶
type QueryReceiptByHashParams struct {
Hash string
}
QueryReceiptByHashParams defines the params to query map info by oin addr.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.