@tari-project/ootle-ts-bindings 1.23.1 → 1.23.3

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.
Files changed (32) hide show
  1. package/dist/index.d.ts +3 -1
  2. package/dist/index.js +3 -1
  3. package/dist/tari-indexer-client.d.ts +1 -0
  4. package/dist/tari-indexer-client.js +1 -0
  5. package/dist/types/Amount.d.ts +1 -1
  6. package/dist/types/Bytes.d.ts +6 -4
  7. package/dist/types/ExecuteResult.d.ts +8 -0
  8. package/dist/types/Instruction.d.ts +9 -4
  9. package/dist/types/MinotariBurnClaimProof.d.ts +1 -0
  10. package/dist/types/{PrivateOutput.d.ts → OutputBody.d.ts} +1 -1
  11. package/dist/types/ResourceContainer.d.ts +3 -3
  12. package/dist/types/TemplateDefV1.d.ts +1 -1
  13. package/dist/types/TransactionEnvelope.d.ts +1 -0
  14. package/dist/types/TransactionPoolRecord.d.ts +6 -0
  15. package/dist/types/TransactionReceipt.d.ts +1 -0
  16. package/dist/types/UnsealedTransaction.d.ts +4 -0
  17. package/dist/types/UtxoOutput.d.ts +2 -2
  18. package/dist/types/tari-indexer-client/GetNetworkInfoResponse.d.ts +7 -0
  19. package/dist/types/tari-indexer-client/GetNetworkInfoResponse.js +1 -0
  20. package/dist/types/tari-indexer-client/GetSubstatesRequest.d.ts +9 -0
  21. package/dist/types/tari-indexer-client/IndexerSubmitTransactionRequest.d.ts +2 -2
  22. package/dist/types/tari-indexer-client/IndexerSubmitTransactionResponse.d.ts +2 -0
  23. package/dist/types/validator-node-client/TemplateAbi.d.ts +1 -1
  24. package/dist/types/wallet-types/AuthoredTemplate.d.ts +1 -1
  25. package/dist/validator-node-client.d.ts +0 -2
  26. package/dist/validator-node-client.js +0 -2
  27. package/package.json +5 -4
  28. package/dist/types/validator-node-client/GetRecentTransactionsRequest.d.ts +0 -1
  29. package/dist/types/validator-node-client/GetRecentTransactionsResponse.d.ts +0 -4
  30. /package/dist/types/{PrivateOutput.js → OutputBody.js} +0 -0
  31. /package/dist/types/{validator-node-client/GetRecentTransactionsRequest.js → TransactionEnvelope.js} +0 -0
  32. /package/dist/types/{validator-node-client/GetRecentTransactionsResponse.js → UnsealedTransaction.js} +0 -0
package/dist/index.d.ts CHANGED
@@ -79,12 +79,12 @@ export * from "./types/NonFungible";
79
79
  export * from "./types/NumPreshards";
80
80
  export * from "./types/OotleAddress";
81
81
  export * from "./types/Ordering";
82
+ export * from "./types/OutputBody";
82
83
  export * from "./types/OutputStatus";
83
84
  export * from "./types/OwnerRule";
84
85
  export * from "./types/PayRef";
85
86
  export * from "./types/PedersenCommitmentBytes";
86
87
  export * from "./types/PeerAddress";
87
- export * from "./types/PrivateOutput";
88
88
  export * from "./types/ProofId";
89
89
  export * from "./types/ProposalCertificate";
90
90
  export * from "./types/PublishedTemplateAddress";
@@ -131,6 +131,7 @@ export * from "./types/TemplateDef";
131
131
  export * from "./types/TemplateDefV1";
132
132
  export * from "./types/TimeoutCertificate";
133
133
  export * from "./types/TransactionAtom";
134
+ export * from "./types/TransactionEnvelope";
134
135
  export * from "./types/TransactionExecution";
135
136
  export * from "./types/TransactionId";
136
137
  export * from "./types/TransactionPoolRecord";
@@ -144,6 +145,7 @@ export * from "./types/TransactionStatus";
144
145
  export * from "./types/Transaction";
145
146
  export * from "./types/TransactionV1";
146
147
  export * from "./types/Type";
148
+ export * from "./types/UnsealedTransaction";
147
149
  export * from "./types/UnsealedTransactionV1";
148
150
  export * from "./types/UnsignedTransaction";
149
151
  export * from "./types/UnsignedTransactionV1";
package/dist/index.js CHANGED
@@ -81,12 +81,12 @@ export * from "./types/NonFungible";
81
81
  export * from "./types/NumPreshards";
82
82
  export * from "./types/OotleAddress";
83
83
  export * from "./types/Ordering";
84
+ export * from "./types/OutputBody";
84
85
  export * from "./types/OutputStatus";
85
86
  export * from "./types/OwnerRule";
86
87
  export * from "./types/PayRef";
87
88
  export * from "./types/PedersenCommitmentBytes";
88
89
  export * from "./types/PeerAddress";
89
- export * from "./types/PrivateOutput";
90
90
  export * from "./types/ProofId";
91
91
  export * from "./types/ProposalCertificate";
92
92
  export * from "./types/PublishedTemplateAddress";
@@ -133,6 +133,7 @@ export * from "./types/TemplateDef";
133
133
  export * from "./types/TemplateDefV1";
134
134
  export * from "./types/TimeoutCertificate";
135
135
  export * from "./types/TransactionAtom";
136
+ export * from "./types/TransactionEnvelope";
136
137
  export * from "./types/TransactionExecution";
137
138
  export * from "./types/TransactionId";
138
139
  export * from "./types/TransactionPoolRecord";
@@ -146,6 +147,7 @@ export * from "./types/TransactionStatus";
146
147
  export * from "./types/Transaction";
147
148
  export * from "./types/TransactionV1";
148
149
  export * from "./types/Type";
150
+ export * from "./types/UnsealedTransaction";
149
151
  export * from "./types/UnsealedTransactionV1";
150
152
  export * from "./types/UnsignedTransaction";
151
153
  export * from "./types/UnsignedTransactionV1";
@@ -1,5 +1,6 @@
1
1
  export * from "./types/tari-indexer-client/IndexerSubmitTransactionResponse";
2
2
  export * from "./types/tari-indexer-client/GetTransactionReceiptResponse";
3
+ export * from "./types/tari-indexer-client/GetNetworkInfoResponse";
3
4
  export * from "./types/tari-indexer-client/TemplateMetadata";
4
5
  export * from "./types/tari-indexer-client/GetUtxoUpdatesRequest";
5
6
  export * from "./types/tari-indexer-client/ListSubstatesResponse";
@@ -2,6 +2,7 @@
2
2
  // SPDX-License-Identifier: BSD-3-Clause
3
3
  export * from "./types/tari-indexer-client/IndexerSubmitTransactionResponse";
4
4
  export * from "./types/tari-indexer-client/GetTransactionReceiptResponse";
5
+ export * from "./types/tari-indexer-client/GetNetworkInfoResponse";
5
6
  export * from "./types/tari-indexer-client/TemplateMetadata";
6
7
  export * from "./types/tari-indexer-client/GetUtxoUpdatesRequest";
7
8
  export * from "./types/tari-indexer-client/ListSubstatesResponse";
@@ -1,5 +1,5 @@
1
1
  /**
2
- * A 192-bit signed amount.
2
+ * A 128-bit signed amount.
3
3
  *
4
4
  * This is a general purpose signed integer, but is primarily used to represent the smallest unit of value in
5
5
  * resources/vaults etc.
@@ -1,7 +1,9 @@
1
1
  /**
2
- * A wrapper around `Vec<u8>` that serializes to and from bytes efficiently.
3
- * Unfortunately, due to some factors (impl serde for Vec<T>, no specialization) ciborium will represent bytes as
4
- * `Array(vec![Integer(u8), ....])` instead of `Bytes(vec![u8, ...])`. which results in a significant bloat in size.
5
- * This wrapper uses of the `Bytes` variant in ciborium (similar to `serde_as(as = "Bytes")`).
2
+ * A wrapper around a byte buffer that implements efficient serde serialisation.
3
+ *
4
+ * Unfortunately, because we cannot implement a specialized version of serde::Serialize (impl serde::Serialize for
5
+ * Vec<u8>) ciborium will represent bytes as `Array(vec![Integer(u8), ....])` instead of `Bytes(vec![u8, ...])`. which
6
+ * results in a significant size overhead. This wrapper uses the `Value::Bytes` variant (similar to `serde_as(as =
7
+ * "Bytes")`).
6
8
  */
7
9
  export type Bytes = Uint8Array;
@@ -4,8 +4,16 @@ export type ExecuteResult = {
4
4
  * The finalized result to commit. If the fee transaction succeeds but the transaction fails, this will be accept.
5
5
  */
6
6
  finalize: FinalizeResult;
7
+ /**
8
+ * The time taken to execute the transaction (excluding finalization).
9
+ */
7
10
  execution_time: {
8
11
  secs: number;
9
12
  nanos: number;
10
13
  };
14
+ /**
15
+ * The epoch during which the transaction was executed. This may be None if consensus aborted before being able to
16
+ * lock to an epoch.
17
+ */
18
+ execute_epoch: bigint | null;
11
19
  };
@@ -4,6 +4,7 @@ import type { ClaimBurnOutputData } from "./ClaimBurnOutputData";
4
4
  import type { ComponentAccessRules } from "./ComponentAccessRules";
5
5
  import type { ComponentReference } from "./ComponentReference";
6
6
  import type { Hash } from "./Hash";
7
+ import type { InstructionArg } from "./InstructionArg";
7
8
  import type { LogLevel } from "./LogLevel";
8
9
  import type { MigrateFunction } from "./MigrateFunction";
9
10
  import type { MinotariBurnClaimProof } from "./MinotariBurnClaimProof";
@@ -19,19 +20,19 @@ export type Instruction = {
19
20
  owner_public_key: RistrettoPublicKeyBytes;
20
21
  owner_rule: OwnerRule | null;
21
22
  access_rules: ComponentAccessRules | null;
22
- workspace_id: WorkspaceOffsetId | null;
23
+ bucket_workspace_id: WorkspaceOffsetId | null;
23
24
  };
24
25
  } | {
25
26
  CallFunction: {
26
27
  address: Hash;
27
28
  function: string;
28
- args: Array<any>;
29
+ args: Array<InstructionArg>;
29
30
  };
30
31
  } | {
31
32
  CallMethod: {
32
33
  call: ComponentReference;
33
34
  method: string;
34
- args: Array<any>;
35
+ args: Array<InstructionArg>;
35
36
  };
36
37
  } | {
37
38
  PutLastInstructionOutputOnWorkspace: {
@@ -79,10 +80,14 @@ export type Instruction = {
79
80
  revealed_input_bucket: WorkspaceOffsetId | null;
80
81
  };
81
82
  } | {
82
- PayFee: {
83
+ PayFeeStealth: {
83
84
  statement: StealthTransferStatement;
84
85
  revealed_input_bucket: WorkspaceOffsetId | null;
85
86
  };
87
+ } | {
88
+ PayFeeFromBucket: {
89
+ bucket: WorkspaceOffsetId;
90
+ };
86
91
  } | {
87
92
  UpdateComponentTemplate: {
88
93
  component: ComponentReference;
@@ -13,4 +13,5 @@ export type MinotariBurnClaimProof = {
13
13
  encoded_merkle_proof: EncodedMerkleProof;
14
14
  kernel: AbridgedTransactionKernel;
15
15
  value: bigint;
16
+ sender_offset_public_key: RistrettoPublicKeyBytes;
16
17
  };
@@ -1,7 +1,7 @@
1
1
  import type { ElgamalVerifiableBalanceBytes } from "./ElgamalVerifiableBalanceBytes";
2
2
  import type { EncryptedData } from "./EncryptedData";
3
3
  import type { RistrettoPublicKeyBytes } from "./RistrettoPublicKeyBytes";
4
- export type PrivateOutput = {
4
+ export type OutputBody = {
5
5
  public_nonce: RistrettoPublicKeyBytes;
6
6
  encrypted_data: EncryptedData;
7
7
  minimum_value_promise: number | bigint;
@@ -1,7 +1,7 @@
1
1
  import type { Amount } from "./Amount";
2
2
  import type { NonFungibleId } from "./NonFungibleId";
3
+ import type { OutputBody } from "./OutputBody";
3
4
  import type { PedersenCommitmentBytes } from "./PedersenCommitmentBytes";
4
- import type { PrivateOutput } from "./PrivateOutput";
5
5
  import type { ResourceAddress } from "./ResourceAddress";
6
6
  /**
7
7
  * Instances of a single resource kept in Buckets and Vaults
@@ -22,11 +22,11 @@ export type ResourceContainer = {
22
22
  Confidential: {
23
23
  address: ResourceAddress;
24
24
  commitments: {
25
- [key in PedersenCommitmentBytes]?: PrivateOutput;
25
+ [key in PedersenCommitmentBytes]?: OutputBody;
26
26
  };
27
27
  revealed_amount: Amount;
28
28
  locked_commitments: {
29
- [key in PedersenCommitmentBytes]?: PrivateOutput;
29
+ [key in PedersenCommitmentBytes]?: OutputBody;
30
30
  };
31
31
  locked_revealed_amount: Amount;
32
32
  };
@@ -1,6 +1,6 @@
1
1
  import type { FunctionDef } from "./FunctionDef";
2
2
  export type TemplateDefV1 = {
3
3
  template_name: string;
4
- tari_version: string;
4
+ abi_version: number;
5
5
  functions: Array<FunctionDef>;
6
6
  };
@@ -0,0 +1 @@
1
+ export type TransactionEnvelope = string;
@@ -1,5 +1,6 @@
1
1
  import type { BlockId } from "./BlockId";
2
2
  import type { Decision } from "./Decision";
3
+ import type { Epoch } from "./Epoch";
3
4
  import type { Evidence } from "./Evidence";
4
5
  import type { LeaderFee } from "./LeaderFee";
5
6
  import type { TransactionPoolStage } from "./TransactionPoolStage";
@@ -15,6 +16,11 @@ export type TransactionPoolRecord = {
15
16
  local_decision: Decision | null;
16
17
  remote_decision: Decision | null;
17
18
  is_ready: boolean;
19
+ /**
20
+ * Epoch to use when executing the transaction. This updates as foreign proposals are received
21
+ * until the transaction is executed.
22
+ */
23
+ locked_epoch: Epoch | null;
18
24
  last_updated: string;
19
25
  last_updated_in_block: BlockId | null;
20
26
  };
@@ -11,4 +11,5 @@ export type TransactionReceipt = {
11
11
  events: Array<Event>;
12
12
  logs: Array<LogEntry>;
13
13
  fee_receipt: FeeReceipt;
14
+ epoch: bigint;
14
15
  };
@@ -0,0 +1,4 @@
1
+ import type { UnsealedTransactionV1 } from "./UnsealedTransactionV1";
2
+ export type UnsealedTransaction = {
3
+ V1: UnsealedTransactionV1;
4
+ };
@@ -1,8 +1,8 @@
1
- import type { PrivateOutput } from "./PrivateOutput";
1
+ import type { OutputBody } from "./OutputBody";
2
2
  import type { SpendCondition } from "./SpendCondition";
3
3
  import type { UtxoTag } from "./UtxoTag";
4
4
  export type UtxoOutput = {
5
- output: PrivateOutput;
5
+ output: OutputBody;
6
6
  spend_condition: SpendCondition;
7
7
  tag: UtxoTag;
8
8
  };
@@ -0,0 +1,7 @@
1
+ import type { Epoch } from "../Epoch";
2
+ import type { Network } from "../Network";
3
+ export type GetNetworkInfoResponse = {
4
+ network: Network;
5
+ network_byte: number;
6
+ epoch: Epoch;
7
+ };
@@ -1,4 +1,13 @@
1
1
  import type { SubstateId } from "../SubstateId";
2
2
  export type GetSubstatesRequest = {
3
+ /**
4
+ * The list of substate IDs to fetch
5
+ */
3
6
  requests: Array<SubstateId>;
7
+ /**
8
+ * If true, only search local storage for the substates. This may result in substates not being found even if they
9
+ * exist. Otherwise, the indexer will attempt to fetch substates from validator nodes across various shard groups
10
+ * which may result in more failures.
11
+ */
12
+ cached_only: boolean;
4
13
  };
@@ -1,4 +1,4 @@
1
- import type { Transaction } from "../Transaction";
1
+ import type { TransactionEnvelope } from "../TransactionEnvelope";
2
2
  export type IndexerSubmitTransactionRequest = {
3
- transaction: Transaction;
3
+ transaction: TransactionEnvelope;
4
4
  };
@@ -1,4 +1,6 @@
1
+ import type { ExecuteResult } from "../ExecuteResult";
1
2
  import type { TransactionId } from "../TransactionId";
2
3
  export type IndexerSubmitTransactionResponse = {
3
4
  transaction_id: TransactionId;
5
+ result: ExecuteResult;
4
6
  };
@@ -2,5 +2,5 @@ import type { VNFunctionDef } from "./VNFunctionDef";
2
2
  export type TemplateAbi = {
3
3
  template_name: string;
4
4
  functions: Array<VNFunctionDef>;
5
- version: string;
5
+ version: number;
6
6
  };
@@ -5,6 +5,6 @@ export type AuthoredTemplate = {
5
5
  author_public_key: RistrettoPublicKeyBytes;
6
6
  address: Hash;
7
7
  name: string;
8
- tari_version: string;
8
+ abi_version: number;
9
9
  functions: Array<FunctionDef>;
10
10
  };
@@ -34,10 +34,8 @@ export * from "./types/validator-node-client/GetBlocksResponse";
34
34
  export * from "./types/validator-node-client/ListBlocksResponse";
35
35
  export * from "./types/validator-node-client/GetBlockRequest";
36
36
  export * from "./types/validator-node-client/VNGetTransactionResultRequest";
37
- export * from "./types/validator-node-client/GetRecentTransactionsRequest";
38
37
  export * from "./types/validator-node-client/VNTemplateMetadata";
39
38
  export * from "./types/validator-node-client/VNLogLevel";
40
- export * from "./types/validator-node-client/GetRecentTransactionsResponse";
41
39
  export * from "./types/validator-node-client/VNAddPeerResponse";
42
40
  export * from "./types/validator-node-client/VNConnection";
43
41
  export * from "./types/validator-node-client/ValidatorNode";
@@ -36,10 +36,8 @@ export * from "./types/validator-node-client/GetBlocksResponse";
36
36
  export * from "./types/validator-node-client/ListBlocksResponse";
37
37
  export * from "./types/validator-node-client/GetBlockRequest";
38
38
  export * from "./types/validator-node-client/VNGetTransactionResultRequest";
39
- export * from "./types/validator-node-client/GetRecentTransactionsRequest";
40
39
  export * from "./types/validator-node-client/VNTemplateMetadata";
41
40
  export * from "./types/validator-node-client/VNLogLevel";
42
- export * from "./types/validator-node-client/GetRecentTransactionsResponse";
43
41
  export * from "./types/validator-node-client/VNAddPeerResponse";
44
42
  export * from "./types/validator-node-client/VNConnection";
45
43
  export * from "./types/validator-node-client/ValidatorNode";
package/package.json CHANGED
@@ -1,6 +1,10 @@
1
1
  {
2
2
  "name": "@tari-project/ootle-ts-bindings",
3
- "version": "1.23.1",
3
+ "version": "1.23.3",
4
+ "private": false,
5
+ "publishConfig": {
6
+ "access": "public"
7
+ },
4
8
  "description": "TypeScript types synchronized to the Tari Ootle Rust codebase",
5
9
  "homepage": "https://github.com/tari-project/tari-ootle#readme",
6
10
  "bugs": {
@@ -12,9 +16,6 @@
12
16
  },
13
17
  "main": "./dist/index.js",
14
18
  "types": "./dist/index.d.ts",
15
- "publishConfig": {
16
- "access": "public"
17
- },
18
19
  "files": [
19
20
  "/dist"
20
21
  ],
@@ -1 +0,0 @@
1
- export type GetRecentTransactionsRequest = Record<string, never>;
@@ -1,4 +0,0 @@
1
- import type { Transaction } from "../Transaction";
2
- export type GetRecentTransactionsResponse = {
3
- transactions: Array<Transaction>;
4
- };
File without changes