@layerzerolabs/common-canton 1.2.67 → 1.2.69

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.
@@ -1,13 +1,20 @@
1
1
  import { AMULET_INSTRUMENT_ID, type ChoiceContext } from '../client/amulet';
2
2
  import type { ICantonClient } from '../client/interface';
3
3
  import type { CantonDeferredValue } from '../deferredValue';
4
- import type { CantonCommands, CantonDisclosedContracts } from '../transaction';
4
+ import type {
5
+ CantonCommands,
6
+ CantonDisclosedContracts,
7
+ CantonUnresolvedCommands,
8
+ } from '../transaction';
5
9
  import { createContractAddressResolver } from './address-resolver';
10
+ import type { CantonRefreshPlan } from './plan';
11
+ import { resolveCantonRefreshPlan } from './resolve-plan';
6
12
  import { substituteRefsToCids } from './reverse-substitute';
7
13
 
8
14
  export interface ResolveCantonAddressParams {
9
- unresolvedCommands: CantonCommands;
15
+ unresolvedCommands: CantonUnresolvedCommands;
10
16
  unresolvedDisclosedContracts: CantonDisclosedContracts;
17
+ refreshPlan?: CantonRefreshPlan;
11
18
  senderParty?: string;
12
19
  /** A contract is only disclosed when none of these parties is already a stakeholder on it. */
13
20
  signingParties: string[];
@@ -17,6 +24,7 @@ export interface ResolveCantonAddressParams {
17
24
  export const resolveCantonTransaction = async ({
18
25
  unresolvedCommands,
19
26
  unresolvedDisclosedContracts,
27
+ refreshPlan,
20
28
  senderParty,
21
29
  signingParties,
22
30
  client,
@@ -24,6 +32,17 @@ export const resolveCantonTransaction = async ({
24
32
  commands: CantonCommands;
25
33
  disclosedContracts: CantonDisclosedContracts;
26
34
  }> => {
35
+ if (refreshPlan) {
36
+ return resolveCantonRefreshPlan({
37
+ unresolvedCommands,
38
+ unresolvedDisclosedContracts,
39
+ refreshPlan,
40
+ senderParty,
41
+ signingParties,
42
+ client,
43
+ });
44
+ }
45
+
27
46
  const nextDisclosed = [...unresolvedDisclosedContracts];
28
47
  const disclosedContractIds = new Set(
29
48
  unresolvedDisclosedContracts.map(({ contractId }) => contractId),
@@ -10,6 +10,7 @@ import {
10
10
  import type { PartialBy } from '@layerzerolabs/typescript-utils';
11
11
 
12
12
  import type { CantonDeferredRef, CantonExpectedSignatories } from './deferredValue';
13
+ import { cantonRefreshPlanSchema } from './refresh/plan';
13
14
 
14
15
  // === Component schemas ===
15
16
 
@@ -97,6 +98,8 @@ export const cantonTransactionSchema = transactionSchema.extend({
97
98
  identityKeys: z.array(z.string()),
98
99
  })
99
100
  .optional(),
101
+ /** Build-time replacements for volatile command inputs and disclosures. */
102
+ refreshPlan: cantonRefreshPlanSchema.optional(),
100
103
  }),
101
104
  });
102
105