Skip to content

Commit

Permalink
Export isWithinDelegatedTimeframe
Browse files Browse the repository at this point in the history
  • Loading branch information
JoelBCarter committed Aug 29, 2024
1 parent 37985c3 commit 7155296
Showing 1 changed file with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// import { isAddress } from '@xylabs/hex'
import type { Payload } from '@xyo-network/payload-model'

import type { DurationFields } from '../Duration.ts'
Expand All @@ -10,11 +9,7 @@ export const validateDuration = (recordPayload: Payload<DurationFields>): boolea
return true
}

// const isValidAddress = (recordPayload: Payload<DomainLeaseFields>): boolean => {
// return isAddress(recordPayload.nameserver, { prefix: false })
// }

const isWithinDelegatedTimeframe = (recordPayload: Payload<DurationFields>, now = Date.now()): boolean => {
export const isWithinDelegatedTimeframe = (recordPayload: Payload<DurationFields>, now = Date.now()): boolean => {
// nbf < now < exp
return recordPayload.nbf < now && now < recordPayload.exp
}

0 comments on commit 7155296

Please sign in to comment.