@tari-project/ootle-ts-bindings 1.49.1 → 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) {
@@ -1,6 +1,7 @@
1
1
  export * from "./types/tari-indexer-client/IndexerSubmitTransactionResponse";
2
2
  export * from "./types/tari-indexer-client/GetTransactionReceiptResponse";
3
3
  export * from "./types/tari-indexer-client/GetNetworkInfoResponse";
4
+ export * from "./types/tari-indexer-client/GetIndexerInfoResponse";
4
5
  export * from "./types/tari-indexer-client/WatchedSubstateItem";
5
6
  export * from "./types/tari-indexer-client/GetUtxoUpdatesRequest";
6
7
  export * from "./types/tari-indexer-client/WatchedTemplateItem";
@@ -8,6 +9,7 @@ export * from "./types/tari-indexer-client/ValidatorConsensusState";
8
9
  export * from "./types/tari-indexer-client/StreamTransactionEventsRequest";
9
10
  export * from "./types/tari-indexer-client/QueryTransactionEventsRequest";
10
11
  export * from "./types/tari-indexer-client/TransactionEntry";
12
+ export * from "./types/tari-indexer-client/TransactionSource";
11
13
  export * from "./types/tari-indexer-client/InspectSubstateRequest";
12
14
  export * from "./types/tari-indexer-client/ListSubstateItem";
13
15
  export * from "./types/tari-indexer-client/IndexerTransactionFinalizedResult";
@@ -3,6 +3,7 @@
3
3
  export * from "./types/tari-indexer-client/IndexerSubmitTransactionResponse";
4
4
  export * from "./types/tari-indexer-client/GetTransactionReceiptResponse";
5
5
  export * from "./types/tari-indexer-client/GetNetworkInfoResponse";
6
+ export * from "./types/tari-indexer-client/GetIndexerInfoResponse";
6
7
  export * from "./types/tari-indexer-client/WatchedSubstateItem";
7
8
  export * from "./types/tari-indexer-client/GetUtxoUpdatesRequest";
8
9
  export * from "./types/tari-indexer-client/WatchedTemplateItem";
@@ -10,6 +11,7 @@ export * from "./types/tari-indexer-client/ValidatorConsensusState";
10
11
  export * from "./types/tari-indexer-client/StreamTransactionEventsRequest";
11
12
  export * from "./types/tari-indexer-client/QueryTransactionEventsRequest";
12
13
  export * from "./types/tari-indexer-client/TransactionEntry";
14
+ export * from "./types/tari-indexer-client/TransactionSource";
13
15
  export * from "./types/tari-indexer-client/InspectSubstateRequest";
14
16
  export * from "./types/tari-indexer-client/ListSubstateItem";
15
17
  export * from "./types/tari-indexer-client/IndexerTransactionFinalizedResult";
@@ -0,0 +1,62 @@
1
+ import type { Epoch } from "../Epoch";
2
+ import type { Network } from "../Network";
3
+ import type { RistrettoPublicKeyBytes } from "../RistrettoPublicKeyBytes";
4
+ /**
5
+ * The configuration of a single indexer node, as far as it affects what its API returns. Every field
6
+ * is local to the node answering the request: two indexers on the same network can disagree on all of
7
+ * them, so a client that cares must ask the node it is talking to.
8
+ */
9
+ export type GetIndexerInfoResponse = {
10
+ /**
11
+ * The indexer's build version.
12
+ */
13
+ version: string;
14
+ network: Network;
15
+ network_byte: number;
16
+ /**
17
+ * The sidechain this indexer follows, if it is configured for one.
18
+ */
19
+ sidechain_id: RistrettoPublicKeyBytes | null;
20
+ /**
21
+ * The current epoch, so a client can resolve the epoch-denominated fields below against a clock
22
+ * without a second request.
23
+ */
24
+ current_epoch: Epoch;
25
+ /**
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
+ */
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;
45
+ /**
46
+ * Whether substates served by this indexer are verified against a shard group committee proof
47
+ * before being returned. When false, values are served as fetched from a single validator and
48
+ * carry no proof of correctness.
49
+ */
50
+ verify_substate_proofs: boolean;
51
+ /**
52
+ * How long this indexer may serve a cached substate as the latest version of that substate, in
53
+ * seconds. A read of the latest version may be up to this stale; reads of a specific version are
54
+ * unaffected.
55
+ */
56
+ latest_substate_cache_ttl_secs: bigint;
57
+ /**
58
+ * Whether this indexer stores every event on the network. When false it is configured with event
59
+ * filters, so event queries answer over a subset and absence is not proof an event did not occur.
60
+ */
61
+ indexes_all_events: boolean;
62
+ };
@@ -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.49.1",
3
+ "version": "1.50.1",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"