@agg-build/sdk 4.28.2 → 4.29.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.
@@ -1,3 +1,4 @@
1
+ import { Static } from "@sinclair/typebox";
1
2
  //#region ../common/src/enums/venue.d.ts
2
3
  /** Use these constants instead of hardcoding "kalshi" or "polymarket". */
3
4
  declare enum Venue {
@@ -751,6 +752,8 @@ type OrderListItem = {
751
752
  txHash: string | null;
752
753
  errorMessage: string | null;
753
754
  dagRunId: string | null;
755
+ /** Self-custody: the linked wallet that signs this order (sign cancels with it). Null = managed. */
756
+ signerAddress?: string | null | undefined;
754
757
  venueMarket: {
755
758
  id: string;
756
759
  venueEventId?: string | undefined;
@@ -895,6 +898,7 @@ type VenueMarket = {
895
898
  price?: number | undefined;
896
899
  venueMarketId: string;
897
900
  label: string;
901
+ title?: string | null | undefined;
898
902
  winner?: boolean | null | undefined;
899
903
  /** Per-share USDC payout of this outcome in [0, 1] once settled; source of truth over `winner` when set. */
900
904
  payoutPerShare?: number | null | undefined;
@@ -1254,312 +1258,116 @@ type SyncBalancesResponse = {
1254
1258
  synced: true;
1255
1259
  };
1256
1260
  //#endregion
1257
- //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.49/node_modules/@sinclair/typebox/build/cjs/type/symbols/symbols.d.ts
1258
- /** Symbol key applied to readonly types */
1259
- declare const ReadonlyKind: unique symbol;
1260
- /** Symbol key applied to optional types */
1261
- declare const OptionalKind: unique symbol;
1262
- /** Symbol key applied to types */
1263
- declare const Hint: unique symbol;
1264
- /** Symbol key applied to types */
1265
- declare const Kind: unique symbol;
1266
- //#endregion
1267
- //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.49/node_modules/@sinclair/typebox/build/cjs/type/readonly/readonly.d.ts
1268
- type TReadonly<T extends TSchema> = T & {
1269
- [ReadonlyKind]: 'Readonly';
1270
- };
1271
- //#endregion
1272
- //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.49/node_modules/@sinclair/typebox/build/cjs/type/literal/literal.d.ts
1273
- type TLiteralValue = boolean | number | string;
1274
- interface TLiteral<T extends TLiteralValue = TLiteralValue> extends TSchema {
1275
- [Kind]: 'Literal';
1276
- static: T;
1277
- const: T;
1278
- }
1279
- //#endregion
1280
- //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.49/node_modules/@sinclair/typebox/build/cjs/type/union/union-type.d.ts
1281
- type UnionStatic<T extends TSchema[], P extends unknown[]> = { [K in keyof T]: T[K] extends TSchema ? Static<T[K], P> : never; }[number];
1282
- interface TUnion<T extends TSchema[] = TSchema[]> extends TSchema {
1283
- [Kind]: 'Union';
1284
- static: UnionStatic<T, this['params']>;
1285
- anyOf: T;
1286
- }
1287
- //#endregion
1288
- //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.49/node_modules/@sinclair/typebox/build/cjs/type/string/string.d.ts
1289
- type StringFormatOption = 'date-time' | 'time' | 'date' | 'email' | 'idn-email' | 'hostname' | 'idn-hostname' | 'ipv4' | 'ipv6' | 'uri' | 'uri-reference' | 'iri' | 'uuid' | 'iri-reference' | 'uri-template' | 'json-pointer' | 'relative-json-pointer' | 'regex' | ({} & string);
1290
- type StringContentEncodingOption = '7bit' | '8bit' | 'binary' | 'quoted-printable' | 'base64' | ({} & string);
1291
- interface StringOptions extends SchemaOptions {
1292
- /** The maximum string length */
1293
- maxLength?: number;
1294
- /** The minimum string length */
1295
- minLength?: number;
1296
- /** A regular expression pattern this string should match */
1297
- pattern?: string;
1298
- /** A format this string should match */
1299
- format?: StringFormatOption;
1300
- /** The content encoding for this string */
1301
- contentEncoding?: StringContentEncodingOption;
1302
- /** The content media type for this string */
1303
- contentMediaType?: string;
1304
- }
1305
- interface TString extends TSchema, StringOptions {
1306
- [Kind]: 'String';
1307
- static: string;
1308
- type: 'string';
1309
- }
1310
- //#endregion
1311
- //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.49/node_modules/@sinclair/typebox/build/cjs/type/boolean/boolean.d.ts
1312
- interface TBoolean extends TSchema {
1313
- [Kind]: 'Boolean';
1314
- static: boolean;
1315
- type: 'boolean';
1316
- }
1317
- //#endregion
1318
- //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.49/node_modules/@sinclair/typebox/build/cjs/type/number/number.d.ts
1319
- interface NumberOptions extends SchemaOptions {
1320
- exclusiveMaximum?: number;
1321
- exclusiveMinimum?: number;
1322
- maximum?: number;
1323
- minimum?: number;
1324
- multipleOf?: number;
1325
- }
1326
- interface TNumber extends TSchema, NumberOptions {
1327
- [Kind]: 'Number';
1328
- static: number;
1329
- type: 'number';
1330
- }
1331
- //#endregion
1332
- //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.49/node_modules/@sinclair/typebox/build/cjs/type/integer/integer.d.ts
1333
- interface IntegerOptions extends SchemaOptions {
1334
- exclusiveMaximum?: number;
1335
- exclusiveMinimum?: number;
1336
- maximum?: number;
1337
- minimum?: number;
1338
- multipleOf?: number;
1339
- }
1340
- interface TInteger extends TSchema, IntegerOptions {
1341
- [Kind]: 'Integer';
1342
- static: number;
1343
- type: 'integer';
1344
- }
1345
- //#endregion
1346
- //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.49/node_modules/@sinclair/typebox/build/cjs/type/optional/optional.d.ts
1347
- type TOptional<T extends TSchema> = T & {
1348
- [OptionalKind]: 'Optional';
1349
- };
1350
- //#endregion
1351
- //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.49/node_modules/@sinclair/typebox/build/cjs/type/null/null.d.ts
1352
- interface TNull extends TSchema {
1353
- [Kind]: 'Null';
1354
- static: null;
1355
- type: 'null';
1356
- }
1357
- //#endregion
1358
- //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.49/node_modules/@sinclair/typebox/build/cjs/type/static/static.d.ts
1359
- /** Creates a static type from a TypeBox type */
1360
- type Static<Type extends TSchema, Params extends unknown[] = [], Result = (Type & {
1361
- params: Params;
1362
- })['static']> = Result;
1363
- //#endregion
1364
- //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.49/node_modules/@sinclair/typebox/build/cjs/type/object/object.d.ts
1365
- type ReadonlyOptionalPropertyKeys<T extends TProperties> = { [K in keyof T]: T[K] extends TReadonly<TSchema> ? (T[K] extends TOptional<T[K]> ? K : never) : never; }[keyof T];
1366
- type ReadonlyPropertyKeys<T extends TProperties> = { [K in keyof T]: T[K] extends TReadonly<TSchema> ? (T[K] extends TOptional<T[K]> ? never : K) : never; }[keyof T];
1367
- type OptionalPropertyKeys<T extends TProperties> = { [K in keyof T]: T[K] extends TOptional<TSchema> ? (T[K] extends TReadonly<T[K]> ? never : K) : never; }[keyof T];
1368
- type RequiredPropertyKeys<T extends TProperties> = keyof Omit<T, ReadonlyOptionalPropertyKeys<T> | ReadonlyPropertyKeys<T> | OptionalPropertyKeys<T>>;
1369
- type ObjectStaticProperties<T extends TProperties, R extends Record<keyof any, unknown>> = Evaluate<(Readonly<Partial<Pick<R, ReadonlyOptionalPropertyKeys<T>>>> & Readonly<Pick<R, ReadonlyPropertyKeys<T>>> & Partial<Pick<R, OptionalPropertyKeys<T>>> & Required<Pick<R, RequiredPropertyKeys<T>>>)>;
1370
- type ObjectStatic<T extends TProperties, P extends unknown[]> = ObjectStaticProperties<T, { [K in keyof T]: Static<T[K], P>; }>;
1371
- type TPropertyKey = string | number;
1372
- type TProperties = Record<TPropertyKey, TSchema>;
1373
- type TIsLiteralString<Type extends string> = ([Type] extends [string] ? [string] extends [Type] ? false : true : false);
1374
- type IsRequiredArrayLiteralConstant<RequiredTuple extends string[]> = (RequiredTuple extends [infer Left extends string, ...infer _ extends string[]] ? TIsLiteralString<Left> : false);
1375
- type TRequiredArray<Properties extends TProperties, RequiredProperties extends TProperties = { [Key in keyof Properties as Properties[Key] extends TOptional<Properties[Key]> ? never : Key]: Properties[Key]; }, RequiredUnion extends string = Extract<keyof RequiredProperties, string>, RequiredTuple extends string[] = UnionToTuple<RequiredUnion>, Result extends string[] | undefined = (IsRequiredArrayLiteralConstant<RequiredTuple> extends true ? RequiredTuple : string[] | undefined)> = Result;
1376
- type TAdditionalProperties = undefined | TSchema | boolean;
1377
- interface ObjectOptions extends SchemaOptions {
1378
- /** Additional property constraints for this object */
1379
- additionalProperties?: TAdditionalProperties;
1380
- /** The minimum number of properties allowed on this object */
1381
- minProperties?: number;
1382
- /** The maximum number of properties allowed on this object */
1383
- maxProperties?: number;
1384
- }
1385
- interface TObject<T extends TProperties = TProperties> extends TSchema, ObjectOptions {
1386
- [Kind]: 'Object';
1387
- static: ObjectStatic<T, this['params']>;
1388
- additionalProperties?: TAdditionalProperties;
1389
- type: 'object';
1390
- properties: T;
1391
- required: TRequiredArray<T>;
1392
- }
1393
- //#endregion
1394
- //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.49/node_modules/@sinclair/typebox/build/cjs/type/helpers/helpers.d.ts
1395
- type UnionToIntersect<U> = (U extends unknown ? (arg: U) => 0 : never) extends ((arg: infer I) => 0) ? I : never;
1396
- type UnionLast<U> = UnionToIntersect<U extends unknown ? (x: U) => 0 : never> extends ((x: infer L) => 0) ? L : never;
1397
- type UnionToTuple<U, Acc extends unknown[] = [], R = UnionLast<U>> = [U] extends [never] ? Acc : UnionToTuple<Exclude<U, R>, [Extract<U, R>, ...Acc]>;
1398
- type Evaluate<T> = T extends (infer O) ? { [K in keyof O]: O[K]; } : never;
1399
- type Ensure<T> = T extends (infer U) ? U : never;
1400
- //#endregion
1401
- //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.49/node_modules/@sinclair/typebox/build/cjs/type/array/array.d.ts
1402
- interface ArrayOptions extends SchemaOptions {
1403
- /** The minimum number of items in this array */
1404
- minItems?: number;
1405
- /** The maximum number of items in this array */
1406
- maxItems?: number;
1407
- /** Should this schema contain unique items */
1408
- uniqueItems?: boolean;
1409
- /** A schema for which some elements should match */
1410
- contains?: TSchema;
1411
- /** A minimum number of contains schema matches */
1412
- minContains?: number;
1413
- /** A maximum number of contains schema matches */
1414
- maxContains?: number;
1415
- }
1416
- type ArrayStatic<T extends TSchema, P extends unknown[]> = Ensure<Static<T, P>[]>;
1417
- interface TArray<T extends TSchema = TSchema> extends TSchema, ArrayOptions {
1418
- [Kind]: 'Array';
1419
- static: ArrayStatic<T, this['params']>;
1420
- type: 'array';
1421
- items: T;
1422
- }
1423
- //#endregion
1424
- //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.49/node_modules/@sinclair/typebox/build/cjs/type/schema/schema.d.ts
1425
- interface SchemaOptions {
1426
- $schema?: string;
1427
- /** Id for this schema */
1428
- $id?: string;
1429
- /** Title of this schema */
1430
- title?: string;
1431
- /** Description of this schema */
1432
- description?: string;
1433
- /** Default value for this schema */
1434
- default?: any;
1435
- /** Example values matching this schema */
1436
- examples?: any;
1437
- /** Optional annotation for readOnly */
1438
- readOnly?: boolean;
1439
- /** Optional annotation for writeOnly */
1440
- writeOnly?: boolean;
1441
- [prop: string]: any;
1442
- }
1443
- interface TKind {
1444
- [Kind]: string;
1445
- }
1446
- interface TSchema extends TKind, SchemaOptions {
1447
- [ReadonlyKind]?: string;
1448
- [OptionalKind]?: string;
1449
- [Hint]?: string;
1450
- params: unknown[];
1451
- static: unknown;
1452
- }
1453
- //#endregion
1454
1261
  //#region ../common/src/typebox/schemas/errors.d.ts
1455
1262
  /**
1456
- * Stable machine-readable codes for `/execution/fill` and `/orderbook/.../route`
1457
- * 400 responses. The frontend branches on this to decide whether a rejection
1263
+ * Stable machine-readable codes for `/execution/fill`, `/execution/orders`,
1264
+ * `/execution/limit-orders` and `/orderbook/.../route` 400 responses. An order
1265
+ * refusal maps to one status and code on every order route. The frontend branches on this to decide whether a rejection
1458
1266
  * is recoverable (silently re-quote and retry) vs. terminal (surface to user).
1459
1267
  *
1460
1268
  * Always carry a human-readable `message` alongside; the code is additive and
1461
1269
  * may be absent on rejections that pre-date this addition.
1462
1270
  */
1463
- declare const QuoteErrorCodeTB: TUnion<[TLiteral<"quote_not_found">, TLiteral<"quote_expired">, TLiteral<"quote_already_executed">, TLiteral<"quote_cancelled">, TLiteral<"quote_user_mismatch">, TLiteral<"quote_app_blocked">, TLiteral<"quote_unfillable">, TLiteral<"quote_min_order_size">, TLiteral<"quote_stale_status">, TLiteral<"quote_stale_price">, TLiteral<"quote_insufficient_balance">, TLiteral<"quote_market_inactive">, TLiteral<"quote_self_custody_unsupported_venue">, TLiteral<"quote_self_custody_app_fee">, TLiteral<"quote_self_custody_redeem_unsupported">, TLiteral<"venue_not_executable">, TLiteral<"outcome_ambiguous">]>;
1271
+ declare const QuoteErrorCodeTB: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"quote_not_found">, import("@sinclair/typebox").TLiteral<"quote_expired">, import("@sinclair/typebox").TLiteral<"quote_already_executed">, import("@sinclair/typebox").TLiteral<"quote_cancelled">, import("@sinclair/typebox").TLiteral<"quote_user_mismatch">, import("@sinclair/typebox").TLiteral<"quote_app_blocked">, import("@sinclair/typebox").TLiteral<"quote_unfillable">, import("@sinclair/typebox").TLiteral<"quote_min_order_size">, import("@sinclair/typebox").TLiteral<"quote_stale_status">, import("@sinclair/typebox").TLiteral<"quote_stale_price">, import("@sinclair/typebox").TLiteral<"quote_insufficient_balance">, import("@sinclair/typebox").TLiteral<"quote_market_inactive">, import("@sinclair/typebox").TLiteral<"quote_self_custody_unsupported_venue">, import("@sinclair/typebox").TLiteral<"quote_self_custody_app_fee">, import("@sinclair/typebox").TLiteral<"quote_self_custody_redeem_unsupported">, import("@sinclair/typebox").TLiteral<"quote_self_custody_limitless_foreign_profile">, import("@sinclair/typebox").TLiteral<"quote_self_custody_limitless_smart_wallet">, import("@sinclair/typebox").TLiteral<"quote_self_custody_tiprun_ambiguous_account">, import("@sinclair/typebox").TLiteral<"venue_not_executable">, import("@sinclair/typebox").TLiteral<"outcome_ambiguous">, import("@sinclair/typebox").TLiteral<"paper_mode_unsupported">]>;
1464
1272
  type QuoteErrorCode = Static<typeof QuoteErrorCodeTB>;
1465
- declare const QuoteErrorTB: TObject<{
1466
- message: TString;
1467
- code: TOptional<TUnion<[TLiteral<"quote_not_found">, TLiteral<"quote_expired">, TLiteral<"quote_already_executed">, TLiteral<"quote_cancelled">, TLiteral<"quote_user_mismatch">, TLiteral<"quote_app_blocked">, TLiteral<"quote_unfillable">, TLiteral<"quote_min_order_size">, TLiteral<"quote_stale_status">, TLiteral<"quote_stale_price">, TLiteral<"quote_insufficient_balance">, TLiteral<"quote_market_inactive">, TLiteral<"quote_self_custody_unsupported_venue">, TLiteral<"quote_self_custody_app_fee">, TLiteral<"quote_self_custody_redeem_unsupported">, TLiteral<"venue_not_executable">, TLiteral<"outcome_ambiguous">]>>;
1273
+ declare const QuoteErrorTB: import("@sinclair/typebox").TObject<{
1274
+ message: import("@sinclair/typebox").TString;
1275
+ code: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"quote_not_found">, import("@sinclair/typebox").TLiteral<"quote_expired">, import("@sinclair/typebox").TLiteral<"quote_already_executed">, import("@sinclair/typebox").TLiteral<"quote_cancelled">, import("@sinclair/typebox").TLiteral<"quote_user_mismatch">, import("@sinclair/typebox").TLiteral<"quote_app_blocked">, import("@sinclair/typebox").TLiteral<"quote_unfillable">, import("@sinclair/typebox").TLiteral<"quote_min_order_size">, import("@sinclair/typebox").TLiteral<"quote_stale_status">, import("@sinclair/typebox").TLiteral<"quote_stale_price">, import("@sinclair/typebox").TLiteral<"quote_insufficient_balance">, import("@sinclair/typebox").TLiteral<"quote_market_inactive">, import("@sinclair/typebox").TLiteral<"quote_self_custody_unsupported_venue">, import("@sinclair/typebox").TLiteral<"quote_self_custody_app_fee">, import("@sinclair/typebox").TLiteral<"quote_self_custody_redeem_unsupported">, import("@sinclair/typebox").TLiteral<"quote_self_custody_limitless_foreign_profile">, import("@sinclair/typebox").TLiteral<"quote_self_custody_limitless_smart_wallet">, import("@sinclair/typebox").TLiteral<"quote_self_custody_tiprun_ambiguous_account">, import("@sinclair/typebox").TLiteral<"venue_not_executable">, import("@sinclair/typebox").TLiteral<"outcome_ambiguous">, import("@sinclair/typebox").TLiteral<"paper_mode_unsupported">]>>;
1468
1276
  }>;
1469
1277
  type QuoteError = Static<typeof QuoteErrorTB>;
1470
1278
  //#endregion
1471
1279
  //#region ../common/src/typebox/schemas/hosted-venue-account.d.ts
1472
1280
  /** Hosted ledger balances are not on-chain signing-wallet balances. */
1473
- declare const HostedVenueBalanceTB: TObject<{
1474
- asset: TLiteral<"USDC">;
1475
- decimals: TLiteral<6>;
1476
- totalRaw: TString;
1477
- availableRaw: TString;
1478
- unmatchedExposureRaw: TString;
1479
- updatedAt: TString;
1281
+ declare const HostedVenueBalanceTB: import("@sinclair/typebox").TObject<{
1282
+ asset: import("@sinclair/typebox").TLiteral<"USDC">;
1283
+ decimals: import("@sinclair/typebox").TLiteral<6>;
1284
+ totalRaw: import("@sinclair/typebox").TString;
1285
+ availableRaw: import("@sinclair/typebox").TString;
1286
+ unmatchedExposureRaw: import("@sinclair/typebox").TString;
1287
+ updatedAt: import("@sinclair/typebox").TString;
1480
1288
  }>;
1481
1289
  type HostedVenueBalance = Static<typeof HostedVenueBalanceTB>;
1482
- declare const HostedVenueAccountTB: TObject<{
1483
- venue: TLiteral<Venue.betdex>;
1484
- accountModel: TLiteral<"platform-hosted">;
1290
+ declare const HostedVenueAccountTB: import("@sinclair/typebox").TObject<{
1291
+ venue: import("@sinclair/typebox").TLiteral<Venue.betdex>;
1292
+ accountModel: import("@sinclair/typebox").TLiteral<"platform-hosted">;
1485
1293
  /** Agg account ID only. Provider wallet/app identities and keys stay private. */
1486
- accountId: TUnion<[TString, TNull]>;
1487
- environment: TUnion<[TLiteral<"sandbox">, TLiteral<"production">, TNull]>;
1488
- status: TUnion<[TLiteral<"not_created">, TLiteral<"provisioning">, TLiteral<"active">, TLiteral<"suspended">, TLiteral<"unavailable">, TLiteral<"disabled">]>;
1489
- provisioningEnabled: TBoolean;
1490
- fundingNetwork: TLiteral<"solana">;
1491
- balanceStatus: TUnion<[TLiteral<"available">, TLiteral<"unavailable">, TLiteral<"not_applicable">]>;
1492
- balance: TUnion<[TObject<{
1493
- asset: TLiteral<"USDC">;
1494
- decimals: TLiteral<6>;
1495
- totalRaw: TString;
1496
- availableRaw: TString;
1497
- unmatchedExposureRaw: TString;
1498
- updatedAt: TString;
1499
- }>, TNull]>;
1294
+ accountId: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
1295
+ environment: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"sandbox">, import("@sinclair/typebox").TLiteral<"production">, import("@sinclair/typebox").TNull]>;
1296
+ status: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"not_created">, import("@sinclair/typebox").TLiteral<"provisioning">, import("@sinclair/typebox").TLiteral<"active">, import("@sinclair/typebox").TLiteral<"suspended">, import("@sinclair/typebox").TLiteral<"unavailable">, import("@sinclair/typebox").TLiteral<"disabled">]>;
1297
+ provisioningEnabled: import("@sinclair/typebox").TBoolean;
1298
+ fundingNetwork: import("@sinclair/typebox").TLiteral<"solana">;
1299
+ balanceStatus: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"available">, import("@sinclair/typebox").TLiteral<"unavailable">, import("@sinclair/typebox").TLiteral<"not_applicable">]>;
1300
+ balance: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
1301
+ asset: import("@sinclair/typebox").TLiteral<"USDC">;
1302
+ decimals: import("@sinclair/typebox").TLiteral<6>;
1303
+ totalRaw: import("@sinclair/typebox").TString;
1304
+ availableRaw: import("@sinclair/typebox").TString;
1305
+ unmatchedExposureRaw: import("@sinclair/typebox").TString;
1306
+ updatedAt: import("@sinclair/typebox").TString;
1307
+ }>, import("@sinclair/typebox").TNull]>;
1500
1308
  }>;
1501
1309
  type HostedVenueAccount = Static<typeof HostedVenueAccountTB>;
1502
1310
  declare const HOSTED_VENUE_ACTIVITY_CODES: readonly ["Deposit", "Withdrawal", "TradeCreation", "TradeVoid", "TradeWin", "WalletToWallet", "Commission", "MarketPositionVoid", "MarketPositionPayout", "MarketPositionRefund", "ManualDebit", "ManualCredit", "SettlementResidual"];
1503
1311
  type HostedVenueActivityCode = (typeof HOSTED_VENUE_ACTIVITY_CODES)[number];
1504
- declare const HostedVenueActivityTB: TObject<{
1505
- venue: TLiteral<Venue.betdex>;
1506
- accountId: TString;
1507
- environment: TUnion<[TLiteral<"sandbox">, TLiteral<"production">]>;
1508
- asset: TLiteral<"USDC">;
1312
+ declare const HostedVenueActivityTB: import("@sinclair/typebox").TObject<{
1313
+ venue: import("@sinclair/typebox").TLiteral<Venue.betdex>;
1314
+ accountId: import("@sinclair/typebox").TString;
1315
+ environment: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"sandbox">, import("@sinclair/typebox").TLiteral<"production">]>;
1316
+ asset: import("@sinclair/typebox").TLiteral<"USDC">;
1509
1317
  /** Native ledger precision, not token-transfer or trade authorization units. */
1510
- decimals: TLiteral<18>;
1511
- page: TInteger;
1512
- nextPage: TUnion<[TInteger, TNull]>;
1513
- observedAt: TString;
1514
- items: TArray<TObject<{
1515
- id: TString;
1516
- code: TUnion<TLiteral<"Deposit" | "Withdrawal" | "TradeCreation" | "TradeVoid" | "TradeWin" | "WalletToWallet" | "Commission" | "MarketPositionVoid" | "MarketPositionPayout" | "MarketPositionRefund" | "ManualDebit" | "ManualCredit" | "SettlementResidual">[]>;
1517
- amountRaw: TString;
1518
- createdAt: TString;
1318
+ decimals: import("@sinclair/typebox").TLiteral<18>;
1319
+ page: import("@sinclair/typebox").TInteger;
1320
+ nextPage: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TInteger, import("@sinclair/typebox").TNull]>;
1321
+ observedAt: import("@sinclair/typebox").TString;
1322
+ items: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
1323
+ id: import("@sinclair/typebox").TString;
1324
+ code: import("@sinclair/typebox").TUnion<import("@sinclair/typebox").TLiteral<"Deposit" | "Withdrawal" | "TradeCreation" | "TradeVoid" | "TradeWin" | "WalletToWallet" | "Commission" | "MarketPositionVoid" | "MarketPositionPayout" | "MarketPositionRefund" | "ManualDebit" | "ManualCredit" | "SettlementResidual">[]>;
1325
+ amountRaw: import("@sinclair/typebox").TString;
1326
+ createdAt: import("@sinclair/typebox").TString;
1519
1327
  }>>;
1520
1328
  }>;
1521
1329
  type HostedVenueActivity = Static<typeof HostedVenueActivityTB>;
1522
- declare const HostedVenueActivityQueryTB: TObject<{
1523
- mode: TOptional<TUnion<[TLiteral<"live">, TLiteral<"paper">]>>;
1524
- page: TOptional<TNumber>;
1330
+ declare const HostedVenueActivityQueryTB: import("@sinclair/typebox").TObject<{
1331
+ mode: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"live">, import("@sinclair/typebox").TLiteral<"paper">]>>;
1332
+ page: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
1525
1333
  }>;
1526
1334
  type HostedVenueActivityQuery = Static<typeof HostedVenueActivityQueryTB>;
1527
- declare const HostedVenueDepositAddressTB: TObject<{
1528
- venue: TLiteral<Venue.betdex>;
1529
- accountId: TString;
1530
- environment: TUnion<[TLiteral<"sandbox">, TLiteral<"production">]>;
1531
- asset: TLiteral<"USDC">;
1532
- network: TLiteral<"solana">;
1533
- address: TString;
1534
- observedAt: TString;
1335
+ declare const HostedVenueDepositAddressTB: import("@sinclair/typebox").TObject<{
1336
+ venue: import("@sinclair/typebox").TLiteral<Venue.betdex>;
1337
+ accountId: import("@sinclair/typebox").TString;
1338
+ environment: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"sandbox">, import("@sinclair/typebox").TLiteral<"production">]>;
1339
+ asset: import("@sinclair/typebox").TLiteral<"USDC">;
1340
+ network: import("@sinclair/typebox").TLiteral<"solana">;
1341
+ address: import("@sinclair/typebox").TString;
1342
+ observedAt: import("@sinclair/typebox").TString;
1535
1343
  }>;
1536
1344
  type HostedVenueDepositAddress = Static<typeof HostedVenueDepositAddressTB>;
1537
- declare const HostedVenueWithdrawalRequestTB: TObject<{
1538
- mode: TLiteral<"live">;
1345
+ declare const HostedVenueWithdrawalRequestTB: import("@sinclair/typebox").TObject<{
1346
+ mode: import("@sinclair/typebox").TLiteral<"live">;
1539
1347
  /** Caller-owned idempotency key. Ambiguous native submissions are never replayed. */
1540
- requestId: TString;
1348
+ requestId: import("@sinclair/typebox").TString;
1541
1349
  /** Exact six-decimal USDC atoms; an omitted amount never means withdraw-all. */
1542
- amountRaw: TString;
1543
- destinationAddress: TString;
1350
+ amountRaw: import("@sinclair/typebox").TString;
1351
+ destinationAddress: import("@sinclair/typebox").TString;
1544
1352
  }>;
1545
1353
  type HostedVenueWithdrawalRequest = Static<typeof HostedVenueWithdrawalRequestTB>;
1546
- declare const HostedVenueWithdrawalTB: TObject<{
1547
- id: TString;
1548
- venue: TLiteral<Venue.betdex>;
1549
- accountId: TString;
1550
- environment: TUnion<[TLiteral<"sandbox">, TLiteral<"production">]>;
1551
- asset: TLiteral<"USDC">;
1552
- decimals: TLiteral<6>;
1553
- network: TLiteral<"solana">;
1554
- amountRaw: TString;
1555
- destinationAddress: TString;
1556
- status: TUnion<[TLiteral<"processing">, TLiteral<"confirmed">, TLiteral<"failed">, TLiteral<"flagged">, TLiteral<"review_required">]>;
1557
- createdAt: TString;
1558
- updatedAt: TString;
1354
+ declare const HostedVenueWithdrawalTB: import("@sinclair/typebox").TObject<{
1355
+ id: import("@sinclair/typebox").TString;
1356
+ venue: import("@sinclair/typebox").TLiteral<Venue.betdex>;
1357
+ accountId: import("@sinclair/typebox").TString;
1358
+ environment: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"sandbox">, import("@sinclair/typebox").TLiteral<"production">]>;
1359
+ asset: import("@sinclair/typebox").TLiteral<"USDC">;
1360
+ decimals: import("@sinclair/typebox").TLiteral<6>;
1361
+ network: import("@sinclair/typebox").TLiteral<"solana">;
1362
+ amountRaw: import("@sinclair/typebox").TString;
1363
+ destinationAddress: import("@sinclair/typebox").TString;
1364
+ status: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"processing">, import("@sinclair/typebox").TLiteral<"confirmed">, import("@sinclair/typebox").TLiteral<"failed">, import("@sinclair/typebox").TLiteral<"flagged">, import("@sinclair/typebox").TLiteral<"review_required">]>;
1365
+ createdAt: import("@sinclair/typebox").TString;
1366
+ updatedAt: import("@sinclair/typebox").TString;
1559
1367
  }>;
1560
1368
  type HostedVenueWithdrawal = Static<typeof HostedVenueWithdrawalTB>;
1561
- declare const ProvisionHostedVenueAccountBodyTB: TObject<{
1562
- mode: TLiteral<"live">;
1369
+ declare const ProvisionHostedVenueAccountBodyTB: import("@sinclair/typebox").TObject<{
1370
+ mode: import("@sinclair/typebox").TLiteral<"live">;
1563
1371
  }>;
1564
1372
  type ProvisionHostedVenueAccountBody = Static<typeof ProvisionHostedVenueAccountBodyTB>;
1565
1373
  //#endregion
@@ -2076,6 +1884,19 @@ interface SignatureRequest {
2076
1884
  * `approveMode: "user_broadcast"` on the fill instead and the approve is
2077
1885
  * requested as a `transaction` the user sends themselves. Handling this
2078
1886
  * request is what makes funding gasless.
1887
+ * - `solana_transaction` — `payload.messageBase64` is the serialized Solana
1888
+ * transaction MESSAGE; `payload.transactionBase64` is the full unsigned
1889
+ * `VersionedTransaction` for wallets that need one to display/simulate.
1890
+ * Return `0x` + 128 hex chars: the 64-byte ed25519 signature over the
1891
+ * decoded message. With a wallet adapter: `const signed = await
1892
+ * wallet.signTransaction(VersionedTransaction.deserialize(base64decode(transactionBase64)))`
1893
+ * then return the signature at the index of `signerAddress` in
1894
+ * `signed.message.staticAccountKeys`, hex-encoded. Do NOT send it — the
1895
+ * server co-signs as fee payer and broadcasts. The user needs no SOL.
1896
+ * The signature MUST be over the UNMODIFIED message: the server verifies
1897
+ * it against the bytes it persisted, so a wallet that inserts
1898
+ * instructions before signing (priority fee, guards, Lighthouse) gets a
1899
+ * 400 — disable such features for this request or sign the raw message.
2079
1900
  *
2080
1901
  * Return `{ txHash }` for anything the wallet BROADCASTS:
2081
1902
  *
@@ -2106,6 +1927,13 @@ declare const SELF_CUSTODY_POLL_INTERVAL_MS = 2000;
2106
1927
  * code), are never bounded by this.
2107
1928
  */
2108
1929
  declare const OPTIONAL_SIGNATURE_TIMEOUT_MS = 15000;
1930
+ /**
1931
+ * How long `fillSelfCustody` waits on an optional Polymarket buy fee pre-sign
1932
+ * (`purpose: "app_fee"`). It never holds the order (that round is already
1933
+ * posted), so it can wait for a slow wallet: just under the server's 60s grace,
1934
+ * after which the request is expired and a post-fill signature asked instead.
1935
+ */
1936
+ declare const OPTIONAL_FEE_SIGNATURE_TIMEOUT_MS = 55000;
2109
1937
  /**
2110
1938
  * States a run never leaves. Everything else means "still working".
2111
1939
  *
@@ -2358,6 +2186,10 @@ interface ListRecurringCryptoMarketsOptions {
2358
2186
  limit?: number;
2359
2187
  includeOrderbookPrices?: boolean;
2360
2188
  includeReferencePrices?: boolean;
2189
+ /**
2190
+ * @deprecated Ignored by the API. Recurring windows are listed from AGG's own
2191
+ * market data before they open, so the response is the same either way.
2192
+ */
2361
2193
  includeDirectVenueMarkets?: boolean;
2362
2194
  includeOrderbookDepth?: boolean;
2363
2195
  orderbookDepth?: number;
@@ -2817,6 +2649,11 @@ interface ExecuteManagedParams {
2817
2649
  * already linked to this account. Omit for managed custody (the default).
2818
2650
  */
2819
2651
  signingAddress?: string;
2652
+ /**
2653
+ * Self-custody buys only: other wallets linked to this account whose balances
2654
+ * may fund the fill. Must match the set the quote was priced with.
2655
+ */
2656
+ fundingAddresses?: string[];
2820
2657
  /**
2821
2658
  * Self-custody only: which approve shape a cross-chain fill uses when the
2822
2659
  * bridge needs an ERC20 approve. Omit (the default) for "sponsored" — the
@@ -3344,6 +3181,7 @@ type ManagedBalancesParams = {
3344
3181
  mode?: ExecutionMode;
3345
3182
  custody?: BalanceCustody;
3346
3183
  };
3184
+ type ManagedBalancesResponse = UnifiedBalanceResponse;
3347
3185
  interface PaperTradingAppOptions {
3348
3186
  /** App ID for the paper account namespace. Defaults to AggClient appId. */
3349
3187
  appId?: string;
@@ -3932,6 +3770,10 @@ interface SmartRouteParams {
3932
3770
  referralPayer?: "user" | "app";
3933
3771
  /** Required with `referralPayer: "app"`: the wallet that signs the parked payout transaction. */
3934
3772
  referralPayerAddress?: string;
3773
+ /** Self-custody: the linked wallet that will sign the fill. */
3774
+ signingAddress?: string;
3775
+ /** Self-custody buys: linked wallets (EVM hex or Solana base58) that may fund the fill. */
3776
+ fundingAddresses?: string[];
3935
3777
  /**
3936
3778
  * User-paid referral only: a wallet that pays Hyperliquid's one-time 1 USDC
3937
3779
  * activation fee for a referrer with no HyperCore account (self-custody
@@ -4040,6 +3882,11 @@ interface SmartRouteSlippage {
4040
3882
  /** Slippage in basis points relative to ref midpoint. */
4041
3883
  slippageBps: number;
4042
3884
  }
3885
+ /** Non-blocking: the quote is fillable, but not with the signingAddress it was priced for. */
3886
+ interface SmartRouteCustodyWarning {
3887
+ reason: string;
3888
+ message: string;
3889
+ }
4043
3890
  interface SmartRouteResponse {
4044
3891
  /** Accepted worst execution price for protected route legs. */
4045
3892
  legBounds?: Array<{
@@ -4167,6 +4014,7 @@ interface SmartRouteResponse {
4167
4014
  };
4168
4015
  /** @deprecated Echoed only when the deprecated request-side override is provided. */
4169
4016
  side?: SmartRouteSide;
4017
+ custodyWarnings?: SmartRouteCustodyWarning[];
4170
4018
  }
4171
4019
  interface CancelManagedExecutionResponse {
4172
4020
  quoteId: string | null;
@@ -4489,6 +4337,12 @@ declare class AggClient {
4489
4337
  private currentUser?;
4490
4338
  private listeners;
4491
4339
  private readonly webSocketAuthCleanups;
4340
+ /** Sockets bound to this session. The browser provider keeps one. */
4341
+ private readonly tradeSockets;
4342
+ /** Token already sent on the open trade socket. Submit must not send it again. */
4343
+ private tradeAuthSentForToken?;
4344
+ /** User id from the latest `{ type: "authenticated" }` on the trade socket. */
4345
+ private tradeSocketAuthenticatedUserId?;
4492
4346
  private storageKey;
4493
4347
  private shouldPersistSession;
4494
4348
  private authDelivery;
@@ -4627,8 +4481,14 @@ declare class AggClient {
4627
4481
  assetKey: string;
4628
4482
  cdnUrl: string;
4629
4483
  }>;
4630
- /** Disconnect a linked auth provider from the current user. */
4631
- disconnectAccount(provider: "wallet" | "solana_wallet" | "google" | "twitter" | "apple" | "email"): Promise<{
4484
+ /**
4485
+ * Disconnect a linked auth provider from the current user. Pass
4486
+ * `providerAccountId` (the wallet address) when the user has more than one
4487
+ * account for the same provider, or the server rejects the call as ambiguous.
4488
+ */
4489
+ disconnectAccount(provider: "wallet" | "solana_wallet" | "google" | "twitter" | "apple" | "email", options?: {
4490
+ providerAccountId?: string;
4491
+ }): Promise<{
4632
4492
  success: true;
4633
4493
  }>;
4634
4494
  /** Sign out — revoke all tokens server-side and clear local session. */
@@ -5003,7 +4863,20 @@ declare class AggClient {
5003
4863
  * pass `false` to disable or an object to tune the timings.
5004
4864
  */
5005
4865
  bookWatchdog?: false | Pick<BookWatchdogOptions, "silenceMs" | "checkIntervalMs">;
4866
+ /**
4867
+ * WebSocket implementation for runtimes without a global one (e.g. the
4868
+ * `ws` package on Node < 22). Node 22+ and browsers need nothing here.
4869
+ */
4870
+ webSocketImpl?: AggWebSocketOptions["webSocketImpl"];
5006
4871
  }): AggWebSocket;
4872
+ private openTradeSockets;
4873
+ /**
4874
+ * User events are registered by `{ action: "authenticate" }`, not a channel
4875
+ * subscribe. The confirmation is `{ type: "authenticated" }`. Send that
4876
+ * frame only when the socket is already open and it has not been sent for
4877
+ * this token. Opening a socket here would lose the fill to the handshake.
4878
+ */
4879
+ private confirmTradeSockets;
5007
4880
  private bindWebSocketAuth;
5008
4881
  /** Execute a previously quoted managed trade. Returns pending order IDs. */
5009
4882
  executeManaged(params: ExecuteManagedParams): Promise<ExecuteManagedResponse>;
@@ -5181,6 +5054,8 @@ interface WsTrade {
5181
5054
  size: number;
5182
5055
  /** @unit seconds (converted from server ms) */
5183
5056
  timestamp: number;
5057
+ /** Venue-unique trade id, when the venue supplies one (Hyperliquid today). */
5058
+ tradeId?: string;
5184
5059
  }
5185
5060
  type WsCandleInterval = "1m" | "5m" | "1h" | "1d";
5186
5061
  interface WsSubscribed {
@@ -5191,7 +5066,9 @@ interface WsSubscribed {
5191
5066
  /** Confirmed marketIds — only set on `arb` confirmations, whose
5192
5067
  * subscriptions are keyed by marketIds, not outcomeIds. */
5193
5068
  marketIds?: string[];
5194
- channel: "orderbook" | "trades" | "arb" | "arb-feed";
5069
+ channel: "orderbook" | "trades" | "arb" | "arb-feed" | "app-events";
5070
+ /** Echo of the request's `id`, when one was sent. */
5071
+ id?: string | number;
5195
5072
  }
5196
5073
  interface WsUnsubscribed {
5197
5074
  type: "unsubscribed";
@@ -5199,16 +5076,63 @@ interface WsUnsubscribed {
5199
5076
  outcomeIds: string[];
5200
5077
  /** Confirmed marketIds — only set on `arb` confirmations. */
5201
5078
  marketIds?: string[];
5202
- channel: "orderbook" | "trades" | "arb" | "arb-feed";
5079
+ channel: "orderbook" | "trades" | "arb" | "arb-feed" | "app-events";
5080
+ id?: string | number;
5203
5081
  }
5204
5082
  interface WsConnected {
5205
5083
  type: "connected";
5206
5084
  appId: string;
5207
5085
  userId?: string;
5086
+ /** Protocol revision. 2 adds error codes, request ids, event ids and resume. */
5087
+ protocolVersion?: number;
5088
+ /** `key` when admitted by `x-app-api-key`, `browser` when admitted by Origin. */
5089
+ auth?: "browser" | "key";
5208
5090
  }
5209
5091
  interface WsAuthenticated {
5210
5092
  type: "authenticated";
5211
5093
  userId: string;
5094
+ /** Token expiry (Unix ms). Re-authenticate before it, or user events stop. */
5095
+ expiresAt?: number;
5096
+ id?: string | number;
5097
+ }
5098
+ /** Sent about a minute before the user token expires. */
5099
+ interface WsAuthExpiring {
5100
+ type: "auth_expiring";
5101
+ userId: string;
5102
+ /** @unit milliseconds */
5103
+ expiresAt: number;
5104
+ }
5105
+ /**
5106
+ * The user session ended and the connection continues at app level: market
5107
+ * data keeps flowing, user events stop until you `authenticate` again.
5108
+ */
5109
+ interface WsAuthExpired {
5110
+ type: "auth_expired";
5111
+ userId: string;
5112
+ reason: "expired" | "revoked" | "suspended";
5113
+ }
5114
+ /**
5115
+ * End of a resume replay. When `complete` is false, events may have been
5116
+ * missed (outside the retention window, or the log was unavailable):
5117
+ * reconcile orders, balances and withdrawals over REST.
5118
+ */
5119
+ interface WsResumed {
5120
+ type: "resumed";
5121
+ stream: "user" | "app";
5122
+ fromEventId: string;
5123
+ replayed: number;
5124
+ complete: boolean;
5125
+ id?: string | number;
5126
+ }
5127
+ /**
5128
+ * Upstream delivery was interrupted; frames on `channels` may be missing.
5129
+ * Orderbooks are resnapshotted automatically; trades and arb updates in the
5130
+ * gap are not recoverable.
5131
+ */
5132
+ interface WsStreamInterrupted {
5133
+ type: "stream_interrupted";
5134
+ channels: string[];
5135
+ timestamp: number;
5212
5136
  }
5213
5137
  interface WsHeartbeat {
5214
5138
  type: "heartbeat";
@@ -5239,9 +5163,19 @@ interface WsMarketResolved {
5239
5163
  /** @unit seconds (converted from server ms) */
5240
5164
  timestamp: number;
5241
5165
  }
5166
+ /** Machine-readable error codes. Branch on `code`, not on `message`. */
5167
+ type WsErrorCode = "missing_app_id" | "invalid_app" | "origin_not_allowed" | "api_key_required" | "invalid_api_key" | "invalid_token" | "token_app_mismatch" | "admin_token_not_allowed" | "too_many_connections" | "rate_limited" | "invalid_message" | "too_many_ids" | "subscription_limit" | "outcomes_blocked" | "not_subscribed" | "snapshot_unavailable" | "app_events_forbidden" | "internal_error";
5242
5168
  interface WsError {
5243
5169
  type: "error";
5170
+ /** Absent only on servers older than protocol version 2. */
5171
+ code?: WsErrorCode;
5244
5172
  message: string;
5173
+ /** Echo of the `id` of the request that caused the error. */
5174
+ id?: string | number;
5175
+ /** Outcome ids the error applies to. */
5176
+ outcomeIds?: string[];
5177
+ /** Market ids the error applies to (arb). */
5178
+ marketIds?: string[];
5245
5179
  }
5246
5180
  interface WsOrderSubmitted {
5247
5181
  type: "order_submitted";
@@ -5251,8 +5185,20 @@ interface WsOrderSubmitted {
5251
5185
  price: number;
5252
5186
  size: number;
5253
5187
  outcomeId?: string;
5188
+ marketId?: string;
5254
5189
  /** @unit seconds (converted from server ms) */
5255
5190
  timestamp: number;
5191
+ /** Owner of the event. */
5192
+ userId?: string;
5193
+ /**
5194
+ * Position in the stream named by `stream` (`user` or `app`). Increasing
5195
+ * per stream; the SDK resumes from the last one after a reconnect and
5196
+ * drops duplicates. Absent if the server's event log was unavailable.
5197
+ */
5198
+ eventId?: string;
5199
+ stream?: "user" | "app";
5200
+ /** True when re-delivered by a resume. */
5201
+ replayed?: boolean;
5256
5202
  }
5257
5203
  interface WsBalanceUpdate {
5258
5204
  type: "balance_update";
@@ -5261,6 +5207,17 @@ interface WsBalanceUpdate {
5261
5207
  walletBalanceCents?: number;
5262
5208
  /** @unit seconds (converted from server ms) */
5263
5209
  timestamp: number;
5210
+ /** Owner of the event. */
5211
+ userId?: string;
5212
+ /**
5213
+ * Position in the stream named by `stream` (`user` or `app`). Increasing
5214
+ * per stream; the SDK resumes from the last one after a reconnect and
5215
+ * drops duplicates. Absent if the server's event log was unavailable.
5216
+ */
5217
+ eventId?: string;
5218
+ stream?: "user" | "app";
5219
+ /** True when re-delivered by a resume. */
5220
+ replayed?: boolean;
5264
5221
  }
5265
5222
  type WsOrderEventType = "cancelled" | "created" | "signed" | "pending_bridge" | "bridge_complete" | "submitting" | "submitted" | "expired" | "dag_started" | "dag_completed" | "dag_failed" | "dag_cancelled" | "step_started" | "step_completed" | "step_waiting" | "step_failed" | "step_retrying" | "filled" | "partial_fill" | "failed" | "bridge_ws_subscribed" | "bridge_ws_subscribe_failed" | "bridge_polling_fallback";
5266
5223
  interface WsOrderEvent {
@@ -5314,6 +5271,15 @@ interface WsOrderEvent {
5314
5271
  correlationId?: string;
5315
5272
  /** @unit milliseconds (raw from server — NOT converted like other WS types) */
5316
5273
  timestamp: number;
5274
+ /**
5275
+ * Position in the stream named by `stream` (`user` or `app`). Increasing
5276
+ * per stream; the SDK resumes from the last one after a reconnect and
5277
+ * drops duplicates. Absent if the server's event log was unavailable.
5278
+ */
5279
+ eventId?: string;
5280
+ stream?: "user" | "app";
5281
+ /** True when re-delivered by a resume. */
5282
+ replayed?: boolean;
5317
5283
  }
5318
5284
  interface WsRedeemEvent {
5319
5285
  type: "redeem_event";
@@ -5326,6 +5292,17 @@ interface WsRedeemEvent {
5326
5292
  errorMessage: string | null;
5327
5293
  /** @unit seconds (converted from server ms) */
5328
5294
  timestamp: number;
5295
+ /** Owner of the event. */
5296
+ userId?: string;
5297
+ /**
5298
+ * Position in the stream named by `stream` (`user` or `app`). Increasing
5299
+ * per stream; the SDK resumes from the last one after a reconnect and
5300
+ * drops duplicates. Absent if the server's event log was unavailable.
5301
+ */
5302
+ eventId?: string;
5303
+ stream?: "user" | "app";
5304
+ /** True when re-delivered by a resume. */
5305
+ replayed?: boolean;
5329
5306
  }
5330
5307
  /** Top-level withdrawal lifecycle states surfaced to partner clients. */
5331
5308
  type WsWithdrawalLifecycleStatus = "pending" | "bridging" | "transferring" | "completed" | "partial" | "failed";
@@ -5367,6 +5344,15 @@ interface WsWithdrawalLifecycleEvent {
5367
5344
  correlationId?: string;
5368
5345
  /** @unit milliseconds (raw from server — NOT converted like other WS types) */
5369
5346
  timestamp: number;
5347
+ /**
5348
+ * Position in the stream named by `stream` (`user` or `app`). Increasing
5349
+ * per stream; the SDK resumes from the last one after a reconnect and
5350
+ * drops duplicates. Absent if the server's event log was unavailable.
5351
+ */
5352
+ eventId?: string;
5353
+ stream?: "user" | "app";
5354
+ /** True when re-delivered by a resume. */
5355
+ replayed?: boolean;
5370
5356
  }
5371
5357
  interface WsArbMarketUpdate {
5372
5358
  type: "arb_market_update";
@@ -5397,7 +5383,22 @@ interface WsArbFeedBatch {
5397
5383
  chunk: number;
5398
5384
  chunkCount: number;
5399
5385
  }
5400
- type WsServerMessage = WsOrderbookSnapshot | WsOrderbookDelta | WsTrade | WsSubscribed | WsUnsubscribed | WsConnected | WsAuthenticated | WsHeartbeat | WsMarketResolved | WsError | WsOrderSubmitted | WsBalanceUpdate | WsOrderEvent | WsRedeemEvent | WsWithdrawalLifecycleEvent | WsArbMarketUpdate | WsArbFeedBatch;
5386
+ type WsServerMessage = WsOrderbookSnapshot | WsOrderbookDelta | WsTrade | WsSubscribed | WsUnsubscribed | WsConnected | WsAuthenticated | WsHeartbeat | WsMarketResolved | WsError | WsOrderSubmitted | WsBalanceUpdate | WsOrderEvent | WsRedeemEvent | WsWithdrawalLifecycleEvent | WsArbMarketUpdate | WsArbFeedBatch | WsAuthExpiring | WsAuthExpired | WsResumed | WsStreamInterrupted;
5387
+ /**
5388
+ * A user event as delivered on the `app-events` channel: the raw server
5389
+ * frame (timestamps in milliseconds, not converted), always with `userId`,
5390
+ * `stream: "app"` and normally an `eventId`.
5391
+ */
5392
+ type WsAppEvent = ((Omit<WsOrderSubmitted, "timestamp"> & {
5393
+ timestamp: number;
5394
+ }) | (Omit<WsBalanceUpdate, "timestamp"> & {
5395
+ timestamp: number;
5396
+ }) | WsOrderEvent | (Omit<WsRedeemEvent, "timestamp"> & {
5397
+ timestamp: number | string;
5398
+ }) | WsWithdrawalLifecycleEvent) & {
5399
+ userId: string;
5400
+ stream: "app";
5401
+ };
5401
5402
  type WsClientMessage = {
5402
5403
  action: "subscribe";
5403
5404
  channel: "orderbook" | "trades";
@@ -5427,6 +5428,14 @@ type WsClientMessage = {
5427
5428
  } | {
5428
5429
  action: "authenticate";
5429
5430
  token: string;
5431
+ resumeFrom?: string;
5432
+ } | {
5433
+ action: "subscribe";
5434
+ channel: "app-events";
5435
+ resumeFrom?: string;
5436
+ } | {
5437
+ action: "unsubscribe";
5438
+ channel: "app-events";
5430
5439
  };
5431
5440
  type DiagnosticEvent = {
5432
5441
  type: "seq_gap";
@@ -5444,6 +5453,15 @@ type DiagnosticEvent = {
5444
5453
  type: "reconnect";
5445
5454
  attempt: number;
5446
5455
  delayMs: number;
5456
+ } |
5457
+ /** The server closed with a configuration error (4001/4003); the SDK does not retry. */
5458
+ {
5459
+ type: "connection_rejected";
5460
+ code: number;
5461
+ reason: string;
5462
+ } | {
5463
+ type: "stream_interrupted";
5464
+ channels: string[];
5447
5465
  } | {
5448
5466
  type: "stale_connection";
5449
5467
  lastMessageAge: number;
@@ -5519,6 +5537,55 @@ declare function snapshotToOrderbook(snapshot: WsOrderbookSnapshot): OrderbookSt
5519
5537
  */
5520
5538
  declare function applyOrderbookDelta(state: OrderbookState, delta: WsOrderbookDelta): OrderbookState;
5521
5539
  //#endregion
5540
+ //#region src/self-custody-signing.d.ts
5541
+ /**
5542
+ * Signing policy for a self-custody fill's `pendingSignatures`, shared by
5543
+ * `AggClient.fillSelfCustody` and `@agg-build/hooks`' `useSelfCustodySigning`
5544
+ * so both answer the same requests in the same order with the same bounds.
5545
+ */
5546
+ /** EVM hex compares case-insensitively; Solana base58 is case-significant. */
5547
+ declare const isSameWalletAddress: (a: string, b: string) => boolean;
5548
+ /** True for the trade-executor's Polymarket order signature step. */
5549
+ declare const isPolymarketOrderSignatureStep: (stepId: string) => boolean;
5550
+ /** An optional fee pre-sign (`purpose: "app_fee"`), e.g. a Polymarket buy fee. */
5551
+ declare const isOptionalFeeRequest: (req: Pick<SignatureRequest, "optional" | "purpose">) => boolean;
5552
+ /**
5553
+ * A required fee request asked after every order filled: the post-fill sell
5554
+ * fee. Declining it leaves the fee uncollected; the trade itself is done.
5555
+ */
5556
+ declare const isPostFillFeeRequest: (req: Pick<SignatureRequest, "optional" | "purpose">, ordersFilled: boolean) => boolean;
5557
+ /** Every order on the run reached a fill (full or partial). False with no orders yet. */
5558
+ declare const areOrdersFilled: (orders: ReadonlyArray<{
5559
+ event: string | null;
5560
+ }> | undefined) => boolean;
5561
+ /**
5562
+ * The requests to sign now, required first.
5563
+ *
5564
+ * An optional fee pre-sign is prepared independently of the order, so it can
5565
+ * be listed before the order prompt exists; it is held back until the
5566
+ * Polymarket ORDER signature has been submitted, and then signed in a round of
5567
+ * its own so a slow or declined fee prompt never holds anything else. Every
5568
+ * other request goes in one batch: the server reads an optional signature (a
5569
+ * referral code, a sponsor) right after the order finalises, so a second round
5570
+ * would arrive too late.
5571
+ */
5572
+ declare const orderSignatureRound: (pending: readonly SignatureRequest[], { orderSubmitted }: {
5573
+ orderSubmitted: boolean;
5574
+ }) => SignatureRequest[];
5575
+ /** The user's own wallets for this fill: its signing address plus every required request's signer. */
5576
+ declare const userSignerAddresses: (pending: readonly SignatureRequest[], signingAddress?: string | null) => string[];
5577
+ /**
5578
+ * How long to wait on the signer for `req`, or `undefined` to wait for the
5579
+ * human. An optional fee pre-sign is bounded by
5580
+ * `OPTIONAL_FEE_SIGNATURE_TIMEOUT_MS`; an optional request addressed to a
5581
+ * wallet other than the user's (a partner's sponsor) by
5582
+ * `OPTIONAL_SIGNATURE_TIMEOUT_MS`. Required requests and optional ones the
5583
+ * user signs (a referral code) are never bounded.
5584
+ */
5585
+ declare const signatureTimeoutMs: (req: SignatureRequest, userSigners: readonly string[]) => number | undefined;
5586
+ /** Rejects after `ms` (when given); a late settlement of `promise` is ignored. */
5587
+ declare function withTimeout<T>(promise: Promise<T>, ms: number | undefined): Promise<T>;
5588
+ //#endregion
5522
5589
  //#region src/errors.d.ts
5523
5590
  /**
5524
5591
  * Thrown when the server returns `challenge_required` during auth start.
@@ -5858,6 +5925,14 @@ interface AggWebSocketCallbacks {
5858
5925
  onWithdrawalLifecycle?: (msg: WsWithdrawalLifecycleEvent) => void;
5859
5926
  onArbMarket?: (msg: WsArbMarketUpdate) => void;
5860
5927
  onArbFeed?: (batch: WsArbFeedBatch) => void;
5928
+ /** About a minute before the user token expires. Call `authenticate()` with a fresh token. */
5929
+ onAuthExpiring?: (msg: WsAuthExpiring) => void;
5930
+ /** The user session ended (expired, revoked, suspended); market data continues. */
5931
+ onAuthExpired?: (msg: WsAuthExpired) => void;
5932
+ /** A resume replay finished. `complete: false` → reconcile over REST. */
5933
+ onResumed?: (msg: WsResumed) => void;
5934
+ /** Upstream delivery was interrupted; orderbooks are resnapshotted automatically. */
5935
+ onStreamInterrupted?: (msg: WsStreamInterrupted) => void;
5861
5936
  onDiagnostics?: DiagnosticCallback;
5862
5937
  onConnectionStateChange?: (connected: boolean) => void;
5863
5938
  }
@@ -5891,9 +5966,26 @@ interface BookWatchdogOptions {
5891
5966
  /** How often silent books are looked for. Default 1 minute. */
5892
5967
  checkIntervalMs?: number;
5893
5968
  }
5969
+ /** Anything constructible like the WHATWG WebSocket — e.g. the `ws` package in Node. */
5970
+ type WebSocketConstructor = new (url: string, options?: any) => WebSocket;
5894
5971
  interface AggWebSocketOptions {
5895
5972
  /** Full WebSocket URL including query params (appId). Token should NOT be in the URL. */
5896
5973
  url: string;
5974
+ /**
5975
+ * WebSocket implementation. Defaults to `globalThis.WebSocket`. Server-side,
5976
+ * pass the `ws` package so `headers` (e.g. `x-app-api-key`) can be sent.
5977
+ */
5978
+ webSocketImpl?: WebSocketConstructor;
5979
+ /**
5980
+ * Handshake headers — server-side only (browsers cannot set them). Use
5981
+ * `{ "x-app-api-key": key }` to authenticate a backend connection.
5982
+ */
5983
+ headers?: Record<string, string>;
5984
+ /**
5985
+ * Resume user/app events from the last `eventId` after a reconnect, so a
5986
+ * dropped connection doesn't lose fills or withdrawal updates. Default true.
5987
+ */
5988
+ resumeEvents?: boolean;
5897
5989
  callbacks?: AggWebSocketCallbacks;
5898
5990
  /** JWT to send via the authenticate message after connecting (avoids token in URL/logs). */
5899
5991
  initialToken?: string;
@@ -5954,6 +6046,18 @@ declare class AggWebSocket {
5954
6046
  private hostDiagnostics?;
5955
6047
  private initialToken?;
5956
6048
  private readonly enableLogs;
6049
+ private readonly webSocketImpl?;
6050
+ private readonly headers?;
6051
+ private readonly resumeEvents;
6052
+ /** Last event id processed per stream; sent as `resumeFrom` on reconnect. */
6053
+ private readonly lastEventId;
6054
+ private lastEventUserId?;
6055
+ private readonly seenEventIds;
6056
+ /** Set once a connection has been established; later connects resume. */
6057
+ private hasConnected;
6058
+ private readonly appEventCbs;
6059
+ /** Last close was a configuration error; don't reconnect until connect() is called. */
6060
+ private rejected;
5957
6061
  constructor(options: AggWebSocketOptions);
5958
6062
  get connected(): boolean;
5959
6063
  /** Decode dynamic authenticated REST bytes in the same processing environment as live data. */
@@ -6000,6 +6104,16 @@ declare class AggWebSocket {
6000
6104
  private _subscribeTrades;
6001
6105
  /** Send a JWT to authenticate (or re-authenticate) the connection. */
6002
6106
  authenticate(token: string): void;
6107
+ /**
6108
+ * Receive every user event of this app (orders, balances, redeems,
6109
+ * withdrawals) — the server-side counterpart of a user session. Requires
6110
+ * a connection opened with an `x-app-api-key` for this app (pass
6111
+ * `webSocketImpl` + `headers`). Frames are raw: timestamps in ms. The
6112
+ * stream resumes from the last `eventId` across reconnects.
6113
+ */
6114
+ subscribeAppEvents(cb: (event: WsAppEvent) => void): () => void;
6115
+ private sendAppEventsSubscribe;
6116
+ private authenticateMessage;
6003
6117
  /** Request a fresh snapshot for one or more subscribed outcomes. */
6004
6118
  resnapshot(outcomeIdOrIds: string | string[]): void;
6005
6119
  /** Connect (idempotent). Called automatically on first subscribe. */
@@ -6022,6 +6136,12 @@ declare class AggWebSocket {
6022
6136
  * ready to accept subscriptions. Now flush all pending subs.
6023
6137
  */
6024
6138
  private handleConnected;
6139
+ /**
6140
+ * Track `eventId` per stream and drop duplicates a resume re-delivers.
6141
+ * App-stream frames go to `subscribeAppEvents` listeners only. Returns
6142
+ * false when the frame was consumed (duplicate or app event).
6143
+ */
6144
+ private acceptEvent;
6025
6145
  private handleSnapshot;
6026
6146
  private handleDelta;
6027
6147
  private handleTrade;
@@ -6061,5 +6181,5 @@ declare class AggWebSocket {
6061
6181
  private isOrderbookDebugEnabled;
6062
6182
  }
6063
6183
  //#endregion
6064
- export { WsOrderEventType as $, hasShape as $a, UserActivityDeposit as $i, NewsFeedArticleFeedItem as $n, NovigExecutionMode as $o, RecurringCryptoDurationInput as $r, AccountProvider as $s, CorrelatedMarketCascadeItem as $t, isAggApiError as A, WithdrawalSourceTokenSymbol as Aa, SignerFn as Ai, ExecutionOverallState as An, BookQuality as Ao, PaperTradingLiquidityStatus as Ar, VenueEventWithMarkets as As, AggLinkAccountWalletConfirmBody as At, WsArbFeedEntry as B, adjustLimitPriceRawToTick as Ba, SmartRouteSetupCostLine as Bi, LeaderboardMetric as Bn, GetBalanceQuery as Bo, PlaceLimitOrderResponse as Br, WalletTokenBalance as Bs, BalanceRefillPolicy as Bt, CandleBuilder as C, WithdrawalLeg as Ca, SELF_CUSTODY_FILL_TIMEOUT_MS as Ci, ExecuteManagedResponse as Cn, Account as Co, OutcomeOrderbookResponse as Cr, UserProfile as Cs, AggAuthWalletVerifyBody as Ct, AggApiFieldError as D, WithdrawalQuoteParams as Da, SetPaperTradingBalanceParams as Di, ExecutionMode as Dn, AuthCodeResponse as Do, PaperTradingAppOptions as Dr, ValidateTradeResponse as Ds, AggLinkAccountBody as Dt, AggApiErrorInit as E, WithdrawalLifecycleStatus as Ea, SearchResponse as Ei, ExecutionDisplayStepKind as En, AttributedOrderbookLevel as Eo, PaperTradingAccountsPage as Er, ValidateTradeRequest as Es, AggClientSessionInput as Et, computeChecksum as F, getBalanceRefillMaximumRaw as Fa, SmartRouteFill as Fi, ExecutionStatusResponse as Fn, CreateApp as Fo, PaperTradingPortfolio as Fr, VenueMarketOutcome as Fs, AppTradingMode as Ft, WsCandleInterval as G, normalizeVenueMarketCluster as Ga, SportsLiveParticipant as Gi, LeaderboardSeriesQuery as Gn, GetPositionsQuery as Go, RampQuoteRequest as Gr, OrderType as Gs, CancelOrderSignature as Gt, WsAttributedLevel as H, buildVenueUrl as Ha, SmartRouteStatus as Hi, LeaderboardRow as Hn, GetHoldingsQuery as Ho, PositionRedeemStatus as Hr, WithdrawalSource as Hs, BatchMidpointsResponse as Ht, snapshotToOrderbook as I, isBalanceRefillWithinDailyCap as Ia, SmartRouteParams as Ii, ExecutionStatusStep as In, DepositStep as Io, PaperTradingPosition as Ir, VenuePositionBalance as Is, AuthStatus as It, WsError as J, SplitsByAmountResult as Ja, TERMINAL_EXECUTION_STATES as Ji, ListRecurringCryptoMarketsOptions as Jn, MatchedMidpoint as Jo, RecurrenceCadence as Jr, CONFIRMED_MATCH_STATUSES as Js, ChartBarsResponse as Jt, WsClientMessage as K, optimizedImageUrl as Ka, SportsLiveResponse as Ki, LeaderboardStats as Kn, HelloResponse as Ko, RampSessionRequest as Kr, TimeInForce as Ks, CancelVenueOrderParams as Kt, DiagnosticCallback as L, LIMIT_PRICE_RAW_SCALE as La, SmartRouteResponse as Li, GetCryptoReferencePricesOptions as Ln, ExecuteManagedRequest as Lo, PaperTradingPositionsPage as Lr, VerifyBody as Ls, BalanceCustody as Lt, OrderbookState as M, projectedOrderbookChecksum as Ma, SmartRouteAllocation as Mi, ExecutionPositionsQuery as Mn, ComputeSplitsRequest as Mo, PaperTradingMarkSource as Mr, VenueKeySummary as Ms, AggregatedOrderbookLevel as Mt, VenueOrderbookLevel as N, DEFAULT_BALANCE_REFILL_DAILY_CAP_RAW as Na, SmartRouteBridgeStep as Ni, ExecutionStatusOrder as Nn, ComputeSplitsResponse as No, PaperTradingOrder as Nr, VenueMarket as Ns, AggregatedOrderbookResponse as Nt, AggRateLimitResponse as O, WithdrawalQuoteResponse as Oa, SignatureRequest as Oi, ExecutionOrderItem as On, AuthTokenResponse as Oo, PaperTradingBalanceAdjustment as Or, VenueEvent as Os, AggLinkAccountConfirmResult as Ot, applyOrderbookDelta as P, DEFAULT_BALANCE_REFILL_MAX_FEE_RAW as Pa, SmartRouteFeeBreakdown as Pi, ExecutionStatusQuery as Pn, ComputeSplitsSelection as Po, PaperTradingOrdersPage as Pr, VenueMarketListItem as Ps, AppClientConfigResponse as Pt, WsOrderEvent as Q, enumGuard as Qa, UserActivityBridge as Qi, MidpointRow as Qn, NonceResponse as Qo, RecurringCryptoDuration as Qr, Chain as Qs, ChartVenueCandles as Qt, DiagnosticEvent as R, LimitPriceSide as Ra, SmartRouteSettlementLeg as Ri, GetOrdersParams as Rn, ExecuteTradeRequest as Ro, PersistedAuthSnapshot as Rr, VerifyResponse as Rs, BalanceRefillAttempt as Rt, Candle as S, WithdrawalExpected as Sa, RpcTokenResponse as Si, ExecuteManagedParams as Sn, QuoteErrorCode as So, OutcomeMidpointRow as Sr, UserHolding as Ss, AggAuthVerifyBody as St, AggApiError as T, WithdrawalLegType as Ta, SearchParams as Ti, ExecutionDisplayGroupStatus as Tn, AttributedOrderbook as To, PaperTradingAccount as Tr, ValidateManagedRequest as Ts, AggClientOptions as Tt, WsAuthenticated as U, sortVenues as Ua, SmartRouteVenueFill as Ui, LeaderboardSeries as Un, GetHoldingsResponse as Uo, RECURRENCE_CADENCES as Ur, WithdrawalSourceItem as Us, BatchOrderbooksResponse as Ut, WsArbMarketUpdate as V, BuildVenueUrlOpts as Va, SmartRouteSide as Vi, LeaderboardQuery as Vn, GetBalanceResponse as Vo, PlacePaperTradingOrderParams as Vr, WithdrawManagedRequest as Vs, BalanceRefillPolicyStatus as Vt, WsBalanceUpdate as W, VenueMarketClusterNode as Wa, SportsGameStatus as Wi, LeaderboardSeriesPoint as Wn, GetOrdersQuery as Wo, RampQuote as Wr, OrderStatus as Ws, CancelManagedExecutionResponse as Wt, WsMarkSource as X, SafeParseResult as Xa, TradeExecutorOrderListResponse as Xi, MarkSource$1 as Xn, MatchedVenueMarketOutcomeRef as Xo, RecurringCryptoComparisonPoint as Xr, MatchStatus as Xs, ChartHistoryManifest as Xt, WsHeartbeat as Y, SafeParseFailure as Ya, TradeExecutorOrder as Yi, ManagedBalancesParams as Yn, MatchedMidpointOutcome as Yo, RecurrenceFilter as Yr, MarketStatus as Ys, ChartCandle as Yt, WsMarketResolved as Z, SafeParseSuccess as Za, UpdateBalanceRefillPolicyParams as Zi, MatchedOrderbookMarket as Zn, MidpointItem as Zo, RecurringCryptoComparisonPriceSource as Zr, MatchType as Zs, ChartResolution as Zt, loadImmutableHistory as _, WithdrawManagedResponse as _a, RequestedOrderbookMarket as _i, DepositAddressesReadyResponse as _n, HostedVenueDepositAddress as _o, OrderbookQuoteFill as _r, TradeSplit as _s, AggAuthDeliveryMode as _t, BookWatchdogOptions as a, UserActivityType as aa, INACTIVE_VENUES as ac, RecurringCryptoOutcomeOrderbookDepth as ai, CorrelatedMarketSignalDirection as an, parseEmail as ao, NewsFeedMarketFeedItem as ar, PositionGroup as as, WsSubscribed as at, mergeClosedCandles as b, WithdrawPreviewResponse as ba, ResolveCorrelatedMarketsResponse as bi, DepositAddressesToken as bn, ProvisionHostedVenueAccountBody as bo, OrderbookServiceUnavailableError as br, UpdateUserBody as bs, AggAuthStartBody as bt, MarketDataEngine as c, ValidateManagedParams as ca, Venue as cc, RecurringCryptoResolution as ci, CreatePaperTradingAccountParams as cn, getWalletAddressFromUserProfile as co, NewsFeedMarketNewsResponse as cr, PricesHistoryResponse as cs, WsVenueBook as ct, createAggClient as d, VenueGeoPolicyResponse as da, isVenueDataVisible as dc, RecurringCryptoWindowComparisons as di, CryptoReferencePriceMarketInput as dn, formatOutcomeTitle as do, NewsFeedStatusResponse as dr, SettlementDiff as ds, WsWithdrawalLegStatus as dt, UserActivityItem as ea, AccountType as ec, RecurringCryptoMarketMetrics as ei, CorrelatedMarketCascadeResponse as en, isEmail as eo, NewsFeedArticleFeedResponse as er, OrderListItem as es, WsOrderSubmitted as et, HostedVenueFundingIntent as f, VenueMarketRef as fa, isVenueInactive as fc, RecurringCryptoWindowMarket as fi, CryptoReferencePriceResult as fn, HostedVenueAccount as fo, OPTIONAL_SIGNATURE_TIMEOUT_MS as fr, SettlementDifference as fs, WsWithdrawalLifecycleEvent as ft, LoadImmutableHistoryOptions as g, WithdrawManagedParams as ga, RedeemResponse as gi, DepositAddressesPendingResponse as gn, HostedVenueBalance as go, OrderbookBatchItemStatus as gr, SyncBalancesResponse as gs, AggClient as gt, prepareHostedVenueRoute as h, VenueSoloQuote as ha, RedeemRequest as hi, CryptoReferencePricesResponse as hn, HostedVenueActivityQuery as ho, OrderbookBatchItemErrorCode as hr, SetupVenueKeyStep as hs, computeBestSplitsByAmount as ht, AggWebSocketOptions as i, UserActivityTrade as ia, ACTIVE_VENUES as ic, RecurringCryptoOutcome as ii, CorrelatedMarketSignalBatch as in, parse as io, NewsFeedMarketFeedArticle as ir, OutcomeMidpoint as is, WsServerMessage as it, OrderbookLevel as j, orderbookCrc32 as ja, SimpleOrderbookLevel as ji, ExecutionPositionGroup as jn, Category as jo, PaperTradingListParams as jr, VenueKeyStatus as js, AggSessionUser as jt, TurnstileChallengeError as k, WithdrawalSourceStatus as ka, SignatureRequestType as ki, ExecutionOrdersQuery as kn, AuthUser as ko, PaperTradingBalanceResponse as kr, VenueEventListItem as ks, AggLinkAccountResult as kt, MarketView as l, ValidateManagedResponse as la, getEffectiveDisabledVenues as lc, RecurringCryptoSourceConfidence as li, CryptoReferencePriceError as ln, formatMarketQuestion as lo, NewsFeedMarketNewsResult as lr, ProphetxExecutionMode as ls, WsVenueInfo as lt, prepareHostedVenueFunding as m, VenuePriceInfo as ma, RedeemLegStatus as mi, CryptoReferencePriceTarget as mn, HostedVenueActivityCode as mo, OrderbookBatchItemError as mr, SetupDepositAddressStep as ms, WsWithdrawalLifecycleStatus as mt, AggWebSocketCallbacks as n, UserActivityRedeem as na, ImageSize as nc, RecurringCryptoOrderbookDepthLevel as ni, CorrelatedMarketSide as nn, isFiniteNonNeg as no, NewsFeedLinkedMarket as nr, OrderbookHistoryPoint as ns, WsOrderbookSnapshot as nt, CandleTail as o, UserActivityUserOp as oa, VENUES as oc, RecurringCryptoPriceComparison as oi, CorrelatedMarketsStatus as on, parseEmailStrict as oo, NewsFeedMarketFeedResponse as or, PricePoint as os, WsTrade as ot, HostedVenueFundingOptions as p, VenueOrderbookEntry as pa, RedeemLegResult as pi, CryptoReferencePriceSource as pn, HostedVenueActivity as po, OrderListQuery as pr, SettlementSource as ps, WsWithdrawalLifecycleLeg as pt, WsConnected as q, retinaImageUrl as qa, SportsLiveState as qi, LimitOrderTimeInForce as qn, MarketPriceHistory as qo, RampWidgetSession as qr, TradeSide$1 as qs, ChartBarsMeta as qt, AggWebSocketDiagnostics as r, UserActivityRedeemLeg as ra, RETINA_IMAGE_SIZES as rc, RecurringCryptoOrderbookDepthSide as ri, CorrelatedMarketSignal as rn, isNonEmptyString as ro, NewsFeedListResponse as rr, OrderbookHistoryResponse as rs, WsRedeemEvent as rt, HistoryRangeRequest as s, UserActivityWithdrawal as sa, VENUE_CHAIN_IDS as sc, RecurringCryptoReferencePrice as si, CreateBalanceRefillPolicyParams as sn, safeParse as so, NewsFeedMarketNewsParams as sr, PriceSource as ss, WsUnsubscribed as st, AggWebSocket as t, UserActivityQuery as ta, IMAGE_SIZES as tc, RecurringCryptoMarketsResponse as ti, CorrelatedMarketQueryResult as tn, isEnum as to, NewsFeedArticleWithSummary as tr, Orderbook as ts, WsOrderbookDelta as tt, MarketViewBatch as u, VenueGeoPolicyEntry as ua, isVenueActive as uc, RecurringCryptoVenueMarket as ui, CryptoReferencePriceExternalMarketInput as un, formatOutcomeLabel as uo, NewsFeedPageOptions as ur, ServerWallet as us, WsVenueLevel as ut, aggregateMidpoint as v, WithdrawManagedSourceItem as va, ResetPaperTradingAccountParams as vi, DepositAddressesResponse as vn, HostedVenueWithdrawal as vo, OrderbookQuoteParams as vr, TradeStep as vs, AggAuthPrivyVerifyBody as vt, CandleInterval as w, WithdrawalLegStatus as wa, SELF_CUSTODY_POLL_INTERVAL_MS as wi, ExecutionDagProgress as wn, App as wo, PaginatedResponse as wr, ValidateBalanceOnClientStep as ws, AggClientAuthOptions as wt, toChecksumAddress as x, WithdrawTokenSymbol as xa, ResolvedCorrelatedMarketsResponse as xi, EventBootstrapResponse as xn, QuoteError as xo, OrderbooksOnlyError as xr, UpsertVenueKey as xs, AggAuthStartResult as xt, mergeCandles as y, WithdrawPreviewParams as ya, ResolveCorrelatedMarketsParams as yi, DepositAddressesSupportedChain as yn, HostedVenueWithdrawalRequest as yo, OrderbookQuoteResponse as yr, UnifiedBalanceResponse as ys, AggAuthProviderType as yt, WsArbFeedBatch as z, LimitPriceTickAdjustment as za, SmartRouteSettlementPlan as zi, GetPositionsParams as zn, ExecuteTradeResponse as zo, PlaceLimitOrderParams as zr, WalletChainBalance as zs, BalanceRefillAttemptStatus as zt };
6065
- //# sourceMappingURL=agg-websocket-BA8wCwM5.d.mts.map
6184
+ export { WsAuthExpired as $, getBalanceRefillMaximumRaw as $a, SmartRouteFill as $i, GetOrdersParams as $n, CreateApp as $o, PaperTradingPosition as $r, VenueMarketOutcome as $s, BalanceRefillAttempt as $t, isAggApiError as A, VenueMarketRef as Aa, isVenueInactive as Ac, RedeemLegResult as Ai, CryptoReferencePricesResponse as An, HostedVenueAccount as Ao, OrderListQuery as Ar, SettlementDifference as As, computeBestSplitsByAmount as At, OrderbookLevel as B, WithdrawalExpected as Ba, SELF_CUSTODY_FILL_TIMEOUT_MS as Bi, ExecutionDisplayGroupStatus as Bn, QuoteErrorCode as Bo, OutcomeOrderbookResponse as Br, UserHolding as Bs, AggClientOptions as Bt, CandleBuilder as C, UserActivityType as Ca, INACTIVE_VENUES as Cc, RecurringCryptoPriceComparison as Ci, CreatePaperTradingAccountParams as Cn, parseEmail as Co, NewsFeedMarketNewsParams as Cr, PositionGroup as Cs, WsVenueBook as Ct, AggApiFieldError as D, ValidateManagedResponse as Da, getEffectiveDisabledVenues as Dc, RecurringCryptoVenueMarket as Di, CryptoReferencePriceResult as Dn, formatMarketQuestion as Do, NewsFeedStatusResponse as Dr, ProphetxExecutionMode as Ds, WsWithdrawalLifecycleEvent as Dt, AggApiErrorInit as E, ValidateManagedParams as Ea, Venue as Ec, RecurringCryptoSourceConfidence as Ei, CryptoReferencePriceMarketInput as En, getWalletAddressFromUserProfile as Eo, NewsFeedPageOptions as Er, PricesHistoryResponse as Es, WsWithdrawalLegStatus as Et, isSameWalletAddress as F, WithdrawManagedResponse as Fa, ResetPaperTradingAccountParams as Fi, DepositAddressesToken as Fn, HostedVenueDepositAddress as Fo, OrderbookQuoteParams as Fr, TradeSplit as Fs, AggAuthStartBody as Ft, snapshotToOrderbook as G, WithdrawalQuoteParams as Ga, SignatureRequest as Gi, ExecutionOverallState as Gn, AuthCodeResponse as Go, PaperTradingBalanceAdjustment as Gr, ValidateTradeResponse as Gs, AggLinkAccountWalletConfirmBody as Gt, VenueOrderbookLevel as H, WithdrawalLegStatus as Ha, SearchParams as Hi, ExecutionMode as Hn, App as Ho, PaperTradingAccount as Hr, ValidateBalanceOnClientStep as Hs, AggLinkAccountBody as Ht, orderSignatureRound as I, WithdrawManagedSourceItem as Ia, ResolveCorrelatedMarketsParams as Ii, EventBootstrapResponse as In, HostedVenueWithdrawal as Io, OrderbookQuoteResponse as Ir, TradeStep as Is, AggAuthStartResult as It, WsAppEvent as J, WithdrawalSourceTokenSymbol as Ja, SimpleOrderbookLevel as Ji, ExecutionStatusOrder as Jn, BookQuality as Jo, PaperTradingListParams as Jr, VenueEventWithMarkets as Js, AggregatedOrderbookResponse as Jt, DiagnosticCallback as K, WithdrawalQuoteResponse as Ka, SignatureRequestType as Ki, ExecutionPositionGroup as Kn, AuthTokenResponse as Ko, PaperTradingBalanceResponse as Kr, VenueEvent as Ks, AggSessionUser as Kt, signatureTimeoutMs as L, WithdrawPreviewParams as La, ResolveCorrelatedMarketsResponse as Li, ExecuteManagedParams as Ln, HostedVenueWithdrawalRequest as Lo, OrderbookServiceUnavailableError as Lr, UnifiedBalanceResponse as Ls, AggAuthVerifyBody as Lt, isOptionalFeeRequest as M, VenuePriceInfo as Ma, RedeemRequest as Mi, DepositAddressesReadyResponse as Mn, HostedVenueActivityCode as Mo, OrderbookBatchItemErrorCode as Mr, SetupDepositAddressStep as Ms, AggAuthDeliveryMode as Mt, isPolymarketOrderSignatureStep as N, VenueSoloQuote as Na, RedeemResponse as Ni, DepositAddressesResponse as Nn, HostedVenueActivityQuery as No, OrderbookBatchItemStatus as Nr, SetupVenueKeyStep as Ns, AggAuthPrivyVerifyBody as Nt, AggRateLimitResponse as O, VenueGeoPolicyEntry as Oa, isVenueActive as Oc, RecurringCryptoWindowComparisons as Oi, CryptoReferencePriceSource as On, formatOutcomeLabel as Oo, OPTIONAL_FEE_SIGNATURE_TIMEOUT_MS as Or, ServerWallet as Os, WsWithdrawalLifecycleLeg as Ot, isPostFillFeeRequest as P, WithdrawManagedParams as Pa, RequestedOrderbookMarket as Pi, DepositAddressesSupportedChain as Pn, HostedVenueBalance as Po, OrderbookQuoteFill as Pr, SyncBalancesResponse as Ps, AggAuthProviderType as Pt, WsAttributedLevel as Q, DEFAULT_BALANCE_REFILL_MAX_FEE_RAW as Qa, SmartRouteFeeBreakdown as Qi, GetCryptoReferencePricesOptions as Qn, ComputeSplitsSelection as Qo, PaperTradingPortfolio as Qr, VenueMarketListItem as Qs, BalanceCustody as Qt, userSignerAddresses as R, WithdrawPreviewResponse as Ra, ResolvedCorrelatedMarketsResponse as Ri, ExecuteManagedResponse as Rn, ProvisionHostedVenueAccountBody as Ro, OrderbooksOnlyError as Rr, UpdateUserBody as Rs, AggAuthWalletVerifyBody as Rt, Candle as S, UserActivityTrade as Sa, ACTIVE_VENUES as Sc, RecurringCryptoOutcomeOrderbookDepth as Si, CreateBalanceRefillPolicyParams as Sn, parse as So, NewsFeedMarketFeedResponse as Sr, OutcomeMidpoint as Ss, WsUnsubscribed as St, AggApiError as T, UserActivityWithdrawal as Ta, VENUE_CHAIN_IDS as Tc, RecurringCryptoResolution as Ti, CryptoReferencePriceExternalMarketInput as Tn, safeParse as To, NewsFeedMarketNewsResult as Tr, PriceSource as Ts, WsVenueLevel as Tt, applyOrderbookDelta as U, WithdrawalLegType as Ua, SearchResponse as Ui, ExecutionOrderItem as Un, AttributedOrderbook as Uo, PaperTradingAccountsPage as Ur, ValidateManagedRequest as Us, AggLinkAccountConfirmResult as Ut, OrderbookState as V, WithdrawalLeg as Va, SELF_CUSTODY_POLL_INTERVAL_MS as Vi, ExecutionDisplayStepKind as Vn, Account as Vo, PaginatedResponse as Vr, UserProfile as Vs, AggClientSessionInput as Vt, computeChecksum as W, WithdrawalLifecycleStatus as Wa, SetPaperTradingBalanceParams as Wi, ExecutionOrdersQuery as Wn, AttributedOrderbookLevel as Wo, PaperTradingAppOptions as Wr, ValidateTradeRequest as Ws, AggLinkAccountResult as Wt, WsArbFeedEntry as X, projectedOrderbookChecksum as Xa, SmartRouteBridgeStep as Xi, ExecutionStatusResponse as Xn, ComputeSplitsRequest as Xo, PaperTradingOrder as Xr, VenueKeySummary as Xs, AppTradingMode as Xt, WsArbFeedBatch as Y, orderbookCrc32 as Ya, SmartRouteAllocation as Yi, ExecutionStatusQuery as Yn, Category as Yo, PaperTradingMarkSource as Yr, VenueKeyStatus as Ys, AppClientConfigResponse as Yt, WsArbMarketUpdate as Z, DEFAULT_BALANCE_REFILL_DAILY_CAP_RAW as Za, SmartRouteCustodyWarning as Zi, ExecutionStatusStep as Zn, ComputeSplitsResponse as Zo, PaperTradingOrdersPage as Zr, VenueMarket as Zs, AuthStatus as Zt, loadImmutableHistory as _, UserActivityDeposit as _a, AccountProvider as _c, RecurringCryptoMarketMetrics as _i, CorrelatedMarketSide as _n, hasShape as _o, NewsFeedArticleWithSummary as _r, NovigExecutionMode as _s, WsResumed as _t, BookWatchdogOptions as a, SmartRouteSide as aa, WithdrawManagedRequest as ac, PositionRedeemStatus as ai, CancelManagedExecutionResponse as an, BuildVenueUrlOpts as ao, LeaderboardSeriesPoint as ar, GetBalanceResponse as as, WsConnected as at, mergeClosedCandles as b, UserActivityRedeem as ba, ImageSize as bc, RecurringCryptoOrderbookDepthSide as bi, CorrelatedMarketSignalDirection as bn, isFiniteNonNeg as bo, NewsFeedMarketFeedArticle as br, OrderbookHistoryPoint as bs, WsSubscribed as bt, MarketDataEngine as c, SportsGameStatus as ca, OrderStatus as cc, RampQuoteRequest as ci, ChartBarsMeta as cn, VenueMarketClusterNode as co, LimitOrderTimeInForce as cr, GetOrdersQuery as cs, WsHeartbeat as ct, createAggClient as d, SportsLiveState as da, TradeSide$1 as dc, RecurrenceCadence as di, ChartHistoryManifest as dn, retinaImageUrl as do, ManagedBalancesResponse as dr, MarketPriceHistory as ds, WsOrderEvent as dt, SmartRouteParams as ea, VenuePositionBalance as ec, PaperTradingPositionsPage as ei, BalanceRefillAttemptStatus as en, isBalanceRefillWithinDailyCap as eo, GetPositionsParams as er, DepositStep as es, WsAuthExpiring as et, HostedVenueFundingIntent as f, TERMINAL_EXECUTION_STATES as fa, CONFIRMED_MATCH_STATUSES as fc, RecurrenceFilter as fi, ChartResolution as fn, SplitsByAmountResult as fo, MarkSource$1 as fr, MatchedMidpoint as fs, WsOrderEventType as ft, LoadImmutableHistoryOptions as g, UserActivityBridge as ga, Chain as gc, RecurringCryptoDurationInput as gi, CorrelatedMarketQueryResult as gn, enumGuard as go, NewsFeedArticleFeedResponse as gr, NonceResponse as gs, WsRedeemEvent as gt, prepareHostedVenueRoute as h, UpdateBalanceRefillPolicyParams as ha, MatchType as hc, RecurringCryptoDuration as hi, CorrelatedMarketCascadeResponse as hn, SafeParseSuccess as ho, NewsFeedArticleFeedItem as hr, MidpointItem as hs, WsOrderbookSnapshot as ht, AggWebSocketOptions as i, SmartRouteSetupCostLine as ia, WalletTokenBalance as ic, PlacePaperTradingOrderParams as ii, BatchOrderbooksResponse as in, adjustLimitPriceRawToTick as io, LeaderboardSeries as ir, GetBalanceQuery as is, WsClientMessage as it, areOrdersFilled as j, VenueOrderbookEntry as ja, RedeemLegStatus as ji, DepositAddressesPendingResponse as jn, HostedVenueActivity as jo, OrderbookBatchItemError as jr, SettlementSource as js, AggClient as jt, TurnstileChallengeError as k, VenueGeoPolicyResponse as ka, isVenueDataVisible as kc, RecurringCryptoWindowMarket as ki, CryptoReferencePriceTarget as kn, formatOutcomeTitle as ko, OPTIONAL_SIGNATURE_TIMEOUT_MS as kr, SettlementDiff as ks, WsWithdrawalLifecycleStatus as kt, MarketView as l, SportsLiveParticipant as la, OrderType as lc, RampSessionRequest as li, ChartBarsResponse as ln, normalizeVenueMarketCluster as lo, ListRecurringCryptoMarketsOptions as lr, GetPositionsQuery as ls, WsMarkSource as lt, prepareHostedVenueFunding as m, TradeExecutorOrderListResponse as ma, MatchStatus as mc, RecurringCryptoComparisonPriceSource as mi, CorrelatedMarketCascadeItem as mn, SafeParseResult as mo, MidpointRow as mr, MatchedVenueMarketOutcomeRef as ms, WsOrderbookDelta as mt, AggWebSocketCallbacks as n, SmartRouteSettlementLeg as na, VerifyResponse as nc, PlaceLimitOrderParams as ni, BalanceRefillPolicyStatus as nn, LimitPriceSide as no, LeaderboardQuery as nr, ExecuteTradeRequest as ns, WsBalanceUpdate as nt, CandleTail as o, SmartRouteStatus as oa, WithdrawalSource as oc, RECURRENCE_CADENCES as oi, CancelOrderSignature as on, buildVenueUrl as oo, LeaderboardSeriesQuery as or, GetHoldingsQuery as os, WsError as ot, HostedVenueFundingOptions as p, TradeExecutorOrder as pa, MarketStatus as pc, RecurringCryptoComparisonPoint as pi, ChartVenueCandles as pn, SafeParseFailure as po, MatchedOrderbookMarket as pr, MatchedMidpointOutcome as ps, WsOrderSubmitted as pt, DiagnosticEvent as q, WithdrawalSourceStatus as qa, SignerFn as qi, ExecutionPositionsQuery as qn, AuthUser as qo, PaperTradingLiquidityStatus as qr, VenueEventListItem as qs, AggregatedOrderbookLevel as qt, AggWebSocketDiagnostics as r, SmartRouteSettlementPlan as ra, WalletChainBalance as rc, PlaceLimitOrderResponse as ri, BatchMidpointsResponse as rn, LimitPriceTickAdjustment as ro, LeaderboardRow as rr, ExecuteTradeResponse as rs, WsCandleInterval as rt, HistoryRangeRequest as s, SmartRouteVenueFill as sa, WithdrawalSourceItem as sc, RampQuote as si, CancelVenueOrderParams as sn, sortVenues as so, LeaderboardStats as sr, GetHoldingsResponse as ss, WsErrorCode as st, AggWebSocket as t, SmartRouteResponse as ta, VerifyBody as tc, PersistedAuthSnapshot as ti, BalanceRefillPolicy as tn, LIMIT_PRICE_RAW_SCALE as to, LeaderboardMetric as tr, ExecuteManagedRequest as ts, WsAuthenticated as tt, MarketViewBatch as u, SportsLiveResponse as ua, TimeInForce as uc, RampWidgetSession as ui, ChartCandle as un, optimizedImageUrl as uo, ManagedBalancesParams as ur, HelloResponse as us, WsMarketResolved as ut, aggregateMidpoint as v, UserActivityItem as va, AccountType as vc, RecurringCryptoMarketsResponse as vi, CorrelatedMarketSignal as vn, isEmail as vo, NewsFeedLinkedMarket as vr, OrderListItem as vs, WsServerMessage as vt, CandleInterval as w, UserActivityUserOp as wa, VENUES as wc, RecurringCryptoReferencePrice as wi, CryptoReferencePriceError as wn, parseEmailStrict as wo, NewsFeedMarketNewsResponse as wr, PricePoint as ws, WsVenueInfo as wt, toChecksumAddress as x, UserActivityRedeemLeg as xa, RETINA_IMAGE_SIZES as xc, RecurringCryptoOutcome as xi, CorrelatedMarketsStatus as xn, isNonEmptyString as xo, NewsFeedMarketFeedItem as xr, OrderbookHistoryResponse as xs, WsTrade as xt, mergeCandles as y, UserActivityQuery as ya, IMAGE_SIZES as yc, RecurringCryptoOrderbookDepthLevel as yi, CorrelatedMarketSignalBatch as yn, isEnum as yo, NewsFeedListResponse as yr, Orderbook as ys, WsStreamInterrupted as yt, withTimeout as z, WithdrawTokenSymbol as za, RpcTokenResponse as zi, ExecutionDagProgress as zn, QuoteError as zo, OutcomeMidpointRow as zr, UpsertVenueKey as zs, AggClientAuthOptions as zt };
6185
+ //# sourceMappingURL=agg-websocket-BUI5Bx-n.d.mts.map