@@ -18,18 +18,29 @@ import {
1818} from "../utils.js" ;
1919
2020export function registerCreateCommands ( program : Command ) : void {
21- const create = program
22- . command ( "create" )
23- . description ( "Create a new auction" ) ;
21+ const create = program . command ( "create" ) . description ( "Create a new auction" ) ;
2422
2523 create
2624 . command ( "english" )
2725 . description ( "Create an English (ascending) auction" )
2826 . requiredOption ( "--mint <MINT>" , "Token mint address of the item" )
2927 . requiredOption ( "--start-price <SOL>" , "Starting price in SOL" , parseFloat )
30- . requiredOption ( "--duration <SECS>" , "Auction duration in seconds" , parseInt )
31- . requiredOption ( "--min-increment <SOL>" , "Minimum bid increment in SOL" , parseFloat )
32- . option ( "--anti-snipe <SECS>" , "Anti-snipe extension in seconds" , parseInt , 300 )
28+ . requiredOption (
29+ "--duration <SECS>" ,
30+ "Auction duration in seconds" ,
31+ parseInt
32+ )
33+ . requiredOption (
34+ "--min-increment <SOL>" ,
35+ "Minimum bid increment in SOL" ,
36+ parseFloat
37+ )
38+ . option (
39+ "--anti-snipe <SECS>" ,
40+ "Anti-snipe extension in seconds" ,
41+ parseInt ,
42+ 300
43+ )
3344 . option ( "--house <PUBKEY>" , "Auction house PDA (auto-derived if omitted)" )
3445 . action ( async ( opts ) => {
3546 try {
@@ -39,7 +50,11 @@ export function registerCreateCommands(program: Command): void {
3950
4051 // Generate auction ID from timestamp
4152 const auctionId = new anchor . BN ( Date . now ( ) ) ;
42- const [ auctionPda ] = deriveAuctionPda ( prog . programId , seller , auctionId ) ;
53+ const [ auctionPda ] = deriveAuctionPda (
54+ prog . programId ,
55+ seller ,
56+ auctionId
57+ ) ;
4358 const [ vaultPda ] = deriveVaultPda ( prog . programId , auctionPda ) ;
4459
4560 // Derive or use provided house
@@ -95,9 +110,21 @@ export function registerCreateCommands(program: Command): void {
95110 . command ( "dutch" )
96111 . description ( "Create a Dutch (descending) auction" )
97112 . requiredOption ( "--mint <MINT>" , "Token mint address of the item" )
98- . requiredOption ( "--start-price <SOL>" , "Starting (highest) price in SOL" , parseFloat )
99- . requiredOption ( "--reserve <SOL>" , "Reserve (floor) price in SOL" , parseFloat )
100- . requiredOption ( "--duration <SECS>" , "Auction duration in seconds" , parseInt )
113+ . requiredOption (
114+ "--start-price <SOL>" ,
115+ "Starting (highest) price in SOL" ,
116+ parseFloat
117+ )
118+ . requiredOption (
119+ "--reserve <SOL>" ,
120+ "Reserve (floor) price in SOL" ,
121+ parseFloat
122+ )
123+ . requiredOption (
124+ "--duration <SECS>" ,
125+ "Auction duration in seconds" ,
126+ parseInt
127+ )
101128 . option ( "--house <PUBKEY>" , "Auction house PDA (auto-derived if omitted)" )
102129 . action ( async ( opts ) => {
103130 try {
@@ -106,7 +133,11 @@ export function registerCreateCommands(program: Command): void {
106133 const seller = wallet . publicKey ;
107134
108135 const auctionId = new anchor . BN ( Date . now ( ) ) ;
109- const [ auctionPda ] = deriveAuctionPda ( prog . programId , seller , auctionId ) ;
136+ const [ auctionPda ] = deriveAuctionPda (
137+ prog . programId ,
138+ seller ,
139+ auctionId
140+ ) ;
110141 const [ vaultPda ] = deriveVaultPda ( prog . programId , auctionPda ) ;
111142
112143 const housePda = opts . house
@@ -159,9 +190,21 @@ export function registerCreateCommands(program: Command): void {
159190 . command ( "sealed" )
160191 . description ( "Create a sealed-bid Vickrey auction" )
161192 . requiredOption ( "--mint <MINT>" , "Token mint address of the item" )
162- . requiredOption ( "--min-collateral <SOL>" , "Minimum collateral in SOL" , parseFloat )
163- . requiredOption ( "--bid-duration <SECS>" , "Bidding phase duration in seconds" , parseInt )
164- . requiredOption ( "--reveal-duration <SECS>" , "Reveal phase duration in seconds" , parseInt )
193+ . requiredOption (
194+ "--min-collateral <SOL>" ,
195+ "Minimum collateral in SOL" ,
196+ parseFloat
197+ )
198+ . requiredOption (
199+ "--bid-duration <SECS>" ,
200+ "Bidding phase duration in seconds" ,
201+ parseInt
202+ )
203+ . requiredOption (
204+ "--reveal-duration <SECS>" ,
205+ "Reveal phase duration in seconds" ,
206+ parseInt
207+ )
165208 . option ( "--house <PUBKEY>" , "Auction house PDA (auto-derived if omitted)" )
166209 . action ( async ( opts ) => {
167210 try {
@@ -170,7 +213,11 @@ export function registerCreateCommands(program: Command): void {
170213 const seller = wallet . publicKey ;
171214
172215 const auctionId = new anchor . BN ( Date . now ( ) ) ;
173- const [ auctionPda ] = deriveAuctionPda ( prog . programId , seller , auctionId ) ;
216+ const [ auctionPda ] = deriveAuctionPda (
217+ prog . programId ,
218+ seller ,
219+ auctionId
220+ ) ;
174221 const [ vaultPda ] = deriveVaultPda ( prog . programId , auctionPda ) ;
175222
176223 const housePda = opts . house
0 commit comments