@oddmaki-protocol/sdk 1.2.0 → 1.3.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.mjs CHANGED
@@ -8770,11 +8770,16 @@ var GET_MARKETS = gql`
8770
8770
  query GetMarkets(
8771
8771
  $venueId: BigInt
8772
8772
  $search: String = ""
8773
+ $statuses: [MarketStatus!] = [Draft, Active, Resolved, Invalid]
8773
8774
  $first: Int = 100
8774
8775
  $skip: Int = 0
8775
8776
  ) {
8776
8777
  markets(
8777
- where: { venue_: { venueId: $venueId }, question_contains_nocase: $search }
8778
+ where: {
8779
+ venue_: { venueId: $venueId }
8780
+ question_contains_nocase: $search
8781
+ status_in: $statuses
8782
+ }
8778
8783
  first: $first
8779
8784
  skip: $skip
8780
8785
  orderBy: createdAt
@@ -8807,11 +8812,16 @@ var GET_MARKETS_WITH_PRICING = gql`
8807
8812
  query GetMarketsWithPricing(
8808
8813
  $venueId: BigInt
8809
8814
  $search: String = ""
8815
+ $statuses: [MarketStatus!] = [Draft, Active, Resolved, Invalid]
8810
8816
  $first: Int = 100
8811
8817
  $skip: Int = 0
8812
8818
  ) {
8813
8819
  markets(
8814
- where: { venue_: { venueId: $venueId }, question_contains_nocase: $search }
8820
+ where: {
8821
+ venue_: { venueId: $venueId }
8822
+ question_contains_nocase: $search
8823
+ status_in: $statuses
8824
+ }
8815
8825
  first: $first
8816
8826
  skip: $skip
8817
8827
  orderBy: createdAt
@@ -9859,6 +9869,7 @@ var GET_MARKET_TOP_HOLDERS = gql`
9859
9869
  `;
9860
9870
 
9861
9871
  // src/modules/public.ts
9872
+ var ALL_MARKET_STATUSES = ["Draft", "Active", "Resolved", "Invalid"];
9862
9873
  var PublicModule = class extends BaseModule {
9863
9874
  /**
9864
9875
  * Get all venues
@@ -9878,6 +9889,7 @@ var PublicModule = class extends BaseModule {
9878
9889
  return this.subgraph.request(GET_MARKETS, {
9879
9890
  venueId: params.venueId?.toString(),
9880
9891
  search: params.search ?? "",
9892
+ statuses: params.statuses ?? ALL_MARKET_STATUSES,
9881
9893
  first: params.first || 100,
9882
9894
  skip: params.skip || 0
9883
9895
  });
@@ -9887,11 +9899,14 @@ var PublicModule = class extends BaseModule {
9887
9899
  *
9888
9900
  * @param params.search Optional case-insensitive substring match against the
9889
9901
  * market `question` field. Empty string matches all markets.
9902
+ * @param params.statuses Optional list of market statuses to include. Omit
9903
+ * to include all statuses (Draft, Active, Resolved, Invalid).
9890
9904
  */
9891
9905
  async getMarketsWithPricing(params) {
9892
9906
  return this.subgraph.request(GET_MARKETS_WITH_PRICING, {
9893
9907
  venueId: params.venueId?.toString(),
9894
9908
  search: params.search ?? "",
9909
+ statuses: params.statuses ?? ALL_MARKET_STATUSES,
9895
9910
  first: params.first || 100,
9896
9911
  skip: params.skip || 0
9897
9912
  });