@agg-build/sdk 4.16.0 → 4.17.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.
package/dist/index.d.mts CHANGED
@@ -634,6 +634,51 @@ type OrderListItem = {
634
634
  * or a venue-specific tag.
635
635
  */
636
636
  partialFillReason: string | null;
637
+ /**
638
+ * Fee breakdown. Optional so paper-trading orders, which have no venue
639
+ * fees, no bridges and no app-fee charge, stay valid without fabricating
640
+ * a zeroed breakdown that would read as "this trade was free".
641
+ *
642
+ * `quoted` is what the route promised at accept time; `actual` is money
643
+ * that moved. `actual.appFee` and `actual.bridge` are TRADE-level and
644
+ * shared by every order under one `actual.dagRunId` — group by it before
645
+ * summing. `quoted.venueFeeRaw` and `actual.venueFeeRaw` are per-leg.
646
+ */
647
+ fees?: {
648
+ /**
649
+ * How the venue charges: `"fill"`, `"fill_in_game_only"`,
650
+ * `"winnings"`, `"exit"`, or null when the schedule cannot be
651
+ * expressed as a rate. Decides what the venue-fee figures mean.
652
+ */
653
+ venueFeeBasis: string | null;
654
+ quoted: {
655
+ /** 6-dec USD atoms. Null when the router emitted no fee for this leg. */
656
+ venueFeeRaw: string | null;
657
+ /** Worst-case partner fee if the route fills 100%. */
658
+ appFeeRaw: string | null;
659
+ appFeeBips: number | null;
660
+ };
661
+ actual: {
662
+ /** Null until the order reaches a DAG run. */
663
+ dagRunId: string | null;
664
+ /** Venue-reported fee, 6-dec USD atoms. Null = unknown, never free. */
665
+ venueFeeRaw: string | null;
666
+ appFee: {
667
+ bips: number;
668
+ /** floor(filled × bips / 10_000). */
669
+ dueRaw: string;
670
+ /** Below `dueRaw` on `under_collected`, "0" on skips. */
671
+ collectedRaw: string;
672
+ status: string;
673
+ } | null;
674
+ bridge: {
675
+ relayFeeUsd: string | null;
676
+ originGasCostUsd: string | null;
677
+ operationCount: number;
678
+ pricedOperationCount: number;
679
+ } | null;
680
+ };
681
+ } | undefined;
637
682
  txHash: string | null;
638
683
  errorMessage: string | null;
639
684
  dagRunId: string | null;
@@ -2472,11 +2517,11 @@ interface MatchedOrderbookMarket extends VenueMarketRef {
2472
2517
  * - `none` — no mark available
2473
2518
  */
2474
2519
  type MarkSource = "local" | "local_merged" | "local_one_sided" | "sibling" | "local_boundary" | "none";
2475
- declare const RECURRENCE_CADENCES: readonly ["PT5M", "PT10M", "PT15M", "PT1H", "P1D", "P1W", "P1M", "P1Y"];
2520
+ declare const RECURRENCE_CADENCES: readonly ["PT5M", "PT10M", "PT15M", "PT30M", "PT1H", "PT4H", "P1D", "P1W", "P1M", "P1Y"];
2476
2521
  type RecurrenceCadence = (typeof RECURRENCE_CADENCES)[number];
2477
2522
  type RecurrenceFilter = RecurrenceCadence | "null";
2478
- type RecurringCryptoDuration = "PT5M" | "PT15M" | "PT1H" | "P1D";
2479
- type RecurringCryptoDurationInput = RecurringCryptoDuration | "5m" | "15m" | "1h" | "1d";
2523
+ type RecurringCryptoDuration = "PT5M" | "PT15M" | "PT30M" | "PT1H" | "PT4H" | "P1D";
2524
+ type RecurringCryptoDurationInput = RecurringCryptoDuration | "5m" | "15m" | "30m" | "1h" | "4h" | "1d";
2480
2525
  type RecurringCryptoSourceConfidence = "verified" | "inferred" | "missing";
2481
2526
  interface ListRecurringCryptoMarketsOptions {
2482
2527
  assets?: string[];
@@ -3044,6 +3089,25 @@ interface PlaceOrderParams {
3044
3089
  allowedSourceChainIds?: number[];
3045
3090
  /** USD budgets capped by refreshed wallet balances; omitted chains cannot fund. */
3046
3091
  chainBalances?: Record<string, number>;
3092
+ /**
3093
+ * Skip the smart-route solver and send one order straight to `venue` (predict,
3094
+ * hyperliquid, novig and prophetx only; others return 400). Requires a `read_write` `x-app-api-key`. No
3095
+ * bridging: funds must already sit on the venue's own chain, and `allowedSourceChainIds` /
3096
+ * `chainBalances` return 400 alongside it. You own price and minimum
3097
+ * checks — an order the venue refuses fails after acceptance and uses up its `externalId`.
3098
+ */
3099
+ skipQuote?: boolean;
3100
+ /**
3101
+ * With `skipQuote`, skip the balance check and fund hold on a buy: nothing checks the
3102
+ * balance and an underfunded order fails at the venue. Sells still check the position.
3103
+ */
3104
+ skipBalance?: boolean;
3105
+ /**
3106
+ * With `skipQuote`, the price to trade at (e.g. `0.52`). Optional: if omitted, the best
3107
+ * available price at submission is used (best ask to buy, bid to sell). Ignored on
3108
+ * prophetx, which prices the order itself within `slipCapBps`.
3109
+ */
3110
+ price?: number;
3047
3111
  }
3048
3112
  interface PlaceOrderResponse {
3049
3113
  orderId: string;
package/dist/index.d.ts CHANGED
@@ -634,6 +634,51 @@ type OrderListItem = {
634
634
  * or a venue-specific tag.
635
635
  */
636
636
  partialFillReason: string | null;
637
+ /**
638
+ * Fee breakdown. Optional so paper-trading orders, which have no venue
639
+ * fees, no bridges and no app-fee charge, stay valid without fabricating
640
+ * a zeroed breakdown that would read as "this trade was free".
641
+ *
642
+ * `quoted` is what the route promised at accept time; `actual` is money
643
+ * that moved. `actual.appFee` and `actual.bridge` are TRADE-level and
644
+ * shared by every order under one `actual.dagRunId` — group by it before
645
+ * summing. `quoted.venueFeeRaw` and `actual.venueFeeRaw` are per-leg.
646
+ */
647
+ fees?: {
648
+ /**
649
+ * How the venue charges: `"fill"`, `"fill_in_game_only"`,
650
+ * `"winnings"`, `"exit"`, or null when the schedule cannot be
651
+ * expressed as a rate. Decides what the venue-fee figures mean.
652
+ */
653
+ venueFeeBasis: string | null;
654
+ quoted: {
655
+ /** 6-dec USD atoms. Null when the router emitted no fee for this leg. */
656
+ venueFeeRaw: string | null;
657
+ /** Worst-case partner fee if the route fills 100%. */
658
+ appFeeRaw: string | null;
659
+ appFeeBips: number | null;
660
+ };
661
+ actual: {
662
+ /** Null until the order reaches a DAG run. */
663
+ dagRunId: string | null;
664
+ /** Venue-reported fee, 6-dec USD atoms. Null = unknown, never free. */
665
+ venueFeeRaw: string | null;
666
+ appFee: {
667
+ bips: number;
668
+ /** floor(filled × bips / 10_000). */
669
+ dueRaw: string;
670
+ /** Below `dueRaw` on `under_collected`, "0" on skips. */
671
+ collectedRaw: string;
672
+ status: string;
673
+ } | null;
674
+ bridge: {
675
+ relayFeeUsd: string | null;
676
+ originGasCostUsd: string | null;
677
+ operationCount: number;
678
+ pricedOperationCount: number;
679
+ } | null;
680
+ };
681
+ } | undefined;
637
682
  txHash: string | null;
638
683
  errorMessage: string | null;
639
684
  dagRunId: string | null;
@@ -2472,11 +2517,11 @@ interface MatchedOrderbookMarket extends VenueMarketRef {
2472
2517
  * - `none` — no mark available
2473
2518
  */
2474
2519
  type MarkSource = "local" | "local_merged" | "local_one_sided" | "sibling" | "local_boundary" | "none";
2475
- declare const RECURRENCE_CADENCES: readonly ["PT5M", "PT10M", "PT15M", "PT1H", "P1D", "P1W", "P1M", "P1Y"];
2520
+ declare const RECURRENCE_CADENCES: readonly ["PT5M", "PT10M", "PT15M", "PT30M", "PT1H", "PT4H", "P1D", "P1W", "P1M", "P1Y"];
2476
2521
  type RecurrenceCadence = (typeof RECURRENCE_CADENCES)[number];
2477
2522
  type RecurrenceFilter = RecurrenceCadence | "null";
2478
- type RecurringCryptoDuration = "PT5M" | "PT15M" | "PT1H" | "P1D";
2479
- type RecurringCryptoDurationInput = RecurringCryptoDuration | "5m" | "15m" | "1h" | "1d";
2523
+ type RecurringCryptoDuration = "PT5M" | "PT15M" | "PT30M" | "PT1H" | "PT4H" | "P1D";
2524
+ type RecurringCryptoDurationInput = RecurringCryptoDuration | "5m" | "15m" | "30m" | "1h" | "4h" | "1d";
2480
2525
  type RecurringCryptoSourceConfidence = "verified" | "inferred" | "missing";
2481
2526
  interface ListRecurringCryptoMarketsOptions {
2482
2527
  assets?: string[];
@@ -3044,6 +3089,25 @@ interface PlaceOrderParams {
3044
3089
  allowedSourceChainIds?: number[];
3045
3090
  /** USD budgets capped by refreshed wallet balances; omitted chains cannot fund. */
3046
3091
  chainBalances?: Record<string, number>;
3092
+ /**
3093
+ * Skip the smart-route solver and send one order straight to `venue` (predict,
3094
+ * hyperliquid, novig and prophetx only; others return 400). Requires a `read_write` `x-app-api-key`. No
3095
+ * bridging: funds must already sit on the venue's own chain, and `allowedSourceChainIds` /
3096
+ * `chainBalances` return 400 alongside it. You own price and minimum
3097
+ * checks — an order the venue refuses fails after acceptance and uses up its `externalId`.
3098
+ */
3099
+ skipQuote?: boolean;
3100
+ /**
3101
+ * With `skipQuote`, skip the balance check and fund hold on a buy: nothing checks the
3102
+ * balance and an underfunded order fails at the venue. Sells still check the position.
3103
+ */
3104
+ skipBalance?: boolean;
3105
+ /**
3106
+ * With `skipQuote`, the price to trade at (e.g. `0.52`). Optional: if omitted, the best
3107
+ * available price at submission is used (best ask to buy, bid to sell). Ignored on
3108
+ * prophetx, which prices the order itself within `slipCapBps`.
3109
+ */
3110
+ price?: number;
3047
3111
  }
3048
3112
  interface PlaceOrderResponse {
3049
3113
  orderId: string;
package/dist/index.js CHANGED
@@ -978,7 +978,9 @@ var RECURRENCE_CADENCES = [
978
978
  "PT5M",
979
979
  "PT10M",
980
980
  "PT15M",
981
+ "PT30M",
981
982
  "PT1H",
983
+ "PT4H",
982
984
  "P1D",
983
985
  "P1W",
984
986
  "P1M",
package/dist/index.mjs CHANGED
@@ -846,7 +846,9 @@ var RECURRENCE_CADENCES = [
846
846
  "PT5M",
847
847
  "PT10M",
848
848
  "PT15M",
849
+ "PT30M",
849
850
  "PT1H",
851
+ "PT4H",
850
852
  "P1D",
851
853
  "P1W",
852
854
  "P1M",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agg-build/sdk",
3
- "version": "4.16.0",
3
+ "version": "4.17.0",
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",