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

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) {
package/dist/index.d.ts CHANGED
@@ -55,7 +55,6 @@ export * from "./types/EntityId";
55
55
  export * from "./types/Epoch";
56
56
  export * from "./types/Era";
57
57
  export * from "./types/Event";
58
- export * from "./types/EvictNodeAtom";
59
58
  export * from "./types/EvidenceInputLockData";
60
59
  export * from "./types/Evidence";
61
60
  export * from "./types/ExecuteResult";
package/dist/index.js CHANGED
@@ -57,7 +57,6 @@ export * from "./types/EntityId";
57
57
  export * from "./types/Epoch";
58
58
  export * from "./types/Era";
59
59
  export * from "./types/Event";
60
- export * from "./types/EvictNodeAtom";
61
60
  export * from "./types/EvidenceInputLockData";
62
61
  export * from "./types/Evidence";
63
62
  export * from "./types/ExecuteResult";
@@ -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";
@@ -73,4 +73,13 @@ export type BlockHeader = {
73
73
  * Currently, this is used to store the block's sidechain_id (if applicable).
74
74
  */
75
75
  extra_data: ExtraData;
76
+ /**
77
+ * The protocol version this block was produced under, resolved from the network's activation schedule at
78
+ * [`Self::epoch`]. It makes the block self-describing: [`Self::calculate_hash`] and the L1 verifier in
79
+ * `tari_sidechain` both select the hash schema from this field rather than from the schedule.
80
+ *
81
+ * A header that carries no version is under [`ProtocolVersion::V0`], so blocks written before the field
82
+ * existed decode and hash unchanged.
83
+ */
84
+ protocol_version: number;
76
85
  };
@@ -1,5 +1,4 @@
1
1
  import type { EndEpochAtom } from "./EndEpochAtom";
2
- import type { EvictNodeAtom } from "./EvictNodeAtom";
3
2
  import type { ForeignProposalAtom } from "./ForeignProposalAtom";
4
3
  import type { TransactionAtom } from "./TransactionAtom";
5
4
  export type Command = {
@@ -14,8 +13,6 @@ export type Command = {
14
13
  SomeAccept: TransactionAtom;
15
14
  } | {
16
15
  ForeignProposal: ForeignProposalAtom;
17
- } | {
18
- EvictNode: EvictNodeAtom;
19
16
  } | {
20
17
  EndEpoch: EndEpochAtom;
21
18
  };
@@ -17,4 +17,10 @@ export type FeeReceipt = {
17
17
  * Breakdown of fee costs
18
18
  */
19
19
  cost_breakdown: FeeBreakdown;
20
+ /**
21
+ * The share of `total_fees_paid` that is burned rather than paid to leaders: `⌊paid × rate / 10_000⌋` at
22
+ * the exhaust burn rate in force for the execution epoch. Settled over what was collected, so it is never
23
+ * charged to the payer and never appears in `cost_breakdown`.
24
+ */
25
+ exhaust_burn: bigint;
20
26
  };
@@ -1 +1 @@
1
- export type FeeSource = "Initial" | "RuntimeCall" | "Storage" | "TransactionWeight" | "SignatureVerification" | "TemplateLoad" | "SubstateCreate" | "WasmExecution" | "TemplatePublish" | "ExhaustBurn" | "NativeExecution";
1
+ export type FeeSource = "Initial" | "RuntimeCall" | "Storage" | "TransactionWeight" | "TemplateLoad" | "SubstateCreate" | "WasmExecution" | "TemplatePublish" | "Reserved" | "NativeExecution";
@@ -1,4 +1,7 @@
1
1
  /**
2
2
  * Representation of a 64-byte hash value
3
+ *
4
+ * Encoded as a CBOR byte string rather than an array of integers, so it crosses the engine
5
+ * boundary in 66 bytes rather than ~130.
3
6
  */
4
7
  export type Hash64 = string;
@@ -20,4 +20,15 @@ export type ResourceAccessRules = {
20
20
  freeze_updater: UpdateRule;
21
21
  update_metadata: AccessRule;
22
22
  metadata_updater: UpdateRule;
23
+ /**
24
+ * Who may install, replace or remove the resource's [`AuthHook`](crate::AuthHook). The hook itself is not
25
+ * an [`AccessRule`], so this updater stands alone rather than pairing with one.
26
+ *
27
+ * A hook runs on nearly every resource action, so one that panics or denies unconditionally takes the
28
+ * resource offline and strands the balances in its vaults. `Locked` — the default — keeps a hook binding
29
+ * for the life of the resource; anything else lets the hook be repaired or retired, at the cost of letting
30
+ * whoever satisfies the updater change the rules that existing holders are relying on — up to and
31
+ * including giving a hook-free resource a hook.
32
+ */
33
+ auth_hook_updater: UpdateRule;
23
34
  };
@@ -13,4 +13,8 @@ export type RuleRequirement = {
13
13
  ScopedToComponent: ComponentAddress;
14
14
  } | {
15
15
  ScopedToTemplate: Hash32;
16
+ } | {
17
+ CallerComponent: ComponentAddress;
18
+ } | {
19
+ DirectCallerTemplate: Hash32;
16
20
  };
@@ -35,7 +35,7 @@ export type TransactionPoolRecord = {
35
35
  */
36
36
  transaction_weight: bigint;
37
37
  /**
38
- * The exhaust burn collected by the executor (`FeeReceipt::exhaust_burn_charged`), set from local
38
+ * The exhaust burn collected by the executor (`FeeReceipt::exhaust_burn`), set from local
39
39
  * execution alongside `transaction_fee`.
40
40
  */
41
41
  exhaust_burn: bigint;
@@ -5,4 +5,5 @@ export type UtxoStateUpdateSet = {
5
5
  updates: Array<WalletUtxoUpdate>;
6
6
  max_state_version: StateVersion;
7
7
  max_epoch: Epoch;
8
+ has_more: boolean;
8
9
  };
@@ -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
@@ -36,11 +49,13 @@ export type GetIndexerInfoResponse = {
36
49
  */
37
50
  verify_substate_proofs: boolean;
38
51
  /**
39
- * How long this indexer may serve a cached substate as the latest version of that substate, in
40
- * seconds. A read of the latest version may be up to this stale; reads of a specific version are
41
- * unaffected.
52
+ * How long after a shard was last confirmed synced this indexer keeps serving cached substates
53
+ * for it, in seconds. Cached values are invalidated by the state transitions this indexer syncs
54
+ * rather than expired on a timer, so a served value trails the chain by the sync interval rather
55
+ * than by this bound - which is what stops a validator that has stopped serving transitions from
56
+ * holding a stale value open indefinitely.
42
57
  */
43
- latest_substate_cache_ttl_secs: bigint;
58
+ substate_cache_max_serve_lag_secs: bigint;
44
59
  /**
45
60
  * Whether this indexer stores every event on the network. When false it is configured with event
46
61
  * filters, so event queries answer over a subset and absence is not proof an event did not occur.
@@ -12,12 +12,12 @@ export type GetNetworkEconomicsResponse = {
12
12
  */
13
13
  total_exhaust_burned: Amount;
14
14
  /**
15
- * Total pre-burn execution fees `F`, summed from transaction receipts.
15
+ * Total fees paid by transaction payers, summed from transaction receipts.
16
16
  */
17
17
  fee_volume: Amount;
18
18
  /**
19
19
  * Total exhaust burned summed from the same receipts as `fee_volume`; `receipt_exhaust_burned /
20
- * fee_volume` is the exact realized burn rate, and this is the burn netted from `total_supply`. May
20
+ * fee_volume` is the exact realized burn share, and this is the burn netted from `total_supply`. May
21
21
  * transiently trail `total_exhaust_burned` while the receipt sync frontier catches up to the checkpoint
22
22
  * frontier.
23
23
  */
@@ -31,7 +31,7 @@ export type GetNetworkEconomicsResponse = {
31
31
  */
32
32
  transaction_receipt_count: bigint;
33
33
  /**
34
- * The target exhaust burn rate in basis points in effect at `current_epoch`.
34
+ * The share of collected fees burned rather than paid to leaders, in basis points, in effect at `current_epoch`.
35
35
  */
36
36
  target_burn_rate_bps: number;
37
37
  };
@@ -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
  };
@@ -7,9 +7,9 @@ export type QueryTransactionEventsRequest = {
7
7
  topic: string | null;
8
8
  substate_id: SubstateId | null;
9
9
  /**
10
- * Filter by resource address. Matches when either the event's `substate_id` is the given
11
- * resource (std.resource.* events) or the event payload contains a `resource_address` entry
12
- * equal to the given address (std.vault.deposit / std.vault.withdraw).
10
+ * Filter by resource address. Matches the events whose `substate_id` is that resource, which
11
+ * is the `std.resource.*` family. Vault events name no resource filter those by
12
+ * `substate_id`, the vault's ID.
13
13
  */
14
14
  resource_address?: ResourceAddress | null;
15
15
  limit: number | null;
@@ -9,9 +9,9 @@ export type StreamTransactionEventsRequest = {
9
9
  substate_id: SubstateId | null;
10
10
  template_address: Hash32 | null;
11
11
  /**
12
- * Filter by resource address. Matches when either the event's `substate_id` is the given
13
- * resource (std.resource.* events) or the event payload contains a `resource_address` entry
14
- * equal to the given address (std.vault.deposit / std.vault.withdraw).
12
+ * Filter by resource address. Matches the events whose `substate_id` is that resource, which
13
+ * is the `std.resource.*` family. Vault events name no resource filter those by
14
+ * `substate_id`, the vault's ID.
15
15
  */
16
16
  resource_address?: ResourceAddress | null;
17
17
  /**
@@ -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";
@@ -1 +1 @@
1
- export type ValidatorConsensusState = "Idle" | "CheckSync" | "Syncing" | "Running" | "Sleeping" | "Shutdown";
1
+ export type ValidatorConsensusState = "Initialising" | "Idle" | "CheckSync" | "Syncing" | "Running" | "Sleeping" | "Shutdown";
@@ -2,8 +2,28 @@ import type { Block } from "../Block";
2
2
  export type GetBlockResponse = {
3
3
  block: Block;
4
4
  /**
5
- * Total WASM metering points consumed by transactions executed for this block (the per-block budget is
6
- * enforced against this sum).
5
+ * Total WASM metering points consumed by transactions executed for this block.
7
6
  */
8
7
  total_wasm_execution_points: bigint;
8
+ /**
9
+ * Total native verification points charged to transactions executed for this block.
10
+ */
11
+ total_native_execution_points: bigint;
12
+ /**
13
+ * The per-block execution points budget a leader packs against. It governs the sum of the two totals above,
14
+ * so only that sum is a meaningful proportion of it.
15
+ */
16
+ max_block_execution_points: bigint;
17
+ /**
18
+ * Total execution weight of the block's transaction commands: each transaction's weight discounted by how much
19
+ * of the work its command stage adds. Foreign proposal commands carry no execution weight and so
20
+ * contribute nothing.
21
+ */
22
+ total_block_execution_weight: bigint;
23
+ /**
24
+ * The execution weight a block may carry and still be voted for. Weight stands in for the size, IO and storage
25
+ * cost that metering does not see, so for ordinary traffic this budget fills long before the execution points
26
+ * one.
27
+ */
28
+ max_block_validation_weight: bigint;
9
29
  };
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.52.0",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -29,7 +29,7 @@
29
29
  "prettier": "^3.8.1",
30
30
  "shx": "^0.4.0",
31
31
  "typescript": "^5.9.3",
32
- "vitest": "^4.1.0"
32
+ "vitest": "^4.1.11"
33
33
  },
34
34
  "scripts": {
35
35
  "build-dist": "tsc --project tsconfig.prod.json",
@@ -1,3 +0,0 @@
1
- export type EvictNodeAtom = {
2
- public_key: string;
3
- };