ic_query/icrc/model/contracts/requests/
ledger_history.rs1use super::IcrcLedgerRequest;
8
9#[derive(Clone, Debug, Eq, PartialEq)]
16pub struct IcrcTransactionsRequest {
17 pub ledger: IcrcLedgerRequest,
19 pub start: u64,
20 pub limit: u32,
21 pub follow_archives: bool,
22}
23
24impl IcrcTransactionsRequest {
25 #[must_use]
26 pub const fn new(ledger: IcrcLedgerRequest, start: u64, limit: u32) -> Self {
27 Self {
28 ledger,
29 start,
30 limit,
31 follow_archives: false,
32 }
33 }
34
35 #[must_use]
36 pub const fn with_follow_archives(mut self, follow_archives: bool) -> Self {
37 self.follow_archives = follow_archives;
38 self
39 }
40}
41
42#[derive(Clone, Debug, Eq, PartialEq)]
49pub struct IcrcArchivesRequest {
50 pub ledger: IcrcLedgerRequest,
52 pub from_canister_id: Option<String>,
53}
54
55impl IcrcArchivesRequest {
56 #[must_use]
57 pub const fn new(ledger: IcrcLedgerRequest) -> Self {
58 Self {
59 ledger,
60 from_canister_id: None,
61 }
62 }
63
64 #[must_use]
65 pub fn with_from_canister_id(mut self, from_canister_id: impl Into<String>) -> Self {
66 self.from_canister_id = Some(from_canister_id.into());
67 self
68 }
69}