@oddmaki-protocol/sdk 1.3.0 → 1.4.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.mjs CHANGED
@@ -401,6 +401,24 @@ var VenueFacet_default = [
401
401
  outputs: [],
402
402
  stateMutability: "nonpayable"
403
403
  },
404
+ {
405
+ type: "function",
406
+ name: "updateVenueMarketCreationFee",
407
+ inputs: [
408
+ {
409
+ name: "venueId",
410
+ type: "uint256",
411
+ internalType: "uint256"
412
+ },
413
+ {
414
+ name: "newFee",
415
+ type: "uint256",
416
+ internalType: "uint256"
417
+ }
418
+ ],
419
+ outputs: [],
420
+ stateMutability: "nonpayable"
421
+ },
404
422
  {
405
423
  type: "function",
406
424
  name: "updateVenueOracleParams",
@@ -505,6 +523,25 @@ var VenueFacet_default = [
505
523
  ],
506
524
  anonymous: false
507
525
  },
526
+ {
527
+ type: "event",
528
+ name: "VenueMarketCreationFeeUpdated",
529
+ inputs: [
530
+ {
531
+ name: "venueId",
532
+ type: "uint256",
533
+ indexed: true,
534
+ internalType: "uint256"
535
+ },
536
+ {
537
+ name: "newFee",
538
+ type: "uint256",
539
+ indexed: false,
540
+ internalType: "uint256"
541
+ }
542
+ ],
543
+ anonymous: false
544
+ },
508
545
  {
509
546
  type: "event",
510
547
  name: "VenueOracleParamsUpdated",
@@ -609,11 +646,6 @@ var VenueFacet_default = [
609
646
  name: "InvalidFeeRecipient",
610
647
  inputs: []
611
648
  },
612
- {
613
- type: "error",
614
- name: "InvalidMarketCreationFee",
615
- inputs: []
616
- },
617
649
  {
618
650
  type: "error",
619
651
  name: "InvalidTickSize",
@@ -7093,21 +7125,24 @@ var UmaOracle_default = [
7093
7125
  // src/modules/venue.ts
7094
7126
  var VenueModule = class extends BaseModule {
7095
7127
  /**
7096
- * Create a new venue
7128
+ * Create a new venue.
7097
7129
  *
7098
- * IMPORTANT: Fee and bond amounts must match your intended collateral token decimals!
7099
- * Most venues use USDC (6 decimals), so amounts should use parseUnits("amount", 6).
7130
+ * IMPORTANT: Fee and bond amounts must match your intended collateral token decimals.
7131
+ * Most venues use USDC (6 decimals), so amounts should use `parseUnits("amount", 6)`.
7100
7132
  *
7101
- * Example for USDC-based venue:
7102
- * - marketCreationFee: parseUnits("10", 6) // 10 USDC
7103
- * - umaRewardAmount: parseUnits("5", 6) // 5 USDC
7104
- * - umaMinBond: parseUnits("1", 6) // 1 USDC
7105
- * - defaultTickSize: parseEther("0.01") // 0.01 per tick (always 18 decimals)
7133
+ * Example for a USDC-based venue:
7134
+ * - marketCreationFee: 0n // free creation, or parseUnits("10", 6) for 10 USDC
7135
+ * - umaRewardAmount: parseUnits("5", 6) // 5 USDC
7136
+ * - umaMinBond: parseUnits("1", 6) // 1 USDC
7137
+ * - defaultTickSize: parseEther("0.01") // 0.01 per tick (always 18 decimals)
7106
7138
  *
7107
- * @param params.marketCreationFee - Upfront fee (min 5e6 for USDC, split 50/50 protocol/venue)
7108
- * @param params.umaRewardAmount - Default reward for UMA asserters (in collateral token units)
7109
- * @param params.umaMinBond - Minimum bond for UMA assertions (in collateral token units)
7110
- * @param params.defaultTickSize - Price increment per tick (always 1e18 scale, e.g., 0.01e18)
7139
+ * @param params.marketCreationFee - Upfront fee in collateral units charged on `createMarket`.
7140
+ * Can be zero. When non-zero, split 50/50 between protocol and venue.
7141
+ * When zero, gate market creation via `creationAccessControl` to deter spam.
7142
+ * Mutable post-creation via `updateMarketCreationFee`.
7143
+ * @param params.umaRewardAmount - Default reward for UMA asserters (in collateral token units).
7144
+ * @param params.umaMinBond - Minimum bond for UMA assertions (in collateral token units).
7145
+ * @param params.defaultTickSize - Price increment per tick (always 1e18 scale, e.g. 0.01e18).
7111
7146
  */
7112
7147
  async createVenue(params) {
7113
7148
  const wallet = this.walletClient;
@@ -7197,6 +7232,27 @@ var VenueModule = class extends BaseModule {
7197
7232
  });
7198
7233
  return wallet.writeContract(request);
7199
7234
  }
7235
+ /**
7236
+ * Update the upfront market creation fee for a venue. Operator-only.
7237
+ *
7238
+ * Affects only markets created after this call — existing markets keep their snapshot.
7239
+ * Pass `0n` for free creation; if you do, gate `createMarket` via `creationAccessControl`
7240
+ * to deter spam.
7241
+ *
7242
+ * @param params.newFee - New fee in collateral token units (e.g. `parseUnits("10", 6)` for 10 USDC).
7243
+ */
7244
+ async updateMarketCreationFee(params) {
7245
+ const wallet = this.walletClient;
7246
+ const account = await this.getSignerAccount();
7247
+ const { request } = await this.publicClient.simulateContract({
7248
+ address: this.config.diamondAddress,
7249
+ abi: VenueFacet_default,
7250
+ functionName: "updateVenueMarketCreationFee",
7251
+ args: [params.venueId, params.newFee],
7252
+ account
7253
+ });
7254
+ return wallet.writeContract(request);
7255
+ }
7200
7256
  /**
7201
7257
  * Update venue oracle parameters (UMA reward and min bond)
7202
7258
  */