@pear-protocol/types 1.15.0 → 1.15.1

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.
@@ -332,11 +332,21 @@ export declare const SyncMeta: z.ZodObject<{
332
332
  externalMaxTs: z.ZodNullable<z.ZodNumber>;
333
333
  }, z.core.$strip>;
334
334
  export type SyncMeta = z.output<typeof SyncMeta>;
335
+ /**
336
+ * Cycle-level metadata for the fills-create request specifically — extends the
337
+ * shared SyncMeta with a first-sync boundary meaningful only to the fills-create
338
+ * checkpoint, so it does not leak into the unrelated funding-payments contract.
339
+ */
340
+ export declare const CreateApplicablesMeta: z.ZodObject<{
341
+ externalMaxTs: z.ZodNullable<z.ZodNumber>;
342
+ firstSyncStartedAt: z.ZodOptional<z.ZodNumber>;
343
+ }, z.core.$strip>;
344
+ export type CreateApplicablesMeta = z.output<typeof CreateApplicablesMeta>;
335
345
  /**
336
346
  * POST /sync/create request — the discover+apply phase of the cycle.
337
347
  * - applicables: baskets keyed by positionKey, find-or-created during apply.
338
348
  * - exchangePositions: the exchange snapshot, enforced source of truth at verify.
339
- * - meta: cycle metadata (watermark).
349
+ * - meta: cycle metadata (watermark, first-sync pre-fetch boundary).
340
350
  *
341
351
  */
342
352
  export declare const CreateApplicablesRequest: z.ZodObject<{
@@ -410,6 +420,7 @@ export declare const CreateApplicablesRequest: z.ZodObject<{
410
420
  }, z.core.$strip>>;
411
421
  meta: z.ZodObject<{
412
422
  externalMaxTs: z.ZodNullable<z.ZodNumber>;
423
+ firstSyncStartedAt: z.ZodOptional<z.ZodNumber>;
413
424
  }, z.core.$strip>;
414
425
  }, z.core.$strip>;
415
426
  export type CreateApplicablesRequest = z.output<typeof CreateApplicablesRequest>;
@@ -106,10 +106,13 @@ const ApplicablePosition = z.object({
106
106
  const SyncMeta = z.object({
107
107
  externalMaxTs: z.number().int().nonnegative().nullable().describe("watermark advance source")
108
108
  });
109
+ const CreateApplicablesMeta = SyncMeta.extend({
110
+ firstSyncStartedAt: z.number().int().nonnegative().optional().describe("backend-issued timestamp returned before the first fill-history fetch")
111
+ });
109
112
  const CreateApplicablesRequest = z.object({
110
113
  applicables: z.array(ApplicablePosition),
111
114
  exchangePositions: z.array(ExternalPosition),
112
- meta: SyncMeta
115
+ meta: CreateApplicablesMeta
113
116
  });
114
117
  const OptionallySignedDecimalString = z.string().regex(/^[+-]?\d+(\.\d+)?$/, "Must be a valid signed decimal string");
115
118
  const FundingPaymentEntry = z.object({
@@ -127,4 +130,4 @@ const CreateFundingPaymentsRequest = z.object({
127
130
  meta: SyncMeta
128
131
  });
129
132
 
130
- export { ApplicableFill, ApplicableMetadata, ApplicablePosition, ConfirmFillsRequest, ConfirmableExternalFill, CreateApplicablesRequest, CreateFundingPaymentsRequest, ExternalPosition, FundingPaymentEntry, ReconcileFillsRequest, ReconcileReplacementExternalFill, SyncFillsSinceRequest, SyncFundingSinceRequest, SyncMeta, UnknownExternalFill };
133
+ export { ApplicableFill, ApplicableMetadata, ApplicablePosition, ConfirmFillsRequest, ConfirmableExternalFill, CreateApplicablesMeta, CreateApplicablesRequest, CreateFundingPaymentsRequest, ExternalPosition, FundingPaymentEntry, ReconcileFillsRequest, ReconcileReplacementExternalFill, SyncFillsSinceRequest, SyncFundingSinceRequest, SyncMeta, UnknownExternalFill };
@@ -3,6 +3,7 @@ export declare const SyncFillsResponse: z.ZodObject<{}, z.core.$strip>;
3
3
  export declare const SyncFillsSinceResponse: z.ZodObject<{
4
4
  sinceMs: z.ZodNumber;
5
5
  neverSynced: z.ZodBoolean;
6
+ firstSyncStartedAt: z.ZodOptional<z.ZodNumber>;
6
7
  confirmedExchangeFillIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
7
8
  }, z.core.$strip>;
8
9
  export declare const SyncFundingSinceResponse: z.ZodObject<{
@@ -7,6 +7,9 @@ const SyncFillsSinceResponse = z.object({
7
7
  // genesis. Clients use this to detect an account that has never imported its trade history —
8
8
  // `sinceMs === 0` alone is ambiguous (a clamped watermark also yields 0).
9
9
  neverSynced: z.boolean(),
10
+ // Backend-clock boundary returned only for a never-synced account. The syncer carries this
11
+ // through when an empty exchange fetch provides no fill-derived checkpoint.
12
+ firstSyncStartedAt: z.number().int().nonnegative().optional(),
10
13
  confirmedExchangeFillIds: z.array(z.string()).optional()
11
14
  });
12
15
  const SyncFundingSinceResponse = z.object({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pear-protocol/types",
3
- "version": "1.15.0",
3
+ "version": "1.15.1",
4
4
  "description": "Pear Protocol Types definitions",
5
5
  "private": false,
6
6
  "type": "module",