Support phase-wide bidding across all auctions
Verify and publish checkpoint container / container (push) Successful in 12m14s
Verify and publish checkpoint container / container (push) Successful in 12m14s
This commit is contained in:
1 parent
12060f3112
commit
38f1684e03
17 files changed
+1070
-18
No files matched your search
@@ -0,0 +1,39 @@
|
||||
import {
|
||||
PhaseBidPromiseError,
|
||||
phaseBidPromiseModeSupported,
|
||||
type PhaseBidClaim,
|
||||
type PhaseBidOpportunity,
|
||||
type PhaseBidPromise,
|
||||
} from './turn-bid-promises';
|
||||
|
||||
/** A new, separate receipt: unlike legacy phaseBid, a qualifying declaration
|
||||
* can occur in an ordinary, Richese cache, or Black Market auction. */
|
||||
export type PhaseAnyBidClaim = PhaseBidClaim;
|
||||
export type PhaseAnyBidPromise = PhaseBidPromise;
|
||||
export type PhaseAnyBidOpportunity = PhaseBidOpportunity;
|
||||
export { PhaseBidPromiseError as PhaseAnyBidPromiseError };
|
||||
export {
|
||||
livePhaseBidPromises as livePhaseAnyBidPromises,
|
||||
phaseBidAllowedRange as phaseAnyBidAllowedRange,
|
||||
phaseBidCompletionRange as phaseAnyBidCompletionRange,
|
||||
recordPhaseBid as recordPhaseAnyBid,
|
||||
reconcilePhaseBidPromises as reconcilePhaseAnyBidPromises,
|
||||
finishPhaseBidPhase as finishPhaseAnyBidPhase,
|
||||
validatePhaseBidPromises as validatePhaseAnyBidPromises,
|
||||
} from './turn-bid-promises';
|
||||
|
||||
export const phaseAnyBidPromiseModeSupported = phaseBidPromiseModeSupported;
|
||||
|
||||
export function parsePhaseAnyBidClaim(value: unknown): PhaseAnyBidClaim {
|
||||
if (!value || typeof value !== 'object' || Array.isArray(value))
|
||||
throw new PhaseBidPromiseError('Choose a Bidding phase bid question.');
|
||||
const input = value as Record<string, unknown>;
|
||||
if (typeof input.turn !== 'number' || !Number.isSafeInteger(input.turn) || input.turn <= 0 ||
|
||||
typeof input.minimum !== 'number' || !Number.isSafeInteger(input.minimum) || input.minimum <= 0)
|
||||
throw new PhaseBidPromiseError('Choose the current turn and a positive whole bid minimum.');
|
||||
return {turn:input.turn, minimum:input.minimum};
|
||||
}
|
||||
|
||||
export function phaseAnyBidClaimText(claim: PhaseAnyBidClaim): string {
|
||||
return `place a bid of at least ${claim.minimum} spice in an ordinary, Richese cache, or Black Market auction from now until this turn's Bidding phase closes`;
|
||||
}
|
||||
Reference in new issue
Block a user