Open Cap Table Protocol Canton SDK - v0.2.84
    Preparing search index...

    Function extractUpdateId

    • Extract updateId from a transaction tree response. The updateId can be at different paths depending on the Canton version. This function checks both possible locations in a type-safe way.

      Parameters

      • response: {
            transactionTree: {
                commandId: string;
                effectiveAt?: string;
                eventsById: {
                    [key: string]:
                        | {
                            CreatedTreeEvent: {
                                value: {
                                    contractId: string;
                                    contractKey?: unknown;
                                    createArgument?: unknown;
                                    createdAt: string;
                                    createdEventBlob: string;
                                    interfaceViews?: {
                                        interfaceId: string;
                                        viewStatus: { code: ...; details?: ...; message: ... };
                                        viewValue?: unknown;
                                    }[];
                                    nodeId: number;
                                    observers?: string[];
                                    offset: number;
                                    packageName: string;
                                    signatories?: string[];
                                    templateId: string;
                                    witnessParties?: string[];
                                };
                            };
                        }
                        | {
                            ExercisedTreeEvent: {
                                value: {
                                    actingParties?: string[];
                                    choice: string;
                                    choiceArgument: unknown;
                                    consuming: boolean;
                                    contractId: string;
                                    exerciseResult: unknown;
                                    implementedInterfaces?: string[];
                                    interfaceId?: string;
                                    lastDescendantNodeId: number;
                                    nodeId: number;
                                    offset: number;
                                    packageName: string;
                                    templateId: string;
                                    witnessParties?: string[];
                                };
                            };
                        };
                };
                offset: number;
                recordTime: string;
                synchronizerId: string;
                traceContext?: { traceparent?: string; tracestate?: string };
                updateId: string;
                workflowId: string;
            };
        }

      Returns string