Documentation ¶
Index ¶
- Constants
- func RenderFailure(ctx *gin.Context, errCode int, err error)
- func RenderFatal(ctx *gin.Context, err error)
- func RenderJSON(ctx *gin.Context, errCode int, err error, data interface{})
- func RenderSuccess(ctx *gin.Context, data interface{})
- type ClaimInfo
- type L2MessageProof
- type Message
- type MessageType
- type QueryByAddressRequest
- type Response
- type ResultData
- type TokenType
- type TxHistoryInfo
- type TxStatusType
- type TxType
Constants ¶
View Source
const ( // Success indicates that the operation was successful. Success = 0 // InternalServerError represents a fatal error occurring on the server. InternalServerError = 500 // ErrParameterInvalidNo represents an error when the parameters are invalid. ErrParameterInvalidNo = 40001 // ErrGetL2ClaimableWithdrawalsError represents an error when trying to get L2 claimable withdrawal transactions. ErrGetL2ClaimableWithdrawalsError = 40002 // ErrGetTxsError represents an error when trying to get transactions by address. ErrGetTxsError = 40003 )
Variables ¶
This section is empty.
Functions ¶
func RenderFailure ¶
RenderFailure renders failure response with json
func RenderFatal ¶
RenderFatal renders fatal response with json
func RenderJSON ¶
RenderJSON renders response with json
func RenderSuccess ¶
RenderSuccess renders success response with json
Types ¶
type ClaimInfo ¶
type ClaimInfo struct { From string `json:"from"` To string `json:"to"` Value string `json:"value"` Message Message `json:"message"` Proof L2MessageProof `json:"proof"` }
type L2MessageProof ¶
type L2MessageProof struct {
MultiSignProof string `json:"multisign_proof"`
}
L2MessageProof is the schema of L2 message proof
type MessageType ¶
type MessageType int
MessageType represents the type of message.
const ( MessageTypeUnknown MessageType = iota MessageTypeL1SentMessage MessageTypeL2SentMessage )
Constants for MessageType.
type QueryByAddressRequest ¶
type QueryByAddressRequest struct { Address string `json:"address" binding:"required"` Page uint64 `json:"page" binding:"required,min=1"` PageSize uint64 `json:"page_size" binding:"required,min=1,max=100"` }
QueryByAddressRequest the request parameter of address api
type Response ¶
type Response struct { ErrCode int `json:"errcode"` ErrMsg string `json:"errmsg"` Data interface{} `json:"data"` }
Response the response schema
type ResultData ¶
type ResultData struct { Results []*TxHistoryInfo `json:"results"` Total uint64 `json:"total"` }
ResultData contains return txs and total
type TxHistoryInfo ¶
type TxHistoryInfo struct { Hash string `json:"hash"` MessageHash string `json:"message_hash"` TokenType TokenType `json:"token_type"` // 0: ETH, 1: ERC20, 2: ERC721, 3: ERC1155, 4: RED TokenIDs []string `json:"token_ids"` // only for erc721 and erc1155 TokenAmounts []string `json:"token_amounts"` // for eth and erc20, the length is 1, for erc721 and erc1155, the length could be > 1 MessageType MessageType `json:"message_type"` // 0: unknown, 1: layer 1 message, 2: layer 2 message TxStatus TxStatusType `json:"tx_status"` L1TokenAddress string `json:"l1_token_address"` L2TokenAddress string `json:"l2_token_address"` BlockNumber uint64 `json:"block_number"` ClaimInfo *ClaimInfo `json:"claim_info"` TxType TxType `json:"tx_type"` // 0: unknown, 1: deposit, 2: withdraw, 3: refund BlockTimestamp uint64 `json:"block_timestamp"` }
TxHistoryInfo the schema of tx history infos
type TxStatusType ¶
type TxStatusType int
const ( TxStatusTypeSent TxStatusType = iota TxStatusTypeConsumed TxStatusTypeDropped )
Constants for TxStatusType.
Click to show internal directories.
Click to hide internal directories.