@oddmaki-protocol/sdk 1.1.0 → 1.2.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
@@ -18,7 +18,8 @@ var CONTRACT_ADDRESSES = {
18
18
  }
19
19
  };
20
20
  var SUBGRAPH_IDS = {
21
- [base.id]: "QmPaESDtwZvtYPx8vvAU3nHE7kZBZ121XQCiPxM4bQauGh"
21
+ [base.id]: "CxoYVjELrNCMLopAmVshnfVAie7yH6QZyCSKD3r41XSQ",
22
+ [baseSepolia.id]: "DCnd3ozSyvYxRg7kmZYiDWGBiJCe6QHwu8M93jMN1Q3b"
22
23
  };
23
24
  function buildSubgraphGatewayUrl(chainId, apiKey) {
24
25
  const id = SUBGRAPH_IDS[chainId];
@@ -8766,9 +8767,14 @@ var GET_VENUES = gql`
8766
8767
  }
8767
8768
  `;
8768
8769
  var GET_MARKETS = gql`
8769
- query GetMarkets($venueId: BigInt, $first: Int = 100, $skip: Int = 0) {
8770
+ query GetMarkets(
8771
+ $venueId: BigInt
8772
+ $search: String = ""
8773
+ $first: Int = 100
8774
+ $skip: Int = 0
8775
+ ) {
8770
8776
  markets(
8771
- where: { venue_: { venueId: $venueId } }
8777
+ where: { venue_: { venueId: $venueId }, question_contains_nocase: $search }
8772
8778
  first: $first
8773
8779
  skip: $skip
8774
8780
  orderBy: createdAt
@@ -8800,11 +8806,12 @@ var GET_MARKETS = gql`
8800
8806
  var GET_MARKETS_WITH_PRICING = gql`
8801
8807
  query GetMarketsWithPricing(
8802
8808
  $venueId: BigInt
8809
+ $search: String = ""
8803
8810
  $first: Int = 100
8804
8811
  $skip: Int = 0
8805
8812
  ) {
8806
8813
  markets(
8807
- where: { venue_: { venueId: $venueId } }
8814
+ where: { venue_: { venueId: $venueId }, question_contains_nocase: $search }
8808
8815
  first: $first
8809
8816
  skip: $skip
8810
8817
  orderBy: createdAt
@@ -9870,16 +9877,21 @@ var PublicModule = class extends BaseModule {
9870
9877
  async getMarkets(params) {
9871
9878
  return this.subgraph.request(GET_MARKETS, {
9872
9879
  venueId: params.venueId?.toString(),
9880
+ search: params.search ?? "",
9873
9881
  first: params.first || 100,
9874
9882
  skip: params.skip || 0
9875
9883
  });
9876
9884
  }
9877
9885
  /**
9878
9886
  * Get markets with pricing data (last trade prices + statistics)
9887
+ *
9888
+ * @param params.search Optional case-insensitive substring match against the
9889
+ * market `question` field. Empty string matches all markets.
9879
9890
  */
9880
9891
  async getMarketsWithPricing(params) {
9881
9892
  return this.subgraph.request(GET_MARKETS_WITH_PRICING, {
9882
9893
  venueId: params.venueId?.toString(),
9894
+ search: params.search ?? "",
9883
9895
  first: params.first || 100,
9884
9896
  skip: params.skip || 0
9885
9897
  });