Skip to content

Commit

Permalink
fix(api): activity analytics (#529)
Browse files Browse the repository at this point in the history
* feat(inx): switch to stream-based updates

* fix(inx): stream-based mapper

* f

* cargo clippy

* clippy

* fix(api): activity analytics
  • Loading branch information
grtlr authored Aug 5, 2022
1 parent 0d29b37 commit a9b294a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
10 changes: 8 additions & 2 deletions bin/inx-chronicle/src/api/stardust/analytics/routes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ use chronicle::{
MongoDb,
},
types::stardust::block::{
AliasOutput, BasicOutput, FoundryOutput, NftOutput, TaggedDataPayload, TransactionPayload,
AliasOutput, BasicOutput, FoundryOutput, MilestonePayload, NftOutput, TaggedDataPayload, TransactionPayload,
TreasuryTransactionPayload,
},
};

Expand Down Expand Up @@ -38,8 +39,13 @@ pub fn routes() -> Router {
"/blocks",
Router::new()
.route("/", get(block_analytics::<()>))
.route("/milestone", get(block_analytics::<MilestonePayload>))
.route("/transaction", get(block_analytics::<TransactionPayload>))
.route("/tagged-data", get(block_analytics::<TaggedDataPayload>)),
.route("/tagged-data", get(block_analytics::<TaggedDataPayload>))
.route(
"/treasury-transaction",
get(block_analytics::<TreasuryTransactionPayload>),
),
)
.nest(
"/outputs",
Expand Down
4 changes: 3 additions & 1 deletion src/db/collections/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ pub use self::{
};
use crate::types::stardust::block::{
AliasOutput, BasicOutput, FoundryOutput, MilestonePayload, NftOutput, TaggedDataPayload, TransactionPayload,
TreasuryTransactionPayload,
};

/// Helper to specify a kind for an output type.
Expand Down Expand Up @@ -72,4 +73,5 @@ macro_rules! impl_payload_kind {
}
impl_payload_kind!(TransactionPayload, "transaction");
impl_payload_kind!(MilestonePayload, "milestone");
impl_payload_kind!(TaggedDataPayload, "tagged-data");
impl_payload_kind!(TaggedDataPayload, "tagged_data");
impl_payload_kind!(TreasuryTransactionPayload, "treasury_transaction");

0 comments on commit a9b294a

Please sign in to comment.