@@ -354,46 +354,6 @@ pub mod matching_engine {
354
354
processor:: settle_auction_none_local ( ctx)
355
355
}
356
356
357
- /// This instruction is used to create the first `AuctionHistory` account, whose PDA is derived
358
- /// using ID == 0.
359
- ///
360
- /// # Arguments
361
- ///
362
- /// * `ctx` - `CreateFirstAuctionHistory` context.
363
- pub fn create_first_auction_history ( ctx : Context < CreateFirstAuctionHistory > ) -> Result < ( ) > {
364
- processor:: create_first_auction_history ( ctx)
365
- }
366
-
367
- /// This instruction is used to create a new `AuctionHistory` account. The PDA is derived using
368
- /// its ID. A new history account can be created only when the current one is full (number of
369
- /// entries equals the hard-coded max entries).
370
- ///
371
- /// # Arguments
372
- ///
373
- /// * `ctx` - `CreateNewAuctionHistory` context.
374
- pub fn create_new_auction_history ( ctx : Context < CreateNewAuctionHistory > ) -> Result < ( ) > {
375
- processor:: create_new_auction_history ( ctx)
376
- }
377
-
378
- /// This instruction is used to add a new entry to the `AuctionHistory` account if there is an
379
- /// `Auction` with some info. Regardless of whether there is info in this account, the
380
- /// instruction finishes its operation by closing this auction account. If the history account
381
- /// is full, this instruction will revert and `create_new_auction_history`` will have to be
382
- /// called to initialize another history account.
383
- ///
384
- /// This mechanism is important for auction participants. The initial offer participant will
385
- /// pay lamports to create the `Auction` account. This instruction allows him to reclaim some
386
- /// lamports by closing that account. And the protocol's fee recipient will be able to claim
387
- /// lamports by closing the empty `Auction` account it creates when he calls any of the
388
- /// `settle_auction_none_*` instructions.
389
- ///
390
- /// # Arguments
391
- ///
392
- /// * `ctx` - `AddAuctionHistoryEntry` context.
393
- pub fn add_auction_history_entry ( ctx : Context < AddAuctionHistoryEntry > ) -> Result < ( ) > {
394
- processor:: add_auction_history_entry ( ctx)
395
- }
396
-
397
357
/// This instruction is used to reserve a sequence number for a fast fill. Fast fills are orders
398
358
/// that have been fulfilled and are destined for Solana and are seeded by source chain, order
399
359
/// sender and sequence number (similar to how Wormhole VAAs are identified by emitter chain,
@@ -415,6 +375,7 @@ pub mod matching_engine {
415
375
) -> Result < ( ) > {
416
376
processor:: reserve_fast_fill_sequence_active_auction ( ctx)
417
377
}
378
+
418
379
/// This instruction is used to reserve a sequence number for a fast fill. Fast fills are orders
419
380
/// that have been fulfilled and are destined for Solana and are seeded by source chain, order
420
381
/// sender and sequence number (similar to how Wormhole VAAs are identified by emitter chain,
@@ -452,6 +413,72 @@ pub mod matching_engine {
452
413
pub fn close_redeemed_fast_fill ( ctx : Context < CloseRedeemedFastFill > ) -> Result < ( ) > {
453
414
processor:: close_redeemed_fast_fill ( ctx)
454
415
}
416
+
417
+ /// This instruction is used to close an auction account after the auction has been settled and
418
+ /// the VAA's timestamp indicates the order has expired. This instruction can be called by
419
+ /// anyone to return the auction's preparer lamports from the rent required to keep this account
420
+ /// alive. The auction data will be serialized as Anchor event CPI instruction data.
421
+ ///
422
+ /// # Arguments
423
+ ///
424
+ /// * `ctx` - `CloseAuction` context.
425
+ pub fn close_auction ( ctx : Context < CloseAuction > ) -> Result < ( ) > {
426
+ processor:: close_auction ( ctx)
427
+ }
428
+
429
+ // Deprecated instructions. These instructions will revert with `ErrorCode::InstructionMissing`.
430
+
431
+ /// DEPRECATED. This instruction does not exist anymore.
432
+ ///
433
+ /// This instruction is used to create the first `AuctionHistory` account, whose PDA is derived
434
+ /// using ID == 0.
435
+ ///
436
+ /// # Arguments
437
+ ///
438
+ /// * `ctx` - `CreateFirstAuctionHistory` context.
439
+ pub fn create_first_auction_history ( _ctx : Context < DeprecatedInstruction > ) -> Result < ( ) > {
440
+ err ! ( ErrorCode :: Deprecated )
441
+ }
442
+
443
+ /// DEPRECATED. This instruction does not exist anymore.
444
+ ///
445
+ /// This instruction is used to create a new `AuctionHistory` account. The PDA is derived using
446
+ /// its ID. A new history account can be created only when the current one is full (number of
447
+ /// entries equals the hard-coded max entries).
448
+ ///
449
+ /// # Arguments
450
+ ///
451
+ /// * `ctx` - `CreateNewAuctionHistory` context.
452
+ pub fn create_new_auction_history ( _ctx : Context < DeprecatedInstruction > ) -> Result < ( ) > {
453
+ err ! ( ErrorCode :: Deprecated )
454
+ }
455
+
456
+ /// DEPRECATED. This instruction does not exist anymore.
457
+ ///
458
+ /// This instruction is used to add a new entry to the `AuctionHistory` account if there is an
459
+ /// `Auction` with some info. Regardless of whether there is info in this account, the
460
+ /// instruction finishes its operation by closing this auction account. If the history account
461
+ /// is full, this instruction will revert and `create_new_auction_history`` will have to be
462
+ /// called to initialize another history account.
463
+ ///
464
+ /// This mechanism is important for auction participants. The initial offer participant will
465
+ /// pay lamports to create the `Auction` account. This instruction allows him to reclaim some
466
+ /// lamports by closing that account. And the protocol's fee recipient will be able to claim
467
+ /// lamports by closing the empty `Auction` account it creates when he calls any of the
468
+ /// `settle_auction_none_*` instructions.
469
+ ///
470
+ /// # Arguments
471
+ ///
472
+ /// * `ctx` - `AddAuctionHistoryEntry` context.
473
+ pub fn add_auction_history_entry ( _ctx : Context < DeprecatedInstruction > ) -> Result < ( ) > {
474
+ err ! ( ErrorCode :: Deprecated )
475
+ }
476
+ }
477
+
478
+ #[ derive( Accounts ) ]
479
+ pub struct DeprecatedInstruction < ' info > {
480
+ /// CHECK: This account is here to avoid program macro compilation errors.
481
+ _dummy : UncheckedAccount < ' info > ,
455
482
}
456
483
457
484
#[ cfg( test) ]
0 commit comments