run/
run.rs

1use ordiscan::{GetInscriptionInfoParams, GetListOfInscriptionParams, Ordiscan, Sort};
2
3#[tokio::main]
4async fn main() -> Result<(), Box<dyn std::error::Error>> {
5  let api_key = String::from("<API-KEY-HERE>");
6  let ordiclient = Ordiscan::new(api_key).unwrap();
7
8  // get address acitivity
9  let address_activity = ordiclient
10    .get_address_activity("bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh")
11    .await?;
12
13  // get inscription info
14  let inspection_info = ordiclient
15    .get_inscription_info(GetInscriptionInfoParams {
16      id: Some("b183b76a2635d1937a60e3eb12e868a64e5fff5e56819cb348cd442877bf95e7i0"),
17      number: None,
18    })
19    .await?;
20
21  // get list of inscription info
22  let list_of_inscriptions = ordiclient
23    .get_list_of_inscriptions(GetListOfInscriptionParams {
24      address: Some("bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh"),
25      sort: Sort::InscriptionNumberDesc,
26      content_type: None,
27      after_number: None,
28      before_number: None,
29    })
30    .await?;
31
32  println!("{:#?}", address_activity);
33  println!("{:#?}", inspection_info);
34  println!("{:#?}", list_of_inscriptions);
35
36  Ok(())
37}