@@ -39,7 +39,7 @@ interface api {
3939 /// The live tip of the blockchain, following the upstream node.
4040 tip ,
4141 /// The immutable tip of the blockchain
42- /// e.g., The last block which has reached the absolute finality and can never rolls back.
42+ /// e.g., The last block which has reached the absolute finality and can never roll back.
4343 immutable-tip ,
4444 }
4545
@@ -56,7 +56,7 @@ interface api {
5656 /// Unknown network.
5757 unknown-network
5858 }
59-
59+
6060 /// Errors that can happen for block.
6161 enum block-error {
6262 /// Block is not found.
@@ -76,9 +76,9 @@ interface api {
7676 /// **Parameters**
7777 ///
7878 /// - `network` : The Cardano network to connect to (e.g., Mainnet, Preprod, Preview).
79- ///
79+ ///
8080 /// **Returns**
81- ///
81+ ///
8282 /// - `ok(network)` : A resource network, if successfully create network resource.
8383 /// - `error(create-network-error)` : If creating network resource failed.
8484 new : static func (network : cardano-network ) -> result <network , create-network-error >;
@@ -94,54 +94,52 @@ interface api {
9494 ///
9595 /// **Returns**
9696 ///
97- /// - `ok(u32)` : A unsigned integer represent the underlying 32-bit representation of subscription ID
98- /// resource. this subscription. Use to distinguishes events from different subscribers
99- /// and provides control over subscription management.The ID must be unique across all
100- /// active subscriptions.
97+ /// - `ok(u32)` : A unsigned integer representing the underlying 32-bit subscription resource ID.
98+ /// This is used to distinguish events from different subscribers and provides
99+ /// control over subscription management.The ID must be unique across all active subscriptions.
101100 /// - `error(subscribe-error)` : If subscription failed.
102101 subscribe-block : func (start : sync-slot ) -> result <u32 , subscribe-error >;
103102
104103 /// Subscribe to blockchain immutable rolls forward.
105104 ///
106105 /// This sets up a subscription to receive event when the immutable part of the blockchain
107106 /// roll forwards.
108- ///
107+ ///
109108 /// **Parameters**
110109 ///
111110 /// - `start` : The slot to begin following from.
112- ///
111+ ///
113112 /// **Returns**
114- ///
115- /// - `ok(u32)` : A unsigned integer represent the underlying 32-bit representation of subscription ID
116- /// resource. this subscription. Use to distinguishes events from different subscribers
117- /// and provides control over subscription management.The ID must be unique across all
118- /// active subscriptions.
113+ ///
114+ /// - `ok(u32)` : A unsigned integer representing the underlying 32-bit subscription resource ID.
115+ /// This is used to distinguish events from different subscribers and provides
116+ /// control over subscription management.The ID must be unique across all active subscriptions.
119117 /// - `error(subscribe-error)` : If subscription failed.
120118 subscribe-immutable-roll-forward : func (start : sync-slot ) -> result <u32 , subscribe-error >;
121119
122120 /// Get a block relative to `start` by `step` .
123121 ///
124122 /// **Parameters**
125123 /// - `start` : Slot to begin retrieval from, current tip if `None` .
126- /// - `step`
127- /// -`0` : the block at `start` , will return `None` if there is no block exactly at this `start` slot.
128- /// -`+n` : the `n` ‑th block *after* the given `start` slot.
129- /// –`‑n` : the `n` ‑th block *before* the given `start` slot.
130- ///
131- /// Note: For both `+n` and `-n` , the `start` does not need to be a true block.
132- /// They will return the block which appears at this block offset, given the arbitrary start point.
133- /// IF the `start` block does exist, it will never returned with a positive or negative `step` , as it is `step` 0.
134- ///
135- /// Example, Given three consecutive blocks at slots `100` , `200` and `300` the following will be returned:
124+ /// - `step`
125+ /// -`0` : the block at `start` , will return `None` if there is no block exactly at this `start` slot.
126+ /// -`+n` : the `n` ‑th block *after* the given `start` slot.
127+ /// –`‑n` : the `n` ‑th block *before* the given `start` slot.
128+ ///
129+ /// Note: For both `+n` and `-n` , the `start` does not need to be a true block.
130+ /// They will return the block which appears at this block offset, given the arbitrary start point.
131+ /// If the `start` block does exist, it will never be returned with a positive or negative `step` , as it is `step` 0.
132+ ///
133+ /// Example, Given three consecutive blocks at slots `100` , `200` and `300` the following will be returned:
136134 /// - `start = 100, step = 0` -> 100 (Exact match)
137135 /// - `start = 100, step = 2` -> 300 (Skips 200)
138136 /// - `start = 150, step = 1` -> 200 (Rounds up from 150)
139137 /// - `start = 200, step = 1` -> 300 (Forward iteration)
140138 /// - `start = 300, step = -2` -> 100 (Skips 200)
141139 /// - `start = 250, step = -2` -> 100 (Rounds down to 200 first)
142- ///
140+ ///
143141 /// **Returns**
144- ///
142+ ///
145143 /// - Returns a `block` resource, `None` if block cannot be retrieved.
146144 get-block : func (start : option <slot >, step : s64 ) -> option <block >;
147145
@@ -166,12 +164,12 @@ interface api {
166164 /// - `false` if the block is in the mutable part.
167165 is-immutable : func () -> bool ;
168166
169- /// Returns whether the block is the first block of a rollback.
170- ///
171- /// **Returns**
172- ///
167+ /// Returns whether the block is the first block of a rollback.
168+ ///
169+ /// **Returns**
170+ ///
173171 /// - `ok(bool)` True if the block is the first block of a rollback,
174- /// otherwise, False.
172+ /// otherwise, False.
175173 /// - `error(block-error)` : If block cannot be retrieved.
176174 is-rollback : func () -> result <bool , block-error >;
177175
@@ -224,7 +222,7 @@ interface api {
224222 /// **Parameters**
225223 ///
226224 /// - `label` : A metadata label used as a key to get the associated metadata.
227- ///
225+ ///
228226 /// **Returns**
229227 ///
230228 /// - `option<cbor>` : The CBOR format of the metadata, `None` if the label requested is not present.
@@ -234,12 +232,12 @@ interface api {
234232 /// Returns the transaction hash.
235233 ///
236234 /// **Returns**
237- ///
235+ ///
238236 /// - `option<txn-hash>` : Cardano transaction hash - Blake2b-256, `None` if cannot retrieve the transaction hash.
239237 get-txn-hash : func () -> option <txn-hash >;
240238
241239 /// Returns the raw CBOR representation of the transaction.
242- ///
240+ ///
243241 /// **Returns**
244242 ///
245243 /// - `option<cbor>` : The CBOR format of the transaction, `None` if cannot retrieve the raw transaction.
@@ -248,13 +246,13 @@ interface api {
248246
249247 resource subscription-id {
250248 /// Returns the network that this subscription is in.
251- ///
249+ ///
252250 /// **Returns**
253- ///
251+ ///
254252 /// - `cardano-network` : The Cardano network that this subscription is in.
255253 get-network : func () -> cardano-network ;
256254
257-
255+
258256 /// Unsubscribing block event of this `subscription-id` instance.
259257 /// Once this function is called, the subscription instance, `subscription-id` will be removed.
260258 unsubscribe : func ();
0 commit comments