@c7-digital/ledger 0.0.9 → 0.0.10

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.
@@ -17,7 +17,7 @@
17
17
  * you need access to Canton-specific endpoints or full control over API calls.
18
18
  */
19
19
  import { ContractId, Party, Choice, InterfaceCompanion, Template } from "@daml/types";
20
- import { AllocatePartyRequest, AllocatePartyResponse, Command, CreateCommand, CreateAndExerciseCommand, CreateEvent, ExerciseCommand, Event, Interface, LedgerOffset, Stream, InterfaceStream, InterfaceMapping, InterfaceMultiStream, PartyDetails, User, MultiStream, TemplateMapping, VersionedRegistry } from "./types.js";
20
+ import { AllocatePartyRequest, AllocatePartyResponse, AnyCommand, CreateCommand, CreateAndExerciseCommand, CreateEvent, ExerciseCommand, Event, Interface, LedgerOffset, Stream, InterfaceStream, InterfaceMapping, InterfaceMultiStream, PartyDetails, User, MultiStream, TemplateMapping, VersionedRegistry } from "./types.js";
21
21
  import { ValidationMode } from "./validation.js";
22
22
  import { PackageIdString } from "./valueTypes.js";
23
23
  export declare function createCmd<T extends object, K = unknown>(template: Template<T, K, string>, payload: T): CreateCommand<T, K>;
@@ -134,7 +134,7 @@ export declare class Ledger {
134
134
  * @param actAs Defaults to the actAs parties of the user in the token.
135
135
  * @returns Stream of events resulting from the submitted commands.
136
136
  */
137
- submit(commands: Command<any, any>[], actAs?: Party[]): Promise<Event<object, unknown>[]>;
137
+ submit(commands: AnyCommand[], actAs?: Party[]): Promise<Event<object, unknown>[]>;
138
138
  private initClient;
139
139
  /**
140
140
  * Stream functionality using WebSockets
@@ -226,6 +226,13 @@ export type ExerciseCommand<T extends object, C, R, K = unknown> = {
226
226
  argument: C;
227
227
  };
228
228
  export type Command<T extends object, C, R = unknown, K = unknown> = CreateCommand<T, K> | CreateAndExerciseCommand<T, C, R, K> | ExerciseCommand<T, C, R, K>;
229
+ /**
230
+ * A command with erased type parameters, suitable for heterogeneous arrays
231
+ * passed to `Ledger.submit()`. Each variant is independently widened to `any`,
232
+ * so a `CreateCommand<A, KA>` and an `ExerciseCommand<B, CB, RB, KB>` can
233
+ * coexist in the same `AnyCommand[]` without a cast.
234
+ */
235
+ export type AnyCommand = CreateCommand<any, any> | CreateAndExerciseCommand<any, any, any, any> | ExerciseCommand<any, any, any, any>;
229
236
  export interface AllocatePartyRequest {
230
237
  partyIdHint?: PartyIdString;
231
238
  displayName?: string;