@agg-build/sdk 4.8.0 → 4.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -3669,6 +3669,13 @@ interface VenueSoloQuote {
3669
3669
  /** Why this venue cannot execute when quoteId is null (or execution is geo-gated). */
3670
3670
  unavailableReason?: string;
3671
3671
  venue: string;
3672
+ /**
3673
+ * The outcome this solo is bound to. `venue` alone is NOT unique — one venue
3674
+ * can list the same matched outcome more than once (e.g. two Hyperliquid
3675
+ * deployers listing the same game), producing two solo cards with the same
3676
+ * `venue`. Key on this alongside `venue` when identifying a card.
3677
+ */
3678
+ venueMarketOutcomeId?: string;
3672
3679
  avgPrice: number | null;
3673
3680
  filledQty: number;
3674
3681
  rawExecCost: number;
package/dist/index.d.ts CHANGED
@@ -3669,6 +3669,13 @@ interface VenueSoloQuote {
3669
3669
  /** Why this venue cannot execute when quoteId is null (or execution is geo-gated). */
3670
3670
  unavailableReason?: string;
3671
3671
  venue: string;
3672
+ /**
3673
+ * The outcome this solo is bound to. `venue` alone is NOT unique — one venue
3674
+ * can list the same matched outcome more than once (e.g. two Hyperliquid
3675
+ * deployers listing the same game), producing two solo cards with the same
3676
+ * `venue`. Key on this alongside `venue` when identifying a card.
3677
+ */
3678
+ venueMarketOutcomeId?: string;
3672
3679
  avgPrice: number | null;
3673
3680
  filledQty: number;
3674
3681
  rawExecCost: number;
package/dist/index.js CHANGED
@@ -1901,6 +1901,8 @@ var COOKIE_REFRESH_DELIVERY = "cookie-refresh";
1901
1901
  var DEFAULT_MIDPOINT_IDS_PER_REQUEST = 75;
1902
1902
  var MAX_MIDPOINT_IDS_PER_REQUEST = 75;
1903
1903
  var MAX_SPORTS_EVENT_IDS_PER_REQUEST = 25;
1904
+ var MIN_POLL_INTERVAL_MS = 250;
1905
+ var MAX_POLL_INTERVAL_MS = 3e4;
1904
1906
  var isUserProfile = (user) => {
1905
1907
  return "accounts" in user && "wallets" in user && "avatarUrl" in user;
1906
1908
  };
@@ -3361,13 +3363,18 @@ Issued At: ${issuedAt}`;
3361
3363
  let pending = (_a = first.pendingSignatures) != null ? _a : [];
3362
3364
  let lastKey = "";
3363
3365
  const deadline = Date.now() + SELF_CUSTODY_FILL_TIMEOUT_MS;
3366
+ let nextPollMs = MIN_POLL_INTERVAL_MS;
3364
3367
  for (; ; ) {
3365
3368
  if (Date.now() > deadline) {
3366
3369
  throw new Error(`Fill for quote ${quoteId} did not finish within the timeout.`);
3367
3370
  }
3368
3371
  if (pending.length === 0) {
3369
- yield new Promise((r) => setTimeout(r, SELF_CUSTODY_POLL_INTERVAL_MS));
3372
+ yield new Promise((r) => setTimeout(r, nextPollMs));
3370
3373
  const polled = yield this.getExecutionStatus({ quoteId });
3374
+ nextPollMs = Number.isFinite(polled.pollAfterMs) ? Math.min(
3375
+ Math.max(polled.pollAfterMs, MIN_POLL_INTERVAL_MS),
3376
+ MAX_POLL_INTERVAL_MS
3377
+ ) : SELF_CUSTODY_POLL_INTERVAL_MS;
3371
3378
  if (TERMINAL_EXECUTION_STATES.has(polled.overallState)) {
3372
3379
  if (polled.overallState !== "filled" && polled.overallState !== "partially_filled") {
3373
3380
  throw new Error(`Fill for quote ${quoteId} ended as ${polled.overallState}.`);
package/dist/index.mjs CHANGED
@@ -1769,6 +1769,8 @@ var COOKIE_REFRESH_DELIVERY = "cookie-refresh";
1769
1769
  var DEFAULT_MIDPOINT_IDS_PER_REQUEST = 75;
1770
1770
  var MAX_MIDPOINT_IDS_PER_REQUEST = 75;
1771
1771
  var MAX_SPORTS_EVENT_IDS_PER_REQUEST = 25;
1772
+ var MIN_POLL_INTERVAL_MS = 250;
1773
+ var MAX_POLL_INTERVAL_MS = 3e4;
1772
1774
  var isUserProfile = (user) => {
1773
1775
  return "accounts" in user && "wallets" in user && "avatarUrl" in user;
1774
1776
  };
@@ -3229,13 +3231,18 @@ Issued At: ${issuedAt}`;
3229
3231
  let pending = (_a = first.pendingSignatures) != null ? _a : [];
3230
3232
  let lastKey = "";
3231
3233
  const deadline = Date.now() + SELF_CUSTODY_FILL_TIMEOUT_MS;
3234
+ let nextPollMs = MIN_POLL_INTERVAL_MS;
3232
3235
  for (; ; ) {
3233
3236
  if (Date.now() > deadline) {
3234
3237
  throw new Error(`Fill for quote ${quoteId} did not finish within the timeout.`);
3235
3238
  }
3236
3239
  if (pending.length === 0) {
3237
- yield new Promise((r) => setTimeout(r, SELF_CUSTODY_POLL_INTERVAL_MS));
3240
+ yield new Promise((r) => setTimeout(r, nextPollMs));
3238
3241
  const polled = yield this.getExecutionStatus({ quoteId });
3242
+ nextPollMs = Number.isFinite(polled.pollAfterMs) ? Math.min(
3243
+ Math.max(polled.pollAfterMs, MIN_POLL_INTERVAL_MS),
3244
+ MAX_POLL_INTERVAL_MS
3245
+ ) : SELF_CUSTODY_POLL_INTERVAL_MS;
3239
3246
  if (TERMINAL_EXECUTION_STATES.has(polled.overallState)) {
3240
3247
  if (polled.overallState !== "filled" && polled.overallState !== "partially_filled") {
3241
3248
  throw new Error(`Fill for quote ${quoteId} ended as ${polled.overallState}.`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agg-build/sdk",
3
- "version": "4.8.0",
3
+ "version": "4.8.1",
4
4
  "description": "Vanilla TypeScript client for the AGG prediction market aggregator (auth, markets, orderbooks, charts, trading, managed execution, WebSockets). Works in browsers, Node.js, and React Native.",
5
5
  "sideEffects": false,
6
6
  "license": "MIT",