![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
@govtechsg/dnsprove
Advanced tools
Helper utility for retrieving OpenAttestations document store address records from DNS
A helper library to retrieve OpenAttestation DNS-TXT records from domains using Google's public DNS service.
A valid OpenAttestation DNS-TXT record looks like:
[
{
name: "example.openattestation.com.",
type: 16,
TTL: 110,
data: '"openatts net=ethereum netId=3 addr=0x2f60375e8144e16Adf1979936301D8341D58C36C"',
},
];
Validation is run on all retrieved records to ensure they conform to the expected format, and records that fail validation will simply be omitted from the returned results.
npm i @govtechsg/dnsprove
To see validation failures run the library with the debug flag turned on, either
In Browser:
localStorage.debug="dnsprove*"
In NodeJS:
DEBUG="dnsprove*" npm run test
This library uses runtypes for compile time static type checking as well as run time input validation. The generated documentation below is inaccurate for any Runtypes generated types due to documentation generator limitations.
Type: function (domain: string): Promise<IDNSQueryResponse>
Type: Array<CustomDnsResolver>
domain
string customDnsResolvers
Array<CustomDnsResolver> Returns Promise<IDNSQueryResponse>
Parses one openattestation DNS-TXT record and turns it into an OpenAttestationsDNSTextRecord object
record
string e.g: '"openatts net=ethereum netId=3 addr=0x0c9d5E6C766030cc6f0f49951D275Ad0701F81EC"'Returns GenericObject
Takes a DNS-TXT Record set and returns openattestation document store records if any
recordSet
Array<IDNSRecord> Refer to tests for examples (optional, default []
)dnssec
boolean Returns Array<OpenAttestationDNSTextRecord>
recordSet
Array<IDNSRecord> (optional, default []
)dnssec
boolean Returns Array<OpenAttestationDnsDidRecord>
Queries a given domain and parses the results to retrieve openattestation document store records if any
domain
string e.g: "example.openattestation.com"customDnsResolvers
Array<CustomDnsResolver>? > getDocumentStoreRecords("example.openattestation.com")
> [ { type: 'openatts',
net: 'ethereum',
netId: '3',
addr: '0x2f60375e8144e16Adf1979936301D8341D58C36C',
dnssec: true } ]
Returns Promise<Array<OpenAttestationDNSTextRecord>>
domain
string customDnsResolvers
Array<CustomDnsResolver>? Returns Promise<Array<OpenAttestationDnsDidRecord>>
MIT
FAQs
Helper utility for retrieving OpenAttestations document store address records from DNS
We found that @govtechsg/dnsprove demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.