canic_core/spec/ic/
cycles.rs

1use crate::spec::prelude::*;
2
3///
4/// IcpXdrConversionRate
5/// Canonical payload from the cycles minting canister describing ICP/XDR rate.
6///
7
8#[derive(CandidType, Debug, Deserialize)]
9pub struct IcpXdrConversionRate {
10    pub timestamp_seconds: u64,
11    pub xdr_permyriad_per_icp: u64,
12}
13
14///
15/// IcpXdrConversionRateResponse
16/// Wrapper around the rate record returned by `get_icp_xdr_conversion_rate`.
17///
18
19#[derive(CandidType, Debug, Deserialize)]
20pub struct IcpXdrConversionRateResponse {
21    pub data: IcpXdrConversionRate,
22}
23
24///
25/// NotifyTopUpArgs
26/// Arguments expected by the cycles canister when notifying a top-up.
27///
28
29#[derive(CandidType, Deserialize)]
30pub struct NotifyTopUpArgs {
31    pub block_index: u64,
32    pub canister_id: Principal,
33}