-
Notifications
You must be signed in to change notification settings - Fork 11
/
constants.ts
72 lines (65 loc) · 2.38 KB
/
constants.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
import { consts } from "../blockchain"
import { chainConstants, txPallets } from "../constants"
/**
* @name getAuctionEndingPeriod
* @summary Period (in blocks) before the end of the auction during which an auction can be extended if new bids are added.
* @returns Number.
*/
export const getAuctionEndingPeriod = (): number => {
const endingPeriod = consts(txPallets.auction, chainConstants.auctionEndingPeriod)
return Number.parseInt(endingPeriod.toString())
}
/**
* @name getAuctionGracePeriod
* @summary Period (in blocks) to extend an auction by if a new bid is received during the ending period.
* @returns Number.
*/
export const getAuctionGracePeriod = (): number => {
const gracePeriod = consts(txPallets.auction, chainConstants.auctionGracePeriod)
return Number.parseInt(gracePeriod.toString())
}
/**
* @name getBidderListLengthLimit
* @summary Total amount of accounts that can be in the bidder list for an auction.
* @returns Number.
*/
export const getBidderListLengthLimit = (): number => {
const limit = consts(txPallets.auction, chainConstants.bidderListLengthLimit)
return Number.parseInt(limit.toString())
}
/**
* @name getMaxAuctionDelay
* @summary Maximum amount of blocks between the current one and the start block of an auction.
* @returns Number.
*/
export const getMaxAuctionDelay = (): number => {
const maxDelay = consts(txPallets.auction, chainConstants.maxAuctionDelay)
return Number.parseInt(maxDelay.toString())
}
/**
* @name getMinAuctionDuration
* @summary Minimum amount of blocks permitted for an auction's length.
* @returns Number.
*/
export const getMinAuctionDuration = (): number => {
const minDuration = consts(txPallets.auction, chainConstants.minAuctionDuration)
return Number.parseInt(minDuration.toString())
}
/**
* @name getMaxAuctionDuration
* @summary Maximum amount of blocks permitted for an auction's length.
* @returns Number.
*/
export const getMaxAuctionDuration = (): number => {
const maxDuration = consts(txPallets.auction, chainConstants.maxAuctionDuration)
return Number.parseInt(maxDuration.toString())
}
/**
* @name getParallelAuctionLimit
* @summary Maximum amount of auctions that can be active at the same time.
* @returns Number.
*/
export const getParallelAuctionLimit = (): number => {
const limit = consts(txPallets.auction, chainConstants.parallelAuctionLimit)
return Number.parseInt(limit.toString())
}