UNPKG

@fairmint/canton-node-sdk

Version:
71 lines 2.79 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.TransactionTreeByOffsetResponseSchema = exports.UpdateByIdResponseSchema = exports.UpdateByIdRequestSchema = exports.CreateContractResponseSchema = exports.CommandResponseSchema = exports.TransactionTreeSchema = void 0; const zod_1 = require("zod"); const events_1 = require("./events"); exports.TransactionTreeSchema = zod_1.z .object({ /** Unique update ID for the transaction. */ updateId: zod_1.z.string(), /** Command ID associated with the transaction (optional). */ commandId: zod_1.z.string().optional(), /** Workflow ID associated with the transaction (optional). */ workflowId: zod_1.z.string().optional(), /** Effective time of the transaction (ISO 8601). */ effectiveAt: zod_1.z.string(), /** Offset of the transaction in the ledger stream. */ offset: zod_1.z.number(), /** Map of event node IDs to tree events. */ eventsById: zod_1.z.record(zod_1.z.string(), events_1.TreeEventSchema), /** Record time of the transaction (ISO 8601). */ recordTime: zod_1.z.string(), /** Synchronizer ID for the transaction. */ synchronizerId: zod_1.z.string(), /** Trace context for distributed tracing (optional). */ traceContext: zod_1.z.object({ /** W3C traceparent header value. */ traceparent: zod_1.z.string(), /** W3C tracestate header value (nullable). */ tracestate: zod_1.z.string().nullable(), }).optional(), }) .strict(); exports.CommandResponseSchema = zod_1.z .object({ /** Transaction tree returned in response to a command. */ transactionTree: exports.TransactionTreeSchema, }) .strict(); exports.CreateContractResponseSchema = zod_1.z .object({ /** Contract ID of the newly created contract. */ contractId: zod_1.z.string(), /** Update ID of the transaction that created the contract. */ updateId: zod_1.z.string(), }) .strict(); exports.UpdateByIdRequestSchema = zod_1.z .object({ /** Update ID to fetch. */ updateId: zod_1.z.string(), /** Parties requesting the update. */ requestingParties: zod_1.z.array(zod_1.z.string()), /** Format of the update. */ updateFormat: zod_1.z.string(), /** Whether to include transactions in the response. */ includeTransactions: zod_1.z.boolean(), }) .strict(); exports.UpdateByIdResponseSchema = zod_1.z .object({ /** Transaction tree for the requested update. */ update: exports.TransactionTreeSchema, }) .strict(); exports.TransactionTreeByOffsetResponseSchema = zod_1.z .object({ /** Transaction tree for the requested offset. */ transaction: exports.TransactionTreeSchema, }) .strict(); //# sourceMappingURL=transactions.js.map