You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/common/src/GRPCClient.ts
+147-1Lines changed: 147 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -308,7 +308,7 @@ export class ConcordiumGRPCClient {
308
308
*
309
309
* @param transaction the transaction to send to the node
310
310
* @param signature the signatures on the signing digest of the transaction
311
-
* @returns The transaction hash as a byte array
311
+
* @returns The transaction hash as a hex-encoded string
312
312
*/
313
313
asyncsendAccountTransaction(
314
314
transaction: v1.AccountTransaction,
@@ -1503,6 +1503,126 @@ export class ConcordiumGRPCClient {
1503
1503
);
1504
1504
}
1505
1505
1506
+
/**
1507
+
* Get the projected earliest time at which a particular baker will be required to bake a block.
1508
+
*
1509
+
* If the baker is not a baker for the current reward period, this returns a timestamp at the
1510
+
* start of the next reward period. If the baker is a baker for the current reward period, the
1511
+
* earliest win time is projected from the current round forward, assuming that each round after
1512
+
* the last finalized round will take the minimum block time. (If blocks take longer, or timeouts
1513
+
* occur, the actual time may be later, and the reported time in subsequent queries may reflect
1514
+
* this.) At the end of an epoch (or if the baker is not projected to bake before the end of the
1515
+
* epoch) the earliest win time for a (current) baker will be projected as the start of the next
1516
+
* epoch. This is because the seed for the leader election is updated at the epoch boundary, and
1517
+
* so the winners cannot be predicted beyond that. Note that in some circumstances the returned
1518
+
* timestamp can be in the past, especially at the end of an epoch.
1519
+
*
1520
+
* @throws an `UNAVAILABLE` RPC error if the current consensus version is 0 (prior to protocol version 6), as the endpoint is only supported from consensus version 1 (from protocol version 6).
1521
+
*
1522
+
* @param {v1.BakerId} baker - The baker that should be queried for.
1523
+
*
1524
+
* @returns {v1.Timestamp} The projected earliest time at which a particular baker will be required to bake a block, as a unix timestamp in milliseconds.
* Get the list of bakers that won the lottery in a particular historical epoch (i.e. the
1577
+
* last finalized block is in a later epoch). This lists the winners for each round in the
1578
+
* epoch, starting from the round after the last block in the previous epoch, running to
1579
+
* the round before the first block in the next epoch. It also indicates if a block in each
1580
+
* round was included in the finalized chain.
1581
+
*
1582
+
* The following error cases are possible:
1583
+
* @throws a `NOT_FOUND` RPC error if the query specifies an unknown block.
1584
+
* @throws an `UNAVAILABLE` RPC error if the query is for an epoch that is not finalized in the current genesis index, or is for a future genesis index.
1585
+
* @throws an `INVALID_ARGUMENT` RPC error if the query is for an epoch that is not finalized for a past genesis index.
1586
+
* @throws an `INVALID_ARGUMENT` RPC error if the query is for a genesis index at consensus version 0.
1587
+
* @throws an `INVALID_ARGUMENT` RPC error if the input `EpochRequest` is malformed.
1588
+
* @throws an `UNAVAILABLE` RPC error if the endpoint is disabled on the node.
1589
+
*
1590
+
* @param {HexString | v1.RelativeEpochRequest } epochRequest - Consists of either a hex-encoded block hash or a relative epoch request consisting of a genesis index and an epoch. If none is passed, it queries the last finalized block.
1591
+
*
1592
+
* @returns {v1.WinningBaker} A stream of winning bakers for a given epoch.
* Get the block hash of the first finalized block in a specified epoch.
1605
+
*
1606
+
* The following error cases are possible:
1607
+
* @throws - a `NOT_FOUND` RPC error if the query specifies an unknown block.
1608
+
* @throws - an `UNAVAILABLE` RPC error if the query is for an epoch that is not finalized in the current genesis index, or is for a future genesis index.
1609
+
* @throws - an `INVALID_ARGUMENT` RPC error if the query is for an epoch with no finalized blocks for a past genesis index.
1610
+
* @throws - an `INVALID_ARGUMENT` RPC error if the input `EpochRequest` is malformed.
1611
+
* @throws - an `UNAVAILABLE` RPC error if the endpoint is disabled on the node.
1612
+
*
1613
+
* @param {HexString | v1.RelativeEpochRequest } epochRequest - Consists of either a hex-encoded block hash or a relative epoch request consisting of a genesis index and an epoch. If none is passed, it queries the last finalized block.
1614
+
*
1615
+
* @returns {HexString} The block hash as a hex encoded string.
0 commit comments