@oddmaki-protocol/sdk 1.2.0 → 1.4.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
@@ -8088,21 +8088,24 @@ declare abstract class BaseModule {
8088
8088
 
8089
8089
  declare class VenueModule extends BaseModule {
8090
8090
  /**
8091
- * Create a new venue
8091
+ * Create a new venue.
8092
8092
  *
8093
- * IMPORTANT: Fee and bond amounts must match your intended collateral token decimals!
8094
- * Most venues use USDC (6 decimals), so amounts should use parseUnits("amount", 6).
8093
+ * IMPORTANT: Fee and bond amounts must match your intended collateral token decimals.
8094
+ * Most venues use USDC (6 decimals), so amounts should use `parseUnits("amount", 6)`.
8095
8095
  *
8096
- * Example for USDC-based venue:
8097
- * - marketCreationFee: parseUnits("10", 6) // 10 USDC
8098
- * - umaRewardAmount: parseUnits("5", 6) // 5 USDC
8099
- * - umaMinBond: parseUnits("1", 6) // 1 USDC
8100
- * - defaultTickSize: parseEther("0.01") // 0.01 per tick (always 18 decimals)
8096
+ * Example for a USDC-based venue:
8097
+ * - marketCreationFee: 0n // free creation, or parseUnits("10", 6) for 10 USDC
8098
+ * - umaRewardAmount: parseUnits("5", 6) // 5 USDC
8099
+ * - umaMinBond: parseUnits("1", 6) // 1 USDC
8100
+ * - defaultTickSize: parseEther("0.01") // 0.01 per tick (always 18 decimals)
8101
8101
  *
8102
- * @param params.marketCreationFee - Upfront fee (min 5e6 for USDC, split 50/50 protocol/venue)
8103
- * @param params.umaRewardAmount - Default reward for UMA asserters (in collateral token units)
8104
- * @param params.umaMinBond - Minimum bond for UMA assertions (in collateral token units)
8105
- * @param params.defaultTickSize - Price increment per tick (always 1e18 scale, e.g., 0.01e18)
8102
+ * @param params.marketCreationFee - Upfront fee in collateral units charged on `createMarket`.
8103
+ * Can be zero. When non-zero, split 50/50 between protocol and venue.
8104
+ * When zero, gate market creation via `creationAccessControl` to deter spam.
8105
+ * Mutable post-creation via `updateMarketCreationFee`.
8106
+ * @param params.umaRewardAmount - Default reward for UMA asserters (in collateral token units).
8107
+ * @param params.umaMinBond - Minimum bond for UMA assertions (in collateral token units).
8108
+ * @param params.defaultTickSize - Price increment per tick (always 1e18 scale, e.g. 0.01e18).
8106
8109
  */
8107
8110
  createVenue(params: {
8108
8111
  name: string;
@@ -8144,6 +8147,19 @@ declare class VenueModule extends BaseModule {
8144
8147
  creationAccessControl: `0x${string}`;
8145
8148
  feeRecipient: `0x${string}`;
8146
8149
  }): Promise<`0x${string}`>;
8150
+ /**
8151
+ * Update the upfront market creation fee for a venue. Operator-only.
8152
+ *
8153
+ * Affects only markets created after this call — existing markets keep their snapshot.
8154
+ * Pass `0n` for free creation; if you do, gate `createMarket` via `creationAccessControl`
8155
+ * to deter spam.
8156
+ *
8157
+ * @param params.newFee - New fee in collateral token units (e.g. `parseUnits("10", 6)` for 10 USDC).
8158
+ */
8159
+ updateMarketCreationFee(params: {
8160
+ venueId: bigint;
8161
+ newFee: bigint;
8162
+ }): Promise<`0x${string}`>;
8147
8163
  /**
8148
8164
  * Update venue oracle parameters (UMA reward and min bond)
8149
8165
  */
@@ -8947,6 +8963,11 @@ declare class TradeModule extends BaseModule {
8947
8963
  }): Promise<`0x${string}`>;
8948
8964
  }
8949
8965
 
8966
+ /**
8967
+ * Market lifecycle statuses indexed by the subgraph. Mirrors the on-chain
8968
+ * market state machine.
8969
+ */
8970
+ type MarketStatus = 'Draft' | 'Active' | 'Resolved' | 'Invalid';
8950
8971
  declare class PublicModule extends BaseModule {
8951
8972
  /**
8952
8973
  * Get all venues
@@ -8963,6 +8984,7 @@ declare class PublicModule extends BaseModule {
8963
8984
  getMarkets(params: {
8964
8985
  venueId?: bigint;
8965
8986
  search?: string;
8987
+ statuses?: MarketStatus[];
8966
8988
  first?: number;
8967
8989
  skip?: number;
8968
8990
  }): Promise<unknown>;
@@ -8971,10 +8993,13 @@ declare class PublicModule extends BaseModule {
8971
8993
  *
8972
8994
  * @param params.search Optional case-insensitive substring match against the
8973
8995
  * market `question` field. Empty string matches all markets.
8996
+ * @param params.statuses Optional list of market statuses to include. Omit
8997
+ * to include all statuses (Draft, Active, Resolved, Invalid).
8974
8998
  */
8975
8999
  getMarketsWithPricing(params: {
8976
9000
  venueId?: bigint;
8977
9001
  search?: string;
9002
+ statuses?: MarketStatus[];
8978
9003
  first?: number;
8979
9004
  skip?: number;
8980
9005
  }): Promise<unknown>;
@@ -9594,11 +9619,6 @@ declare const CONTRACT_ADDRESSES: {
9594
9619
  readonly subgraph: "https://api.studio.thegraph.com/query/1716020/oddmaki-base/version/latest";
9595
9620
  };
9596
9621
  };
9597
- declare const SUBGRAPH_IDS: {
9598
- readonly 8453: "CxoYVjELrNCMLopAmVshnfVAie7yH6QZyCSKD3r41XSQ";
9599
- readonly 84532: "DCnd3ozSyvYxRg7kmZYiDWGBiJCe6QHwu8M93jMN1Q3b";
9600
- };
9601
- declare function buildSubgraphGatewayUrl(chainId: number, apiKey: string): string | undefined;
9602
9622
  declare const DEFAULT_CHAIN: {
9603
9623
  blockExplorers: {
9604
9624
  readonly default: {
@@ -10274,6 +10294,25 @@ var VenueFacet = [
10274
10294
  ],
10275
10295
  stateMutability: "nonpayable"
10276
10296
  },
10297
+ {
10298
+ type: "function",
10299
+ name: "updateVenueMarketCreationFee",
10300
+ inputs: [
10301
+ {
10302
+ name: "venueId",
10303
+ type: "uint256",
10304
+ internalType: "uint256"
10305
+ },
10306
+ {
10307
+ name: "newFee",
10308
+ type: "uint256",
10309
+ internalType: "uint256"
10310
+ }
10311
+ ],
10312
+ outputs: [
10313
+ ],
10314
+ stateMutability: "nonpayable"
10315
+ },
10277
10316
  {
10278
10317
  type: "function",
10279
10318
  name: "updateVenueOracleParams",
@@ -10379,6 +10418,25 @@ var VenueFacet = [
10379
10418
  ],
10380
10419
  anonymous: false
10381
10420
  },
10421
+ {
10422
+ type: "event",
10423
+ name: "VenueMarketCreationFeeUpdated",
10424
+ inputs: [
10425
+ {
10426
+ name: "venueId",
10427
+ type: "uint256",
10428
+ indexed: true,
10429
+ internalType: "uint256"
10430
+ },
10431
+ {
10432
+ name: "newFee",
10433
+ type: "uint256",
10434
+ indexed: false,
10435
+ internalType: "uint256"
10436
+ }
10437
+ ],
10438
+ anonymous: false
10439
+ },
10382
10440
  {
10383
10441
  type: "event",
10384
10442
  name: "VenueOracleParamsUpdated",
@@ -10485,12 +10543,6 @@ var VenueFacet = [
10485
10543
  inputs: [
10486
10544
  ]
10487
10545
  },
10488
- {
10489
- type: "error",
10490
- name: "InvalidMarketCreationFee",
10491
- inputs: [
10492
- ]
10493
- },
10494
10546
  {
10495
10547
  type: "error",
10496
10548
  name: "InvalidTickSize",
@@ -17334,4 +17386,4 @@ declare function parseMetadata<T extends {
17334
17386
 
17335
17387
  declare const version = "0.1.0";
17336
17388
 
17337
- export { AccessControlFacet as AccessControlFacetABI, AccessControlModule, BatchOrdersFacet as BatchOrdersFacetABI, CONTRACT_ADDRESSES, type ChancePercentInput, ConditionalTokens as ConditionalTokensABI, DEFAULT_CHAIN, ERC20 as ERC20ABI, FeedProvider, GET_ALL_MARKETS_FEED, GET_ALL_MARKETS_FEED_BY_VOLUME, GET_CHART_TRADES, GET_CHART_TRADES_ALL, GET_GROUP_MARKETS, GET_LEADERBOARD, GET_MARKET, GET_MARKETS, GET_MARKETS_WITH_PRICING, GET_MARKET_GROUP, GET_MARKET_GROUPS, GET_MARKET_GROUP_ITEM, GET_MARKET_TOP_HOLDERS, GET_ORDERS, GET_PROTOCOL_STATS, GET_QUESTION, GET_QUESTIONS, GET_RECENT_MARKETS, GET_RECENT_TRADES, GET_TOP_OF_BOOK, GET_TRADER_CLOSED_POSITIONS, GET_TRADER_FILLS, GET_TRADER_POSITIONS, GET_TRADER_PROFILE, GET_TRADES, GET_UNIFIED_MARKET_FEED, GET_UNIFIED_MARKET_FEED_BY_VOLUME, GET_USER, GET_VENUES, LimitOrdersFacet as LimitOrdersFacetABI, MarketGroupFacet as MarketGroupFacetABI, type MarketMetadata, MarketModule, MarketOrdersFacet as MarketOrdersFacetABI, type MarketQuestion, MarketsFacet as MarketsFacetABI, MatchingFacet as MatchingFacetABI, MetadataFacet as MetadataFacetABI, NegRiskFacet as NegRiskFacetABI, OddMakiClient, type OddMakiClientConfig, type OddMakiConfig, OrderBookFacet as OrderBookFacetABI, PROTOCOL_FEES, type PriceMarketData, PriceMarketFacet as PriceMarketFacetABI, PriceMarketModule, ProtocolFacet as ProtocolFacetABI, PublicModule, PythResolutionFacet as PythResolutionFacetABI, type PythUpdate, ResolutionFacet as ResolutionFacetABI, SUBGRAPH_IDS, SubgraphClient, type SubgraphMarketPriceData, TICK_SIZE_FINE, TICK_SIZE_STANDARD, TagsFacet as TagsFacetABI, TokenModule, type TopOfBookEntry, TradeModule, UMA_DEFAULTS, UmaModule, UmaOracle as UmaOracleABI, VALID_TICK_SIZES, VaultFacet as VaultFacetABI, VenueFacet as VenueFacetABI, type VenueMetadata, VenueModule, WhitelistAccessControl as WhitelistAccessControlABI, buildSubgraphGatewayUrl, calculateChancePercent, clearDecimalsCache, createExpiry, createOddMakiClient, formatAmount, formatAncillaryData, formatTimestamp, getCachedTokenDecimals, getOutcomePrice, getTokenDecimals, isValidTickSize, parseAmount, parseAncillaryData, parseMetadata, parseTokenAmount, priceToTick, resolveIPFSUri, tickToPercentage, tickToPrice, version };
17389
+ export { AccessControlFacet as AccessControlFacetABI, AccessControlModule, BatchOrdersFacet as BatchOrdersFacetABI, CONTRACT_ADDRESSES, type ChancePercentInput, ConditionalTokens as ConditionalTokensABI, DEFAULT_CHAIN, ERC20 as ERC20ABI, FeedProvider, GET_ALL_MARKETS_FEED, GET_ALL_MARKETS_FEED_BY_VOLUME, GET_CHART_TRADES, GET_CHART_TRADES_ALL, GET_GROUP_MARKETS, GET_LEADERBOARD, GET_MARKET, GET_MARKETS, GET_MARKETS_WITH_PRICING, GET_MARKET_GROUP, GET_MARKET_GROUPS, GET_MARKET_GROUP_ITEM, GET_MARKET_TOP_HOLDERS, GET_ORDERS, GET_PROTOCOL_STATS, GET_QUESTION, GET_QUESTIONS, GET_RECENT_MARKETS, GET_RECENT_TRADES, GET_TOP_OF_BOOK, GET_TRADER_CLOSED_POSITIONS, GET_TRADER_FILLS, GET_TRADER_POSITIONS, GET_TRADER_PROFILE, GET_TRADES, GET_UNIFIED_MARKET_FEED, GET_UNIFIED_MARKET_FEED_BY_VOLUME, GET_USER, GET_VENUES, LimitOrdersFacet as LimitOrdersFacetABI, MarketGroupFacet as MarketGroupFacetABI, type MarketMetadata, MarketModule, MarketOrdersFacet as MarketOrdersFacetABI, type MarketQuestion, type MarketStatus, MarketsFacet as MarketsFacetABI, MatchingFacet as MatchingFacetABI, MetadataFacet as MetadataFacetABI, NegRiskFacet as NegRiskFacetABI, OddMakiClient, type OddMakiClientConfig, type OddMakiConfig, OrderBookFacet as OrderBookFacetABI, PROTOCOL_FEES, type PriceMarketData, PriceMarketFacet as PriceMarketFacetABI, PriceMarketModule, ProtocolFacet as ProtocolFacetABI, PublicModule, PythResolutionFacet as PythResolutionFacetABI, type PythUpdate, ResolutionFacet as ResolutionFacetABI, SubgraphClient, type SubgraphMarketPriceData, TICK_SIZE_FINE, TICK_SIZE_STANDARD, TagsFacet as TagsFacetABI, TokenModule, type TopOfBookEntry, TradeModule, UMA_DEFAULTS, UmaModule, UmaOracle as UmaOracleABI, VALID_TICK_SIZES, VaultFacet as VaultFacetABI, VenueFacet as VenueFacetABI, type VenueMetadata, VenueModule, WhitelistAccessControl as WhitelistAccessControlABI, calculateChancePercent, clearDecimalsCache, createExpiry, createOddMakiClient, formatAmount, formatAncillaryData, formatTimestamp, getCachedTokenDecimals, getOutcomePrice, getTokenDecimals, isValidTickSize, parseAmount, parseAncillaryData, parseMetadata, parseTokenAmount, priceToTick, resolveIPFSUri, tickToPercentage, tickToPrice, version };
package/dist/index.d.ts CHANGED
@@ -8088,21 +8088,24 @@ declare abstract class BaseModule {
8088
8088
 
8089
8089
  declare class VenueModule extends BaseModule {
8090
8090
  /**
8091
- * Create a new venue
8091
+ * Create a new venue.
8092
8092
  *
8093
- * IMPORTANT: Fee and bond amounts must match your intended collateral token decimals!
8094
- * Most venues use USDC (6 decimals), so amounts should use parseUnits("amount", 6).
8093
+ * IMPORTANT: Fee and bond amounts must match your intended collateral token decimals.
8094
+ * Most venues use USDC (6 decimals), so amounts should use `parseUnits("amount", 6)`.
8095
8095
  *
8096
- * Example for USDC-based venue:
8097
- * - marketCreationFee: parseUnits("10", 6) // 10 USDC
8098
- * - umaRewardAmount: parseUnits("5", 6) // 5 USDC
8099
- * - umaMinBond: parseUnits("1", 6) // 1 USDC
8100
- * - defaultTickSize: parseEther("0.01") // 0.01 per tick (always 18 decimals)
8096
+ * Example for a USDC-based venue:
8097
+ * - marketCreationFee: 0n // free creation, or parseUnits("10", 6) for 10 USDC
8098
+ * - umaRewardAmount: parseUnits("5", 6) // 5 USDC
8099
+ * - umaMinBond: parseUnits("1", 6) // 1 USDC
8100
+ * - defaultTickSize: parseEther("0.01") // 0.01 per tick (always 18 decimals)
8101
8101
  *
8102
- * @param params.marketCreationFee - Upfront fee (min 5e6 for USDC, split 50/50 protocol/venue)
8103
- * @param params.umaRewardAmount - Default reward for UMA asserters (in collateral token units)
8104
- * @param params.umaMinBond - Minimum bond for UMA assertions (in collateral token units)
8105
- * @param params.defaultTickSize - Price increment per tick (always 1e18 scale, e.g., 0.01e18)
8102
+ * @param params.marketCreationFee - Upfront fee in collateral units charged on `createMarket`.
8103
+ * Can be zero. When non-zero, split 50/50 between protocol and venue.
8104
+ * When zero, gate market creation via `creationAccessControl` to deter spam.
8105
+ * Mutable post-creation via `updateMarketCreationFee`.
8106
+ * @param params.umaRewardAmount - Default reward for UMA asserters (in collateral token units).
8107
+ * @param params.umaMinBond - Minimum bond for UMA assertions (in collateral token units).
8108
+ * @param params.defaultTickSize - Price increment per tick (always 1e18 scale, e.g. 0.01e18).
8106
8109
  */
8107
8110
  createVenue(params: {
8108
8111
  name: string;
@@ -8144,6 +8147,19 @@ declare class VenueModule extends BaseModule {
8144
8147
  creationAccessControl: `0x${string}`;
8145
8148
  feeRecipient: `0x${string}`;
8146
8149
  }): Promise<`0x${string}`>;
8150
+ /**
8151
+ * Update the upfront market creation fee for a venue. Operator-only.
8152
+ *
8153
+ * Affects only markets created after this call — existing markets keep their snapshot.
8154
+ * Pass `0n` for free creation; if you do, gate `createMarket` via `creationAccessControl`
8155
+ * to deter spam.
8156
+ *
8157
+ * @param params.newFee - New fee in collateral token units (e.g. `parseUnits("10", 6)` for 10 USDC).
8158
+ */
8159
+ updateMarketCreationFee(params: {
8160
+ venueId: bigint;
8161
+ newFee: bigint;
8162
+ }): Promise<`0x${string}`>;
8147
8163
  /**
8148
8164
  * Update venue oracle parameters (UMA reward and min bond)
8149
8165
  */
@@ -8947,6 +8963,11 @@ declare class TradeModule extends BaseModule {
8947
8963
  }): Promise<`0x${string}`>;
8948
8964
  }
8949
8965
 
8966
+ /**
8967
+ * Market lifecycle statuses indexed by the subgraph. Mirrors the on-chain
8968
+ * market state machine.
8969
+ */
8970
+ type MarketStatus = 'Draft' | 'Active' | 'Resolved' | 'Invalid';
8950
8971
  declare class PublicModule extends BaseModule {
8951
8972
  /**
8952
8973
  * Get all venues
@@ -8963,6 +8984,7 @@ declare class PublicModule extends BaseModule {
8963
8984
  getMarkets(params: {
8964
8985
  venueId?: bigint;
8965
8986
  search?: string;
8987
+ statuses?: MarketStatus[];
8966
8988
  first?: number;
8967
8989
  skip?: number;
8968
8990
  }): Promise<unknown>;
@@ -8971,10 +8993,13 @@ declare class PublicModule extends BaseModule {
8971
8993
  *
8972
8994
  * @param params.search Optional case-insensitive substring match against the
8973
8995
  * market `question` field. Empty string matches all markets.
8996
+ * @param params.statuses Optional list of market statuses to include. Omit
8997
+ * to include all statuses (Draft, Active, Resolved, Invalid).
8974
8998
  */
8975
8999
  getMarketsWithPricing(params: {
8976
9000
  venueId?: bigint;
8977
9001
  search?: string;
9002
+ statuses?: MarketStatus[];
8978
9003
  first?: number;
8979
9004
  skip?: number;
8980
9005
  }): Promise<unknown>;
@@ -9594,11 +9619,6 @@ declare const CONTRACT_ADDRESSES: {
9594
9619
  readonly subgraph: "https://api.studio.thegraph.com/query/1716020/oddmaki-base/version/latest";
9595
9620
  };
9596
9621
  };
9597
- declare const SUBGRAPH_IDS: {
9598
- readonly 8453: "CxoYVjELrNCMLopAmVshnfVAie7yH6QZyCSKD3r41XSQ";
9599
- readonly 84532: "DCnd3ozSyvYxRg7kmZYiDWGBiJCe6QHwu8M93jMN1Q3b";
9600
- };
9601
- declare function buildSubgraphGatewayUrl(chainId: number, apiKey: string): string | undefined;
9602
9622
  declare const DEFAULT_CHAIN: {
9603
9623
  blockExplorers: {
9604
9624
  readonly default: {
@@ -10274,6 +10294,25 @@ var VenueFacet = [
10274
10294
  ],
10275
10295
  stateMutability: "nonpayable"
10276
10296
  },
10297
+ {
10298
+ type: "function",
10299
+ name: "updateVenueMarketCreationFee",
10300
+ inputs: [
10301
+ {
10302
+ name: "venueId",
10303
+ type: "uint256",
10304
+ internalType: "uint256"
10305
+ },
10306
+ {
10307
+ name: "newFee",
10308
+ type: "uint256",
10309
+ internalType: "uint256"
10310
+ }
10311
+ ],
10312
+ outputs: [
10313
+ ],
10314
+ stateMutability: "nonpayable"
10315
+ },
10277
10316
  {
10278
10317
  type: "function",
10279
10318
  name: "updateVenueOracleParams",
@@ -10379,6 +10418,25 @@ var VenueFacet = [
10379
10418
  ],
10380
10419
  anonymous: false
10381
10420
  },
10421
+ {
10422
+ type: "event",
10423
+ name: "VenueMarketCreationFeeUpdated",
10424
+ inputs: [
10425
+ {
10426
+ name: "venueId",
10427
+ type: "uint256",
10428
+ indexed: true,
10429
+ internalType: "uint256"
10430
+ },
10431
+ {
10432
+ name: "newFee",
10433
+ type: "uint256",
10434
+ indexed: false,
10435
+ internalType: "uint256"
10436
+ }
10437
+ ],
10438
+ anonymous: false
10439
+ },
10382
10440
  {
10383
10441
  type: "event",
10384
10442
  name: "VenueOracleParamsUpdated",
@@ -10485,12 +10543,6 @@ var VenueFacet = [
10485
10543
  inputs: [
10486
10544
  ]
10487
10545
  },
10488
- {
10489
- type: "error",
10490
- name: "InvalidMarketCreationFee",
10491
- inputs: [
10492
- ]
10493
- },
10494
10546
  {
10495
10547
  type: "error",
10496
10548
  name: "InvalidTickSize",
@@ -17334,4 +17386,4 @@ declare function parseMetadata<T extends {
17334
17386
 
17335
17387
  declare const version = "0.1.0";
17336
17388
 
17337
- export { AccessControlFacet as AccessControlFacetABI, AccessControlModule, BatchOrdersFacet as BatchOrdersFacetABI, CONTRACT_ADDRESSES, type ChancePercentInput, ConditionalTokens as ConditionalTokensABI, DEFAULT_CHAIN, ERC20 as ERC20ABI, FeedProvider, GET_ALL_MARKETS_FEED, GET_ALL_MARKETS_FEED_BY_VOLUME, GET_CHART_TRADES, GET_CHART_TRADES_ALL, GET_GROUP_MARKETS, GET_LEADERBOARD, GET_MARKET, GET_MARKETS, GET_MARKETS_WITH_PRICING, GET_MARKET_GROUP, GET_MARKET_GROUPS, GET_MARKET_GROUP_ITEM, GET_MARKET_TOP_HOLDERS, GET_ORDERS, GET_PROTOCOL_STATS, GET_QUESTION, GET_QUESTIONS, GET_RECENT_MARKETS, GET_RECENT_TRADES, GET_TOP_OF_BOOK, GET_TRADER_CLOSED_POSITIONS, GET_TRADER_FILLS, GET_TRADER_POSITIONS, GET_TRADER_PROFILE, GET_TRADES, GET_UNIFIED_MARKET_FEED, GET_UNIFIED_MARKET_FEED_BY_VOLUME, GET_USER, GET_VENUES, LimitOrdersFacet as LimitOrdersFacetABI, MarketGroupFacet as MarketGroupFacetABI, type MarketMetadata, MarketModule, MarketOrdersFacet as MarketOrdersFacetABI, type MarketQuestion, MarketsFacet as MarketsFacetABI, MatchingFacet as MatchingFacetABI, MetadataFacet as MetadataFacetABI, NegRiskFacet as NegRiskFacetABI, OddMakiClient, type OddMakiClientConfig, type OddMakiConfig, OrderBookFacet as OrderBookFacetABI, PROTOCOL_FEES, type PriceMarketData, PriceMarketFacet as PriceMarketFacetABI, PriceMarketModule, ProtocolFacet as ProtocolFacetABI, PublicModule, PythResolutionFacet as PythResolutionFacetABI, type PythUpdate, ResolutionFacet as ResolutionFacetABI, SUBGRAPH_IDS, SubgraphClient, type SubgraphMarketPriceData, TICK_SIZE_FINE, TICK_SIZE_STANDARD, TagsFacet as TagsFacetABI, TokenModule, type TopOfBookEntry, TradeModule, UMA_DEFAULTS, UmaModule, UmaOracle as UmaOracleABI, VALID_TICK_SIZES, VaultFacet as VaultFacetABI, VenueFacet as VenueFacetABI, type VenueMetadata, VenueModule, WhitelistAccessControl as WhitelistAccessControlABI, buildSubgraphGatewayUrl, calculateChancePercent, clearDecimalsCache, createExpiry, createOddMakiClient, formatAmount, formatAncillaryData, formatTimestamp, getCachedTokenDecimals, getOutcomePrice, getTokenDecimals, isValidTickSize, parseAmount, parseAncillaryData, parseMetadata, parseTokenAmount, priceToTick, resolveIPFSUri, tickToPercentage, tickToPrice, version };
17389
+ export { AccessControlFacet as AccessControlFacetABI, AccessControlModule, BatchOrdersFacet as BatchOrdersFacetABI, CONTRACT_ADDRESSES, type ChancePercentInput, ConditionalTokens as ConditionalTokensABI, DEFAULT_CHAIN, ERC20 as ERC20ABI, FeedProvider, GET_ALL_MARKETS_FEED, GET_ALL_MARKETS_FEED_BY_VOLUME, GET_CHART_TRADES, GET_CHART_TRADES_ALL, GET_GROUP_MARKETS, GET_LEADERBOARD, GET_MARKET, GET_MARKETS, GET_MARKETS_WITH_PRICING, GET_MARKET_GROUP, GET_MARKET_GROUPS, GET_MARKET_GROUP_ITEM, GET_MARKET_TOP_HOLDERS, GET_ORDERS, GET_PROTOCOL_STATS, GET_QUESTION, GET_QUESTIONS, GET_RECENT_MARKETS, GET_RECENT_TRADES, GET_TOP_OF_BOOK, GET_TRADER_CLOSED_POSITIONS, GET_TRADER_FILLS, GET_TRADER_POSITIONS, GET_TRADER_PROFILE, GET_TRADES, GET_UNIFIED_MARKET_FEED, GET_UNIFIED_MARKET_FEED_BY_VOLUME, GET_USER, GET_VENUES, LimitOrdersFacet as LimitOrdersFacetABI, MarketGroupFacet as MarketGroupFacetABI, type MarketMetadata, MarketModule, MarketOrdersFacet as MarketOrdersFacetABI, type MarketQuestion, type MarketStatus, MarketsFacet as MarketsFacetABI, MatchingFacet as MatchingFacetABI, MetadataFacet as MetadataFacetABI, NegRiskFacet as NegRiskFacetABI, OddMakiClient, type OddMakiClientConfig, type OddMakiConfig, OrderBookFacet as OrderBookFacetABI, PROTOCOL_FEES, type PriceMarketData, PriceMarketFacet as PriceMarketFacetABI, PriceMarketModule, ProtocolFacet as ProtocolFacetABI, PublicModule, PythResolutionFacet as PythResolutionFacetABI, type PythUpdate, ResolutionFacet as ResolutionFacetABI, SubgraphClient, type SubgraphMarketPriceData, TICK_SIZE_FINE, TICK_SIZE_STANDARD, TagsFacet as TagsFacetABI, TokenModule, type TopOfBookEntry, TradeModule, UMA_DEFAULTS, UmaModule, UmaOracle as UmaOracleABI, VALID_TICK_SIZES, VaultFacet as VaultFacetABI, VenueFacet as VenueFacetABI, type VenueMetadata, VenueModule, WhitelistAccessControl as WhitelistAccessControlABI, calculateChancePercent, clearDecimalsCache, createExpiry, createOddMakiClient, formatAmount, formatAncillaryData, formatTimestamp, getCachedTokenDecimals, getOutcomePrice, getTokenDecimals, isValidTickSize, parseAmount, parseAncillaryData, parseMetadata, parseTokenAmount, priceToTick, resolveIPFSUri, tickToPercentage, tickToPrice, version };
package/dist/index.js CHANGED
@@ -19,14 +19,6 @@ var CONTRACT_ADDRESSES = {
19
19
  subgraph: "https://api.studio.thegraph.com/query/1716020/oddmaki-base/version/latest"
20
20
  }
21
21
  };
22
- var SUBGRAPH_IDS = {
23
- [chains.base.id]: "CxoYVjELrNCMLopAmVshnfVAie7yH6QZyCSKD3r41XSQ",
24
- [chains.baseSepolia.id]: "DCnd3ozSyvYxRg7kmZYiDWGBiJCe6QHwu8M93jMN1Q3b"
25
- };
26
- function buildSubgraphGatewayUrl(chainId, apiKey) {
27
- const id = SUBGRAPH_IDS[chainId];
28
- return id ? `https://gateway.thegraph.com/api/${apiKey}/subgraphs/id/${id}` : void 0;
29
- }
30
22
  var DEFAULT_CHAIN = chains.base;
31
23
  var SubgraphClient = class {
32
24
  constructor(endpoint) {
@@ -403,6 +395,24 @@ var VenueFacet_default = [
403
395
  outputs: [],
404
396
  stateMutability: "nonpayable"
405
397
  },
398
+ {
399
+ type: "function",
400
+ name: "updateVenueMarketCreationFee",
401
+ inputs: [
402
+ {
403
+ name: "venueId",
404
+ type: "uint256",
405
+ internalType: "uint256"
406
+ },
407
+ {
408
+ name: "newFee",
409
+ type: "uint256",
410
+ internalType: "uint256"
411
+ }
412
+ ],
413
+ outputs: [],
414
+ stateMutability: "nonpayable"
415
+ },
406
416
  {
407
417
  type: "function",
408
418
  name: "updateVenueOracleParams",
@@ -507,6 +517,25 @@ var VenueFacet_default = [
507
517
  ],
508
518
  anonymous: false
509
519
  },
520
+ {
521
+ type: "event",
522
+ name: "VenueMarketCreationFeeUpdated",
523
+ inputs: [
524
+ {
525
+ name: "venueId",
526
+ type: "uint256",
527
+ indexed: true,
528
+ internalType: "uint256"
529
+ },
530
+ {
531
+ name: "newFee",
532
+ type: "uint256",
533
+ indexed: false,
534
+ internalType: "uint256"
535
+ }
536
+ ],
537
+ anonymous: false
538
+ },
510
539
  {
511
540
  type: "event",
512
541
  name: "VenueOracleParamsUpdated",
@@ -611,11 +640,6 @@ var VenueFacet_default = [
611
640
  name: "InvalidFeeRecipient",
612
641
  inputs: []
613
642
  },
614
- {
615
- type: "error",
616
- name: "InvalidMarketCreationFee",
617
- inputs: []
618
- },
619
643
  {
620
644
  type: "error",
621
645
  name: "InvalidTickSize",
@@ -7095,21 +7119,24 @@ var UmaOracle_default = [
7095
7119
  // src/modules/venue.ts
7096
7120
  var VenueModule = class extends BaseModule {
7097
7121
  /**
7098
- * Create a new venue
7122
+ * Create a new venue.
7099
7123
  *
7100
- * IMPORTANT: Fee and bond amounts must match your intended collateral token decimals!
7101
- * Most venues use USDC (6 decimals), so amounts should use parseUnits("amount", 6).
7124
+ * IMPORTANT: Fee and bond amounts must match your intended collateral token decimals.
7125
+ * Most venues use USDC (6 decimals), so amounts should use `parseUnits("amount", 6)`.
7102
7126
  *
7103
- * Example for USDC-based venue:
7104
- * - marketCreationFee: parseUnits("10", 6) // 10 USDC
7105
- * - umaRewardAmount: parseUnits("5", 6) // 5 USDC
7106
- * - umaMinBond: parseUnits("1", 6) // 1 USDC
7107
- * - defaultTickSize: parseEther("0.01") // 0.01 per tick (always 18 decimals)
7127
+ * Example for a USDC-based venue:
7128
+ * - marketCreationFee: 0n // free creation, or parseUnits("10", 6) for 10 USDC
7129
+ * - umaRewardAmount: parseUnits("5", 6) // 5 USDC
7130
+ * - umaMinBond: parseUnits("1", 6) // 1 USDC
7131
+ * - defaultTickSize: parseEther("0.01") // 0.01 per tick (always 18 decimals)
7108
7132
  *
7109
- * @param params.marketCreationFee - Upfront fee (min 5e6 for USDC, split 50/50 protocol/venue)
7110
- * @param params.umaRewardAmount - Default reward for UMA asserters (in collateral token units)
7111
- * @param params.umaMinBond - Minimum bond for UMA assertions (in collateral token units)
7112
- * @param params.defaultTickSize - Price increment per tick (always 1e18 scale, e.g., 0.01e18)
7133
+ * @param params.marketCreationFee - Upfront fee in collateral units charged on `createMarket`.
7134
+ * Can be zero. When non-zero, split 50/50 between protocol and venue.
7135
+ * When zero, gate market creation via `creationAccessControl` to deter spam.
7136
+ * Mutable post-creation via `updateMarketCreationFee`.
7137
+ * @param params.umaRewardAmount - Default reward for UMA asserters (in collateral token units).
7138
+ * @param params.umaMinBond - Minimum bond for UMA assertions (in collateral token units).
7139
+ * @param params.defaultTickSize - Price increment per tick (always 1e18 scale, e.g. 0.01e18).
7113
7140
  */
7114
7141
  async createVenue(params) {
7115
7142
  const wallet = this.walletClient;
@@ -7199,6 +7226,27 @@ var VenueModule = class extends BaseModule {
7199
7226
  });
7200
7227
  return wallet.writeContract(request);
7201
7228
  }
7229
+ /**
7230
+ * Update the upfront market creation fee for a venue. Operator-only.
7231
+ *
7232
+ * Affects only markets created after this call — existing markets keep their snapshot.
7233
+ * Pass `0n` for free creation; if you do, gate `createMarket` via `creationAccessControl`
7234
+ * to deter spam.
7235
+ *
7236
+ * @param params.newFee - New fee in collateral token units (e.g. `parseUnits("10", 6)` for 10 USDC).
7237
+ */
7238
+ async updateMarketCreationFee(params) {
7239
+ const wallet = this.walletClient;
7240
+ const account = await this.getSignerAccount();
7241
+ const { request } = await this.publicClient.simulateContract({
7242
+ address: this.config.diamondAddress,
7243
+ abi: VenueFacet_default,
7244
+ functionName: "updateVenueMarketCreationFee",
7245
+ args: [params.venueId, params.newFee],
7246
+ account
7247
+ });
7248
+ return wallet.writeContract(request);
7249
+ }
7202
7250
  /**
7203
7251
  * Update venue oracle parameters (UMA reward and min bond)
7204
7252
  */
@@ -8772,11 +8820,16 @@ var GET_MARKETS = graphqlRequest.gql`
8772
8820
  query GetMarkets(
8773
8821
  $venueId: BigInt
8774
8822
  $search: String = ""
8823
+ $statuses: [MarketStatus!] = [Draft, Active, Resolved, Invalid]
8775
8824
  $first: Int = 100
8776
8825
  $skip: Int = 0
8777
8826
  ) {
8778
8827
  markets(
8779
- where: { venue_: { venueId: $venueId }, question_contains_nocase: $search }
8828
+ where: {
8829
+ venue_: { venueId: $venueId }
8830
+ question_contains_nocase: $search
8831
+ status_in: $statuses
8832
+ }
8780
8833
  first: $first
8781
8834
  skip: $skip
8782
8835
  orderBy: createdAt
@@ -8809,11 +8862,16 @@ var GET_MARKETS_WITH_PRICING = graphqlRequest.gql`
8809
8862
  query GetMarketsWithPricing(
8810
8863
  $venueId: BigInt
8811
8864
  $search: String = ""
8865
+ $statuses: [MarketStatus!] = [Draft, Active, Resolved, Invalid]
8812
8866
  $first: Int = 100
8813
8867
  $skip: Int = 0
8814
8868
  ) {
8815
8869
  markets(
8816
- where: { venue_: { venueId: $venueId }, question_contains_nocase: $search }
8870
+ where: {
8871
+ venue_: { venueId: $venueId }
8872
+ question_contains_nocase: $search
8873
+ status_in: $statuses
8874
+ }
8817
8875
  first: $first
8818
8876
  skip: $skip
8819
8877
  orderBy: createdAt
@@ -9861,6 +9919,7 @@ var GET_MARKET_TOP_HOLDERS = graphqlRequest.gql`
9861
9919
  `;
9862
9920
 
9863
9921
  // src/modules/public.ts
9922
+ var ALL_MARKET_STATUSES = ["Draft", "Active", "Resolved", "Invalid"];
9864
9923
  var PublicModule = class extends BaseModule {
9865
9924
  /**
9866
9925
  * Get all venues
@@ -9880,6 +9939,7 @@ var PublicModule = class extends BaseModule {
9880
9939
  return this.subgraph.request(GET_MARKETS, {
9881
9940
  venueId: params.venueId?.toString(),
9882
9941
  search: params.search ?? "",
9942
+ statuses: params.statuses ?? ALL_MARKET_STATUSES,
9883
9943
  first: params.first || 100,
9884
9944
  skip: params.skip || 0
9885
9945
  });
@@ -9889,11 +9949,14 @@ var PublicModule = class extends BaseModule {
9889
9949
  *
9890
9950
  * @param params.search Optional case-insensitive substring match against the
9891
9951
  * market `question` field. Empty string matches all markets.
9952
+ * @param params.statuses Optional list of market statuses to include. Omit
9953
+ * to include all statuses (Draft, Active, Resolved, Invalid).
9892
9954
  */
9893
9955
  async getMarketsWithPricing(params) {
9894
9956
  return this.subgraph.request(GET_MARKETS_WITH_PRICING, {
9895
9957
  venueId: params.venueId?.toString(),
9896
9958
  search: params.search ?? "",
9959
+ statuses: params.statuses ?? ALL_MARKET_STATUSES,
9897
9960
  first: params.first || 100,
9898
9961
  skip: params.skip || 0
9899
9962
  });
@@ -11395,7 +11458,6 @@ exports.ProtocolFacetABI = ProtocolFacet_default;
11395
11458
  exports.PublicModule = PublicModule;
11396
11459
  exports.PythResolutionFacetABI = PythResolutionFacet_default;
11397
11460
  exports.ResolutionFacetABI = ResolutionFacet_default;
11398
- exports.SUBGRAPH_IDS = SUBGRAPH_IDS;
11399
11461
  exports.SubgraphClient = SubgraphClient;
11400
11462
  exports.TICK_SIZE_FINE = TICK_SIZE_FINE;
11401
11463
  exports.TICK_SIZE_STANDARD = TICK_SIZE_STANDARD;
@@ -11410,7 +11472,6 @@ exports.VaultFacetABI = VaultFacet_default;
11410
11472
  exports.VenueFacetABI = VenueFacet_default;
11411
11473
  exports.VenueModule = VenueModule;
11412
11474
  exports.WhitelistAccessControlABI = WhitelistAccessControl_default;
11413
- exports.buildSubgraphGatewayUrl = buildSubgraphGatewayUrl;
11414
11475
  exports.calculateChancePercent = calculateChancePercent;
11415
11476
  exports.clearDecimalsCache = clearDecimalsCache;
11416
11477
  exports.createExpiry = createExpiry;