@bench.games/opportunity-markets 0.2.2 → 0.2.5

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.cjs CHANGED
@@ -42,7 +42,7 @@ __export(index_exports, {
42
42
  COMPUTATION_DEFINITION_ACCOUNT_DISCRIMINATOR: () => COMPUTATION_DEFINITION_ACCOUNT_DISCRIMINATOR,
43
43
  CREATE_MARKET_DISCRIMINATOR: () => CREATE_MARKET_DISCRIMINATOR,
44
44
  DO_UNSTAKE_EARLY_DISCRIMINATOR: () => DO_UNSTAKE_EARLY_DISCRIMINATOR,
45
- EXTEND_REVEAL_PERIOD_DISCRIMINATOR: () => EXTEND_REVEAL_PERIOD_DISCRIMINATOR,
45
+ END_REVEAL_PERIOD_DISCRIMINATOR: () => END_REVEAL_PERIOD_DISCRIMINATOR,
46
46
  FEE_POOL_DISCRIMINATOR: () => FEE_POOL_DISCRIMINATOR,
47
47
  INCREASE_REWARD_POOL_DISCRIMINATOR: () => INCREASE_REWARD_POOL_DISCRIMINATOR,
48
48
  INCREMENT_OPTION_TALLY_DISCRIMINATOR: () => INCREMENT_OPTION_TALLY_DISCRIMINATOR,
@@ -130,8 +130,8 @@ __export(index_exports, {
130
130
  deriveSharedSecret: () => deriveSharedSecret,
131
131
  deriveX25519KeypairFromSignature: () => deriveX25519KeypairFromSignature,
132
132
  doUnstakeEarly: () => doUnstakeEarly,
133
+ endRevealPeriod: () => endRevealPeriod,
133
134
  ensureCentralState: () => ensureCentralState,
134
- extendRevealPeriod: () => extendRevealPeriod,
135
135
  fetchAllArciumSignerAccount: () => fetchAllArciumSignerAccount,
136
136
  fetchAllCentralState: () => fetchAllCentralState,
137
137
  fetchAllClockAccount: () => fetchAllClockAccount,
@@ -245,14 +245,14 @@ __export(index_exports, {
245
245
  getDoUnstakeEarlyInstructionDataCodec: () => getDoUnstakeEarlyInstructionDataCodec,
246
246
  getDoUnstakeEarlyInstructionDataDecoder: () => getDoUnstakeEarlyInstructionDataDecoder,
247
247
  getDoUnstakeEarlyInstructionDataEncoder: () => getDoUnstakeEarlyInstructionDataEncoder,
248
+ getEndRevealPeriodDiscriminatorBytes: () => getEndRevealPeriodDiscriminatorBytes,
249
+ getEndRevealPeriodInstruction: () => getEndRevealPeriodInstruction,
250
+ getEndRevealPeriodInstructionDataCodec: () => getEndRevealPeriodInstructionDataCodec,
251
+ getEndRevealPeriodInstructionDataDecoder: () => getEndRevealPeriodInstructionDataDecoder,
252
+ getEndRevealPeriodInstructionDataEncoder: () => getEndRevealPeriodInstructionDataEncoder,
248
253
  getEpochCodec: () => getEpochCodec,
249
254
  getEpochDecoder: () => getEpochDecoder,
250
255
  getEpochEncoder: () => getEpochEncoder,
251
- getExtendRevealPeriodDiscriminatorBytes: () => getExtendRevealPeriodDiscriminatorBytes,
252
- getExtendRevealPeriodInstruction: () => getExtendRevealPeriodInstruction,
253
- getExtendRevealPeriodInstructionDataCodec: () => getExtendRevealPeriodInstructionDataCodec,
254
- getExtendRevealPeriodInstructionDataDecoder: () => getExtendRevealPeriodInstructionDataDecoder,
255
- getExtendRevealPeriodInstructionDataEncoder: () => getExtendRevealPeriodInstructionDataEncoder,
256
256
  getFeePoolCodec: () => getFeePoolCodec,
257
257
  getFeePoolDecoder: () => getFeePoolDecoder,
258
258
  getFeePoolDiscriminatorBytes: () => getFeePoolDiscriminatorBytes,
@@ -498,7 +498,7 @@ __export(index_exports, {
498
498
  parseCloseStakeAccountInstruction: () => parseCloseStakeAccountInstruction,
499
499
  parseCreateMarketInstruction: () => parseCreateMarketInstruction,
500
500
  parseDoUnstakeEarlyInstruction: () => parseDoUnstakeEarlyInstruction,
501
- parseExtendRevealPeriodInstruction: () => parseExtendRevealPeriodInstruction,
501
+ parseEndRevealPeriodInstruction: () => parseEndRevealPeriodInstruction,
502
502
  parseIncreaseRewardPoolInstruction: () => parseIncreaseRewardPoolInstruction,
503
503
  parseIncrementOptionTallyInstruction: () => parseIncrementOptionTallyInstruction,
504
504
  parseInitCentralStateInstruction: () => parseInitCentralStateInstruction,
@@ -631,7 +631,9 @@ function getCentralStateEncoder() {
631
631
  ["authority", (0, import_kit2.getAddressEncoder)()],
632
632
  ["minOptionDeposit", (0, import_kit2.getU64Encoder)()],
633
633
  ["protocolFeeBp", (0, import_kit2.getU16Encoder)()],
634
- ["feeRecipient", (0, import_kit2.getAddressEncoder)()]
634
+ ["feeRecipient", (0, import_kit2.getAddressEncoder)()],
635
+ ["rewardWithdrawStakedLimit", (0, import_kit2.getU32Encoder)()],
636
+ ["minimumInitialRevealPeriod", (0, import_kit2.getU64Encoder)()]
635
637
  ]),
636
638
  (value) => ({ ...value, discriminator: CENTRAL_STATE_DISCRIMINATOR })
637
639
  );
@@ -644,7 +646,9 @@ function getCentralStateDecoder() {
644
646
  ["authority", (0, import_kit2.getAddressDecoder)()],
645
647
  ["minOptionDeposit", (0, import_kit2.getU64Decoder)()],
646
648
  ["protocolFeeBp", (0, import_kit2.getU16Decoder)()],
647
- ["feeRecipient", (0, import_kit2.getAddressDecoder)()]
649
+ ["feeRecipient", (0, import_kit2.getAddressDecoder)()],
650
+ ["rewardWithdrawStakedLimit", (0, import_kit2.getU32Decoder)()],
651
+ ["minimumInitialRevealPeriod", (0, import_kit2.getU64Decoder)()]
648
652
  ]);
649
653
  }
650
654
  function getCentralStateCodec() {
@@ -880,6 +884,7 @@ function getMarketCreatedEventEncoder() {
880
884
  ["rewardAmount", (0, import_kit11.getU64Encoder)()],
881
885
  ["timeToStake", (0, import_kit11.getU64Encoder)()],
882
886
  ["timeToReveal", (0, import_kit11.getU64Encoder)()],
887
+ ["earlinessCutoffSeconds", (0, import_kit11.getU64Encoder)()],
883
888
  ["marketAuthority", (0, import_kit11.getOptionEncoder)((0, import_kit11.getAddressEncoder)())],
884
889
  ["authorizedReaderPubkey", (0, import_kit11.getArrayEncoder)((0, import_kit11.getU8Encoder)(), { size: 32 })],
885
890
  ["unstakeDelaySeconds", (0, import_kit11.getU64Encoder)()],
@@ -896,6 +901,7 @@ function getMarketCreatedEventDecoder() {
896
901
  ["rewardAmount", (0, import_kit11.getU64Decoder)()],
897
902
  ["timeToStake", (0, import_kit11.getU64Decoder)()],
898
903
  ["timeToReveal", (0, import_kit11.getU64Decoder)()],
904
+ ["earlinessCutoffSeconds", (0, import_kit11.getU64Decoder)()],
899
905
  ["marketAuthority", (0, import_kit11.getOptionDecoder)((0, import_kit11.getAddressDecoder)())],
900
906
  ["authorizedReaderPubkey", (0, import_kit11.getArrayDecoder)((0, import_kit11.getU8Decoder)(), { size: 32 })],
901
907
  ["unstakeDelaySeconds", (0, import_kit11.getU64Decoder)()],
@@ -1502,8 +1508,10 @@ function getTallyIncrementedEventEncoder() {
1502
1508
  ["market", (0, import_kit34.getAddressEncoder)()],
1503
1509
  ["stakeAccount", (0, import_kit34.getAddressEncoder)()],
1504
1510
  ["optionId", (0, import_kit34.getU64Encoder)()],
1505
- ["amount", (0, import_kit34.getU64Encoder)()],
1511
+ ["userStake", (0, import_kit34.getU64Encoder)()],
1506
1512
  ["userScore", (0, import_kit34.getU64Encoder)()],
1513
+ ["totalScore", (0, import_kit34.getU64Encoder)()],
1514
+ ["totalStake", (0, import_kit34.getU64Encoder)()],
1507
1515
  ["timestamp", (0, import_kit34.getI64Encoder)()]
1508
1516
  ]);
1509
1517
  }
@@ -1513,8 +1521,10 @@ function getTallyIncrementedEventDecoder() {
1513
1521
  ["market", (0, import_kit34.getAddressDecoder)()],
1514
1522
  ["stakeAccount", (0, import_kit34.getAddressDecoder)()],
1515
1523
  ["optionId", (0, import_kit34.getU64Decoder)()],
1516
- ["amount", (0, import_kit34.getU64Decoder)()],
1524
+ ["userStake", (0, import_kit34.getU64Decoder)()],
1517
1525
  ["userScore", (0, import_kit34.getU64Decoder)()],
1526
+ ["totalScore", (0, import_kit34.getU64Decoder)()],
1527
+ ["totalStake", (0, import_kit34.getU64Decoder)()],
1518
1528
  ["timestamp", (0, import_kit34.getI64Decoder)()]
1519
1529
  ]);
1520
1530
  }
@@ -2137,13 +2147,15 @@ function getOpportunityMarketEncoder() {
2137
2147
  (0, import_kit46.getOptionEncoder)((0, import_kit46.getArrayEncoder)(getWinningOptionEncoder()))
2138
2148
  ],
2139
2149
  ["rewardAmount", (0, import_kit46.getU64Encoder)()],
2140
- ["marketAuthority", (0, import_kit46.getOptionEncoder)((0, import_kit46.getAddressEncoder)())],
2150
+ ["marketAuthority", (0, import_kit46.getAddressEncoder)()],
2151
+ ["revealPeriodAuthority", (0, import_kit46.getAddressEncoder)()],
2141
2152
  ["mint", (0, import_kit46.getAddressEncoder)()],
2142
2153
  ["earlinessCutoffSeconds", (0, import_kit46.getU64Encoder)()],
2143
2154
  ["unstakeDelaySeconds", (0, import_kit46.getU64Encoder)()],
2144
2155
  ["authorizedReaderPubkey", (0, import_kit46.getArrayEncoder)((0, import_kit46.getU8Encoder)(), { size: 32 })],
2145
2156
  ["allowClosingEarly", (0, import_kit46.getBooleanEncoder)()],
2146
- ["rewardWithdrawn", (0, import_kit46.getBooleanEncoder)()]
2157
+ ["rewardWithdrawn", (0, import_kit46.getBooleanEncoder)()],
2158
+ ["totalStakedCount", (0, import_kit46.getU64Encoder)()]
2147
2159
  ]),
2148
2160
  (value) => ({ ...value, discriminator: OPPORTUNITY_MARKET_DISCRIMINATOR })
2149
2161
  );
@@ -2163,13 +2175,15 @@ function getOpportunityMarketDecoder() {
2163
2175
  (0, import_kit46.getOptionDecoder)((0, import_kit46.getArrayDecoder)(getWinningOptionDecoder()))
2164
2176
  ],
2165
2177
  ["rewardAmount", (0, import_kit46.getU64Decoder)()],
2166
- ["marketAuthority", (0, import_kit46.getOptionDecoder)((0, import_kit46.getAddressDecoder)())],
2178
+ ["marketAuthority", (0, import_kit46.getAddressDecoder)()],
2179
+ ["revealPeriodAuthority", (0, import_kit46.getAddressDecoder)()],
2167
2180
  ["mint", (0, import_kit46.getAddressDecoder)()],
2168
2181
  ["earlinessCutoffSeconds", (0, import_kit46.getU64Decoder)()],
2169
2182
  ["unstakeDelaySeconds", (0, import_kit46.getU64Decoder)()],
2170
2183
  ["authorizedReaderPubkey", (0, import_kit46.getArrayDecoder)((0, import_kit46.getU8Decoder)(), { size: 32 })],
2171
2184
  ["allowClosingEarly", (0, import_kit46.getBooleanDecoder)()],
2172
- ["rewardWithdrawn", (0, import_kit46.getBooleanDecoder)()]
2185
+ ["rewardWithdrawn", (0, import_kit46.getBooleanDecoder)()],
2186
+ ["totalStakedCount", (0, import_kit46.getU64Decoder)()]
2173
2187
  ]);
2174
2188
  }
2175
2189
  function getOpportunityMarketCodec() {
@@ -2232,8 +2246,8 @@ function getOpportunityMarketOptionEncoder() {
2232
2246
  ["discriminator", (0, import_kit47.fixEncoderSize)((0, import_kit47.getBytesEncoder)(), 8)],
2233
2247
  ["bump", (0, import_kit47.getU8Encoder)()],
2234
2248
  ["id", (0, import_kit47.getU64Encoder)()],
2235
- ["totalStaked", (0, import_kit47.getOptionEncoder)((0, import_kit47.getU64Encoder)())],
2236
- ["totalScore", (0, import_kit47.getOptionEncoder)((0, import_kit47.getU64Encoder)())]
2249
+ ["totalStaked", (0, import_kit47.getU64Encoder)()],
2250
+ ["totalScore", (0, import_kit47.getU64Encoder)()]
2237
2251
  ]),
2238
2252
  (value) => ({
2239
2253
  ...value,
@@ -2246,8 +2260,8 @@ function getOpportunityMarketOptionDecoder() {
2246
2260
  ["discriminator", (0, import_kit47.fixDecoderSize)((0, import_kit47.getBytesDecoder)(), 8)],
2247
2261
  ["bump", (0, import_kit47.getU8Decoder)()],
2248
2262
  ["id", (0, import_kit47.getU64Decoder)()],
2249
- ["totalStaked", (0, import_kit47.getOptionDecoder)((0, import_kit47.getU64Decoder)())],
2250
- ["totalScore", (0, import_kit47.getOptionDecoder)((0, import_kit47.getU64Decoder)())]
2263
+ ["totalStaked", (0, import_kit47.getU64Decoder)()],
2264
+ ["totalScore", (0, import_kit47.getU64Decoder)()]
2251
2265
  ]);
2252
2266
  }
2253
2267
  function getOpportunityMarketOptionCodec() {
@@ -2586,7 +2600,7 @@ var OpportunityMarketInstruction = /* @__PURE__ */ ((OpportunityMarketInstructio
2586
2600
  OpportunityMarketInstruction2[OpportunityMarketInstruction2["CloseStakeAccount"] = 2] = "CloseStakeAccount";
2587
2601
  OpportunityMarketInstruction2[OpportunityMarketInstruction2["CreateMarket"] = 3] = "CreateMarket";
2588
2602
  OpportunityMarketInstruction2[OpportunityMarketInstruction2["DoUnstakeEarly"] = 4] = "DoUnstakeEarly";
2589
- OpportunityMarketInstruction2[OpportunityMarketInstruction2["ExtendRevealPeriod"] = 5] = "ExtendRevealPeriod";
2603
+ OpportunityMarketInstruction2[OpportunityMarketInstruction2["EndRevealPeriod"] = 5] = "EndRevealPeriod";
2590
2604
  OpportunityMarketInstruction2[OpportunityMarketInstruction2["IncreaseRewardPool"] = 6] = "IncreaseRewardPool";
2591
2605
  OpportunityMarketInstruction2[OpportunityMarketInstruction2["IncrementOptionTally"] = 7] = "IncrementOptionTally";
2592
2606
  OpportunityMarketInstruction2[OpportunityMarketInstruction2["InitCentralState"] = 8] = "InitCentralState";
@@ -2657,11 +2671,11 @@ function identifyOpportunityMarketInstruction(instruction) {
2657
2671
  if ((0, import_kit50.containsBytes)(
2658
2672
  data,
2659
2673
  (0, import_kit50.fixEncoderSize)((0, import_kit50.getBytesEncoder)(), 8).encode(
2660
- new Uint8Array([95, 102, 32, 59, 88, 1, 211, 128])
2674
+ new Uint8Array([144, 81, 42, 65, 127, 60, 134, 92])
2661
2675
  ),
2662
2676
  0
2663
2677
  )) {
2664
- return 5 /* ExtendRevealPeriod */;
2678
+ return 5 /* EndRevealPeriod */;
2665
2679
  }
2666
2680
  if ((0, import_kit50.containsBytes)(
2667
2681
  data,
@@ -3468,7 +3482,8 @@ function getCreateMarketInstructionDataEncoder() {
3468
3482
  ["marketAuthority", (0, import_kit56.getOptionEncoder)((0, import_kit56.getAddressEncoder)())],
3469
3483
  ["unstakeDelaySeconds", (0, import_kit56.getU64Encoder)()],
3470
3484
  ["authorizedReaderPubkey", (0, import_kit56.getArrayEncoder)((0, import_kit56.getU8Encoder)(), { size: 32 })],
3471
- ["allowClosingEarly", (0, import_kit56.getBooleanEncoder)()]
3485
+ ["allowClosingEarly", (0, import_kit56.getBooleanEncoder)()],
3486
+ ["revealPeriodAuthority", (0, import_kit56.getAddressEncoder)()]
3472
3487
  ]),
3473
3488
  (value) => ({ ...value, discriminator: CREATE_MARKET_DISCRIMINATOR })
3474
3489
  );
@@ -3483,7 +3498,8 @@ function getCreateMarketInstructionDataDecoder() {
3483
3498
  ["marketAuthority", (0, import_kit56.getOptionDecoder)((0, import_kit56.getAddressDecoder)())],
3484
3499
  ["unstakeDelaySeconds", (0, import_kit56.getU64Decoder)()],
3485
3500
  ["authorizedReaderPubkey", (0, import_kit56.getArrayDecoder)((0, import_kit56.getU8Decoder)(), { size: 32 })],
3486
- ["allowClosingEarly", (0, import_kit56.getBooleanDecoder)()]
3501
+ ["allowClosingEarly", (0, import_kit56.getBooleanDecoder)()],
3502
+ ["revealPeriodAuthority", (0, import_kit56.getAddressDecoder)()]
3487
3503
  ]);
3488
3504
  }
3489
3505
  function getCreateMarketInstructionDataCodec() {
@@ -3844,65 +3860,58 @@ function parseDoUnstakeEarlyInstruction(instruction) {
3844
3860
  };
3845
3861
  }
3846
3862
 
3847
- // src/generated/instructions/extendRevealPeriod.ts
3863
+ // src/generated/instructions/endRevealPeriod.ts
3848
3864
  var import_kit58 = require("@solana/kit");
3849
- var EXTEND_REVEAL_PERIOD_DISCRIMINATOR = new Uint8Array([
3850
- 95,
3851
- 102,
3852
- 32,
3853
- 59,
3854
- 88,
3855
- 1,
3856
- 211,
3857
- 128
3865
+ var END_REVEAL_PERIOD_DISCRIMINATOR = new Uint8Array([
3866
+ 144,
3867
+ 81,
3868
+ 42,
3869
+ 65,
3870
+ 127,
3871
+ 60,
3872
+ 134,
3873
+ 92
3858
3874
  ]);
3859
- function getExtendRevealPeriodDiscriminatorBytes() {
3875
+ function getEndRevealPeriodDiscriminatorBytes() {
3860
3876
  return (0, import_kit58.fixEncoderSize)((0, import_kit58.getBytesEncoder)(), 8).encode(
3861
- EXTEND_REVEAL_PERIOD_DISCRIMINATOR
3877
+ END_REVEAL_PERIOD_DISCRIMINATOR
3862
3878
  );
3863
3879
  }
3864
- function getExtendRevealPeriodInstructionDataEncoder() {
3880
+ function getEndRevealPeriodInstructionDataEncoder() {
3865
3881
  return (0, import_kit58.transformEncoder)(
3866
- (0, import_kit58.getStructEncoder)([
3867
- ["discriminator", (0, import_kit58.fixEncoderSize)((0, import_kit58.getBytesEncoder)(), 8)],
3868
- ["newTimeToReveal", (0, import_kit58.getU64Encoder)()]
3869
- ]),
3870
- (value) => ({ ...value, discriminator: EXTEND_REVEAL_PERIOD_DISCRIMINATOR })
3882
+ (0, import_kit58.getStructEncoder)([["discriminator", (0, import_kit58.fixEncoderSize)((0, import_kit58.getBytesEncoder)(), 8)]]),
3883
+ (value) => ({ ...value, discriminator: END_REVEAL_PERIOD_DISCRIMINATOR })
3871
3884
  );
3872
3885
  }
3873
- function getExtendRevealPeriodInstructionDataDecoder() {
3886
+ function getEndRevealPeriodInstructionDataDecoder() {
3874
3887
  return (0, import_kit58.getStructDecoder)([
3875
- ["discriminator", (0, import_kit58.fixDecoderSize)((0, import_kit58.getBytesDecoder)(), 8)],
3876
- ["newTimeToReveal", (0, import_kit58.getU64Decoder)()]
3888
+ ["discriminator", (0, import_kit58.fixDecoderSize)((0, import_kit58.getBytesDecoder)(), 8)]
3877
3889
  ]);
3878
3890
  }
3879
- function getExtendRevealPeriodInstructionDataCodec() {
3891
+ function getEndRevealPeriodInstructionDataCodec() {
3880
3892
  return (0, import_kit58.combineCodec)(
3881
- getExtendRevealPeriodInstructionDataEncoder(),
3882
- getExtendRevealPeriodInstructionDataDecoder()
3893
+ getEndRevealPeriodInstructionDataEncoder(),
3894
+ getEndRevealPeriodInstructionDataDecoder()
3883
3895
  );
3884
3896
  }
3885
- function getExtendRevealPeriodInstruction(input, config) {
3897
+ function getEndRevealPeriodInstruction(input, config) {
3886
3898
  const programAddress = config?.programAddress ?? OPPORTUNITY_MARKET_PROGRAM_ADDRESS;
3887
3899
  const originalAccounts = {
3888
3900
  authority: { value: input.authority ?? null, isWritable: false },
3889
3901
  market: { value: input.market ?? null, isWritable: true }
3890
3902
  };
3891
3903
  const accounts = originalAccounts;
3892
- const args = { ...input };
3893
3904
  const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
3894
3905
  return Object.freeze({
3895
3906
  accounts: [
3896
3907
  getAccountMeta(accounts.authority),
3897
3908
  getAccountMeta(accounts.market)
3898
3909
  ],
3899
- data: getExtendRevealPeriodInstructionDataEncoder().encode(
3900
- args
3901
- ),
3910
+ data: getEndRevealPeriodInstructionDataEncoder().encode({}),
3902
3911
  programAddress
3903
3912
  });
3904
3913
  }
3905
- function parseExtendRevealPeriodInstruction(instruction) {
3914
+ function parseEndRevealPeriodInstruction(instruction) {
3906
3915
  if (instruction.accounts.length < 2) {
3907
3916
  throw new Error("Not enough accounts");
3908
3917
  }
@@ -3915,9 +3924,7 @@ function parseExtendRevealPeriodInstruction(instruction) {
3915
3924
  return {
3916
3925
  programAddress: instruction.programAddress,
3917
3926
  accounts: { authority: getNextAccount(), market: getNextAccount() },
3918
- data: getExtendRevealPeriodInstructionDataDecoder().decode(
3919
- instruction.data
3920
- )
3927
+ data: getEndRevealPeriodInstructionDataDecoder().decode(instruction.data)
3921
3928
  };
3922
3929
  }
3923
3930
 
@@ -4240,7 +4247,9 @@ function getInitCentralStateInstructionDataEncoder() {
4240
4247
  ["earlinessCutoffSeconds", (0, import_kit61.getU64Encoder)()],
4241
4248
  ["minOptionDeposit", (0, import_kit61.getU64Encoder)()],
4242
4249
  ["protocolFeeBp", (0, import_kit61.getU16Encoder)()],
4243
- ["feeRecipient", (0, import_kit61.getAddressEncoder)()]
4250
+ ["feeRecipient", (0, import_kit61.getAddressEncoder)()],
4251
+ ["rewardWithdrawStakedLimit", (0, import_kit61.getU32Encoder)()],
4252
+ ["minimumInitialRevealPeriod", (0, import_kit61.getU64Encoder)()]
4244
4253
  ]),
4245
4254
  (value) => ({ ...value, discriminator: INIT_CENTRAL_STATE_DISCRIMINATOR })
4246
4255
  );
@@ -4251,7 +4260,9 @@ function getInitCentralStateInstructionDataDecoder() {
4251
4260
  ["earlinessCutoffSeconds", (0, import_kit61.getU64Decoder)()],
4252
4261
  ["minOptionDeposit", (0, import_kit61.getU64Decoder)()],
4253
4262
  ["protocolFeeBp", (0, import_kit61.getU16Decoder)()],
4254
- ["feeRecipient", (0, import_kit61.getAddressDecoder)()]
4263
+ ["feeRecipient", (0, import_kit61.getAddressDecoder)()],
4264
+ ["rewardWithdrawStakedLimit", (0, import_kit61.getU32Decoder)()],
4265
+ ["minimumInitialRevealPeriod", (0, import_kit61.getU64Decoder)()]
4255
4266
  ]);
4256
4267
  }
4257
4268
  function getInitCentralStateInstructionDataCodec() {
@@ -5600,7 +5611,8 @@ function getStakeInstructionDataCodec() {
5600
5611
  async function getStakeInstructionAsync(input, config) {
5601
5612
  const programAddress = config?.programAddress ?? OPPORTUNITY_MARKET_PROGRAM_ADDRESS;
5602
5613
  const originalAccounts = {
5603
- signer: { value: input.signer ?? null, isWritable: true },
5614
+ signer: { value: input.signer ?? null, isWritable: false },
5615
+ payer: { value: input.payer ?? null, isWritable: true },
5604
5616
  market: { value: input.market ?? null, isWritable: false },
5605
5617
  stakeAccount: { value: input.stakeAccount ?? null, isWritable: true },
5606
5618
  tokenMint: { value: input.tokenMint ?? null, isWritable: false },
@@ -5733,6 +5745,7 @@ async function getStakeInstructionAsync(input, config) {
5733
5745
  return Object.freeze({
5734
5746
  accounts: [
5735
5747
  getAccountMeta(accounts.signer),
5748
+ getAccountMeta(accounts.payer),
5736
5749
  getAccountMeta(accounts.market),
5737
5750
  getAccountMeta(accounts.stakeAccount),
5738
5751
  getAccountMeta(accounts.tokenMint),
@@ -5762,7 +5775,8 @@ async function getStakeInstructionAsync(input, config) {
5762
5775
  function getStakeInstruction(input, config) {
5763
5776
  const programAddress = config?.programAddress ?? OPPORTUNITY_MARKET_PROGRAM_ADDRESS;
5764
5777
  const originalAccounts = {
5765
- signer: { value: input.signer ?? null, isWritable: true },
5778
+ signer: { value: input.signer ?? null, isWritable: false },
5779
+ payer: { value: input.payer ?? null, isWritable: true },
5766
5780
  market: { value: input.market ?? null, isWritable: false },
5767
5781
  stakeAccount: { value: input.stakeAccount ?? null, isWritable: true },
5768
5782
  tokenMint: { value: input.tokenMint ?? null, isWritable: false },
@@ -5807,6 +5821,7 @@ function getStakeInstruction(input, config) {
5807
5821
  return Object.freeze({
5808
5822
  accounts: [
5809
5823
  getAccountMeta(accounts.signer),
5824
+ getAccountMeta(accounts.payer),
5810
5825
  getAccountMeta(accounts.market),
5811
5826
  getAccountMeta(accounts.stakeAccount),
5812
5827
  getAccountMeta(accounts.tokenMint),
@@ -5834,7 +5849,7 @@ function getStakeInstruction(input, config) {
5834
5849
  });
5835
5850
  }
5836
5851
  function parseStakeInstruction(instruction) {
5837
- if (instruction.accounts.length < 20) {
5852
+ if (instruction.accounts.length < 21) {
5838
5853
  throw new Error("Not enough accounts");
5839
5854
  }
5840
5855
  let accountIndex = 0;
@@ -5847,6 +5862,7 @@ function parseStakeInstruction(instruction) {
5847
5862
  programAddress: instruction.programAddress,
5848
5863
  accounts: {
5849
5864
  signer: getNextAccount(),
5865
+ payer: getNextAccount(),
5850
5866
  market: getNextAccount(),
5851
5867
  stakeAccount: getNextAccount(),
5852
5868
  tokenMint: getNextAccount(),
@@ -5970,6 +5986,7 @@ function getStakeCallbackInstruction(input, config) {
5970
5986
  value: input.instructionsSysvar ?? null,
5971
5987
  isWritable: false
5972
5988
  },
5989
+ market: { value: input.market ?? null, isWritable: true },
5973
5990
  stakeAccount: { value: input.stakeAccount ?? null, isWritable: true }
5974
5991
  };
5975
5992
  const accounts = originalAccounts;
@@ -5989,6 +6006,7 @@ function getStakeCallbackInstruction(input, config) {
5989
6006
  getAccountMeta(accounts.computationAccount),
5990
6007
  getAccountMeta(accounts.clusterAccount),
5991
6008
  getAccountMeta(accounts.instructionsSysvar),
6009
+ getAccountMeta(accounts.market),
5992
6010
  getAccountMeta(accounts.stakeAccount)
5993
6011
  ],
5994
6012
  data: getStakeCallbackInstructionDataEncoder().encode(
@@ -5998,7 +6016,7 @@ function getStakeCallbackInstruction(input, config) {
5998
6016
  });
5999
6017
  }
6000
6018
  function parseStakeCallbackInstruction(instruction) {
6001
- if (instruction.accounts.length < 7) {
6019
+ if (instruction.accounts.length < 8) {
6002
6020
  throw new Error("Not enough accounts");
6003
6021
  }
6004
6022
  let accountIndex = 0;
@@ -6016,6 +6034,7 @@ function parseStakeCallbackInstruction(instruction) {
6016
6034
  computationAccount: getNextAccount(),
6017
6035
  clusterAccount: getNextAccount(),
6018
6036
  instructionsSysvar: getNextAccount(),
6037
+ market: getNextAccount(),
6019
6038
  stakeAccount: getNextAccount()
6020
6039
  },
6021
6040
  data: getStakeCallbackInstructionDataDecoder().decode(instruction.data)
@@ -6398,7 +6417,9 @@ function getUpdateCentralStateInstructionDataEncoder() {
6398
6417
  ["earlinessCutoffSeconds", (0, import_kit75.getU64Encoder)()],
6399
6418
  ["minOptionDeposit", (0, import_kit75.getU64Encoder)()],
6400
6419
  ["protocolFeeBp", (0, import_kit75.getU16Encoder)()],
6401
- ["feeRecipient", (0, import_kit75.getAddressEncoder)()]
6420
+ ["feeRecipient", (0, import_kit75.getAddressEncoder)()],
6421
+ ["rewardWithdrawStakedLimit", (0, import_kit75.getU32Encoder)()],
6422
+ ["minimumInitialRevealPeriod", (0, import_kit75.getU64Encoder)()]
6402
6423
  ]),
6403
6424
  (value) => ({ ...value, discriminator: UPDATE_CENTRAL_STATE_DISCRIMINATOR })
6404
6425
  );
@@ -6409,7 +6430,9 @@ function getUpdateCentralStateInstructionDataDecoder() {
6409
6430
  ["earlinessCutoffSeconds", (0, import_kit75.getU64Decoder)()],
6410
6431
  ["minOptionDeposit", (0, import_kit75.getU64Decoder)()],
6411
6432
  ["protocolFeeBp", (0, import_kit75.getU16Decoder)()],
6412
- ["feeRecipient", (0, import_kit75.getAddressDecoder)()]
6433
+ ["feeRecipient", (0, import_kit75.getAddressDecoder)()],
6434
+ ["rewardWithdrawStakedLimit", (0, import_kit75.getU32Decoder)()],
6435
+ ["minimumInitialRevealPeriod", (0, import_kit75.getU64Decoder)()]
6413
6436
  ]);
6414
6437
  }
6415
6438
  function getUpdateCentralStateInstructionDataCodec() {
@@ -6538,7 +6561,7 @@ function getWithdrawRewardInstructionDataCodec() {
6538
6561
  async function getWithdrawRewardInstructionAsync(input, config) {
6539
6562
  const programAddress = config?.programAddress ?? OPPORTUNITY_MARKET_PROGRAM_ADDRESS;
6540
6563
  const originalAccounts = {
6541
- creator: { value: input.creator ?? null, isWritable: false },
6564
+ authority: { value: input.authority ?? null, isWritable: false },
6542
6565
  market: { value: input.market ?? null, isWritable: true },
6543
6566
  tokenMint: { value: input.tokenMint ?? null, isWritable: false },
6544
6567
  marketTokenAta: { value: input.marketTokenAta ?? null, isWritable: true },
@@ -6546,6 +6569,7 @@ async function getWithdrawRewardInstructionAsync(input, config) {
6546
6569
  value: input.refundTokenAccount ?? null,
6547
6570
  isWritable: true
6548
6571
  },
6572
+ centralState: { value: input.centralState ?? null, isWritable: false },
6549
6573
  tokenProgram: { value: input.tokenProgram ?? null, isWritable: false }
6550
6574
  };
6551
6575
  const accounts = originalAccounts;
@@ -6559,14 +6583,39 @@ async function getWithdrawRewardInstructionAsync(input, config) {
6559
6583
  ]
6560
6584
  });
6561
6585
  }
6586
+ if (!accounts.centralState.value) {
6587
+ accounts.centralState.value = await (0, import_kit76.getProgramDerivedAddress)({
6588
+ programAddress,
6589
+ seeds: [
6590
+ (0, import_kit76.getBytesEncoder)().encode(
6591
+ new Uint8Array([
6592
+ 99,
6593
+ 101,
6594
+ 110,
6595
+ 116,
6596
+ 114,
6597
+ 97,
6598
+ 108,
6599
+ 95,
6600
+ 115,
6601
+ 116,
6602
+ 97,
6603
+ 116,
6604
+ 101
6605
+ ])
6606
+ )
6607
+ ]
6608
+ });
6609
+ }
6562
6610
  const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
6563
6611
  return Object.freeze({
6564
6612
  accounts: [
6565
- getAccountMeta(accounts.creator),
6613
+ getAccountMeta(accounts.authority),
6566
6614
  getAccountMeta(accounts.market),
6567
6615
  getAccountMeta(accounts.tokenMint),
6568
6616
  getAccountMeta(accounts.marketTokenAta),
6569
6617
  getAccountMeta(accounts.refundTokenAccount),
6618
+ getAccountMeta(accounts.centralState),
6570
6619
  getAccountMeta(accounts.tokenProgram)
6571
6620
  ],
6572
6621
  data: getWithdrawRewardInstructionDataEncoder().encode({}),
@@ -6576,7 +6625,7 @@ async function getWithdrawRewardInstructionAsync(input, config) {
6576
6625
  function getWithdrawRewardInstruction(input, config) {
6577
6626
  const programAddress = config?.programAddress ?? OPPORTUNITY_MARKET_PROGRAM_ADDRESS;
6578
6627
  const originalAccounts = {
6579
- creator: { value: input.creator ?? null, isWritable: false },
6628
+ authority: { value: input.authority ?? null, isWritable: false },
6580
6629
  market: { value: input.market ?? null, isWritable: true },
6581
6630
  tokenMint: { value: input.tokenMint ?? null, isWritable: false },
6582
6631
  marketTokenAta: { value: input.marketTokenAta ?? null, isWritable: true },
@@ -6584,17 +6633,19 @@ function getWithdrawRewardInstruction(input, config) {
6584
6633
  value: input.refundTokenAccount ?? null,
6585
6634
  isWritable: true
6586
6635
  },
6636
+ centralState: { value: input.centralState ?? null, isWritable: false },
6587
6637
  tokenProgram: { value: input.tokenProgram ?? null, isWritable: false }
6588
6638
  };
6589
6639
  const accounts = originalAccounts;
6590
6640
  const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
6591
6641
  return Object.freeze({
6592
6642
  accounts: [
6593
- getAccountMeta(accounts.creator),
6643
+ getAccountMeta(accounts.authority),
6594
6644
  getAccountMeta(accounts.market),
6595
6645
  getAccountMeta(accounts.tokenMint),
6596
6646
  getAccountMeta(accounts.marketTokenAta),
6597
6647
  getAccountMeta(accounts.refundTokenAccount),
6648
+ getAccountMeta(accounts.centralState),
6598
6649
  getAccountMeta(accounts.tokenProgram)
6599
6650
  ],
6600
6651
  data: getWithdrawRewardInstructionDataEncoder().encode({}),
@@ -6602,7 +6653,7 @@ function getWithdrawRewardInstruction(input, config) {
6602
6653
  });
6603
6654
  }
6604
6655
  function parseWithdrawRewardInstruction(instruction) {
6605
- if (instruction.accounts.length < 6) {
6656
+ if (instruction.accounts.length < 7) {
6606
6657
  throw new Error("Not enough accounts");
6607
6658
  }
6608
6659
  let accountIndex = 0;
@@ -6614,11 +6665,12 @@ function parseWithdrawRewardInstruction(instruction) {
6614
6665
  return {
6615
6666
  programAddress: instruction.programAddress,
6616
6667
  accounts: {
6617
- creator: getNextAccount(),
6668
+ authority: getNextAccount(),
6618
6669
  market: getNextAccount(),
6619
6670
  tokenMint: getNextAccount(),
6620
6671
  marketTokenAta: getNextAccount(),
6621
6672
  refundTokenAccount: getNextAccount(),
6673
+ centralState: getNextAccount(),
6622
6674
  tokenProgram: getNextAccount()
6623
6675
  },
6624
6676
  data: getWithdrawRewardInstructionDataDecoder().decode(instruction.data)
@@ -6667,6 +6719,7 @@ async function createMarket(input) {
6667
6719
  unstakeDelaySeconds,
6668
6720
  authorizedReaderPubkey,
6669
6721
  allowClosingEarly,
6722
+ revealPeriodAuthority,
6670
6723
  programAddress
6671
6724
  } = input;
6672
6725
  return getCreateMarketInstructionAsync(
@@ -6681,7 +6734,8 @@ async function createMarket(input) {
6681
6734
  marketAuthority,
6682
6735
  unstakeDelaySeconds,
6683
6736
  authorizedReaderPubkey: toNumberArray(authorizedReaderPubkey),
6684
- allowClosingEarly
6737
+ allowClosingEarly,
6738
+ revealPeriodAuthority
6685
6739
  },
6686
6740
  programAddress ? { programAddress } : void 0
6687
6741
  );
@@ -6781,6 +6835,7 @@ async function stake(input, config) {
6781
6835
  const {
6782
6836
  programAddress,
6783
6837
  signer,
6838
+ payer,
6784
6839
  market,
6785
6840
  stakeAccountId,
6786
6841
  tokenMint,
@@ -6799,6 +6854,7 @@ async function stake(input, config) {
6799
6854
  {
6800
6855
  ...getComputeAccounts("stake", config),
6801
6856
  signer,
6857
+ payer,
6802
6858
  market,
6803
6859
  stakeAccountId,
6804
6860
  tokenMint,
@@ -6859,10 +6915,10 @@ function selectWinningOptions(input) {
6859
6915
  );
6860
6916
  }
6861
6917
 
6862
- // src/instructions/extendRevealPeriod.ts
6863
- function extendRevealPeriod(input) {
6918
+ // src/instructions/endRevealPeriod.ts
6919
+ function endRevealPeriod(input) {
6864
6920
  const { programAddress, ...params } = input;
6865
- return getExtendRevealPeriodInstruction(
6921
+ return getEndRevealPeriodInstruction(
6866
6922
  params,
6867
6923
  programAddress ? { programAddress } : void 0
6868
6924
  );
@@ -6949,7 +7005,7 @@ async function ensureCentralState(rpc, params) {
6949
7005
  const existing = await fetchMaybeCentralState(rpc, centralStateAddress);
6950
7006
  if (existing.exists) {
6951
7007
  const s = existing.data;
6952
- if (s.earlinessCutoffSeconds === BigInt(args.earlinessCutoffSeconds) && s.minOptionDeposit === BigInt(args.minOptionDeposit) && s.protocolFeeBp === args.protocolFeeBp && s.feeRecipient === args.feeRecipient) {
7008
+ if (s.earlinessCutoffSeconds === BigInt(args.earlinessCutoffSeconds) && s.minOptionDeposit === BigInt(args.minOptionDeposit) && s.protocolFeeBp === args.protocolFeeBp && s.feeRecipient === args.feeRecipient && s.rewardWithdrawStakedLimit === args.rewardWithdrawStakedLimit && s.minimumInitialRevealPeriod === BigInt(args.minimumInitialRevealPeriod)) {
6953
7009
  return null;
6954
7010
  }
6955
7011
  return getUpdateCentralStateInstructionAsync(
@@ -7175,7 +7231,7 @@ function nonceToBytes(nonce) {
7175
7231
  COMPUTATION_DEFINITION_ACCOUNT_DISCRIMINATOR,
7176
7232
  CREATE_MARKET_DISCRIMINATOR,
7177
7233
  DO_UNSTAKE_EARLY_DISCRIMINATOR,
7178
- EXTEND_REVEAL_PERIOD_DISCRIMINATOR,
7234
+ END_REVEAL_PERIOD_DISCRIMINATOR,
7179
7235
  FEE_POOL_DISCRIMINATOR,
7180
7236
  INCREASE_REWARD_POOL_DISCRIMINATOR,
7181
7237
  INCREMENT_OPTION_TALLY_DISCRIMINATOR,
@@ -7263,8 +7319,8 @@ function nonceToBytes(nonce) {
7263
7319
  deriveSharedSecret,
7264
7320
  deriveX25519KeypairFromSignature,
7265
7321
  doUnstakeEarly,
7322
+ endRevealPeriod,
7266
7323
  ensureCentralState,
7267
- extendRevealPeriod,
7268
7324
  fetchAllArciumSignerAccount,
7269
7325
  fetchAllCentralState,
7270
7326
  fetchAllClockAccount,
@@ -7378,14 +7434,14 @@ function nonceToBytes(nonce) {
7378
7434
  getDoUnstakeEarlyInstructionDataCodec,
7379
7435
  getDoUnstakeEarlyInstructionDataDecoder,
7380
7436
  getDoUnstakeEarlyInstructionDataEncoder,
7437
+ getEndRevealPeriodDiscriminatorBytes,
7438
+ getEndRevealPeriodInstruction,
7439
+ getEndRevealPeriodInstructionDataCodec,
7440
+ getEndRevealPeriodInstructionDataDecoder,
7441
+ getEndRevealPeriodInstructionDataEncoder,
7381
7442
  getEpochCodec,
7382
7443
  getEpochDecoder,
7383
7444
  getEpochEncoder,
7384
- getExtendRevealPeriodDiscriminatorBytes,
7385
- getExtendRevealPeriodInstruction,
7386
- getExtendRevealPeriodInstructionDataCodec,
7387
- getExtendRevealPeriodInstructionDataDecoder,
7388
- getExtendRevealPeriodInstructionDataEncoder,
7389
7445
  getFeePoolCodec,
7390
7446
  getFeePoolDecoder,
7391
7447
  getFeePoolDiscriminatorBytes,
@@ -7631,7 +7687,7 @@ function nonceToBytes(nonce) {
7631
7687
  parseCloseStakeAccountInstruction,
7632
7688
  parseCreateMarketInstruction,
7633
7689
  parseDoUnstakeEarlyInstruction,
7634
- parseExtendRevealPeriodInstruction,
7690
+ parseEndRevealPeriodInstruction,
7635
7691
  parseIncreaseRewardPoolInstruction,
7636
7692
  parseIncrementOptionTallyInstruction,
7637
7693
  parseInitCentralStateInstruction,