@@ -34,10 +34,10 @@ pub type BitcoinAddress = String;
3434/// Block Hash.
3535pub type BlockHash = Vec < u8 > ;
3636
37- /// Element in the Response of [bitcoin_get_current_fee_percentiles](super::bitcoin_get_current_fee_percentiles).
37+ /// Element in the Response of [` bitcoin_get_current_fee_percentiles` ](super::bitcoin_get_current_fee_percentiles).
3838pub type MillisatoshiPerByte = u64 ;
3939
40- /// Identifier of [Utxo].
40+ /// Identifier of [` Utxo` ].
4141#[ derive(
4242 CandidType , Serialize , Deserialize , Debug , PartialEq , Eq , PartialOrd , Ord , Hash , Clone , Default ,
4343) ]
@@ -53,7 +53,7 @@ pub struct Outpoint {
5353 CandidType , Serialize , Deserialize , Debug , PartialEq , Eq , PartialOrd , Ord , Hash , Clone , Default ,
5454) ]
5555pub struct Utxo {
56- /// See [Outpoint].
56+ /// See [` Outpoint` ].
5757 pub outpoint : Outpoint ,
5858 /// Value in the units of satoshi.
5959 pub value : Satoshi ,
@@ -72,38 +72,38 @@ pub enum UtxoFilter {
7272 /// Page reference.
7373 ///
7474 /// DON'T construct it from scratch.
75- /// Only get it from the `next_page` field of [GetUtxosResponse].
75+ /// Only get it from the `next_page` field of [` GetUtxosResponse` ].
7676 #[ serde( rename = "page" ) ]
7777 Page ( Vec < u8 > ) ,
7878}
7979
80- /// Argument type of [bitcoin_get_balance](super::bitcoin_get_balance).
80+ /// Argument type of [` bitcoin_get_balance` ](super::bitcoin_get_balance).
8181#[ derive(
8282 CandidType , Serialize , Deserialize , Debug , PartialEq , Eq , PartialOrd , Ord , Hash , Clone , Default ,
8383) ]
8484pub struct GetBalanceRequest {
85- /// See [BitcoinAddress].
85+ /// See [` BitcoinAddress` ].
8686 pub address : BitcoinAddress ,
87- /// See [BitcoinNetwork].
87+ /// See [` BitcoinNetwork` ].
8888 pub network : BitcoinNetwork ,
8989 /// Minimum number of confirmations. There is an upper bound of 144. Typically set to a value around 6 in practice.
9090 pub min_confirmations : Option < u32 > ,
9191}
9292
93- /// Argument type of [bitcoin_get_utxos](super::bitcoin_get_utxos).
93+ /// Argument type of [` bitcoin_get_utxos` ](super::bitcoin_get_utxos).
9494#[ derive(
9595 CandidType , Serialize , Deserialize , Debug , PartialEq , Eq , PartialOrd , Ord , Hash , Clone , Default ,
9696) ]
9797pub struct GetUtxosRequest {
98- /// See [BitcoinAddress].
98+ /// See [` BitcoinAddress` ].
9999 pub address : BitcoinAddress ,
100- /// See [BitcoinNetwork].
100+ /// See [` BitcoinNetwork` ].
101101 pub network : BitcoinNetwork ,
102- /// See [UtxoFilter].
102+ /// See [` UtxoFilter` ].
103103 pub filter : Option < UtxoFilter > ,
104104}
105105
106- /// Response type of [bitcoin_get_utxos](super::bitcoin_get_utxos).
106+ /// Response type of [` bitcoin_get_utxos` ](super::bitcoin_get_utxos).
107107#[ derive(
108108 CandidType , Serialize , Deserialize , Debug , PartialEq , Eq , PartialOrd , Ord , Hash , Clone , Default ,
109109) ]
@@ -116,11 +116,11 @@ pub struct GetUtxosResponse {
116116 pub tip_height : u32 ,
117117 /// Page reference when the response needs to be paginated.
118118 ///
119- /// To be used in [UtxoFilter::Page].
119+ /// To be used in [` UtxoFilter::Page` ].
120120 pub next_page : Option < Vec < u8 > > ,
121121}
122122
123- /// Argument type of [bitcoin_send_transaction](super::bitcoin_send_transaction).
123+ /// Argument type of [` bitcoin_send_transaction` ](super::bitcoin_send_transaction).
124124#[ derive(
125125 CandidType , Serialize , Deserialize , Debug , PartialEq , Eq , PartialOrd , Ord , Hash , Clone , Default ,
126126) ]
@@ -130,11 +130,11 @@ pub struct SendTransactionRequest {
130130 /// Several checks are performed.
131131 /// See [IC method `bitcoin_send_transaction`](https://internetcomputer.org/docs/current/references/ic-interface-spec/#ic-bitcoin_send_transaction).
132132 pub transaction : Vec < u8 > ,
133- /// See [BitcoinNetwork].
133+ /// See [` BitcoinNetwork` ].
134134 pub network : BitcoinNetwork ,
135135}
136136
137- /// Argument type of [bitcoin_get_current_fee_percentiles](super::bitcoin_get_current_fee_percentiles).
137+ /// Argument type of [` bitcoin_get_current_fee_percentiles` ](super::bitcoin_get_current_fee_percentiles).
138138#[ derive(
139139 CandidType ,
140140 Serialize ,
@@ -150,6 +150,41 @@ pub struct SendTransactionRequest {
150150 Default ,
151151) ]
152152pub struct GetCurrentFeePercentilesRequest {
153- /// See [BitcoinNetwork].
153+ /// See [` BitcoinNetwork` ].
154154 pub network : BitcoinNetwork ,
155155}
156+
157+ /// Argument type of [`bitcoin_get_block_headers`](super::bitcoin_get_block_headers).
158+ #[ derive(
159+ CandidType ,
160+ Serialize ,
161+ Deserialize ,
162+ Debug ,
163+ PartialEq ,
164+ Eq ,
165+ PartialOrd ,
166+ Ord ,
167+ Hash ,
168+ Clone ,
169+ Copy ,
170+ Default ,
171+ ) ]
172+ pub struct GetBlockHeadersRequest {
173+ /// The starting block height for the request.
174+ pub start_height : u32 ,
175+ /// The ending block height for the request, or `None` for the current tip.
176+ pub end_height : Option < u32 > ,
177+ /// See [`BitcoinNetwork`].
178+ pub network : BitcoinNetwork ,
179+ }
180+
181+ /// Response type of [`bitcoin_get_block_headers`](super::bitcoin_get_block_headers).
182+ #[ derive(
183+ CandidType , Serialize , Deserialize , Debug , PartialEq , Eq , PartialOrd , Ord , Hash , Clone , Default ,
184+ ) ]
185+ pub struct GetBlockHeadersResponse {
186+ /// The tip of the blockchain when this request was filled.
187+ pub tip_height : u32 ,
188+ /// The requested block headers.
189+ pub block_headers : Vec < Vec < u8 > > ,
190+ }
0 commit comments