Documentation ¶
Index ¶
- Constants
- func GetBlockTableName() string
- func GetContractTableName() string
- func GetOrderTableName() string
- func GetPorterTransferedAndCompletion(addr string, e *xorm.Engine) (transfered int64, completion float32, err error)
- func InitMySQLXorm(addr string, showSQL bool) *xorm.Engine
- func InsertBlock(block *Block, db *xorm.Engine) error
- func InsertOrder(order *Order, db *xorm.Engine) error
- func Keccak256EncodePackedContractOrder(co *contracts.CrossControllerOrder) (orderHash [32]byte)
- func UpdateBlock(id int, blockNumber int64, db *xorm.Engine) error
- func UpdateOrderProof(id int64, proof string, db *xorm.Engine) error
- func UpdateOrderReceiptStatus(receiptTxHash string, order *Order, db *xorm.Engine) error
- func UpdateOrderStatus(order *Order, db *xorm.Engine) error
- type Block
- type Chain
- type CostReq
- type CostResp
- type CrossChainPair
- type Fee
- type Message
- type NextIDResp
- type Order
- type Porter
- type Proof
- type ProofReq
- type RawProof
- type RawZkProof
- type Router
- type RouterReq
- type RouterResponse
- type SupportCrossChains
- type ZkProof
Constants ¶
View Source
const ( PARAM_ERROR string = "Params error" AMOUNT_ERROR string = "Amount error" PONG string = "Pong" INTERNAL_ERROR string = "Internal error" )
View Source
const ( DB_TABLE_ORDER = "orders" DB_TABLE_CONTRACT = "contract_config" DB_TABLE_BLOCK = "block" )
Variables ¶
This section is empty.
Functions ¶
func GetBlockTableName ¶
func GetBlockTableName() string
func GetContractTableName ¶
func GetContractTableName() string
func GetOrderTableName ¶
func GetOrderTableName() string
func Keccak256EncodePackedContractOrder ¶
func Keccak256EncodePackedContractOrder(co *contracts.CrossControllerOrder) (orderHash [32]byte)
Types ¶
type Block ¶
type Block struct { ID int `xorm:"'id' pk autoincr"` ChainId int `xorm:"chain_id" json:"chain_id"` Contract string `xorm:"contract" json:"contract"` BlockNumber int64 `xorm:"block_number" json:"block_number"` Created time.Time `xorm:"created" json:"created"` Updated time.Time `xorm:"updated" json:"updated"` }
type CrossChainPair ¶
type NextIDResp ¶
type NextIDResp struct {
NextOrderID int64 `json:"next_order_id"`
}
type Order ¶
type Order struct { ID int64 `xorm:"'id' pk" json:"id"` PoterId string `xorm:"poter_id" json:"poter_id"` SrcChainId uint64 `xorm:"src_chain_id" json:"src_chain_id"` SrcAddress string `xorm:"src_address" json:"src_address"` SrcToken string `xorm:"src_token" json:"src_token"` SrcAmount float64 `xorm:"src_amount" json:"src_amount"` SrcTxHash string `xorm:"src_tx_hash" json:"src_tx_hash"` FixedFee float64 `xorm:"fixed_fee" json:"fixed_fee"` FloatFee float64 `xorm:"float_fee" json:"float_fee"` DestChainId uint64 `xorm:"dest_chain_id" json:"dest_chain_id"` DestAddress string `xorm:"dest_address" json:"dest_address"` DestToken string `xorm:"dest_token" json:"dest_token"` DestAmount float64 `xorm:"dest_amount" json:"dest_amount"` DestTxHash string `xorm:"dest_tx_hash" json:"dest_tx_hash"` DestTxStatus int `xorm:"dest_tx_status" json:"dest_tx_status"` CommitmentIdx uint64 `xorm:"commitment_idx" json:"commitment_idx"` AddCommitmentTxHash string `xorm:"addcommitment_tx" json:"addcommitment_tx"` AddCommitmentTxStatus int `xorm:"addcommitment_tx_status" json:"addcommitment_tx_status"` Proof string `xorm:"proof" json:"proof"` RawProof string `xorm:"raw_proof" json:"raw_proof"` ReceiptTxHash string `xorm:"receipt_tx_hash" json:"receipt_tx_hash"` ReceiptTxStatus int `xorm:"receipt_tx_status" json:"receipt_tx_status"` Created time.Time `xorm:"created" json:"created"` FinishedTime time.Time `xorm:"finished_time" json:"finish_time"` Updated time.Time `xorm:"updated" json:"updated"` Status int `xorm:"status" json:"status"` RZKP *RawZkProof `xorm:"-"` ZKP *ZkProof `xorm:"-"` }
func GetOrderList ¶
type RawZkProof ¶
func (*RawZkProof) RawProofToZkProof ¶
func (rp *RawZkProof) RawProofToZkProof() (zProof *ZkProof)
type RouterResponse ¶
type SupportCrossChains ¶
type SupportCrossChains struct {
Pairs []*CrossChainPair `json:"chain_pairs"`
}
Click to show internal directories.
Click to hide internal directories.