Skip to content

Commit

Permalink
fix: api. (#261)
Browse files Browse the repository at this point in the history
* fix: api.

* fix lint.
  • Loading branch information
chinyuchan authored Jun 25, 2024
1 parent ea11561 commit 226283f
Showing 1 changed file with 19 additions and 22 deletions.
41 changes: 19 additions & 22 deletions explorer/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,28 +63,25 @@ async fn main() -> Result<()> {
.route("/api/address/count", get(get_address_count))
.route("/api/chain/statistics", get(get_statistics))
.route("/api/txs/distribute", get(get_tx_distribute))
.route("/api/v2/txs/distribute", get(get_tx_distribute))
.route("/api/v2/address/count", get(get_address_count))
.route("/api/v2/chain/statistic", get(get_statistics))
.route("/api/v2/number/block", get(get_block_by_num))
.route("/api/v2/hash/block", get(get_block_by_hash))
.route("/api/v2/blocks", get(get_blocks))
.route("/api/v2/hash/tx", get(get_tx_by_hash))
.route("/api/v2/txs", get(get_txs))
.route("/api/v2/assets", get(get_assets))
.route("/api/v2/hash/claim", get(get_claim_by_tx_hash))
.route("/api/v2/claims", get(get_claims))
.route("/api/v2/hash/delegation", get(get_delegation_by_tx_hash))
.route("/api/v2/delegations", get(get_delegations))
.route(
"/api/v2/hash/undelegation",
get(get_undelegation_by_tx_hash),
)
.route("/api/v2/undelegations", get(get_undelegations))
.route("/api/v2/hash/n2e", get(get_n2e_by_tx_hash))
.route("/api/v2/n2es", get(get_n2e_txs))
.route("/api/v2/hash/e2n", get(get_e2n_by_tx_hash))
.route("/api/v2/e2ns", get(get_e2n_txs))
.route("/api/txs/distribute", get(get_tx_distribute))
.route("/api/address/count", get(get_address_count))
.route("/api/chain/statistic", get(get_statistics))
.route("/api/number/block", get(get_block_by_num))
.route("/api/hash/block", get(get_block_by_hash))
.route("/api/blocks", get(get_blocks))
.route("/api/hash/tx", get(get_tx_by_hash))
.route("/api/txs", get(get_txs))
.route("/api/assets", get(get_assets))
.route("/api/hash/claim", get(get_claim_by_tx_hash))
.route("/api/claims", get(get_claims))
.route("/api/hash/delegation", get(get_delegation_by_tx_hash))
.route("/api/delegations", get(get_delegations))
.route("/api/hash/undelegation", get(get_undelegation_by_tx_hash))
.route("/api/undelegations", get(get_undelegations))
.route("/api/hash/n2e", get(get_n2e_by_tx_hash))
.route("/api/n2es", get(get_n2e_txs))
.route("/api/hash/e2n", get(get_e2n_by_tx_hash))
.route("/api/e2ns", get(get_e2n_txs))
.layer(cors)
.with_state(app_state);
let listener = tokio::net::TcpListener::bind(&addr).await.unwrap();
Expand Down

0 comments on commit 226283f

Please sign in to comment.