- `Object` - *filter*, transactions filter.
+ Optional
* `String` - *status*, transactions status, which can be `pending` or `completed`.
- * `String` - *from_chain*, transactions source chain, which can be `bytom` or `vapor`.
+ * `String` - *source_chain_name*, transactions source chain, which can be `bytom` or `vapor`.
* `String` - *source_tx_hash*, souce transaction hash string.
* `String` - *dest_tx_hash*, destination transaction hash string.
- `Object` - *sort*, transactions sorter.
`Object`:
-- `String` - *from_chain*, source chain name of the cross-chain transaction.
+- `String` - *source_chain_name*, source chain name of the cross-chain transaction.
- `Integer` - *source_block_height*, block height of the cross-chain transaction on the source chain.
- `String` - *source_block_hash*, block hash of the cross-chain transaction on the source chain.
- `Integer` - *source_tx_index*, transaction index in the source block.
},
"data":[
{
- "from_chain":"bytom",
+ "source_chain_name":"bytom",
"source_block_height":174,
"source_block_hash":"569a3a5a43910ea634a947fd092bb3085359db451235ae59c20daab4e4b0d274",
"source_tx_index":1,
txQuery := s.db.Preload("Chain").Preload("Reqs").Preload("Reqs.Asset").Where(txFilter)
// filter direction
- if fromChainName, err := listTxsReq.GetFilterString("from_chain"); err == nil && fromChainName != "" {
- txQuery = txQuery.Joins("join chains on chains.id = cross_transactions.chain_id").Where("chains.name = ?", fromChainName)
+ if sourceChainName, err := listTxsReq.GetFilterString("source_chain_name"); err == nil && sourceChainName != "" {
+ txQuery = txQuery.Joins("join chains on chains.id = cross_transactions.chain_id").Where("chains.name = ?", sourceChainName)
}
txQuery = txQuery.Order(fmt.Sprintf("cross_transactions.source_block_height %s", listTxsReq.Sorter.Order))
txQuery = txQuery.Order(fmt.Sprintf("cross_transactions.source_tx_index %s", listTxsReq.Sorter.Order))
}
return json.Marshal(&struct {
- FromChain string `json:"from_chain"`
+ SourceChainName string `json:"source_chain_name"`
SourceBlockHeight uint64 `json:"source_block_height"`
SourceBlockHash string `json:"source_block_hash"`
SourceTxIndex uint64 `json:"source_tx_index"`
Status string `json:"status"`
Reqs []*CrossTransactionReq `json:"crosschain_requests"`
}{
- FromChain: c.Chain.Name,
+ SourceChainName: c.Chain.Name,
SourceBlockHeight: c.SourceBlockHeight,
SourceBlockHash: c.SourceBlockHash,
SourceTxIndex: c.SourceTxIndex,