@predictasiax/api 3.0.0 → 3.0.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.
package/dist/index.d.cts CHANGED
@@ -740,6 +740,8 @@ declare class AuditResource extends Resource {
740
740
  /** WebCrypto variant of verifyProof (same rules, including expectedLength). */
741
741
  static verifyProofAsync(leaf: string, root: string, proof: string[], expectedLength: number): Promise<boolean>;
742
742
  }
743
+ /** True when every bound top-level field equals its value inside the hashed `canonical`. */
744
+ declare function fieldsMatchCanonical(event: Partial<AuditEvent>): boolean;
743
745
 
744
746
  /**
745
747
  * Fees resource — pre-trade 5-actor split estimator.
@@ -1093,7 +1095,7 @@ declare class TemplatesResource extends Resource {
1093
1095
  * await pax.orders.place({ marketId: "hadjar-f1-2026", side: "yes", price: "0.05", size: "10" });
1094
1096
  */
1095
1097
 
1096
- declare const VERSION = "3.0.0";
1098
+ declare const VERSION = "3.0.1";
1097
1099
  type PaxClientOptions = HttpClientOptions;
1098
1100
  declare class PaxClient {
1099
1101
  private readonly _http;
@@ -1174,11 +1176,13 @@ interface AttachRefResult {
1174
1176
  /**
1175
1177
  * Detect + persist a builder ref, then return headers ready for PaxClient.
1176
1178
  *
1177
- * Precedence: explicit `ref` opt → URL `?ref=` → cookie → localStorage →
1178
- * in-memory (this process) → none.
1179
+ * Precedence: explicit `ref` opt → stored ref (cookie → localStorage →
1180
+ * in-memory) → URL `?ref=` → none.
1179
1181
  *
1180
- * When a fresh value is found in URL / explicit, it is persisted according
1181
- * to `storage` (default `cookie` in the browser, `memory` server-side).
1182
+ * First write wins: a `?ref=` in the URL is persisted only when no ref is
1183
+ * stored yet, so a later link cannot silently replace the referral that
1184
+ * brought the user in (same sticky semantics as the server). Only an explicit
1185
+ * `ref` option, or `clearRef()` first, replaces a stored value.
1182
1186
  */
1183
1187
  declare function attachRef(opts?: AttachRefOptions): AttachRefResult;
1184
1188
  /**
@@ -1421,4 +1425,4 @@ declare function runWithRetry<T>(fn: () => Promise<T>, opts?: {
1421
1425
  onRetry?: (attempt: number, error: Error) => void;
1422
1426
  }): Promise<T>;
1423
1427
 
1424
- export { APIPromise, type APIResponseInfo, type Account, type AccountBalance, AccountResource, type ApiKey, type ApplicationResult, type ApplicationStatus, type ApplyCreateParams, ApplyResource, type AttachRefOptions, type AttachRefResult, type AuditAnchor, type AuditBatch, type AuditEvent, AuditResource, type AuditStatus, type AuditVerification, type BatchOrderResultItem, type BatchOrdersResult, type Candle, type CandleInterval, type Category, type CreateMarketParams, CursorPage, type CursorPageInit, type CursorPageParams, DEFAULT_BASE_URL, type Decimal, type Env, type Envelope, type FeeEstimate, type FeeEstimateParams, FeesResource, type GrantClaimResult, type GrantEvent, type GrantEventType, type GrantPhase, type GrantTier, type GrantVesting, GrantsResource, type HealthStatus, type HmacHeaders, type HttpClientOptions, type KeyScope, type ListEnvelope, type ListMarketsParams, type ListOrdersParams, type ListTemplatesParams, type Market, type MarketStatus, type MarketTemplate, type MarketType, MarketsResource, type MerkleProof, type Order, type OrderHistoryParams, type OrderList, type OrderRow, type OrderStatus, type OrderType, type Orderbook, type OrderbookLevel, OrdersResource, type Outcome, PagePromise, PaxAuthError, PaxCircuitBreakerError, PaxClient, type PaxClientOptions, PaxConflictError, PaxError, type PaxErrorDetails, type PaxErrorPayload, PaxNotFoundError, PaxRateLimitError, PaxReadOnlyModeError, PaxSandboxOnlyError, PaxServerError, PaxValidationError, PaxWSClient, type PaxWSClientOptions, PaxWrongEnvKeyError, type PlaceOrderParams, type Position, type PriceHistoryRange, type RequestOptions, type ResponseMeta, type SandboxKeyMintParams, type SandboxKeyResult, SandboxKeysResource, SandboxResource, SettleResource, type Side, type SignInput, TemplatesResource, type Tier, type TierLimits, type TimeInForce, type TokenGrant, type Trade, VERSION, type WithResponseResult, type WsEvent, type WsHandler, attachRef, buildCanonical, buildError, clearRef, computeBackoff, expectedProofLength, normalizeBaseUrl, runWithRetry, signRequest };
1428
+ export { APIPromise, type APIResponseInfo, type Account, type AccountBalance, AccountResource, type ApiKey, type ApplicationResult, type ApplicationStatus, type ApplyCreateParams, ApplyResource, type AttachRefOptions, type AttachRefResult, type AuditAnchor, type AuditBatch, type AuditEvent, AuditResource, type AuditStatus, type AuditVerification, type BatchOrderResultItem, type BatchOrdersResult, type Candle, type CandleInterval, type Category, type CreateMarketParams, CursorPage, type CursorPageInit, type CursorPageParams, DEFAULT_BASE_URL, type Decimal, type Env, type Envelope, type FeeEstimate, type FeeEstimateParams, FeesResource, type GrantClaimResult, type GrantEvent, type GrantEventType, type GrantPhase, type GrantTier, type GrantVesting, GrantsResource, type HealthStatus, type HmacHeaders, type HttpClientOptions, type KeyScope, type ListEnvelope, type ListMarketsParams, type ListOrdersParams, type ListTemplatesParams, type Market, type MarketStatus, type MarketTemplate, type MarketType, MarketsResource, type MerkleProof, type Order, type OrderHistoryParams, type OrderList, type OrderRow, type OrderStatus, type OrderType, type Orderbook, type OrderbookLevel, OrdersResource, type Outcome, PagePromise, PaxAuthError, PaxCircuitBreakerError, PaxClient, type PaxClientOptions, PaxConflictError, PaxError, type PaxErrorDetails, type PaxErrorPayload, PaxNotFoundError, PaxRateLimitError, PaxReadOnlyModeError, PaxSandboxOnlyError, PaxServerError, PaxValidationError, PaxWSClient, type PaxWSClientOptions, PaxWrongEnvKeyError, type PlaceOrderParams, type Position, type PriceHistoryRange, type RequestOptions, type ResponseMeta, type SandboxKeyMintParams, type SandboxKeyResult, SandboxKeysResource, SandboxResource, SettleResource, type Side, type SignInput, TemplatesResource, type Tier, type TierLimits, type TimeInForce, type TokenGrant, type Trade, VERSION, type WithResponseResult, type WsEvent, type WsHandler, attachRef, buildCanonical, buildError, clearRef, computeBackoff, expectedProofLength, fieldsMatchCanonical, normalizeBaseUrl, runWithRetry, signRequest };
package/dist/index.d.ts CHANGED
@@ -740,6 +740,8 @@ declare class AuditResource extends Resource {
740
740
  /** WebCrypto variant of verifyProof (same rules, including expectedLength). */
741
741
  static verifyProofAsync(leaf: string, root: string, proof: string[], expectedLength: number): Promise<boolean>;
742
742
  }
743
+ /** True when every bound top-level field equals its value inside the hashed `canonical`. */
744
+ declare function fieldsMatchCanonical(event: Partial<AuditEvent>): boolean;
743
745
 
744
746
  /**
745
747
  * Fees resource — pre-trade 5-actor split estimator.
@@ -1093,7 +1095,7 @@ declare class TemplatesResource extends Resource {
1093
1095
  * await pax.orders.place({ marketId: "hadjar-f1-2026", side: "yes", price: "0.05", size: "10" });
1094
1096
  */
1095
1097
 
1096
- declare const VERSION = "3.0.0";
1098
+ declare const VERSION = "3.0.1";
1097
1099
  type PaxClientOptions = HttpClientOptions;
1098
1100
  declare class PaxClient {
1099
1101
  private readonly _http;
@@ -1174,11 +1176,13 @@ interface AttachRefResult {
1174
1176
  /**
1175
1177
  * Detect + persist a builder ref, then return headers ready for PaxClient.
1176
1178
  *
1177
- * Precedence: explicit `ref` opt → URL `?ref=` → cookie → localStorage →
1178
- * in-memory (this process) → none.
1179
+ * Precedence: explicit `ref` opt → stored ref (cookie → localStorage →
1180
+ * in-memory) → URL `?ref=` → none.
1179
1181
  *
1180
- * When a fresh value is found in URL / explicit, it is persisted according
1181
- * to `storage` (default `cookie` in the browser, `memory` server-side).
1182
+ * First write wins: a `?ref=` in the URL is persisted only when no ref is
1183
+ * stored yet, so a later link cannot silently replace the referral that
1184
+ * brought the user in (same sticky semantics as the server). Only an explicit
1185
+ * `ref` option, or `clearRef()` first, replaces a stored value.
1182
1186
  */
1183
1187
  declare function attachRef(opts?: AttachRefOptions): AttachRefResult;
1184
1188
  /**
@@ -1421,4 +1425,4 @@ declare function runWithRetry<T>(fn: () => Promise<T>, opts?: {
1421
1425
  onRetry?: (attempt: number, error: Error) => void;
1422
1426
  }): Promise<T>;
1423
1427
 
1424
- export { APIPromise, type APIResponseInfo, type Account, type AccountBalance, AccountResource, type ApiKey, type ApplicationResult, type ApplicationStatus, type ApplyCreateParams, ApplyResource, type AttachRefOptions, type AttachRefResult, type AuditAnchor, type AuditBatch, type AuditEvent, AuditResource, type AuditStatus, type AuditVerification, type BatchOrderResultItem, type BatchOrdersResult, type Candle, type CandleInterval, type Category, type CreateMarketParams, CursorPage, type CursorPageInit, type CursorPageParams, DEFAULT_BASE_URL, type Decimal, type Env, type Envelope, type FeeEstimate, type FeeEstimateParams, FeesResource, type GrantClaimResult, type GrantEvent, type GrantEventType, type GrantPhase, type GrantTier, type GrantVesting, GrantsResource, type HealthStatus, type HmacHeaders, type HttpClientOptions, type KeyScope, type ListEnvelope, type ListMarketsParams, type ListOrdersParams, type ListTemplatesParams, type Market, type MarketStatus, type MarketTemplate, type MarketType, MarketsResource, type MerkleProof, type Order, type OrderHistoryParams, type OrderList, type OrderRow, type OrderStatus, type OrderType, type Orderbook, type OrderbookLevel, OrdersResource, type Outcome, PagePromise, PaxAuthError, PaxCircuitBreakerError, PaxClient, type PaxClientOptions, PaxConflictError, PaxError, type PaxErrorDetails, type PaxErrorPayload, PaxNotFoundError, PaxRateLimitError, PaxReadOnlyModeError, PaxSandboxOnlyError, PaxServerError, PaxValidationError, PaxWSClient, type PaxWSClientOptions, PaxWrongEnvKeyError, type PlaceOrderParams, type Position, type PriceHistoryRange, type RequestOptions, type ResponseMeta, type SandboxKeyMintParams, type SandboxKeyResult, SandboxKeysResource, SandboxResource, SettleResource, type Side, type SignInput, TemplatesResource, type Tier, type TierLimits, type TimeInForce, type TokenGrant, type Trade, VERSION, type WithResponseResult, type WsEvent, type WsHandler, attachRef, buildCanonical, buildError, clearRef, computeBackoff, expectedProofLength, normalizeBaseUrl, runWithRetry, signRequest };
1428
+ export { APIPromise, type APIResponseInfo, type Account, type AccountBalance, AccountResource, type ApiKey, type ApplicationResult, type ApplicationStatus, type ApplyCreateParams, ApplyResource, type AttachRefOptions, type AttachRefResult, type AuditAnchor, type AuditBatch, type AuditEvent, AuditResource, type AuditStatus, type AuditVerification, type BatchOrderResultItem, type BatchOrdersResult, type Candle, type CandleInterval, type Category, type CreateMarketParams, CursorPage, type CursorPageInit, type CursorPageParams, DEFAULT_BASE_URL, type Decimal, type Env, type Envelope, type FeeEstimate, type FeeEstimateParams, FeesResource, type GrantClaimResult, type GrantEvent, type GrantEventType, type GrantPhase, type GrantTier, type GrantVesting, GrantsResource, type HealthStatus, type HmacHeaders, type HttpClientOptions, type KeyScope, type ListEnvelope, type ListMarketsParams, type ListOrdersParams, type ListTemplatesParams, type Market, type MarketStatus, type MarketTemplate, type MarketType, MarketsResource, type MerkleProof, type Order, type OrderHistoryParams, type OrderList, type OrderRow, type OrderStatus, type OrderType, type Orderbook, type OrderbookLevel, OrdersResource, type Outcome, PagePromise, PaxAuthError, PaxCircuitBreakerError, PaxClient, type PaxClientOptions, PaxConflictError, PaxError, type PaxErrorDetails, type PaxErrorPayload, PaxNotFoundError, PaxRateLimitError, PaxReadOnlyModeError, PaxSandboxOnlyError, PaxServerError, PaxValidationError, PaxWSClient, type PaxWSClientOptions, PaxWrongEnvKeyError, type PlaceOrderParams, type Position, type PriceHistoryRange, type RequestOptions, type ResponseMeta, type SandboxKeyMintParams, type SandboxKeyResult, SandboxKeysResource, SandboxResource, SettleResource, type Side, type SignInput, TemplatesResource, type Tier, type TierLimits, type TimeInForce, type TokenGrant, type Trade, VERSION, type WithResponseResult, type WsEvent, type WsHandler, attachRef, buildCanonical, buildError, clearRef, computeBackoff, expectedProofLength, fieldsMatchCanonical, normalizeBaseUrl, runWithRetry, signRequest };
package/dist/index.js CHANGED
Binary file