Skip to content

Commit

Permalink
Merge pull request #71 from ensdomains/fix/wrapped-domain-type
Browse files Browse the repository at this point in the history
fix: registration type in wrappeddomain
  • Loading branch information
TateB authored Oct 24, 2022
2 parents 0c7b915 + 25cce9f commit e66a2b2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/ens-test-env/src/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ services:
volumes:
- $DATA_FOLDER/ipfs:/data/ipfs
postgres:
image: postgres
image: postgres:14
ports:
- '5432:5432'
command: ['postgres', '-cshared_preload_libraries=pg_stat_statements']
Expand Down
10 changes: 10 additions & 0 deletions packages/ensjs/src/functions/getNames.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ export type Name = {
registrationDate?: Date
expiryDate?: Date
fuses?: CurrentFuses
registration?: {
expiryDate: Date
registrationDate: Date
}
type: 'domain' | 'registration' | 'wrappedDomain'
}

Expand Down Expand Up @@ -66,6 +70,12 @@ const mapDomain = (domain: any) => {

const mapWrappedDomain = (wrappedDomain: any) => {
const domain = mapDomain(wrappedDomain.domain)
if (domain.registration) {
domain.registration = {
expiryDate: new Date(parseInt(domain.registration.expiryDate) * 1000),
registrationDate: new Date(domain.registration.registrationDate * 1000),
}
}
return {
expiryDate: new Date(parseInt(wrappedDomain.expiryDate) * 1000),
fuses: decodeFuses(wrappedDomain.fuses),
Expand Down

0 comments on commit e66a2b2

Please sign in to comment.