@tari-project/ootle-ts-bindings 1.50.0 → 1.50.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -58,6 +58,10 @@ export function shortenSubstateId(substateId, start = 4, end = 4) {
58
58
  return parts[0] + "_" + shortenString(parts[1], start, end);
59
59
  }
60
60
  export function shortenString(string, start = 8, end = 8) {
61
+ // The number 3 is from the characters for ellipsis
62
+ if (string.length < start + end + 3) {
63
+ return string;
64
+ }
61
65
  return string.substring(0, start) + "..." + string.slice(-end);
62
66
  }
63
67
  export function rejectReasonToString(reason) {
@@ -9,6 +9,7 @@ export * from "./types/tari-indexer-client/ValidatorConsensusState";
9
9
  export * from "./types/tari-indexer-client/StreamTransactionEventsRequest";
10
10
  export * from "./types/tari-indexer-client/QueryTransactionEventsRequest";
11
11
  export * from "./types/tari-indexer-client/TransactionEntry";
12
+ export * from "./types/tari-indexer-client/TransactionSource";
12
13
  export * from "./types/tari-indexer-client/InspectSubstateRequest";
13
14
  export * from "./types/tari-indexer-client/ListSubstateItem";
14
15
  export * from "./types/tari-indexer-client/IndexerTransactionFinalizedResult";
@@ -11,6 +11,7 @@ export * from "./types/tari-indexer-client/ValidatorConsensusState";
11
11
  export * from "./types/tari-indexer-client/StreamTransactionEventsRequest";
12
12
  export * from "./types/tari-indexer-client/QueryTransactionEventsRequest";
13
13
  export * from "./types/tari-indexer-client/TransactionEntry";
14
+ export * from "./types/tari-indexer-client/TransactionSource";
14
15
  export * from "./types/tari-indexer-client/InspectSubstateRequest";
15
16
  export * from "./types/tari-indexer-client/ListSubstateItem";
16
17
  export * from "./types/tari-indexer-client/IndexerTransactionFinalizedResult";
@@ -23,12 +23,25 @@ export type GetIndexerInfoResponse = {
23
23
  */
24
24
  current_epoch: Epoch;
25
25
  /**
26
- * How many epochs past its terminal epoch this indexer retains a transaction submitted through it
27
- * before pruning the record. `None` means transactions are retained indefinitely. Transaction
28
- * receipts are retained regardless of this setting. A client paginating transaction history hits
29
- * this floor rather than the start of the chain.
26
+ * How many epochs past its terminal epoch this indexer retains a transaction before pruning the
27
+ * record. `None` means transactions are retained indefinitely. Transaction receipts are retained
28
+ * regardless of this setting. A client paginating transaction history hits this floor rather
29
+ * than the start of the chain.
30
30
  */
31
31
  transaction_retention_epochs: bigint | null;
32
+ /**
33
+ * Whether this indexer stores transactions observed on the network gossip topic in addition to
34
+ * those submitted directly to it. When false, a transaction submitted elsewhere is unknown to
35
+ * this indexer until its receipt is synced.
36
+ *
37
+ * Even when true the stored set of transactions is best effort: an indexer misses whatever was
38
+ * gossiped while it was offline or while its inbound queue was full, and there is no backfill.
39
+ * Transaction receipts carry no such caveat — they are synced from network state and are
40
+ * complete from genesis — so a committed transaction always has a receipt even when its body is
41
+ * missing here. Transactions that never committed get no receipt, so gossip is the only source
42
+ * for them.
43
+ */
44
+ index_gossiped_transactions: boolean;
32
45
  /**
33
46
  * Whether substates served by this indexer are verified against a shard group committee proof
34
47
  * before being returned. When false, values are served as fetched from a single validator and
@@ -1,5 +1,11 @@
1
1
  import type { TransactionId } from "../TransactionId";
2
+ import type { TransactionSource } from "./TransactionSource";
2
3
  export type ListRecentTransactionsRequest = {
3
4
  limit: number | null;
4
5
  last_id: TransactionId | null;
6
+ /**
7
+ * Restrict the listing to transactions from this source. Omitted, transactions from every
8
+ * source are listed.
9
+ */
10
+ source: TransactionSource | null;
5
11
  };
@@ -1,6 +1,7 @@
1
1
  import type { PrunedTransaction } from "../PrunedTransaction";
2
2
  import type { TransactionId } from "../TransactionId";
3
3
  import type { TransactionResultSummary } from "./TransactionResultSummary";
4
+ import type { TransactionSource } from "./TransactionSource";
4
5
  export type TransactionEntry = {
5
6
  transaction_id: TransactionId;
6
7
  /**
@@ -19,4 +20,8 @@ export type TransactionEntry = {
19
20
  * this indexer. None if the transaction was not rejected at submission.
20
21
  */
21
22
  rejected_reason: string | null;
23
+ /**
24
+ * Where this indexer learned of the transaction.
25
+ */
26
+ source: TransactionSource;
22
27
  };
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Where an indexer learned of a transaction it has stored.
3
+ */
4
+ export type TransactionSource = "local" | "gossip";
@@ -0,0 +1,2 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tari-project/ootle-ts-bindings",
3
- "version": "1.50.0",
3
+ "version": "1.50.1",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"