dns.getProof
Fetches the DNSSEC proof of a DNS name's _ens TXT record. Parameters, return value, errors and examples for dns.getProof in @ensforge/sdk.
Fetches the DNSSEC proof of a DNS name's _ens TXT record.
When to use
Use to fetch a proof once and pass it to dns.claim, or to inspect it.
Details
- Fetched from the deployment's DNSSEC gateway (ENSIP-17) unless
gatewayUrlsis given. - Not verified;
dns.getStatusverifies it on-chain.
Signature
function getProof(client: Like, options: getProof.Options): Promise<getProof.ReturnType>Call it as ens.dns.getProof(options) on a client, or Actions.dns.getProof(client, options).
dns.getProof.request(options) builds a deferred read for Actions.batch. See Look up many at once.
Parameters
| Option | Type | Default | Description |
|---|---|---|---|
name (required) | string | DNS name. Normalized automatically. | |
gatewayUrls | readonly string[] | DNSSEC gateways to use instead of the deployment's. |
Also takes the read options.
Returns
Resolves to Proof. Signed RRSets, the record's TXT strings and its signature times.
| Field | Type | Description |
|---|---|---|
name | string | DNS name the proof is for, e.g. _ens.example.com. |
rrsets | readonly SignedRRSet[] | Signed RRSets, root first. |
inception | number | Signature inception of the proven record set, as a Unix timestamp; 0 when it does not exist. |
expiration | number | Signature expiration of the proven record set, as a Unix timestamp; 0 when it does not exist. |
txt | readonly string[] | TXT strings of the proven record set; empty when the record does not exist. |
Errors
| Error | Codes | When |
|---|---|---|
InvalidInputError | INVALID_NAME | names that are not DNS names. |
GatewayError | GATEWAY_REQUEST_FAILED, GATEWAY_RESPONSE_INVALID | the DNSSEC gateway fails. |
UnsupportedError | UNSUPPORTED_ON_DEPLOYMENT | without a DNSSEC gateway or gatewayUrls. |
NetworkError | RPC_REQUEST_FAILED, RPC_TIMEOUT, RATE_LIMITED | the RPC request fails. |
It can also fail with the errors every read can (Errors.CommonError: ConfigError, ContractRevertError, InternalError, NetworkError).
See How errors work.
Examples
const proof = await ens.dns.getProof({ name: "example.com" })See also
dns.claimto import with it
Was this page helpful?