@agg-build/sdk 4.28.2 → 4.29.0

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
  *
@@ -2817,6 +2645,11 @@ interface ExecuteManagedParams {
2817
2645
  * already linked to this account. Omit for managed custody (the default).
2818
2646
  */
2819
2647
  signingAddress?: string;
2648
+ /**
2649
+ * Self-custody buys only: other wallets linked to this account whose balances
2650
+ * may fund the fill. Must match the set the quote was priced with.
2651
+ */
2652
+ fundingAddresses?: string[];
2820
2653
  /**
2821
2654
  * Self-custody only: which approve shape a cross-chain fill uses when the
2822
2655
  * bridge needs an ERC20 approve. Omit (the default) for "sponsored" — the
@@ -3344,6 +3177,7 @@ type ManagedBalancesParams = {
3344
3177
  mode?: ExecutionMode;
3345
3178
  custody?: BalanceCustody;
3346
3179
  };
3180
+ type ManagedBalancesResponse = UnifiedBalanceResponse;
3347
3181
  interface PaperTradingAppOptions {
3348
3182
  /** App ID for the paper account namespace. Defaults to AggClient appId. */
3349
3183
  appId?: string;
@@ -3932,6 +3766,10 @@ interface SmartRouteParams {
3932
3766
  referralPayer?: "user" | "app";
3933
3767
  /** Required with `referralPayer: "app"`: the wallet that signs the parked payout transaction. */
3934
3768
  referralPayerAddress?: string;
3769
+ /** Self-custody: the linked wallet that will sign the fill. */
3770
+ signingAddress?: string;
3771
+ /** Self-custody buys: linked wallets (EVM hex or Solana base58) that may fund the fill. */
3772
+ fundingAddresses?: string[];
3935
3773
  /**
3936
3774
  * User-paid referral only: a wallet that pays Hyperliquid's one-time 1 USDC
3937
3775
  * activation fee for a referrer with no HyperCore account (self-custody
@@ -4040,6 +3878,11 @@ interface SmartRouteSlippage {
4040
3878
  /** Slippage in basis points relative to ref midpoint. */
4041
3879
  slippageBps: number;
4042
3880
  }
3881
+ /** Non-blocking: the quote is fillable, but not with the signingAddress it was priced for. */
3882
+ interface SmartRouteCustodyWarning {
3883
+ reason: string;
3884
+ message: string;
3885
+ }
4043
3886
  interface SmartRouteResponse {
4044
3887
  /** Accepted worst execution price for protected route legs. */
4045
3888
  legBounds?: Array<{
@@ -4167,6 +4010,7 @@ interface SmartRouteResponse {
4167
4010
  };
4168
4011
  /** @deprecated Echoed only when the deprecated request-side override is provided. */
4169
4012
  side?: SmartRouteSide;
4013
+ custodyWarnings?: SmartRouteCustodyWarning[];
4170
4014
  }
4171
4015
  interface CancelManagedExecutionResponse {
4172
4016
  quoteId: string | null;
@@ -4489,6 +4333,12 @@ declare class AggClient {
4489
4333
  private currentUser?;
4490
4334
  private listeners;
4491
4335
  private readonly webSocketAuthCleanups;
4336
+ /** Sockets bound to this session. The browser provider keeps one. */
4337
+ private readonly tradeSockets;
4338
+ /** Token already sent on the open trade socket. Submit must not send it again. */
4339
+ private tradeAuthSentForToken?;
4340
+ /** User id from the latest `{ type: "authenticated" }` on the trade socket. */
4341
+ private tradeSocketAuthenticatedUserId?;
4492
4342
  private storageKey;
4493
4343
  private shouldPersistSession;
4494
4344
  private authDelivery;
@@ -4627,8 +4477,14 @@ declare class AggClient {
4627
4477
  assetKey: string;
4628
4478
  cdnUrl: string;
4629
4479
  }>;
4630
- /** Disconnect a linked auth provider from the current user. */
4631
- disconnectAccount(provider: "wallet" | "solana_wallet" | "google" | "twitter" | "apple" | "email"): Promise<{
4480
+ /**
4481
+ * Disconnect a linked auth provider from the current user. Pass
4482
+ * `providerAccountId` (the wallet address) when the user has more than one
4483
+ * account for the same provider, or the server rejects the call as ambiguous.
4484
+ */
4485
+ disconnectAccount(provider: "wallet" | "solana_wallet" | "google" | "twitter" | "apple" | "email", options?: {
4486
+ providerAccountId?: string;
4487
+ }): Promise<{
4632
4488
  success: true;
4633
4489
  }>;
4634
4490
  /** Sign out — revoke all tokens server-side and clear local session. */
@@ -5003,7 +4859,20 @@ declare class AggClient {
5003
4859
  * pass `false` to disable or an object to tune the timings.
5004
4860
  */
5005
4861
  bookWatchdog?: false | Pick<BookWatchdogOptions, "silenceMs" | "checkIntervalMs">;
4862
+ /**
4863
+ * WebSocket implementation for runtimes without a global one (e.g. the
4864
+ * `ws` package on Node < 22). Node 22+ and browsers need nothing here.
4865
+ */
4866
+ webSocketImpl?: AggWebSocketOptions["webSocketImpl"];
5006
4867
  }): AggWebSocket;
4868
+ private openTradeSockets;
4869
+ /**
4870
+ * User events are registered by `{ action: "authenticate" }`, not a channel
4871
+ * subscribe. The confirmation is `{ type: "authenticated" }`. Send that
4872
+ * frame only when the socket is already open and it has not been sent for
4873
+ * this token. Opening a socket here would lose the fill to the handshake.
4874
+ */
4875
+ private confirmTradeSockets;
5007
4876
  private bindWebSocketAuth;
5008
4877
  /** Execute a previously quoted managed trade. Returns pending order IDs. */
5009
4878
  executeManaged(params: ExecuteManagedParams): Promise<ExecuteManagedResponse>;
@@ -5181,6 +5050,8 @@ interface WsTrade {
5181
5050
  size: number;
5182
5051
  /** @unit seconds (converted from server ms) */
5183
5052
  timestamp: number;
5053
+ /** Venue-unique trade id, when the venue supplies one (Hyperliquid today). */
5054
+ tradeId?: string;
5184
5055
  }
5185
5056
  type WsCandleInterval = "1m" | "5m" | "1h" | "1d";
5186
5057
  interface WsSubscribed {
@@ -5191,7 +5062,9 @@ interface WsSubscribed {
5191
5062
  /** Confirmed marketIds — only set on `arb` confirmations, whose
5192
5063
  * subscriptions are keyed by marketIds, not outcomeIds. */
5193
5064
  marketIds?: string[];
5194
- channel: "orderbook" | "trades" | "arb" | "arb-feed";
5065
+ channel: "orderbook" | "trades" | "arb" | "arb-feed" | "app-events";
5066
+ /** Echo of the request's `id`, when one was sent. */
5067
+ id?: string | number;
5195
5068
  }
5196
5069
  interface WsUnsubscribed {
5197
5070
  type: "unsubscribed";
@@ -5199,16 +5072,63 @@ interface WsUnsubscribed {
5199
5072
  outcomeIds: string[];
5200
5073
  /** Confirmed marketIds — only set on `arb` confirmations. */
5201
5074
  marketIds?: string[];
5202
- channel: "orderbook" | "trades" | "arb" | "arb-feed";
5075
+ channel: "orderbook" | "trades" | "arb" | "arb-feed" | "app-events";
5076
+ id?: string | number;
5203
5077
  }
5204
5078
  interface WsConnected {
5205
5079
  type: "connected";
5206
5080
  appId: string;
5207
5081
  userId?: string;
5082
+ /** Protocol revision. 2 adds error codes, request ids, event ids and resume. */
5083
+ protocolVersion?: number;
5084
+ /** `key` when admitted by `x-app-api-key`, `browser` when admitted by Origin. */
5085
+ auth?: "browser" | "key";
5208
5086
  }
5209
5087
  interface WsAuthenticated {
5210
5088
  type: "authenticated";
5211
5089
  userId: string;
5090
+ /** Token expiry (Unix ms). Re-authenticate before it, or user events stop. */
5091
+ expiresAt?: number;
5092
+ id?: string | number;
5093
+ }
5094
+ /** Sent about a minute before the user token expires. */
5095
+ interface WsAuthExpiring {
5096
+ type: "auth_expiring";
5097
+ userId: string;
5098
+ /** @unit milliseconds */
5099
+ expiresAt: number;
5100
+ }
5101
+ /**
5102
+ * The user session ended and the connection continues at app level: market
5103
+ * data keeps flowing, user events stop until you `authenticate` again.
5104
+ */
5105
+ interface WsAuthExpired {
5106
+ type: "auth_expired";
5107
+ userId: string;
5108
+ reason: "expired" | "revoked" | "suspended";
5109
+ }
5110
+ /**
5111
+ * End of a resume replay. When `complete` is false, events may have been
5112
+ * missed (outside the retention window, or the log was unavailable):
5113
+ * reconcile orders, balances and withdrawals over REST.
5114
+ */
5115
+ interface WsResumed {
5116
+ type: "resumed";
5117
+ stream: "user" | "app";
5118
+ fromEventId: string;
5119
+ replayed: number;
5120
+ complete: boolean;
5121
+ id?: string | number;
5122
+ }
5123
+ /**
5124
+ * Upstream delivery was interrupted; frames on `channels` may be missing.
5125
+ * Orderbooks are resnapshotted automatically; trades and arb updates in the
5126
+ * gap are not recoverable.
5127
+ */
5128
+ interface WsStreamInterrupted {
5129
+ type: "stream_interrupted";
5130
+ channels: string[];
5131
+ timestamp: number;
5212
5132
  }
5213
5133
  interface WsHeartbeat {
5214
5134
  type: "heartbeat";
@@ -5239,9 +5159,19 @@ interface WsMarketResolved {
5239
5159
  /** @unit seconds (converted from server ms) */
5240
5160
  timestamp: number;
5241
5161
  }
5162
+ /** Machine-readable error codes. Branch on `code`, not on `message`. */
5163
+ 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
5164
  interface WsError {
5243
5165
  type: "error";
5166
+ /** Absent only on servers older than protocol version 2. */
5167
+ code?: WsErrorCode;
5244
5168
  message: string;
5169
+ /** Echo of the `id` of the request that caused the error. */
5170
+ id?: string | number;
5171
+ /** Outcome ids the error applies to. */
5172
+ outcomeIds?: string[];
5173
+ /** Market ids the error applies to (arb). */
5174
+ marketIds?: string[];
5245
5175
  }
5246
5176
  interface WsOrderSubmitted {
5247
5177
  type: "order_submitted";
@@ -5251,8 +5181,20 @@ interface WsOrderSubmitted {
5251
5181
  price: number;
5252
5182
  size: number;
5253
5183
  outcomeId?: string;
5184
+ marketId?: string;
5254
5185
  /** @unit seconds (converted from server ms) */
5255
5186
  timestamp: number;
5187
+ /** Owner of the event. */
5188
+ userId?: string;
5189
+ /**
5190
+ * Position in the stream named by `stream` (`user` or `app`). Increasing
5191
+ * per stream; the SDK resumes from the last one after a reconnect and
5192
+ * drops duplicates. Absent if the server's event log was unavailable.
5193
+ */
5194
+ eventId?: string;
5195
+ stream?: "user" | "app";
5196
+ /** True when re-delivered by a resume. */
5197
+ replayed?: boolean;
5256
5198
  }
5257
5199
  interface WsBalanceUpdate {
5258
5200
  type: "balance_update";
@@ -5261,6 +5203,17 @@ interface WsBalanceUpdate {
5261
5203
  walletBalanceCents?: number;
5262
5204
  /** @unit seconds (converted from server ms) */
5263
5205
  timestamp: number;
5206
+ /** Owner of the event. */
5207
+ userId?: string;
5208
+ /**
5209
+ * Position in the stream named by `stream` (`user` or `app`). Increasing
5210
+ * per stream; the SDK resumes from the last one after a reconnect and
5211
+ * drops duplicates. Absent if the server's event log was unavailable.
5212
+ */
5213
+ eventId?: string;
5214
+ stream?: "user" | "app";
5215
+ /** True when re-delivered by a resume. */
5216
+ replayed?: boolean;
5264
5217
  }
5265
5218
  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
5219
  interface WsOrderEvent {
@@ -5314,6 +5267,15 @@ interface WsOrderEvent {
5314
5267
  correlationId?: string;
5315
5268
  /** @unit milliseconds (raw from server — NOT converted like other WS types) */
5316
5269
  timestamp: number;
5270
+ /**
5271
+ * Position in the stream named by `stream` (`user` or `app`). Increasing
5272
+ * per stream; the SDK resumes from the last one after a reconnect and
5273
+ * drops duplicates. Absent if the server's event log was unavailable.
5274
+ */
5275
+ eventId?: string;
5276
+ stream?: "user" | "app";
5277
+ /** True when re-delivered by a resume. */
5278
+ replayed?: boolean;
5317
5279
  }
5318
5280
  interface WsRedeemEvent {
5319
5281
  type: "redeem_event";
@@ -5326,6 +5288,17 @@ interface WsRedeemEvent {
5326
5288
  errorMessage: string | null;
5327
5289
  /** @unit seconds (converted from server ms) */
5328
5290
  timestamp: number;
5291
+ /** Owner of the event. */
5292
+ userId?: string;
5293
+ /**
5294
+ * Position in the stream named by `stream` (`user` or `app`). Increasing
5295
+ * per stream; the SDK resumes from the last one after a reconnect and
5296
+ * drops duplicates. Absent if the server's event log was unavailable.
5297
+ */
5298
+ eventId?: string;
5299
+ stream?: "user" | "app";
5300
+ /** True when re-delivered by a resume. */
5301
+ replayed?: boolean;
5329
5302
  }
5330
5303
  /** Top-level withdrawal lifecycle states surfaced to partner clients. */
5331
5304
  type WsWithdrawalLifecycleStatus = "pending" | "bridging" | "transferring" | "completed" | "partial" | "failed";
@@ -5367,6 +5340,15 @@ interface WsWithdrawalLifecycleEvent {
5367
5340
  correlationId?: string;
5368
5341
  /** @unit milliseconds (raw from server — NOT converted like other WS types) */
5369
5342
  timestamp: number;
5343
+ /**
5344
+ * Position in the stream named by `stream` (`user` or `app`). Increasing
5345
+ * per stream; the SDK resumes from the last one after a reconnect and
5346
+ * drops duplicates. Absent if the server's event log was unavailable.
5347
+ */
5348
+ eventId?: string;
5349
+ stream?: "user" | "app";
5350
+ /** True when re-delivered by a resume. */
5351
+ replayed?: boolean;
5370
5352
  }
5371
5353
  interface WsArbMarketUpdate {
5372
5354
  type: "arb_market_update";
@@ -5397,7 +5379,22 @@ interface WsArbFeedBatch {
5397
5379
  chunk: number;
5398
5380
  chunkCount: number;
5399
5381
  }
5400
- type WsServerMessage = WsOrderbookSnapshot | WsOrderbookDelta | WsTrade | WsSubscribed | WsUnsubscribed | WsConnected | WsAuthenticated | WsHeartbeat | WsMarketResolved | WsError | WsOrderSubmitted | WsBalanceUpdate | WsOrderEvent | WsRedeemEvent | WsWithdrawalLifecycleEvent | WsArbMarketUpdate | WsArbFeedBatch;
5382
+ type WsServerMessage = WsOrderbookSnapshot | WsOrderbookDelta | WsTrade | WsSubscribed | WsUnsubscribed | WsConnected | WsAuthenticated | WsHeartbeat | WsMarketResolved | WsError | WsOrderSubmitted | WsBalanceUpdate | WsOrderEvent | WsRedeemEvent | WsWithdrawalLifecycleEvent | WsArbMarketUpdate | WsArbFeedBatch | WsAuthExpiring | WsAuthExpired | WsResumed | WsStreamInterrupted;
5383
+ /**
5384
+ * A user event as delivered on the `app-events` channel: the raw server
5385
+ * frame (timestamps in milliseconds, not converted), always with `userId`,
5386
+ * `stream: "app"` and normally an `eventId`.
5387
+ */
5388
+ type WsAppEvent = ((Omit<WsOrderSubmitted, "timestamp"> & {
5389
+ timestamp: number;
5390
+ }) | (Omit<WsBalanceUpdate, "timestamp"> & {
5391
+ timestamp: number;
5392
+ }) | WsOrderEvent | (Omit<WsRedeemEvent, "timestamp"> & {
5393
+ timestamp: number | string;
5394
+ }) | WsWithdrawalLifecycleEvent) & {
5395
+ userId: string;
5396
+ stream: "app";
5397
+ };
5401
5398
  type WsClientMessage = {
5402
5399
  action: "subscribe";
5403
5400
  channel: "orderbook" | "trades";
@@ -5427,6 +5424,14 @@ type WsClientMessage = {
5427
5424
  } | {
5428
5425
  action: "authenticate";
5429
5426
  token: string;
5427
+ resumeFrom?: string;
5428
+ } | {
5429
+ action: "subscribe";
5430
+ channel: "app-events";
5431
+ resumeFrom?: string;
5432
+ } | {
5433
+ action: "unsubscribe";
5434
+ channel: "app-events";
5430
5435
  };
5431
5436
  type DiagnosticEvent = {
5432
5437
  type: "seq_gap";
@@ -5444,6 +5449,15 @@ type DiagnosticEvent = {
5444
5449
  type: "reconnect";
5445
5450
  attempt: number;
5446
5451
  delayMs: number;
5452
+ } |
5453
+ /** The server closed with a configuration error (4001/4003); the SDK does not retry. */
5454
+ {
5455
+ type: "connection_rejected";
5456
+ code: number;
5457
+ reason: string;
5458
+ } | {
5459
+ type: "stream_interrupted";
5460
+ channels: string[];
5447
5461
  } | {
5448
5462
  type: "stale_connection";
5449
5463
  lastMessageAge: number;
@@ -5519,6 +5533,55 @@ declare function snapshotToOrderbook(snapshot: WsOrderbookSnapshot): OrderbookSt
5519
5533
  */
5520
5534
  declare function applyOrderbookDelta(state: OrderbookState, delta: WsOrderbookDelta): OrderbookState;
5521
5535
  //#endregion
5536
+ //#region src/self-custody-signing.d.ts
5537
+ /**
5538
+ * Signing policy for a self-custody fill's `pendingSignatures`, shared by
5539
+ * `AggClient.fillSelfCustody` and `@agg-build/hooks`' `useSelfCustodySigning`
5540
+ * so both answer the same requests in the same order with the same bounds.
5541
+ */
5542
+ /** EVM hex compares case-insensitively; Solana base58 is case-significant. */
5543
+ declare const isSameWalletAddress: (a: string, b: string) => boolean;
5544
+ /** True for the trade-executor's Polymarket order signature step. */
5545
+ declare const isPolymarketOrderSignatureStep: (stepId: string) => boolean;
5546
+ /** An optional fee pre-sign (`purpose: "app_fee"`), e.g. a Polymarket buy fee. */
5547
+ declare const isOptionalFeeRequest: (req: Pick<SignatureRequest, "optional" | "purpose">) => boolean;
5548
+ /**
5549
+ * A required fee request asked after every order filled: the post-fill sell
5550
+ * fee. Declining it leaves the fee uncollected; the trade itself is done.
5551
+ */
5552
+ declare const isPostFillFeeRequest: (req: Pick<SignatureRequest, "optional" | "purpose">, ordersFilled: boolean) => boolean;
5553
+ /** Every order on the run reached a fill (full or partial). False with no orders yet. */
5554
+ declare const areOrdersFilled: (orders: ReadonlyArray<{
5555
+ event: string | null;
5556
+ }> | undefined) => boolean;
5557
+ /**
5558
+ * The requests to sign now, required first.
5559
+ *
5560
+ * An optional fee pre-sign is prepared independently of the order, so it can
5561
+ * be listed before the order prompt exists; it is held back until the
5562
+ * Polymarket ORDER signature has been submitted, and then signed in a round of
5563
+ * its own so a slow or declined fee prompt never holds anything else. Every
5564
+ * other request goes in one batch: the server reads an optional signature (a
5565
+ * referral code, a sponsor) right after the order finalises, so a second round
5566
+ * would arrive too late.
5567
+ */
5568
+ declare const orderSignatureRound: (pending: readonly SignatureRequest[], { orderSubmitted }: {
5569
+ orderSubmitted: boolean;
5570
+ }) => SignatureRequest[];
5571
+ /** The user's own wallets for this fill: its signing address plus every required request's signer. */
5572
+ declare const userSignerAddresses: (pending: readonly SignatureRequest[], signingAddress?: string | null) => string[];
5573
+ /**
5574
+ * How long to wait on the signer for `req`, or `undefined` to wait for the
5575
+ * human. An optional fee pre-sign is bounded by
5576
+ * `OPTIONAL_FEE_SIGNATURE_TIMEOUT_MS`; an optional request addressed to a
5577
+ * wallet other than the user's (a partner's sponsor) by
5578
+ * `OPTIONAL_SIGNATURE_TIMEOUT_MS`. Required requests and optional ones the
5579
+ * user signs (a referral code) are never bounded.
5580
+ */
5581
+ declare const signatureTimeoutMs: (req: SignatureRequest, userSigners: readonly string[]) => number | undefined;
5582
+ /** Rejects after `ms` (when given); a late settlement of `promise` is ignored. */
5583
+ declare function withTimeout<T>(promise: Promise<T>, ms: number | undefined): Promise<T>;
5584
+ //#endregion
5522
5585
  //#region src/errors.d.ts
5523
5586
  /**
5524
5587
  * Thrown when the server returns `challenge_required` during auth start.
@@ -5858,6 +5921,14 @@ interface AggWebSocketCallbacks {
5858
5921
  onWithdrawalLifecycle?: (msg: WsWithdrawalLifecycleEvent) => void;
5859
5922
  onArbMarket?: (msg: WsArbMarketUpdate) => void;
5860
5923
  onArbFeed?: (batch: WsArbFeedBatch) => void;
5924
+ /** About a minute before the user token expires. Call `authenticate()` with a fresh token. */
5925
+ onAuthExpiring?: (msg: WsAuthExpiring) => void;
5926
+ /** The user session ended (expired, revoked, suspended); market data continues. */
5927
+ onAuthExpired?: (msg: WsAuthExpired) => void;
5928
+ /** A resume replay finished. `complete: false` → reconcile over REST. */
5929
+ onResumed?: (msg: WsResumed) => void;
5930
+ /** Upstream delivery was interrupted; orderbooks are resnapshotted automatically. */
5931
+ onStreamInterrupted?: (msg: WsStreamInterrupted) => void;
5861
5932
  onDiagnostics?: DiagnosticCallback;
5862
5933
  onConnectionStateChange?: (connected: boolean) => void;
5863
5934
  }
@@ -5891,9 +5962,26 @@ interface BookWatchdogOptions {
5891
5962
  /** How often silent books are looked for. Default 1 minute. */
5892
5963
  checkIntervalMs?: number;
5893
5964
  }
5965
+ /** Anything constructible like the WHATWG WebSocket — e.g. the `ws` package in Node. */
5966
+ type WebSocketConstructor = new (url: string, options?: any) => WebSocket;
5894
5967
  interface AggWebSocketOptions {
5895
5968
  /** Full WebSocket URL including query params (appId). Token should NOT be in the URL. */
5896
5969
  url: string;
5970
+ /**
5971
+ * WebSocket implementation. Defaults to `globalThis.WebSocket`. Server-side,
5972
+ * pass the `ws` package so `headers` (e.g. `x-app-api-key`) can be sent.
5973
+ */
5974
+ webSocketImpl?: WebSocketConstructor;
5975
+ /**
5976
+ * Handshake headers — server-side only (browsers cannot set them). Use
5977
+ * `{ "x-app-api-key": key }` to authenticate a backend connection.
5978
+ */
5979
+ headers?: Record<string, string>;
5980
+ /**
5981
+ * Resume user/app events from the last `eventId` after a reconnect, so a
5982
+ * dropped connection doesn't lose fills or withdrawal updates. Default true.
5983
+ */
5984
+ resumeEvents?: boolean;
5897
5985
  callbacks?: AggWebSocketCallbacks;
5898
5986
  /** JWT to send via the authenticate message after connecting (avoids token in URL/logs). */
5899
5987
  initialToken?: string;
@@ -5954,6 +6042,18 @@ declare class AggWebSocket {
5954
6042
  private hostDiagnostics?;
5955
6043
  private initialToken?;
5956
6044
  private readonly enableLogs;
6045
+ private readonly webSocketImpl?;
6046
+ private readonly headers?;
6047
+ private readonly resumeEvents;
6048
+ /** Last event id processed per stream; sent as `resumeFrom` on reconnect. */
6049
+ private readonly lastEventId;
6050
+ private lastEventUserId?;
6051
+ private readonly seenEventIds;
6052
+ /** Set once a connection has been established; later connects resume. */
6053
+ private hasConnected;
6054
+ private readonly appEventCbs;
6055
+ /** Last close was a configuration error; don't reconnect until connect() is called. */
6056
+ private rejected;
5957
6057
  constructor(options: AggWebSocketOptions);
5958
6058
  get connected(): boolean;
5959
6059
  /** Decode dynamic authenticated REST bytes in the same processing environment as live data. */
@@ -6000,6 +6100,16 @@ declare class AggWebSocket {
6000
6100
  private _subscribeTrades;
6001
6101
  /** Send a JWT to authenticate (or re-authenticate) the connection. */
6002
6102
  authenticate(token: string): void;
6103
+ /**
6104
+ * Receive every user event of this app (orders, balances, redeems,
6105
+ * withdrawals) — the server-side counterpart of a user session. Requires
6106
+ * a connection opened with an `x-app-api-key` for this app (pass
6107
+ * `webSocketImpl` + `headers`). Frames are raw: timestamps in ms. The
6108
+ * stream resumes from the last `eventId` across reconnects.
6109
+ */
6110
+ subscribeAppEvents(cb: (event: WsAppEvent) => void): () => void;
6111
+ private sendAppEventsSubscribe;
6112
+ private authenticateMessage;
6003
6113
  /** Request a fresh snapshot for one or more subscribed outcomes. */
6004
6114
  resnapshot(outcomeIdOrIds: string | string[]): void;
6005
6115
  /** Connect (idempotent). Called automatically on first subscribe. */
@@ -6022,6 +6132,12 @@ declare class AggWebSocket {
6022
6132
  * ready to accept subscriptions. Now flush all pending subs.
6023
6133
  */
6024
6134
  private handleConnected;
6135
+ /**
6136
+ * Track `eventId` per stream and drop duplicates a resume re-delivers.
6137
+ * App-stream frames go to `subscribeAppEvents` listeners only. Returns
6138
+ * false when the frame was consumed (duplicate or app event).
6139
+ */
6140
+ private acceptEvent;
6025
6141
  private handleSnapshot;
6026
6142
  private handleDelta;
6027
6143
  private handleTrade;
@@ -6061,5 +6177,5 @@ declare class AggWebSocket {
6061
6177
  private isOrderbookDebugEnabled;
6062
6178
  }
6063
6179
  //#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.ts.map
6180
+ 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 };
6181
+ //# sourceMappingURL=agg-websocket-BpZ8ljCl.d.ts.map