@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.d.mts +66 -18
- package/dist/index.d.ts +66 -18
- package/dist/index.js +73 -17
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +73 -17
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
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)
|
|
8098
|
-
* - umaRewardAmount: parseUnits("5", 6)
|
|
8099
|
-
* - umaMinBond: parseUnits("1", 6)
|
|
8100
|
-
* - defaultTickSize: parseEther("0.01")
|
|
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
|
|
8103
|
-
*
|
|
8104
|
-
*
|
|
8105
|
-
*
|
|
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
|
*/
|
|
@@ -10283,6 +10299,25 @@ var VenueFacet = [
|
|
|
10283
10299
|
],
|
|
10284
10300
|
stateMutability: "nonpayable"
|
|
10285
10301
|
},
|
|
10302
|
+
{
|
|
10303
|
+
type: "function",
|
|
10304
|
+
name: "updateVenueMarketCreationFee",
|
|
10305
|
+
inputs: [
|
|
10306
|
+
{
|
|
10307
|
+
name: "venueId",
|
|
10308
|
+
type: "uint256",
|
|
10309
|
+
internalType: "uint256"
|
|
10310
|
+
},
|
|
10311
|
+
{
|
|
10312
|
+
name: "newFee",
|
|
10313
|
+
type: "uint256",
|
|
10314
|
+
internalType: "uint256"
|
|
10315
|
+
}
|
|
10316
|
+
],
|
|
10317
|
+
outputs: [
|
|
10318
|
+
],
|
|
10319
|
+
stateMutability: "nonpayable"
|
|
10320
|
+
},
|
|
10286
10321
|
{
|
|
10287
10322
|
type: "function",
|
|
10288
10323
|
name: "updateVenueOracleParams",
|
|
@@ -10388,6 +10423,25 @@ var VenueFacet = [
|
|
|
10388
10423
|
],
|
|
10389
10424
|
anonymous: false
|
|
10390
10425
|
},
|
|
10426
|
+
{
|
|
10427
|
+
type: "event",
|
|
10428
|
+
name: "VenueMarketCreationFeeUpdated",
|
|
10429
|
+
inputs: [
|
|
10430
|
+
{
|
|
10431
|
+
name: "venueId",
|
|
10432
|
+
type: "uint256",
|
|
10433
|
+
indexed: true,
|
|
10434
|
+
internalType: "uint256"
|
|
10435
|
+
},
|
|
10436
|
+
{
|
|
10437
|
+
name: "newFee",
|
|
10438
|
+
type: "uint256",
|
|
10439
|
+
indexed: false,
|
|
10440
|
+
internalType: "uint256"
|
|
10441
|
+
}
|
|
10442
|
+
],
|
|
10443
|
+
anonymous: false
|
|
10444
|
+
},
|
|
10391
10445
|
{
|
|
10392
10446
|
type: "event",
|
|
10393
10447
|
name: "VenueOracleParamsUpdated",
|
|
@@ -10494,12 +10548,6 @@ var VenueFacet = [
|
|
|
10494
10548
|
inputs: [
|
|
10495
10549
|
]
|
|
10496
10550
|
},
|
|
10497
|
-
{
|
|
10498
|
-
type: "error",
|
|
10499
|
-
name: "InvalidMarketCreationFee",
|
|
10500
|
-
inputs: [
|
|
10501
|
-
]
|
|
10502
|
-
},
|
|
10503
10551
|
{
|
|
10504
10552
|
type: "error",
|
|
10505
10553
|
name: "InvalidTickSize",
|
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)
|
|
8098
|
-
* - umaRewardAmount: parseUnits("5", 6)
|
|
8099
|
-
* - umaMinBond: parseUnits("1", 6)
|
|
8100
|
-
* - defaultTickSize: parseEther("0.01")
|
|
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
|
|
8103
|
-
*
|
|
8104
|
-
*
|
|
8105
|
-
*
|
|
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
|
*/
|
|
@@ -10283,6 +10299,25 @@ var VenueFacet = [
|
|
|
10283
10299
|
],
|
|
10284
10300
|
stateMutability: "nonpayable"
|
|
10285
10301
|
},
|
|
10302
|
+
{
|
|
10303
|
+
type: "function",
|
|
10304
|
+
name: "updateVenueMarketCreationFee",
|
|
10305
|
+
inputs: [
|
|
10306
|
+
{
|
|
10307
|
+
name: "venueId",
|
|
10308
|
+
type: "uint256",
|
|
10309
|
+
internalType: "uint256"
|
|
10310
|
+
},
|
|
10311
|
+
{
|
|
10312
|
+
name: "newFee",
|
|
10313
|
+
type: "uint256",
|
|
10314
|
+
internalType: "uint256"
|
|
10315
|
+
}
|
|
10316
|
+
],
|
|
10317
|
+
outputs: [
|
|
10318
|
+
],
|
|
10319
|
+
stateMutability: "nonpayable"
|
|
10320
|
+
},
|
|
10286
10321
|
{
|
|
10287
10322
|
type: "function",
|
|
10288
10323
|
name: "updateVenueOracleParams",
|
|
@@ -10388,6 +10423,25 @@ var VenueFacet = [
|
|
|
10388
10423
|
],
|
|
10389
10424
|
anonymous: false
|
|
10390
10425
|
},
|
|
10426
|
+
{
|
|
10427
|
+
type: "event",
|
|
10428
|
+
name: "VenueMarketCreationFeeUpdated",
|
|
10429
|
+
inputs: [
|
|
10430
|
+
{
|
|
10431
|
+
name: "venueId",
|
|
10432
|
+
type: "uint256",
|
|
10433
|
+
indexed: true,
|
|
10434
|
+
internalType: "uint256"
|
|
10435
|
+
},
|
|
10436
|
+
{
|
|
10437
|
+
name: "newFee",
|
|
10438
|
+
type: "uint256",
|
|
10439
|
+
indexed: false,
|
|
10440
|
+
internalType: "uint256"
|
|
10441
|
+
}
|
|
10442
|
+
],
|
|
10443
|
+
anonymous: false
|
|
10444
|
+
},
|
|
10391
10445
|
{
|
|
10392
10446
|
type: "event",
|
|
10393
10447
|
name: "VenueOracleParamsUpdated",
|
|
@@ -10494,12 +10548,6 @@ var VenueFacet = [
|
|
|
10494
10548
|
inputs: [
|
|
10495
10549
|
]
|
|
10496
10550
|
},
|
|
10497
|
-
{
|
|
10498
|
-
type: "error",
|
|
10499
|
-
name: "InvalidMarketCreationFee",
|
|
10500
|
-
inputs: [
|
|
10501
|
-
]
|
|
10502
|
-
},
|
|
10503
10551
|
{
|
|
10504
10552
|
type: "error",
|
|
10505
10553
|
name: "InvalidTickSize",
|
package/dist/index.js
CHANGED
|
@@ -403,6 +403,24 @@ var VenueFacet_default = [
|
|
|
403
403
|
outputs: [],
|
|
404
404
|
stateMutability: "nonpayable"
|
|
405
405
|
},
|
|
406
|
+
{
|
|
407
|
+
type: "function",
|
|
408
|
+
name: "updateVenueMarketCreationFee",
|
|
409
|
+
inputs: [
|
|
410
|
+
{
|
|
411
|
+
name: "venueId",
|
|
412
|
+
type: "uint256",
|
|
413
|
+
internalType: "uint256"
|
|
414
|
+
},
|
|
415
|
+
{
|
|
416
|
+
name: "newFee",
|
|
417
|
+
type: "uint256",
|
|
418
|
+
internalType: "uint256"
|
|
419
|
+
}
|
|
420
|
+
],
|
|
421
|
+
outputs: [],
|
|
422
|
+
stateMutability: "nonpayable"
|
|
423
|
+
},
|
|
406
424
|
{
|
|
407
425
|
type: "function",
|
|
408
426
|
name: "updateVenueOracleParams",
|
|
@@ -507,6 +525,25 @@ var VenueFacet_default = [
|
|
|
507
525
|
],
|
|
508
526
|
anonymous: false
|
|
509
527
|
},
|
|
528
|
+
{
|
|
529
|
+
type: "event",
|
|
530
|
+
name: "VenueMarketCreationFeeUpdated",
|
|
531
|
+
inputs: [
|
|
532
|
+
{
|
|
533
|
+
name: "venueId",
|
|
534
|
+
type: "uint256",
|
|
535
|
+
indexed: true,
|
|
536
|
+
internalType: "uint256"
|
|
537
|
+
},
|
|
538
|
+
{
|
|
539
|
+
name: "newFee",
|
|
540
|
+
type: "uint256",
|
|
541
|
+
indexed: false,
|
|
542
|
+
internalType: "uint256"
|
|
543
|
+
}
|
|
544
|
+
],
|
|
545
|
+
anonymous: false
|
|
546
|
+
},
|
|
510
547
|
{
|
|
511
548
|
type: "event",
|
|
512
549
|
name: "VenueOracleParamsUpdated",
|
|
@@ -611,11 +648,6 @@ var VenueFacet_default = [
|
|
|
611
648
|
name: "InvalidFeeRecipient",
|
|
612
649
|
inputs: []
|
|
613
650
|
},
|
|
614
|
-
{
|
|
615
|
-
type: "error",
|
|
616
|
-
name: "InvalidMarketCreationFee",
|
|
617
|
-
inputs: []
|
|
618
|
-
},
|
|
619
651
|
{
|
|
620
652
|
type: "error",
|
|
621
653
|
name: "InvalidTickSize",
|
|
@@ -7095,21 +7127,24 @@ var UmaOracle_default = [
|
|
|
7095
7127
|
// src/modules/venue.ts
|
|
7096
7128
|
var VenueModule = class extends BaseModule {
|
|
7097
7129
|
/**
|
|
7098
|
-
* Create a new venue
|
|
7130
|
+
* Create a new venue.
|
|
7099
7131
|
*
|
|
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)
|
|
7132
|
+
* IMPORTANT: Fee and bond amounts must match your intended collateral token decimals.
|
|
7133
|
+
* Most venues use USDC (6 decimals), so amounts should use `parseUnits("amount", 6)`.
|
|
7102
7134
|
*
|
|
7103
|
-
* Example for USDC-based venue:
|
|
7104
|
-
* - marketCreationFee: parseUnits("10", 6)
|
|
7105
|
-
* - umaRewardAmount: parseUnits("5", 6)
|
|
7106
|
-
* - umaMinBond: parseUnits("1", 6)
|
|
7107
|
-
* - defaultTickSize: parseEther("0.01")
|
|
7135
|
+
* Example for a USDC-based venue:
|
|
7136
|
+
* - marketCreationFee: 0n // free creation, or parseUnits("10", 6) for 10 USDC
|
|
7137
|
+
* - umaRewardAmount: parseUnits("5", 6) // 5 USDC
|
|
7138
|
+
* - umaMinBond: parseUnits("1", 6) // 1 USDC
|
|
7139
|
+
* - defaultTickSize: parseEther("0.01") // 0.01 per tick (always 18 decimals)
|
|
7108
7140
|
*
|
|
7109
|
-
* @param params.marketCreationFee - Upfront fee
|
|
7110
|
-
*
|
|
7111
|
-
*
|
|
7112
|
-
*
|
|
7141
|
+
* @param params.marketCreationFee - Upfront fee in collateral units charged on `createMarket`.
|
|
7142
|
+
* Can be zero. When non-zero, split 50/50 between protocol and venue.
|
|
7143
|
+
* When zero, gate market creation via `creationAccessControl` to deter spam.
|
|
7144
|
+
* Mutable post-creation via `updateMarketCreationFee`.
|
|
7145
|
+
* @param params.umaRewardAmount - Default reward for UMA asserters (in collateral token units).
|
|
7146
|
+
* @param params.umaMinBond - Minimum bond for UMA assertions (in collateral token units).
|
|
7147
|
+
* @param params.defaultTickSize - Price increment per tick (always 1e18 scale, e.g. 0.01e18).
|
|
7113
7148
|
*/
|
|
7114
7149
|
async createVenue(params) {
|
|
7115
7150
|
const wallet = this.walletClient;
|
|
@@ -7199,6 +7234,27 @@ var VenueModule = class extends BaseModule {
|
|
|
7199
7234
|
});
|
|
7200
7235
|
return wallet.writeContract(request);
|
|
7201
7236
|
}
|
|
7237
|
+
/**
|
|
7238
|
+
* Update the upfront market creation fee for a venue. Operator-only.
|
|
7239
|
+
*
|
|
7240
|
+
* Affects only markets created after this call — existing markets keep their snapshot.
|
|
7241
|
+
* Pass `0n` for free creation; if you do, gate `createMarket` via `creationAccessControl`
|
|
7242
|
+
* to deter spam.
|
|
7243
|
+
*
|
|
7244
|
+
* @param params.newFee - New fee in collateral token units (e.g. `parseUnits("10", 6)` for 10 USDC).
|
|
7245
|
+
*/
|
|
7246
|
+
async updateMarketCreationFee(params) {
|
|
7247
|
+
const wallet = this.walletClient;
|
|
7248
|
+
const account = await this.getSignerAccount();
|
|
7249
|
+
const { request } = await this.publicClient.simulateContract({
|
|
7250
|
+
address: this.config.diamondAddress,
|
|
7251
|
+
abi: VenueFacet_default,
|
|
7252
|
+
functionName: "updateVenueMarketCreationFee",
|
|
7253
|
+
args: [params.venueId, params.newFee],
|
|
7254
|
+
account
|
|
7255
|
+
});
|
|
7256
|
+
return wallet.writeContract(request);
|
|
7257
|
+
}
|
|
7202
7258
|
/**
|
|
7203
7259
|
* Update venue oracle parameters (UMA reward and min bond)
|
|
7204
7260
|
*/
|